gramming Example,  Prev: History Functions,  Up: Programming with GNU History

2.4 History Variables
=====================

This section describes the externally-visible variables exported by the
GNU History Library.

 -- Variable: int history_base
     The logical offset of the first entry in the history list.

 -- Variable: int history_length
     The number of entries currently stored in the history list.

 -- Variable: int history_max_entries
     The maximum number of history entries.  This must be changed using
     'stifle_history()'.

 -- Variable: int history_write_timestamps
     If non-zero, timestamps are written to the history file, so they
     can be preserved between sessions.  The default value is 0, meaning
     that timestamps are not saved.

     The current timestamp format uses the value of HISTORY_COMMENT_CHAR
     to delimit timestamp entries in the history file.  If that variable
     does not have a value (the default), timestamps will not be
     written.

 -- Variable: char history_expansion_char
     The character that introduces a history event.  The default is '!'.
     Setting this to 0 inhibits history expansion.

 -- Variable: char history_subst_char
     The character that invokes word substitution if found at the start
     of a line.  The default is '^'.

 -- Variable: char history_comment_char
     During tokenization, if this character is seen as the first
     character of a word, then it and all subsequent characters up to a
     newline are ignored, suppressing history expansion for the
     remainder of the line.  This is disabled by default.

 -- Variable: char * history_word_delimiters
     The characters that separate tokens for 'history_tokenize()'.  The
     default value is '" \t\n()<>;&|"'.

 -- Variable: char * history_search_delimiter_chars
     The list of additional characters which can delimit a history
     search string, in addition to space, TAB, ':' and '?' in the case
     of a substring search.  The default is empty.

 -- Variable: char * history_no_expand_chars
     The list of characters which inhibit history expansion if found
     immediately following HISTORY_EXPANSION_CHAR.  The default is
     space, tab, newline, carriage return, and '='.

 -- Variable: int history_quotes_inhibit_expansion
     If non-zero, the history expansion code implements shell-like
     quoting: single-quoted words are not scanned for the history
     expansion character or the history comment character, and
     double-quoted words may have history expansion performed, since
     single quotes are not special within double quotes.  The default
     value is 0.

 -- Variable: int history_quoting_state
     An application may set this variable to indicate that the current
     line being expanded is subject to existing quoting.  If set to ''',
     the history expansion function will assume that the line is
     single-quoted and inhibit expansion until it reads an unquoted
     closing single quote; if set to '"', history expansion will assume
     the line is double quoted until it reads an unquoted closing double
     quote.  If set to zero, the default, the history expansion function
     will assume the line is not quoted and treat quote characters
     within the line as described above.  This is only effective if
     HISTORY_QUOTES_INHIBIT_EXPANSION is set.

 -- Variable: rl_linebuf_func_t * history_inhibit_expansion_function
     This should be set to the address of a function that takes two
     arguments: a 'char *' (STRING) and an 'int' index into that string
     (I).  It should return a non-zero value if the history expansion
     starting at STRING[I] should not be performed; zero if the
     expansion should be done.  It is intended for use by applications
     like Bash that use the history expansion character for additional
     purposes.  By default, this variable is set to 'NULL'.

