history: Introduction to History

1 
1 2.1 Introduction to History
1 ===========================
1 
1 Many programs read input from the user a line at a time.  The GNU
1 History library is able to keep track of those lines, associate
1 arbitrary data with each line, and utilize information from previous
1 lines in composing new ones.
1 
1    The programmer using the History library has available functions for
1 remembering lines on a history list, associating arbitrary data with a
1 line, removing lines from the list, searching through the list for a
1 line containing an arbitrary text string, and referencing any line in
1 the list directly.  In addition, a history "expansion" function is
1 available which provides for a consistent user interface across
1 different programs.
1 
1    The user using programs written with the History library has the
1 benefit of a consistent user interface with a set of well-known commands
1 for manipulating the text of previous lines and using that text in new
1 commands.  The basic history manipulation commands are similar to the
1 history substitution provided by 'csh'.
1 
1    If the programmer desires, he can use the Readline library, which
1 includes some history manipulation by default, and has the added
1 advantage of command line editing.
1 
1    Before declaring any functions using any functionality the History
1 library provides in other code, an application writer should include the
1 file '<readline/history.h>' in any file that uses the History library's
1 features.  It supplies extern declarations for all of the library's
1 public functions and variables, and declares all of the public data
1 structures.
1