history.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
#ifndef history_h
#define history_h
/*
* Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h> /* FILE * */
/*-----------------------------------------------------------------------
* This module is used to record and traverse historical lines of user input.
*/
/*
* Create a new history maintenance object.
*/
/*
* Delete a history maintenance object.
*/
/*
* Whenever a new line is added to the history buffer, it is given
* a unique ID, recorded in an object of the following type.
*/
typedef unsigned long GlhLineID;
/*
* Query the id of a history line offset by a given number of lines from
* the one that is currently being recalled. If a recall session isn't
* in progress, or the offset points outside the history list, 0 is
* returned.
*/
/*
* Recall a line by its history buffer ID. If the line is no longer
* in the buffer, or the specified id is zero, NULL is returned.
*/
/*
* Write the contents of the history buffer to a given file. Note that
* ~ and $ expansion are not performed on the filename.
*/
/*
* Restore the contents of the history buffer from a given file.
* Note that ~ and $ expansion are not performed on the filename.
*/
/*
* Set and query the current history group.
*/
/*
* Display the contents of the history list to the specified stdio
* output group.
*/
/*
* Change the size of the history buffer.
*/
/*
* Set an upper limit to the number of lines that can be recorded in the
* history list, or remove a previously specified limit.
*/
/*
* Discard either all history, or the history associated with the current
* history group.
*/
/*
* Temporarily enable or disable the history facility.
*/
/*
* Lookup a history line by its sequential number of entry in the
* history buffer.
*/
/*
* Query the state of the history list.
*/
int *max_lines);
/*
* Get the range of lines in the history buffer.
*/
/*
* Return the size of the history buffer and the amount of the
* buffer that is currently in use.
*/
/*
* Get information about the last error in this module.
*/
/*
* Return non-zero if a history search session is currently in progress.
*/
#endif