From: Chet Ramey
@@ -79,7 +79,7 @@ by the Free Software Foundation.
-Copyright (C) 1988-1999 Free Software Foundation, Inc.
+Copyright (C) 1988-2001 Free Software Foundation, Inc.
-Many programs read input from the user a line at a time. The GNU History
-library is able to keep track of those lines, associate arbitrary data with
-each line, and utilize information from previous lines in composing new
-ones.
+Many programs read input from the user a line at a time. The GNU
+History library is able to keep track of those lines, associate arbitrary
+data with each line, and utilize information from previous lines in
+composing new ones.
@@ -409,9 +409,11 @@ declared as follows:
GNU History Library
-Edition 4.1, for
-History Library
Version 4.1.January 2000
+Edition 4.2, for
+History Library
Version 4.2.Apr 2001
Brian Fox, Free Software Foundation
Chet Ramey, Case Western Reserve University
+typedef void *histdata_t;
+
typedef struct _hist_entry {
char *line;
- char *data;
+ histdata_t data;
} HIST_ENTRY;
@@ -430,12 +432,14 @@ The state of the History library is encapsulated into a single structure:
-/* A structure used to pass the current state of the history stuff around. */ +/* + * A structure used to pass around the current state of the history. + */ typedef struct _hist_state { - HIST_ENTRY **entries; /* Pointer to the entries themselves. */ - int offset; /* The location pointer within this array. */ - int length; /* Number of elements within this array. */ - int size; /* Number of slots allocated to this array. */ + HIST_ENTRY **entries; /* Pointer to the entries themselves. */ + int offset; /* The location pointer within this array. */ + int length; /* Number of elements within this array. */ + int size; /* Number of slots allocated to this array. */ int flags; } HISTORY_STATE;@@ -451,7 +455,7 @@ stifled.
This section describes the calling sequence for the various functions -present in GNU History. +exported by the GNU History library.
@@ -485,7 +489,7 @@ functions in your program.
NULL
.
@@ -538,7 +542,7 @@ and containing structure.
NULL
pointer is returned.
NULL
terminated array of HIST_ENTRY
which is the
+Return a NULL
terminated array of HIST_ENTRY *
which is the
current input history. Element 0 of this list is the beginning of time.
If there is no history, return NULL
.
NULL
.
where_history ()
. If there is no entry there, return a NULL
+where_history()
. If there is no entry there, return a NULL
pointer.
history_base
. If there is no entry there, or if offset
+history_base
(see section History Variables).
+If there is no entry there, or if offset
is greater than the history length, return a NULL
pointer.
NULL
pointer.
NULL
, then read from
-`~/.history'. Returns 0 if successful, or errno if not.
+Add the contents of filename to the history list, a line at a time.
+If filename is NULL
, then read from `~/.history'.
+Returns 0 if successful, or errno
if not.
NULL
, then read from `~/.history'. Returns 0 if successful,
or errno
if not.
@@ -762,29 +771,34 @@ or errno
if not.
NULL
, then write the history list to `~/.history'. Values
-returned are as in read_history ()
.
+if necessary.
+If filename is NULL
, then write the history list to
+`~/.history'.
+Returns 0 on success, or errno
on a read or write error.
NULL
, then append to `~/.history'.
+Returns 0 on success, or errno
on a read or write error.
NULL
, then `~/.history' is truncated.
+Returns 0 on success, or errno
on failure.
-These functions implement csh
-like history expansion.
+These functions implement history expansion.
@@ -807,7 +821,7 @@ to a string (see section History Expansion). Re
0
1
-
()<>;&|$
, and shell quoting conventions are
-obeyed.
+shell might. The tokens are split on the characters in the
+history_word_delimiters variable,
+and shell quoting conventions are obeyed.
++
history_tokenize
.
-This section describes the externally visible variables exported by +This section describes the externally-visible variables exported by the GNU History Library.
@@ -887,10 +902,10 @@ The number of entries currently stored in the history list.
stifle_history ()
.
+stifle_history()
.
" \t\n()<>;&|"
.
++
char *
(string) and an integer index into that string (i).
+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.
+By default, this variable is set to NULL
.
-main () +#include <stdio.h> +#include <readline/history.h> + +main (argc, argv) + int argc; + char **argv; { char line[1024], *t; int len, done = 0; @@ -1098,8 +1129,6 @@ Jump to: - h - -m -- n - p @@ -1124,37 +1153,35 @@ Jump to:g
- - get_history_event +
- get_history_event
h
- -- history_arg_extract +
- history_arg_extract
- history_base
- history_comment_char
- history_expand
- history_expansion_char
- history_get
- history_get_history_state -
- history_inhibit_expansion_function +
- history_inhibit_expansion_function
- history_is_stifled
- history_length
- history_list -
- history_no_expand_chars -
- history_quotes_inhibit_expansion +
- history_max_entries +
- history_no_expand_chars +
- history_quotes_inhibit_expansion
- history_search -
- history_search_delimiter_chars +
- history_search_delimiter_chars
- history_search_pos
- history_search_prefix
- history_set_history_state
- history_set_pos
- history_subst_char -
- history_tokenize +
- history_tokenize
- history_total_bytes
- history_truncate_file -
m
-- - max_input_history +
- history_word_delimiters
n
@@ -1188,7 +1215,7 @@ Jump to: -This document was generated on 19 January 2000 using the +This document was generated on 16 April 2001 using the texi2html translator version 1.52.
diff --git a/doc/history.info b/doc/history.info index e73cd63..5db15f6 100644 --- a/doc/history.info +++ b/doc/history.info @@ -1,5 +1,5 @@ -This is Info file history.info, produced by Makeinfo version 1.68 from -the input file /usr/homes/chet/src/bash/readline-src/doc/hist.texinfo. +This is history.info, produced by makeinfo version 4.0 from +/usr/homes/chet/src/bash/readline-src/doc/hist.texinfo. INFO-DIR-SECTION Libraries START-INFO-DIR-ENTRY @@ -10,7 +10,7 @@ END-INFO-DIR-ENTRY that provides a consistent user interface for recalling lines of previously typed input. - Copyright (C) 1988-1999 Free Software Foundation, Inc. + Copyright (C) 1988-2001 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice pare @@ -53,7 +53,7 @@ Using History Interactively This chapter describes how to use the GNU History Library interactively, from a user's standpoint. It should be considered a user's guide. For information on using the GNU History Library in your -own programs, *note Programming with GNU History::.. +own programs, *note Programming with GNU History::. * Menu: @@ -238,7 +238,7 @@ Programming with GNU History This chapter describes how to interface programs that you write with the GNU History Library. It should be considered a technical guide. For information on the interactive use of GNU History, *note Using -History Interactively::.. +History Interactively::. * Menu: @@ -293,9 +293,11 @@ History Storage The history list is an array of history entries. A history entry is declared as follows: + typedef void *histdata_t; + typedef struct _hist_entry { char *line; - char *data; + histdata_t data; } HIST_ENTRY; The history list itself might therefore be declared as @@ -305,12 +307,14 @@ declared as follows: The state of the History library is encapsulated into a single structure: - /* A structure used to pass the current state of the history stuff around. */ + /* + * A structure used to pass around the current state of the history. + */ typedef struct _hist_state { - HIST_ENTRY **entries; /* Pointer to the entries themselves. */ - int offset; /* The location pointer within this array. */ - int length; /* Number of elements within this array. */ - int size; /* Number of slots allocated to this array. */ + HIST_ENTRY **entries; /* Pointer to the entries themselves. */ + int offset; /* The location pointer within this array. */ + int length; /* Number of elements within this array. */ + int size; /* Number of slots allocated to this array. */ int flags; } HISTORY_STATE; @@ -324,7 +328,7 @@ History Functions ================= This section describes the calling sequence for the various functions -present in GNU History. +exported by the GNU History library. * Menu: @@ -354,11 +358,11 @@ Initializing History and State Management state of the History library when you want to use the history functions in your program. - - Function: void using_history () + - Function: void using_history (void) Begin a session in which the history functions might be used. This initializes the interactive variables. - - Function: HISTORY_STATE * history_get_history_state () + - Function: HISTORY_STATE * history_get_history_state (void) Return a structure describing the current state of the input history. @@ -374,7 +378,7 @@ History List Management These functions manage individual entries on the history list, or set parameters managing the list itself. - - Function: void add_history (char *string) + - Function: void add_history (const char *string) Place STRING at the end of the history list. The associated data field (if any) is set to `NULL'. @@ -383,24 +387,24 @@ parameters managing the list itself. removed element is returned so you can free the line, data, and containing structure. - - Function: HIST_ENTRY * replace_history_entry (int which, char *line, - char *data) + - Function: HIST_ENTRY * replace_history_entry (int which, const char + *line, histdata_t data) Make the history entry at offset WHICH have LINE and DATA. This returns the old entry so you can dispose of the data. In the case of an invalid WHICH, a `NULL' pointer is returned. - - Function: void clear_history () + - Function: void clear_history (void) Clear the history list by deleting all the entries. - Function: void stifle_history (int max) Stifle the history list, remembering only the last MAX entries. - - Function: int unstifle_history () + - Function: int unstifle_history (void) Stop stifling the history. This returns the previous amount the history was stifled. The value is positive if the history was stifled, negative if it wasn't. - - Function: int history_is_stifled () + - Function: int history_is_stifled (void) Returns non-zero if the history is stifled, zero if it is not. @@ -412,25 +416,26 @@ Information About the History List These functions return information about the entire history list or individual list entries. - - Function: HIST_ENTRY ** history_list () - Return a `NULL' terminated array of `HIST_ENTRY' which is the + - Function: HIST_ENTRY ** history_list (void) + Return a `NULL' terminated array of `HIST_ENTRY *' which is the current input history. Element 0 of this list is the beginning of time. If there is no history, return `NULL'. - - Function: int where_history () + - Function: int where_history (void) Returns the offset of the current history element. - - Function: HIST_ENTRY * current_history () + - Function: HIST_ENTRY * current_history (void) Return the history entry at the current position, as determined by - `where_history ()'. If there is no entry there, return a `NULL' + `where_history()'. If there is no entry there, return a `NULL' pointer. - Function: HIST_ENTRY * history_get (int offset) Return the history entry at position OFFSET, starting from - `history_base'. If there is no entry there, or if OFFSET is - greater than the history length, return a `NULL' pointer. + `history_base' (*note History Variables::). If there is no entry + there, or if OFFSET is greater than the history length, return a + `NULL' pointer. - - Function: int history_total_bytes () + - Function: int history_total_bytes (void) Return the number of bytes that the primary history entries are using. This function returns the sum of the lengths of all the lines in the history. @@ -445,15 +450,16 @@ Moving Around the History List set or changed. - Function: int history_set_pos (int pos) - Set the position in the history list to POS, an absolute index - into the list. + Set the current history offset to POS, an absolute index into the + list. Returns 1 on success, 0 if POS is less than zero or greater + than the number of history entries. - - Function: HIST_ENTRY * previous_history () + - Function: HIST_ENTRY * previous_history (void) Back up the current history offset to the previous history entry, and return a pointer to that entry. If there is no previous entry, return a `NULL' pointer. - - Function: HIST_ENTRY * next_history () + - Function: HIST_ENTRY * next_history (void) Move the current history offset forward to the next history entry, and return the a pointer to that entry. If there is no next entry, return a `NULL' pointer. @@ -470,24 +476,27 @@ and backward from the current history position. The search may be "anchored", meaning that the string must match at the beginning of the history entry. - - Function: int history_search (char *string, int direction) + - Function: int history_search (const char *string, int direction) Search the history for STRING, starting at the current history - offset. If DIRECTION < 0, then the search is through previous - entries, else through subsequent. If STRING is found, then the - current history index is set to that history entry, and the value - returned is the offset in the line of the entry where STRING was - found. Otherwise, nothing is changed, and a -1 is returned. - - - Function: int history_search_prefix (char *string, int direction) + offset. If DIRECTION is less than 0, then the search is through + previous entries, otherwise through subsequent entries. If STRING + is found, then the current history index is set to that history + entry, and the value returned is the offset in the line of the + entry where STRING was found. Otherwise, nothing is changed, and + a -1 is returned. + + - Function: int history_search_prefix (const char *string, int + direction) Search the history for STRING, starting at the current history offset. The search is anchored: matching lines must begin with - STRING. If DIRECTION < 0, then the search is through previous - entries, else through subsequent. If STRING is found, then the - current history index is set to that entry, and the return value - is 0. Otherwise, nothing is changed, and a -1 is returned. - - - Function: int history_search_pos (char *string, int direction, int - pos) + STRING. If DIRECTION is less than 0, then the search is through + previous entries, otherwise through subsequent entries. If STRING + is found, then the current history index is set to that entry, and + the return value is 0. Otherwise, nothing is changed, and a -1 is + returned. + + - Function: int history_search_pos (const char *string, int direction, + int pos) Search for STRING in the history list, starting at POS, an absolute index into the list. If DIRECTION is negative, the search proceeds backward from POS, otherwise forward. Returns the @@ -503,29 +512,35 @@ Managing the History File The History library can read the history from and write it to a file. This section documents the functions for managing a history file. - - Function: int read_history (char *filename) - Add the contents of FILENAME to the history list, a line at a - time. If FILENAME is `NULL', then read from `~/.history'. - Returns 0 if successful, or errno if not. + - Function: int read_history (const char *filename) + Add the contents of FILENAME to the history list, a line at a time. + If FILENAME is `NULL', then read from `~/.history'. Returns 0 if + successful, or `errno' if not. - - Function: int read_history_range (char *filename, int from, int to) + - Function: int read_history_range (const char *filename, int from, + int to) Read a range of lines from FILENAME, adding them to the history list. Start reading at line FROM and end at TO. If FROM is zero, start at the beginning. If TO is less than FROM, then read until the end of the file. If FILENAME is `NULL', then read from `~/.history'. Returns 0 if successful, or `errno' if not. - - Function: int write_history (char *filename) + - Function: int write_history (const char *filename) Write the current history to FILENAME, overwriting FILENAME if necessary. If FILENAME is `NULL', then write the history list to - `~/.history'. Values returned are as in `read_history ()'. + `~/.history'. Returns 0 on success, or `errno' on a read or write + error. - - Function: int append_history (int nelements, char *filename) - Append the last NELEMENTS of the history list to FILENAME. + - Function: int append_history (int nelements, const char *filename) + Append the last NELEMENTS of the history list to FILENAME. If + FILENAME is `NULL', then append to `~/.history'. Returns 0 on + success, or `errno' on a read or write error. - - Function: int history_truncate_file (char *filename, int nlines) + - Function: int history_truncate_file (const char *filename, int + nlines) Truncate the history file FILENAME, leaving only the last NLINES - lines. + lines. If FILENAME is `NULL', then `~/.history' is truncated. + Returns 0 on success, or `errno' on failure. File: history.info, Node: History Expansion, Prev: Managing the History File, Up: History Functions @@ -533,15 +548,15 @@ File: history.info, Node: History Expansion, Prev: Managing the History File, History Expansion ----------------- - These functions implement `csh'-like history expansion. + These functions implement history expansion. - Function: int history_expand (char *string, char **output) Expand STRING, placing the result into OUTPUT, a pointer to a - string (*note History Interaction::.). Returns: + string (*note History Interaction::). Returns: `0' If no expansions took place (or, if the only change in the - text was the de-slashifying of the history expansion - character); + text was the removal of escape characters preceding the + history expansion character); `1' if expansions did take place; @@ -551,18 +566,13 @@ History Expansion `2' if the returned line should be displayed, but not executed, - as with the `:p' modifier (*note Modifiers::.). + as with the `:p' modifier (*note Modifiers::). If an error ocurred in expansion, then OUTPUT contains a descriptive error message. - - Function: char * history_arg_extract (int first, int last, char - *string) - Extract a string segment consisting of the FIRST through LAST - arguments present in STRING. Arguments are broken up as in Bash. - - - Function: char * get_history_event (char *string, int *cindex, int - qchar) + - Function: char * get_history_event (const char *string, int *cindex, + int qchar) Returns the text of the history event beginning at STRING + *CINDEX. *CINDEX is modified to point to after the event specifier. At function entry, CINDEX points to the index into @@ -570,10 +580,17 @@ History Expansion character that is allowed to end the event specification in addition to the "normal" terminating characters. - - Function: char ** history_tokenize (char *string) + - Function: char ** history_tokenize (const char *string) Return an array of tokens parsed out of STRING, much as the shell - might. The tokens are split on white space and on the characters - `()<>;&|$', and shell quoting conventions are obeyed. + might. The tokens are split on the characters in the + HISTORY_WORD_DELIMITERS variable, and shell quoting conventions + are obeyed. + + - Function: char * history_arg_extract (int first, int last, const + char *string) + Extract a string segment consisting of the FIRST through LAST + arguments present in STRING. Arguments are split using + `history_tokenize'. File: history.info, Node: History Variables, Next: History Programming Example, Prev: History Functions, Up: Programming with GNU History @@ -581,7 +598,7 @@ File: history.info, Node: History Variables, Next: History Programming Example History Variables ================= - This section describes the externally visible variables exported by + This section describes the externally-visible variables exported by the GNU History Library. - Variable: int history_base @@ -590,12 +607,13 @@ the GNU History Library. - Variable: int history_length The number of entries currently stored in the history list. - - Variable: int max_input_history + - Variable: int history_max_entries The maximum number of history entries. This must be changed using - `stifle_history ()'. + `stifle_history()'. - Variable: char history_expansion_char - The character that starts a history event. The default is `!'. + 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 @@ -607,28 +625,32 @@ the GNU History Library. 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 \fBhistory_tokenize()\fP. + The default value is `" \t\n()<>;&|"'. + - Variable: char * history_no_expand_chars The list of characters which inhibit history expansion if found immediately following HISTORY_EXPANSION_CHAR. The default is - whitespace and `='. + space, tab, newline, carriage return, and `='. - Variable: char * history_search_delimiter_chars The list of additional characters which can delimit a history - search string, in addition to whitespace, `:' and `?' in the case + search string, in addition to space, TAB, `:' and `?' in the case of a substring search. The default is empty. - Variable: int history_quotes_inhibit_expansion If non-zero, single-quoted words are not scanned for the history expansion character. The default value is 0. - - Variable: Function * history_inhibit_expansion_function + - 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 integer 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. + 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'. File: history.info, Node: History Programming Example, Prev: History Variables, Up: Programming with GNU History @@ -639,7 +661,12 @@ History Programming Example The following program demonstrates simple use of the GNU History Library. - main () + #include+ #include + + main (argc, argv) + int argc; + char **argv; { char line[1024], *t; int len, done = 0; @@ -758,6 +785,7 @@ Function and Variable Index * history_is_stifled: History List Management. * history_length: History Variables. * history_list: Information About the History List. +* history_max_entries: History Variables. * history_no_expand_chars: History Variables. * history_quotes_inhibit_expansion: History Variables. * history_search: Searching the History List. @@ -770,7 +798,7 @@ Function and Variable Index * history_tokenize: History Expansion. * history_total_bytes: Information About the History List. * history_truncate_file: Managing the History File. -* max_input_history: History Variables. +* history_word_delimiters: History Variables. * next_history: Moving Around the History List. * previous_history: Moving Around the History List. * read_history: Managing the History File. @@ -786,26 +814,26 @@ Function and Variable Index Tag Table: -Node: Top1162 -Node: Using History Interactively1742 -Node: History Interaction2250 -Node: Event Designators3669 -Node: Word Designators4596 -Node: Modifiers6225 -Node: Programming with GNU History7363 -Node: Introduction to History8089 -Node: History Storage9774 -Node: History Functions10867 -Node: Initializing History and State Management11838 -Node: History List Management12630 -Node: Information About the History List14151 -Node: Moving Around the History List15457 -Node: Searching the History List16342 -Node: Managing the History File18174 -Node: History Expansion19680 -Node: History Variables21519 -Node: History Programming Example23837 -Node: Concept Index26441 -Node: Function and Variable Index26927 +Node: Top1136 +Node: Using History Interactively1716 +Node: History Interaction2223 +Node: Event Designators3642 +Node: Word Designators4569 +Node: Modifiers6198 +Node: Programming with GNU History7336 +Node: Introduction to History8061 +Node: History Storage9746 +Node: History Functions10857 +Node: Initializing History and State Management11841 +Node: History List Management12641 +Node: Information About the History List14191 +Node: Moving Around the History List15547 +Node: Searching the History List16536 +Node: Managing the History File18454 +Node: History Expansion20260 +Node: History Variables22155 +Node: History Programming Example24725 +Node: Concept Index27447 +Node: Function and Variable Index27933 End Tag Table diff --git a/doc/history.ps b/doc/history.ps index abd7810..4532736 100644 --- a/doc/history.ps +++ b/doc/history.ps @@ -1,5 +1,5 @@ %!PS-Adobe-2.0 -%%Creator: dvips(k) 5.82 Copyright 1998 Radical Eye Software +%%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %%Title: history.dvi %%Pages: 20 %%PageOrder: Ascend @@ -8,7 +8,7 @@ %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -D 300 -t letter -o history.ps history.dvi %DVIPSParameters: dpi=300, compressed -%DVIPSSource: TeX output 2000.01.19:1217 +%DVIPSSource: TeX output 2001.04.16:1105 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S @@ -20,9 +20,9 @@ mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] -N/FBB[0 0 0 0]N/nn 0 N/IE 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin +N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin /FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array -/BitMaps X/BuildChar{CharBuilder}N/Encoding IE N end A{/foo setfont}2 +/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get @@ -50,7 +50,7 @@ bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X -1000 div/DVImag X/IE 256 array N 2 string 0 1 255{IE S A 360 add 36 4 +1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N /p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ /Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) @@ -107,8 +107,8 @@ A2120E5BA212071330A2EA0370A25B1201A25BA3485A12730077C7FC127E123C11187F8F 14>I I E %EndDVIPSBitmapFont -%DVIPSBitmapFont: Fd cmsl9 9 1 -/Fd 1 47 df<1270A212F0126004047D830B>46 D E +%DVIPSBitmapFont: Fd cmti9 9 1 +/Fd 1 47 df<1230127812F0126005047C830C>46 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fe cmr9 9 24 /Fe 24 122 df I E %EndDVIPSBitmapFont -%DVIPSBitmapFont: Fh cmtt10 12 24 -/Fh 24 119 df<13E0A538F0E1E0EAFCE7387EEFC0381FFF00EA07FCEA01F0EA07FCEA1F +%DVIPSBitmapFont: Fh cmtt10 12 27 +/Fh 27 119 df<13E0A538F0E1E0EAFCE7387EEFC0381FFF00EA07FCEA01F0EA07FCEA1F FF387EEFC038FCE7E0EAF0E13800E000A513157D991A>42 D<1338137CA2136C13EEA313 C6A2EA01C7A438038380A4380701C0A213FFA24813E0EA0E00A4481370387F01FC38FF83 FE387F01FC171E7F9D1A>65 D 69 D<387FFFFCB5FC7E380E001CA51400A2EB03 -80A3EA0FFFA3EA0E03A390C7FCA8EA7FE012FF127F161E7F9D1A>I<38FF83FEA3381C00 -70AA381FFFF0A3381C0070AB38FF83FEA3171E7F9D1A>72 D I<38FE03FE12FFA2381D8070A213C0121CA213E0A213601370A213 -301338A21318131CA2130C130EA21306A213071303A238FF81F0A21380171E7F9D1A>78 +90C7FCA3141CA5B512FCA3161E7E9D1A>69 D<38FF83FEA3381C0070AA381FFFF0A3381C +0070AB38FF83FEA3171E7F9D1A>72 D +I<38FE03FE12FFA2381D8070A213C0121CA213E0A213601370A213301338A21318131CA2 +130C130EA21306A213071303A238FF81F0A21380171E7F9D1A>78 D I 82 D<3803F1C0EA0FFDEA3FFFEA7C0FEA700312E01301A390C7FC12 138013C700011300A2EA00EEA2137CA21338AA48B4FCA3171E7F9D1A>89 D<387FFFC0B512E0A26C13C013047D7E1A>95 D 97 D 99 -D I<12FEA3120EA6133EEBFF80000F -13C013C1EB80E01300120EAC38FFE3FE13E713E3171E7F9D1A>104 -D I< -EAFE3EEBFF80B512C0EA0FC1EB80E01300120EAC38FFE3FE13E713E317157F941A>110 -D I<387F81F838FF8FFC38 -7F9FFE3803FE1EEBF80CEBE000A25B5BAAEA7FFFB5FC7E17157F941A>114 +F016157D941A>97 D<12FEA3120EA6133EEBFF80000F13E0EBC1F0EB8070EB0038120E14 +1CA7000F13381478EB80F0EBC1E0EBFFC0000E138038063E00161E7F9D1A>I I I I I<12FEA3120EA6133EEBFF80000F13C013C1EB80E01300120EAC38FFE3 +FE13E713E3171E7F9D1A>104 D I 108 +D +110 D I<387F81F838FF8F +FC387F9FFE3803FE1EEBF80CEBE000A25B5BAAEA7FFFB5FC7E17157F941A>114 D<487E1203A6387FFFE0B5FCA238038000AA1470A43801C1E013FF6C1380EB3F00141C7F 9B1A>116 D<38FE0FE0A3EA0E00AD1301EA0F033807FFFE7EEA00FC17157F941A>I<387F C7FC00FF13FE007F13FC380E00E0A3380701C0A338038380A33801C700A3EA00EEA3137C @@ -325,7 +329,7 @@ A10D>93 D 99 D<1438EB01F8EB00781438A21470A614E013FCEA0382EA0601121CEA3C00383801C01278 12F0A438E00380A412F0EA700738380F00381C37803807C7E015207D9F19>I<13F8EA07 -0EEA0E07121C383803801278127012F0A2B5FC00F0C7FC5AA46C5AEA7002EA3004EA1C18 +0EEA0E07381C038012381278127012F0B5FC00F0C7FCA25AA46C5AEA7002EA3004EA1C18 EA07E011147D9314>I I<140EEB3E11EBE1A33801C1C238 0381E0EA07801301120FA3380703C01480EB8700EA04FC48C7FCA21218121CEA0FFF14C0 @@ -356,8 +360,15 @@ A35A5A5A121EEAFFF8EA0E00A45AA65A1310A41320A2EA1840EA0F800D1C7C9B12>I<38 0171C7FC1339133A133E133C133813181310A25BA25BEA70C0EAF08000F1C8FC12E61278 191D809318>I E %EndDVIPSBitmapFont -%DVIPSBitmapFont: Fk cmbx12 17.28 36 -/Fk 36 122 df 103 +D<38FC01FC381E007014201217EA1380A2EA11C0EA10E0A213701338A2131C130E1307A2 +EB03A0EB01E0A213001460123800FE132016177E961C>110 D<38FF81FC381C00701420 +B0000C1340120E6C138038018300EA007C16177E961C>117 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fl cmbx12 17.28 36 +/Fl 36 122 df 49 D I E %EndDVIPSBitmapFont -%DVIPSBitmapFont: Fl cmsy10 10.95 1 -/Fl 1 14 df<14FF010713E090381F00F80178131E01E01307D80180EB018048C812C000 -061560481530A248151848150CA2481506A4481503A900601506A46C150CA26C15186C15 -30A26C15606C15C06C6CEB0180D800E0EB07000178131E011F13F8903807FFE0010090C7 -FC282B7EA02D>13 D E +%DVIPSBitmapFont: Fm cmsy10 10.95 1 +/Fm 1 14 df<14FE903807FFC090381F01F0903878003C01E0130ED80180130348C7EA01 +800006EC00C0481560A2481530481518A248150CA4481506A90060150CA46C1518A26C15 +306C1560A26C15C06CEC01806C6CEB0300D800E0130E0178133C90381F01F0903807FFC0 +D900FEC7FC272B7DA02E>13 D E %EndDVIPSBitmapFont -%DVIPSBitmapFont: Fm cmbx12 14.4 45 -/Fm 45 122 df<123C127FEAFF80A213C0A3127F123E1200A2EA0180A3EA0300A2120612 +%DVIPSBitmapFont: Fn cmbx12 14.4 44 +/Fn 44 122 df<123C127FEAFF80A213C0A3127F123E1200A2EA0180A3EA0300A2120612 0E5A5A12100A157B8813>44 D<121C127FA2EAFF80A3EA7F00A2121C09097B8813>46 D<130E131E137EEA07FE12FFA212F81200B3ABB512FEA317277BA622>49 D I I I 77 -D I 80 -D 82 D<9038FF80600003EBF0E0000F13F8381F80FD383F -001F003E1307481303A200FC1301A214007EA26C140013C0EA7FFCEBFFE06C13F86C13FE -80000714806C14C0C6FC010F13E0EB007FEC1FF0140F140700E01303A46C14E0A26C1307 -6C14C0B4EB0F80EBE03F39E3FFFE0000E15B38C01FF01C297CA825>I 85 D I I<3803FF80000F13F0381F01FC383F80 -FE147F801580EA1F00C7FCA4EB3FFF3801FC3FEA0FE0EA1F80EA3F00127E5AA4145F007E -13DF393F839FFC381FFE0F3803FC031E1B7E9A21>97 D I I I I< -EB07F8EB3FFCEB7E3E3801FC7FEA03F813F01207143E1400A7B512C0A33807F000B3A338 -7FFF80A3182A7EA915>I<9038FF80F00003EBE3F8390FC1FE1C391F007C7C48137E003E -EB3E10007EEB3F00A6003E133E003F137E6C137C380FC1F8380BFFE00018138090C8FC12 -38A2123C383FFFF814FF6C14C06C14E06C14F0121F383C0007007CEB01F8481300A4007C -EB01F0A2003FEB07E0390FC01F806CB5120038007FF01E287E9A22>I I<1207EA0F80EA1FC0EA3FE0A3EA1FC0EA0F80EA0700C7FCA7EAFFE0A3120F -B3A3EAFFFEA30F2B7EAA12>I 108 -D<26FFC07FEB1FC0903AC1FFC07FF0903AC307E0C1F8D80FC49038F101FC9039C803F200 -01D801FE7F01D05BA201E05BB03CFFFE3FFF8FFFE0A3331B7D9A38>I<38FFC07E9038C1 -FF809038C30FC0D80FC413E0EBC80701D813F013D0A213E0B039FFFE3FFFA3201B7D9A25 ->I I<38FFE1FE9038EFFF809038FE0FE0390FF803F09038F001F801E013FC -140015FEA2157FA8157E15FEA215FC140101F013F89038F807F09038FC0FE09038EFFF80 -9038E1FC0001E0C7FCA9EAFFFEA320277E9A25>I<38FFC1F0EBC7FCEBC63E380FCC7F13 -D813D0A2EBF03EEBE000B0B5FCA3181B7F9A1B>114 D<3803FE30380FFFF0EA3E03EA78 -00127000F01370A27E00FE1300EAFFE06CB4FC14C06C13E06C13F0000713F8C6FCEB07FC -130000E0137C143C7E14387E6C137038FF01E038E7FFC000C11300161B7E9A1B>I<13E0 -A41201A31203A21207120F381FFFE0B5FCA2380FE000AD1470A73807F0E0000313C03801 -FF8038007F0014267FA51A>I<39FFE07FF0A3000F1307B2140FA2000713173903F067FF -3801FFC738007F87201B7D9A25>I<39FFFC03FFA3390FF000F0000714E07F0003EB01C0 -A2EBFC0300011480EBFE070000140013FFEB7F0EA2149EEB3F9C14FC6D5AA26D5AA36D5A -A26D5AA2201B7F9A23>I<3BFFFC7FFC1FFCA33B0FE00FE001C02607F007EB0380A201F8 -EBF00700031600EC0FF801FC5C0001150EEC1FFC2600FE1C5B15FE9039FF387E3C017F14 -38EC787F6D486C5A16F0ECE01F011F5CA26D486C5AA2EC800701075CA22E1B7F9A31>I< -39FFFC1FFEA33907F003803803F8079038FC0F003801FE1E00005BEB7F3814F86D5A6D5A -130F806D7E130F497EEB3CFEEB38FFEB787F9038F03F803901E01FC0D803C013E0EB800F -39FFF03FFFA3201B7F9A23>I<39FFFC03FFA3390FF000F0000714E07F0003EB01C0A2EB -FC0300011480EBFE070000140013FFEB7F0EA2149EEB3F9C14FC6D5AA26D5AA36D5AA26D -5AA25CA21307003890C7FCEA7C0FEAFE0E131E131C5BEA74F0EA3FE0EA0F8020277F9A23 ->I E +A33803FC00B3B1B512F0A314297EA819>I 78 D 80 D 82 D<9038FF80600003EBF0E0 +000F13F8381F80FD383F001F003E1307481303A200FC1301A214007EA26C140013C0EA7F +FCEBFFE06C13F86C13FE80000714806C14C0C6FC010F13E0EB007FEC1FF0140F140700E0 +1303A46C14E0A26C13076C14C0B4EB0F80EBE03F39E3FFFE0000E15B38C01FF01C297CA8 +25>I 85 +D I I<3803FF80000F13F0381F01FC383F80FE147F801580EA1F00C7FCA4EB3FFF3801 +FC3FEA0FE0EA1F80EA3F00127E5AA4145F007E13DF393F839FFC381FFE0F3803FC031E1B +7E9A21>97 D I I I I I<9038FF80F000 +03EBE3F8390FC1FE1C391F007C7C48137E003EEB3E10007EEB3F00A6003E133E003F137E +6C137C380FC1F8380BFFE00018138090C8FC1238A2123C383FFFF814FF6C14C06C14E06C +14F0121F383C0007007CEB01F8481300A4007CEB01F0A2003FEB07E0390FC01F806CB512 +0038007FF01E287E9A22>I I<1207EA0F80EA1FC0EA3FE0 +A3EA1FC0EA0F80EA0700C7FCA7EAFFE0A3120FB3A3EAFFFEA30F2B7EAA12>I 108 D<26FFC07FEB1FC0903AC1FFC07FF0903AC307E0 +C1F8D80FC49038F101FC9039C803F20001D801FE7F01D05BA201E05BB03CFFFE3FFF8FFF +E0A3331B7D9A38>I<38FFC07E9038C1FF809038C30FC0D80FC413E0EBC80701D813F013 +D0A213E0B039FFFE3FFFA3201B7D9A25>I I<38FFE1FE9038EFFF809038FE +0FE0390FF803F09038F001F801E013FC140015FEA2157FA8157E15FEA215FC140101F013 +F89038F807F09038FC0FE09038EFFF809038E1FC0001E0C7FCA9EAFFFEA320277E9A25> +I<38FFC1F0EBC7FCEBC63E380FCC7F13D813D0A2EBF03EEBE000B0B5FCA3181B7F9A1B> +114 D<3803FE30380FFFF0EA3E03EA7800127000F01370A27E00FE1300EAFFE06CB4FC14 +C06C13E06C13F0000713F8C6FCEB07FC130000E0137C143C7E14387E6C137038FF01E038 +E7FFC000C11300161B7E9A1B>I<13E0A41201A31203A21207120F381FFFE0B5FCA2380F +E000AD1470A73807F0E0000313C03801FF8038007F0014267FA51A>I<39FFE07FF0A300 +0F1307B2140FA2000713173903F067FF3801FFC738007F87201B7D9A25>I<39FFFC03FF +A3390FF000F0000714E07F0003EB01C0A2EBFC0300011480EBFE070000140013FFEB7F0E +A2149EEB3F9C14FC6D5AA26D5AA36D5AA26D5AA2201B7F9A23>I<3BFFFC7FFC1FFCA33B +0FE00FE001C02607F007EB0380A201F8EBF00700031600EC0FF801FC5C0001150EEC1FFC +2600FE1C5B15FE9039FF387E3C017F1438EC787F6D486C5A16F0ECE01F011F5CA26D486C +5AA2EC800701075CA22E1B7F9A31>I<39FFFC1FFEA33907F003803803F8079038FC0F00 +3801FE1E00005BEB7F3814F86D5A6D5A130F806D7E130F497EEB3CFEEB38FFEB787F9038 +F03F803901E01FC0D803C013E0EB800F39FFF03FFFA3201B7F9A23>I<39FFFC03FFA339 +0FF000F0000714E07F0003EB01C0A2EBFC0300011480EBFE070000140013FFEB7F0EA214 +9EEB3F9C14FC6D5AA26D5AA36D5AA26D5AA25CA21307003890C7FCEA7C0FEAFE0E131E13 +1C5BEA74F0EA3FE0EA0F8020277F9A23>I E %EndDVIPSBitmapFont -%DVIPSBitmapFont: Fn cmtt10 10.95 75 -/Fn 75 127 df<127012F8B012701200A5127012F8A31270051C779B18>33 +%DVIPSBitmapFont: Fo cmtt10 10.95 76 +/Fo 76 127 df<127012F8B012701200A5127012F8A31270051C779B18>33 D I I<13C01201A3EA03F0EA0FFCEA3FFEEA7DCFEA71C738E1C38013C7A338F1C0001279123F @@ -589,8 +596,8 @@ EA0380487EA36C5A111C7D9B18>I<137013F8A213D8A2EA01DCA3138CEA038EA4EA0707 A5380FFF80A3EA0E03381C01C0A3387F07F000FF13F8007F13F0151C7F9B18>65 D 68 D I I<387F07F038FF +0EA3EA1FFEA3EA1C0EA390C7FCA21438A5B512F8A3151C7F9B18>I I<387F07F038FF 8FF8387F07F0381C01C0A9EA1FFFA3EA1C01AA387F07F038FF8FF8387F07F0151C7F9B18 >72 D I 76 D<387E07F038FF0FF8387F07F0381D81C0 @@ -624,34 +631,36 @@ B5FCA23801C000AEEA7FFFA3131C7F9B18>I<3801E1F03807FFF85A381E1E30381C0E00 0070481338A4007813F0EA7E03381FFFC06C13803801FC00151F7F9318>I<127E12FE12 7E120EA5133EEBFF80000F13C013C1EB80E01300120EAB387FC7FC38FFE7FE387FC7FC17 1C809B18>I I 108 D<38F9C1C038FFF7F013FF383E3E -38EA3C3CA2EA3838AB38FE3E3EEB7E7EEB3E3E1714809318>I I I I<3801F380EA07FBEA1FFFEA3E1FEA380FEA7007A2EAE003A6EA7007A2 -EA380FEA3C1FEA1FFFEA0FFBEA03E3EA0003A7EB1FF0EB3FF8EB1FF0151E7E9318>I<38 -FF0FC0EB3FE0EB7FF0EA07F0EBE060EBC0005BA290C7FCA9EAFFFC7F5B14147E9318>I< -EA07F7EA3FFF5AEA780FEAE007A3007CC7FCEA7FE0EA1FFCEA03FEEA001F38600780EAE0 -03A212F038F80F00B5FC13FCEAE7F011147D9318>I<487E1203A4387FFFC0B5FCA23803 -8000A9144014E0A33801C1C013FF6C1380EB3E0013197F9818>I<387E07E0EAFE0FEA7E -07EA0E00AC1301EA0F033807FFFC6C13FE3801FCFC1714809318>I<387F8FF000FF13F8 -007F13F0381C01C0380E0380A338070700A3138FEA038EA3EA01DCA3EA00F8A213701514 -7F9318>I<38FF07F8138F1307383800E0A4381C01C0137113F9A213D9EA1DDD000D1380 -A3138DEA0F8FA23807070015147F9318>I<387F8FF0139F138F380F0700EA078EEA039E -EA01DC13F81200137013F07FEA01DCEA039E138EEA0707000E1380387F8FF000FF13F800 -7F13F015147F9318>I<387F8FF000FF13F8007F13F0380E01C0EB0380A21207EB0700A2 -EA0387A2138EEA01CEA213CC120013DC1378A31370A313F05B1279EA7BC0EA7F806CC7FC -121E151E7F9318>I<383FFFF05AA2387001E0EB03C0EB078038000F00131E5B13F8485A -EA03C0485A380F0070121E5A5AB512F0A314147F9318>I I<126012 -F0B3B012600424769F18>I<127CB4FC13C01203C67EAB7FEB7FC0EB3FE0A2EB7FC0EBF0 -005BABEA03C012FF90C7FC127C13247E9F18>I I E +18>I<127E12FE127E120EA5EB3FF0A3EB0780EB0F00131E5B5B5BEA0FF87F139C130EEA +0E0F7FEB038014C0387FC7F812FF127F151C7F9B18>107 D I<38F9C1C038FFF7F013FF383E3E38EA3C3CA2EA3838AB38FE3E3EEB7E +7EEB3E3E1714809318>I I I I<3801F380EA07FB +EA1FFFEA3E1FEA380FEA7007A2EAE003A6EA7007A2EA380FEA3C1FEA1FFFEA0FFBEA03E3 +EA0003A7EB1FF0EB3FF8EB1FF0151E7E9318>I<38FF0FC0EB3FE0EB7FF0EA07F0EBE060 +EBC0005BA290C7FCA9EAFFFC7F5B14147E9318>I I<487E1203A4387FFFC0B5FCA238038000A9144014E0A33801C1C013FF6C +1380EB3E0013197F9818>I<387E07E0EAFE0FEA7E07EA0E00AC1301EA0F033807FFFC6C +13FE3801FCFC1714809318>I<387F8FF000FF13F8007F13F0381C01C0380E0380A33807 +0700A3138FEA038EA3EA01DCA3EA00F8A2137015147F9318>I<38FF07F8138F13073838 +00E0A4381C01C0137113F9A213D9EA1DDD000D1380A3138DEA0F8FA23807070015147F93 +18>I<387F8FF0139F138F380F0700EA078EEA039EEA01DC13F81200137013F07FEA01DC +EA039E138EEA0707000E1380387F8FF000FF13F8007F13F015147F9318>I<387F8FF000 +FF13F8007F13F0380E01C0EB0380A21207EB0700A2EA0387A2138EEA01CEA213CC120013 +DC1378A31370A313F05B1279EA7BC0EA7F806CC7FC121E151E7F9318>I<383FFFF05AA2 +387001E0EB03C0EB078038000F00131E5B13F8485AEA03C0485A380F0070121E5A5AB512 +F0A314147F9318>I I<126012F0B3B012600424769F18>I<127CB4FC +13C01203C67EAB7FEB7FC0EB3FE0A2EB7FC0EBF0005BABEA03C012FF90C7FC127C13247E +9F18>I I +E %EndDVIPSBitmapFont -%DVIPSBitmapFont: Fo cmr10 10.95 75 -/Fo 75 123 df<90381F83E09038F06E303901C07878380380F8903800F03048EB7000A7 +%DVIPSBitmapFont: Fp cmr10 10.95 74 +/Fp 74 123 df<90381F83E09038F06E303901C07878380380F8903800F03048EB7000A7 B612803907007000B2383FE3FF1D20809F1B>11 D<133FEBE0C0EA01C0380381E0EA0701 A290C7FCA6B512E0EA0700B2383FC3FC1620809F19>I I<90381F81F89038F04F043901C07C063903 @@ -664,7 +673,7 @@ D<13401380EA01005A12061204120C5AA212381230A212701260A412E0AC1260A4127012 5A0A2E7EA112>I<127012F012F8A212781208A31210A31220A21240050E7C840D>44 D I<127012F8A3127005057C840D>I 48 D<13801203120F12F31203B3A6EA07C0EAFFFE0F1E7C9D17>I 48 D<13801203120F12F31203B3A6EA07C0EA7FFE0F1E7C9D17>I I I I I<90380FE01090 -38381C309038E002703803C00139078000F048C71270121E15305A1510127C127800F814 -00A7EC3FFEEC01F000781300127C123CA27EA27E6C7E3903C001703900E002309038380C -1090380FF0001F217E9F24>I<39FFF07FF8390F000780AD90B5FCEB0007AF39FFF07FF8 -1D1F7E9E22>I I<3807FFC038003E00131EB3A3 -122012F8A3EAF01CEA403CEA6038EA1070EA0FC012207F9E17>I 76 D I I I I I I<3803F040 -380C0CC0EA1803EA3001EA6000A212E01440A36C13007E127CEA7F80EA3FF86CB4FC0007 -1380C613C0EB1FE013031301EB00F014707EA46C136014E06C13C038F8018038C60300EA -81FC14217E9F19>I<007FB512E038780F010060EB006000401420A200C0143000801410 -A400001400B3497E3803FFFC1C1F7E9E21>I<39FFF00FF8390F0003E0EC0080B3A46CEB -01001380120314026C6C5A6C6C5AEB3830EB0FC01D207E9E22>I<39FFF003FE391F8000 -F86CC7126015206C6C1340A36C6C1380A2EBE00100011400A23800F002A213F8EB7804A2 -6D5AA36D5AA2131F6D5AA2EB07C0A36D5AA36DC7FC1F207F9E22>I<3BFFF07FF81FF03B -1F000FC007C06C903907800180170015C001805C00071502EC09E013C000035DEC19F014 -10D801E05CA2EC2078D800F05CA2EC403C01785CA2EC801E017C1460013C144090383D00 -0F133F6D5CA2011E1307010E91C7FCA2010C7F010413022C207F9E2F>I<12FFA212C0B3 -B3A512FFA2082D7CA10D>91 D I<12FFA21203B3B3A512FFA2082D80A10D>I<12081210 -1220A21240A21280A312B812FCA2127C1238060E7D9F0D>96 D I<121C12FC121CAA137CEA1D87381E0180EB00C0001C13E01470A21478A6 -147014F014E0001E13C0381A018038198700EA107C15207E9F19>I I I I<13 -7CEA01C6EA030F1207EA0E061300A7EAFFF0EA0E00B2EA7FE01020809F0E>I<14E03803 -E330EA0E3CEA1C1C38380E00EA780FA5EA380E6C5AEA1E38EA33E00020C7FCA21230A2EA -3FFE381FFF8014C0383001E038600070481330A4006013606C13C0381C03803803FC0014 -1F7F9417>I<121C12FC121CAA137C1386EA1D03001E1380A2121CAE38FF8FF014207E9F -19>I<1238127CA31238C7FCA6121C12FC121CB1EAFF80091F7F9E0C>I<13E0EA01F0A3EA -00E01300A61370EA07F012001370B3A31260EAF06013C0EA6180EA3F000C28829E0E>I< -121C12FC121CAAEB1FE0EB0780EB060013045B5B5B136013E0EA1DF0EA1E70EA1C38133C -131C7F130F7F148014C038FF9FF014207E9F18>I<121C12FC121CB3ABEAFF8009207F9F -0C>I<391C3E03E039FCC30C30391D039038391E01E01CA2001C13C0AE3AFF8FF8FF8021 -147E9326>I I I I<3801 -F04038070CC0EA0E02EA1C03EA38011278127012F0A6127012781238EA1C03EA0C05EA07 -09EA01F1EA0001A8EB0FF8151D7F9318>I I I<1202A31206A2120E -A2123EEAFFF8EA0E00AB1304A5EA07081203EA01F00E1C7F9B12>I<381C0380EAFC1FEA -1C03AE1307120CEA061B3803E3F014147E9319>I<38FF83F8383E00E0001C13C06C1380 -A338070100A21383EA0382A2EA01C4A213E4EA00E8A21370A3132015147F9318>I<39FF -9FE1FC393C078070391C030060EC8020000E1440A214C0D80704138014E0A23903886100 -1471A23801D032143A143E3800E01CA2EB6018EB40081E147F9321>I<38FF87F8381E03 -C0380E0180EB0300EA0702EA0384EA01C813D8EA00F01370137813F8139CEA010E1202EA -060738040380000C13C0003C13E038FE07FC16147F9318>I<38FF83F8383E00E0001C13 -C06C1380A338070100A21383EA0382A2EA01C4A213E4EA00E8A21370A31320A25BA3EAF0 -80A200F1C7FC1262123C151D7F9318>I -I E +00A3146014E013FF138014601420A391C7FCA87FEAFFFE1A1F7F9E1E>I<90380FE02090 +387818609038E004E03803800238070001481300001E1460A25A1520127C127800F81400 +A7EC7FFCEC03E000781301127C123CA27EA27E7E380380023900E0046090387818209038 +0FE0001E217D9F24>I<39FFF07FF8390F000780AD90B5FCEB0007AF39FFF07FF81D1F7E +9E22>I I 76 D I I I I I I<38 +03F040380C0CC0EA1803EA3001EA6000A212E01440A36C13007E127CEA7F80EA3FF86CB4 +FC00071380C613C0EB1FE013031301EB00F014707EA46C136014E06C13C038F8018038C6 +0300EA81FC14217E9F19>I<007FB512E038780F010060EB006000401420A200C0143000 +801410A400001400B3497E3803FFFC1C1F7E9E21>I<39FFF00FF8390F0003E0EC0080B3 +A46CEB01001380120314026C6C5A6C6C5AEB3830EB0FC01D207E9E22>I<39FFF003FE39 +1F8000F86CC7126015206C6C1340A36C6C1380A2EBE00100011400A23800F002A213F8EB +7804A26D5AA36D5AA2131F6D5AA2EB07C0A36D5AA36DC7FC1F207F9E22>I<3BFFF07FF8 +1FF03B1F000FC007C06C903907800180170015C001805C00071502EC09E013C000035DEC +19F01410D801E05CA2EC2078D800F05CA2EC403C01785CA2EC801E017C1460013C144090 +383D000F133F6D5CA2011E1307010E91C7FCA2010C7F010413022C207F9E2F>I<12FFA2 +12C0B3B3A512FFA2082D7CA10D>91 D I<12FFA21203B3B3A512FFA2082D80A10D>I<12 +0812101220A21240A21280A312B812FCA2127C1238060E7D9F0D>96 +D I<121C12FC121CAA137CEA1D87381E0180EB00 +C0001C13E01470A21478A6147014F014E0001E13C0381A018038198700EA107C15207E9F +19>I I I I<137CEA01C6EA030F1207EA0E061300A7EAFFF0EA0E00B2EA7FE010 +20809F0E>I<14E03803E330EA0E3CEA1C1C38380E00EA780FA5EA380E6C5AEA1E38EA33 +E00020C7FCA21230A2EA3FFE381FFF8014C0383001E038600070481330A4006013606C13 +C0381C03803803FC00141F7F9417>I<121C12FC121CAA137C1386EA1D03001E1380A212 +1CAE38FF8FF014207E9F19>I<1238127CA31238C7FCA6121C12FC121CB1EAFF80091F7F +9E0C>I<13E0EA01F0A3EA00E01300A61370EA07F012001370B3A31260EAF06013C0EA61 +80EA3F000C28829E0E>I<121C12FC121CAAEB1FE0EB0780EB060013045B5B5B136013E0 +EA1DF0EA1E70EA1C38133C131C7F130F7F148014C038FF9FF014207E9F18>I<121C12FC +121CB3ABEAFF8009207F9F0C>I<391C3E03E039FCC30C30391D019018001EEBE01CA200 +1C13C0AE3AFF8FF8FF8021147E9326>I I I I<3801F04038070CC0EA0E02EA1C03EA38011278127012F0A61270 +12781238EA1C03EA0C05EA0709EA01F1EA0001A8EB0FF8151D7F9318>I I I<1202A31206A2120EA2123EEAFFF8EA0E00AB1304A5EA07081203EA01F00E1C7F +9B12>I<381C0380EAFC1FEA1C03AE1307120CEA061B3803E3F014147E9319>I<38FF83F8 +383E00E0001C13C06C1380A338070100A21383EA0382A2EA01C4A213E4EA00E8A21370A3 +132015147F9318>I<39FF9FE1FC393C078070391C030060EC8020000E1440A214C0D807 +04138014E0A239038861001471A23801D032143A143E3800E01CA2EB6018EB40081E147F +9321>I<38FF87F8381E03C0380E0180EB0300EA0702EA0384EA01C813D8EA00F0137013 +7813F8139CEA010E1202EA060738040380000C13C0003C13E038FE07FC16147F9318>I< +38FF83F8383E00E0001C13C06C1380A338070100A21383EA0382A2EA01C4A213E4EA00E8 +A21370A31320A25BA3EAF080A200F1C7FC1262123C151D7F9318>I I E %EndDVIPSBitmapFont -%DVIPSBitmapFont: Fp cmbx12 20.736 13 -/Fp 13 122 df )d -Fo(in)j(an)o(y)f(\014le)75 1513 y(that)d(uses)h(the)h(History)e +(in)75 1482 y(other)14 b(co)q(de,)h(an)f(application)i(writer)e(should) +i(include)g(the)f(\014le)g Fo( )d +Fp(in)j(an)o(y)f(\014le)75 1537 y(that)d(uses)h(the)h(History)e (library's)i(features.)18 b(It)12 b(supplies)i(extern)e(declarations)h -(for)e(all)i(of)f(the)g(library's)75 1568 y(public)17 +(for)e(all)i(of)f(the)g(library's)75 1591 y(public)17 b(functions)f(and)g(v)m(ariables,)g(and)f(declares)h(all)g(of)f(the)h -(public)h(data)d(structures.)75 1686 y Fm(2.2)33 b(History)22 -b(Storage)137 1778 y Fo(The)16 b(history)f(list)h(is)g(an)f(arra)o(y)f +(public)h(data)d(structures.)75 1722 y Fn(2.2)33 b(History)22 +b(Storage)137 1819 y Fp(The)16 b(history)f(list)h(is)g(an)f(arra)o(y)f (of)g(history)i(en)o(tries.)k(A)15 b(history)g(en)o(try)g(is)h -(declared)g(as)f(follo)o(ws:)195 1839 y Fn(typedef)23 -b(struct)g(_hist_entry)f({)243 1891 y(char)h(*line;)243 -1943 y(char)g(*data;)195 1995 y(})h(HIST_ENTRY;)137 2058 -y Fo(The)16 b(history)f(list)h(itself)g(migh)o(t)f(therefore)g(b)q(e)h -(declared)g(as)195 2119 y Fn(HIST_ENTRY)22 b(**the_history_list;)137 -2183 y Fo(The)16 b(state)e(of)h(the)g(History)g(library)h(is)g -(encapsulated)g(in)o(to)f(a)g(single)i(structure:)195 -2243 y Fn(/*)24 b(A)f(structure)g(used)g(to)h(pass)f(the)h(current)f -(state)g(of)g(the)h(history)f(stuff)g(around.)g(*/)p -2033 2253 21 42 v 195 2295 a(typedef)g(struct)g(_hist_state)f({)243 -2347 y(HIST_ENTRY)g(**entries;)214 b(/*)23 b(Pointer)g(to)h(the)f -(entries)g(themselves.)f(*/)243 2399 y(int)h(offset;)453 -b(/*)23 b(The)h(location)e(pointer)h(within)g(this)h(array.)f(*/)p -2033 2409 V 243 2451 a(int)g(length;)453 b(/*)23 b(Number)g(of)h -(elements)f(within)g(this)g(array.)g(*/)p 1985 2461 V -243 2503 a(int)g(size;)501 b(/*)23 b(Number)g(of)h(slots)f(allocated)g -(to)g(this)h(array.)f(*/)p 2057 2513 V 243 2555 a(int)g(flags;)195 -2606 y(})h(HISTORY_STATE;)137 2670 y Fo(If)16 b(the)f(\015ags)g(mem)o -(b)q(er)g(includes)j Fn(HS_STIFLED)p Fo(,)13 b(the)i(history)h(has)f(b) -q(een)h(sti\015ed.)p eop +(declared)g(as)f(follo)o(ws:)195 1885 y Fo(typedef)23 +b(void)g(*histdata_t;)195 1988 y(typedef)g(struct)g(_hist_entry)f({)243 +2040 y(char)h(*line;)243 2092 y(histdata_t)f(data;)195 +2144 y(})i(HIST_ENTRY;)137 2212 y Fp(The)16 b(history)f(list)h(itself)g +(migh)o(t)f(therefore)g(b)q(e)h(declared)g(as)195 2277 +y Fo(HIST_ENTRY)22 b(**the_history_list;)137 2345 y Fp(The)16 +b(state)e(of)h(the)g(History)g(library)h(is)g(encapsulated)g(in)o(to)f +(a)g(single)i(structure:)195 2411 y Fo(/*)219 2462 y(*)24 +b(A)f(structure)g(used)g(to)h(pass)f(around)g(the)h(current)f(state)g +(of)g(the)h(history.)219 2514 y(*/)195 2566 y(typedef)f(struct)g +(_hist_state)f({)243 2618 y(HIST_ENTRY)g(**entries;)h(/*)g(Pointer)g +(to)h(the)f(entries)g(themselves.)g(*/)243 2670 y(int)g(offset;)262 +b(/*)23 b(The)h(location)f(pointer)f(within)h(this)h(array.)f(*/)p +eop %%Page: 6 8 -6 7 bop 75 -58 a Fo(6)1347 b(GNU)15 b(History)g(Library)75 -183 y Fm(2.3)33 b(History)22 b(F)-6 b(unctions)137 278 -y Fo(This)21 b(section)g(describ)q(es)h(the)f(calling)h(sequence)g(for) -e(the)g(v)m(arious)h(functions)g(presen)o(t)g(in)g(GNU)75 -333 y(History)l(.)75 441 y Fi(2.3.1)30 b(Initializing)20 -b(History)h(and)f(State)g(Managemen)n(t)137 536 y Fo(This)e(section)g -(describ)q(es)h(functions)f(used)g(to)e(initialize)21 -b(and)c(manage)g(the)g(state)g(of)g(the)g(History)75 -591 y(library)f(when)g(y)o(ou)f(w)o(an)o(t)f(to)g(use)i(the)f(history)g -(functions)h(in)g(y)o(our)f(program.)1650 679 y(F)l(unction)-1749 -b Fh(void)20 b Fg(using)p 333 679 18 3 v 20 w(history)j -Ff(\(\))195 734 y Fo(Begin)18 b(a)f(session)h(in)g(whic)o(h)g(the)g -(history)f(functions)h(migh)o(t)f(b)q(e)h(used.)27 b(This)18 -b(initializes)195 788 y(the)d(in)o(teractiv)o(e)h(v)m(ariables.)1650 -877 y(F)l(unction)-1749 b Fh(HISTORY_STATE)21 b(*)e Fg(history)p -657 877 V 21 w(get)p 755 877 V 21 w(history)p 951 877 -V 21 w(state)j Ff(\(\))195 931 y Fo(Return)16 b(a)f(structure)g -(describing)i(the)e(curren)o(t)g(state)f(of)h(the)g(input)i(history)l -(.)1650 1019 y(F)l(unction)-1749 b Fh(void)20 b Fg(history)p -377 1019 V 20 w(set)p 468 1019 V 21 w(history)p 664 1019 -V 21 w(state)j Ff(\()p Fn(HISTORY_STATE)13 b(*state)p -Ff(\))195 1074 y Fo(Set)i(the)h(state)e(of)h(the)g(history)g(list)h -(according)g(to)e Fj(state)p Fo(.)75 1182 y Fi(2.3.2)30 -b(History)20 b(List)h(Managemen)n(t)137 1277 y Fo(These)11 +6 7 bop 75 -58 a Fp(6)1347 b(GNU)15 b(History)g(Library)243 +149 y Fo(int)23 b(length;)262 b(/*)23 b(Number)g(of)h(elements)f +(within)g(this)g(array.)g(*/)243 201 y(int)g(size;)310 +b(/*)23 b(Number)g(of)h(slots)f(allocated)g(to)g(this)h(array.)f(*/)243 +253 y(int)g(flags;)195 305 y(})h(HISTORY_STATE;)137 372 +y Fp(If)16 b(the)f(\015ags)g(mem)o(b)q(er)g(includes)j +Fo(HS_STIFLED)p Fp(,)13 b(the)i(history)h(has)f(b)q(een)h(sti\015ed.)75 +498 y Fn(2.3)33 b(History)22 b(F)-6 b(unctions)137 593 +y Fp(This)13 b(section)g(describ)q(es)h(the)e(calling)i(sequence)g(for) +e(the)g(v)m(arious)h(functions)g(exp)q(orted)f(b)o(y)h(the)f +Fk(gnu)75 648 y Fp(History)j(library)l(.)75 758 y Fi(2.3.1)30 +b(Initializing)20 b(History)h(and)f(State)g(Managemen)n(t)137 +853 y Fp(This)e(section)g(describ)q(es)h(functions)f(used)g(to)e +(initialize)21 b(and)c(manage)g(the)g(state)g(of)g(the)g(History)75 +908 y(library)f(when)g(y)o(ou)f(w)o(an)o(t)f(to)g(use)i(the)f(history)g +(functions)h(in)g(y)o(our)f(program.)1762 1021 y(F)l(unction)-1861 +b Fh(void)20 b Fg(using)p 333 1021 18 3 v 20 w(history)j +Ff(\()p Fo(void)p Ff(\))195 1075 y Fp(Begin)e(a)f(session)g(in)h(whic)o +(h)g(the)f(history)g(functions)g(migh)o(t)g(b)q(e)h(used.)34 +b(This)21 b(initializes)i(the)195 1130 y(in)o(teractiv)o(e)16 +b(v)m(ariables.)1762 1243 y(F)l(unction)-1861 b Fh(HISTORY_STATE)21 +b(*)e Fg(history)p 657 1243 V 21 w(get)p 755 1243 V 21 +w(history)p 951 1243 V 21 w(state)j Ff(\()p Fo(void)p +Ff(\))195 1298 y Fp(Return)15 b(a)g(structure)g(describing)i(the)e +(curren)o(t)g(state)f(of)h(the)g(input)i(history)l(.)1762 +1411 y(F)l(unction)-1861 b Fh(void)20 b Fg(history)p +377 1411 V 20 w(set)p 468 1411 V 21 w(history)p 664 1411 +V 21 w(state)j Ff(\()p Fo(HISTORY_STATE)13 b(*state)p +Ff(\))195 1466 y Fp(Set)i(the)h(state)e(of)h(the)g(history)g(list)h +(according)g(to)e Fj(state)p Fp(.)75 1575 y Fi(2.3.2)30 +b(History)20 b(List)h(Managemen)n(t)137 1671 y Fp(These)11 b(functions)h(manage)e(individual)k(en)o(tries)d(on)g(the)g(history)f -(list,)i(or)f(set)f(parameters)g(managing)75 1332 y(the)15 -b(list)h(itself.)1650 1420 y(F)l(unction)-1749 b Fh(void)20 -b Fg(add)p 294 1420 V 20 w(history)j Ff(\()p Fn(char)14 -b(*string)p Ff(\))195 1475 y Fo(Place)i Fj(string)j Fo(at)c(the)g(end)i -(of)d(the)i(history)f(list.)22 b(The)15 b(asso)q(ciated)h(data)f -(\014eld)h(\(if)g(an)o(y\))e(is)195 1530 y(set)h(to)g -Fn(NULL)p Fo(.)1650 1618 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21 -b(*)e Fg(remo)n(v)n(e)p 584 1618 V 20 w(history)k Ff(\()p -Fn(int)14 b(which)p Ff(\))195 1673 y Fo(Remo)o(v)o(e)g(history)g(en)o -(try)f(at)h(o\013set)f Fj(whic)o(h)h Fo(from)g(the)g(history)l(.)19 -b(The)14 b(remo)o(v)o(ed)g(elemen)o(t)g(is)195 1727 y(returned)i(so)e -(y)o(ou)h(can)h(free)f(the)g(line,)i(data,)d(and)h(con)o(taining)h -(structure.)1650 1816 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21 -b(*)e Fg(replace)p 580 1816 V 22 w(history)p 777 1816 -V 20 w(en)n(try)24 b Ff(\()p Fn(int)14 b(which,)g(char)283 -1870 y(*line,)g(char)g(*data)p Ff(\))195 1925 y Fo(Mak)o(e)f(the)h -(history)f(en)o(try)g(at)g(o\013set)g Fj(whic)o(h)h Fo(ha)o(v)o(e)g -Fj(line)k Fo(and)13 b Fj(data)p Fo(.)19 b(This)14 b(returns)g(the)f -(old)195 1980 y(en)o(try)k(so)g(y)o(ou)g(can)g(disp)q(ose)i(of)d(the)i -(data.)25 b(In)18 b(the)f(case)h(of)f(an)g(in)o(v)m(alid)i -Fj(whic)o(h)p Fo(,)g(a)e Fn(NULL)195 2035 y Fo(p)q(oin)o(ter)f(is)f -(returned.)1650 2123 y(F)l(unction)-1749 b Fh(void)20 -b Fg(clear)p 320 2123 V 21 w(history)j Ff(\(\))195 2178 -y Fo(Clear)15 b(the)h(history)f(list)h(b)o(y)f(deleting)i(all)f(the)f -(en)o(tries.)1650 2266 y(F)l(unction)-1749 b Fh(void)20 -b Fg(sti\015e)p 320 2266 V 21 w(history)j Ff(\()p Fn(int)14 -b(max)p Ff(\))195 2321 y Fo(Sti\015e)i(the)f(history)h(list,)f(remem)o -(b)q(ering)h(only)g(the)f(last)g Fj(max)j Fo(en)o(tries.)1650 -2409 y(F)l(unction)-1749 b Fh(int)20 b Fg(unsti\015e)p -358 2409 V 21 w(history)i Ff(\(\))195 2463 y Fo(Stop)e(sti\015ing)i -(the)f(history)l(.)36 b(This)21 b(returns)g(the)f(previous)i(amoun)o(t) -e(the)g(history)h(w)o(as)195 2518 y(sti\015ed.)g(The)15 -b(v)m(alue)i(is)e(p)q(ositiv)o(e)i(if)e(the)g(history)h(w)o(as)e -(sti\015ed,)i(negativ)o(e)f(if)h(it)f(w)o(asn't.)1650 -2606 y(F)l(unction)-1749 b Fh(int)20 b Fg(history)p 351 -2606 V 20 w(is)p 409 2606 V 21 w(sti\015ed)k Ff(\(\))195 -2661 y Fo(Returns)16 b(non-zero)f(if)h(the)f(history)g(is)h(sti\015ed,) -g(zero)f(if)g(it)h(is)g(not.)p eop +(list,)i(or)f(set)f(parameters)g(managing)75 1725 y(the)15 +b(list)h(itself.)1762 1838 y(F)l(unction)-1861 b Fh(void)20 +b Fg(add)p 294 1838 V 20 w(history)j Ff(\()p Fo(const)14 +b(char)g(*string)p Ff(\))195 1893 y Fp(Place)i Fj(string)i +Fp(at)d(the)g(end)h(of)e(the)h(history)g(list.)21 b(The)15 +b(asso)q(ciated)g(data)g(\014eld)h(\(if)f(an)o(y\))f(is)i(set)f(to)195 +1948 y Fo(NULL)p Fp(.)1762 2061 y(F)l(unction)-1861 b +Fh(HIST_ENTRY)21 b(*)e Fg(remo)n(v)n(e)p 584 2061 V 20 +w(history)k Ff(\()p Fo(int)14 b(which)p Ff(\))195 2115 +y Fp(Remo)o(v)o(e)22 b(history)g(en)o(try)h(at)f(o\013set)g +Fj(whic)o(h)h Fp(from)f(the)h(history)l(.)43 b(The)23 +b(remo)o(v)o(ed)f(elemen)o(t)h(is)195 2170 y(returned)16 +b(so)e(y)o(ou)h(can)h(free)f(the)g(line,)i(data,)d(and)h(con)o(taining) +h(structure.)1762 2283 y(F)l(unction)-1861 b Fh(HIST_ENTRY)21 +b(*)e Fg(replace)p 580 2283 V 22 w(history)p 777 2283 +V 20 w(en)n(try)24 b Ff(\()p Fo(int)14 b(which,)g(const)h(char)283 +2338 y(*line,)f(histdata_t)g(data)p Ff(\))195 2393 y +Fp(Mak)o(e)f(the)h(history)g(en)o(try)f(at)g(o\013set)g +Fj(whic)o(h)i Fp(ha)o(v)o(e)e Fj(line)18 b Fp(and)c Fj(data)p +Fp(.)19 b(This)14 b(returns)g(the)g(old)g(en)o(try)195 +2448 y(so)19 b(y)o(ou)f(can)i(disp)q(ose)g(of)e(the)i(data.)30 +b(In)20 b(the)f(case)g(of)g(an)g(in)o(v)m(alid)i Fj(whic)o(h)p +Fp(,)g(a)d Fo(NULL)h Fp(p)q(oin)o(ter)g(is)195 2502 y(returned.)1762 +2615 y(F)l(unction)-1861 b Fh(void)20 b Fg(clear)p 320 +2615 V 21 w(history)j Ff(\()p Fo(void)p Ff(\))195 2670 +y Fp(Clear)15 b(the)h(history)f(list)h(b)o(y)f(deleting)i(all)f(the)f +(en)o(tries.)p eop %%Page: 7 9 -7 8 bop 75 -58 a Fo(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g -(History)889 b(7)75 183 y Fi(2.3.3)30 b(Information)19 -b(Ab)r(out)i(the)f(History)h(List)137 279 y Fo(These)13 -b(functions)h(return)f(information)g(ab)q(out)f(the)h(en)o(tire)h -(history)e(list)i(or)e(individual)k(list)e(en)o(tries.)1650 -371 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21 b(**)e Fg(history)p -605 371 18 3 v 21 w(list)24 b Ff(\(\))195 426 y Fo(Return)f(a)g -Fn(NULL)f Fo(terminated)g(arra)o(y)g(of)g Fn(HIST_ENTRY)f -Fo(whic)o(h)j(is)f(the)f(curren)o(t)h(input)195 481 y(history)l(.)j -(Elemen)o(t)18 b(0)e(of)h(this)h(list)g(is)f(the)h(b)q(eginning)h(of)e -(time.)26 b(If)17 b(there)g(is)h(no)f(history)l(,)195 -535 y(return)e Fn(NULL)p Fo(.)1650 627 y(F)l(unction)-1749 -b Fh(int)20 b Fg(where)p 325 627 V 20 w(history)j Ff(\(\))195 -682 y Fo(Returns)16 b(the)f(o\013set)f(of)h(the)g(curren)o(t)g(history) -g(elemen)o(t.)1650 773 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21 -b(*)e Fg(curren)n(t)p 587 773 V 21 w(history)k Ff(\(\))195 -828 y Fo(Return)g(the)f(history)g(en)o(try)g(at)f(the)h(curren)o(t)g(p) -q(osition,)j(as)c(determined)j(b)o(y)e Fn(where_)195 -883 y(history)14 b(\(\))p Fo(.)20 b(If)15 b(there)g(is)h(no)f(en)o(try) -g(there,)g(return)g(a)g Fn(NULL)g Fo(p)q(oin)o(ter.)1650 -975 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21 b(*)e Fg(history)p -579 975 V 21 w(get)j Ff(\()p Fn(int)15 b(offset)p Ff(\))195 -1029 y Fo(Return)21 b(the)g(history)g(en)o(try)f(at)g(p)q(osition)i -Fj(o\013set)p Fo(,)e(starting)g(from)g Fn(history_base)p -Fo(.)35 b(If)195 1084 y(there)16 b(is)h(no)g(en)o(try)f(there,)g(or)g -(if)g Fj(o\013set)h Fo(is)g(greater)e(than)h(the)h(history)f(length,)h -(return)f(a)195 1139 y Fn(NULL)f Fo(p)q(oin)o(ter.)1650 -1231 y(F)l(unction)-1749 b Fh(int)20 b Fg(history)p 351 -1231 V 20 w(total)p 487 1231 V 22 w(b)n(ytes)j Ff(\(\))195 -1285 y Fo(Return)c(the)f(n)o(um)o(b)q(er)g(of)g(b)o(ytes)g(that)f(the)h -(primary)h(history)f(en)o(tries)g(are)g(using.)29 b(This)195 -1340 y(function)16 b(returns)f(the)g(sum)h(of)e(the)i(lengths)f(of)g -(all)h(the)g(lines)g(in)g(the)g(history)l(.)75 1452 y +7 8 bop 75 -58 a Fp(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g +(History)889 b(7)1762 149 y(F)l(unction)-1861 b Fh(void)20 +b Fg(sti\015e)p 320 149 18 3 v 21 w(history)j Ff(\()p +Fo(int)14 b(max)p Ff(\))195 204 y Fp(Sti\015e)i(the)f(history)h(list,)f +(remem)o(b)q(ering)h(only)g(the)f(last)g Fj(max)j Fp(en)o(tries.)1762 +307 y(F)l(unction)-1861 b Fh(int)20 b Fg(unsti\015e)p +358 307 V 21 w(history)i Ff(\()p Fo(void)p Ff(\))195 +361 y Fp(Stop)c(sti\015ing)i(the)e(history)l(.)29 b(This)19 +b(returns)f(the)h(previous)g(amoun)o(t)e(the)i(history)f(w)o(as)f +(sti\015ed.)195 416 y(The)e(v)m(alue)i(is)f(p)q(ositiv)o(e)g(if)f(the)h +(history)f(w)o(as)f(sti\015ed,)i(negativ)o(e)f(if)h(it)f(w)o(asn't.) +1762 518 y(F)l(unction)-1861 b Fh(int)20 b Fg(history)p +351 518 V 20 w(is)p 409 518 V 21 w(sti\015ed)k Ff(\()p +Fo(void)p Ff(\))195 573 y Fp(Returns)15 b(non-zero)g(if)h(the)f +(history)g(is)h(sti\015ed,)g(zero)f(if)g(it)h(is)g(not.)75 +676 y Fi(2.3.3)30 b(Information)19 b(Ab)r(out)i(the)f(History)h(List) +137 770 y Fp(These)13 b(functions)h(return)f(information)g(ab)q(out)f +(the)h(en)o(tire)h(history)e(list)i(or)e(individual)k(list)e(en)o +(tries.)1762 872 y(F)l(unction)-1861 b Fh(HIST_ENTRY)21 +b(**)e Fg(history)p 605 872 V 21 w(list)24 b Ff(\()p +Fo(void)p Ff(\))195 927 y Fp(Return)15 b(a)g Fo(NULL)f +Fp(terminated)i(arra)o(y)e(of)h Fo(HIST_ENTRY)f(*)h Fp(whic)o(h)h(is)f +(the)h(curren)o(t)f(input)h(history)l(.)195 982 y(Elemen)o(t)g(0)f(of)f +(this)i(list)g(is)g(the)f(b)q(eginning)i(of)e(time.)20 +b(If)c(there)f(is)h(no)f(history)l(,)g(return)g Fo(NULL)p +Fp(.)1762 1084 y(F)l(unction)-1861 b Fh(int)20 b Fg(where)p +325 1084 V 20 w(history)j Ff(\()p Fo(void)p Ff(\))195 +1139 y Fp(Returns)15 b(the)g(o\013set)f(of)h(the)g(curren)o(t)g +(history)g(elemen)o(t.)1762 1241 y(F)l(unction)-1861 +b Fh(HIST_ENTRY)21 b(*)e Fg(curren)n(t)p 587 1241 V 21 +w(history)k Ff(\()p Fo(void)p Ff(\))195 1296 y Fp(Return)12 +b(the)h(history)f(en)o(try)g(at)g(the)g(curren)o(t)h(p)q(osition,)g(as) +f(determined)i(b)o(y)e Fo(where_history\(\))p Fp(.)195 +1350 y(If)j(there)h(is)f(no)h(en)o(try)e(there,)h(return)g(a)g +Fo(NULL)g Fp(p)q(oin)o(ter.)1762 1453 y(F)l(unction)-1861 +b Fh(HIST_ENTRY)21 b(*)e Fg(history)p 579 1453 V 21 w(get)j +Ff(\()p Fo(int)15 b(offset)p Ff(\))195 1508 y Fp(Return)20 +b(the)h(history)g(en)o(try)f(at)h(p)q(osition)g Fj(o\013set)p +Fp(,)g(starting)f(from)g Fo(history_base)f Fp(\(see)i(Sec-)195 +1562 y(tion)15 b(2.4)f([History)g(V)l(ariables],)h(page)g(10\).)j(If)d +(there)g(is)g(no)g(en)o(try)f(there,)h(or)f(if)h Fj(o\013set)g +Fp(is)g(greater)195 1617 y(than)g(the)g(history)g(length,)h(return)f(a) +g Fo(NULL)g Fp(p)q(oin)o(ter.)1762 1719 y(F)l(unction)-1861 +b Fh(int)20 b Fg(history)p 351 1719 V 20 w(total)p 487 +1719 V 22 w(b)n(ytes)j Ff(\()p Fo(void)p Ff(\))195 1774 +y Fp(Return)13 b(the)h(n)o(um)o(b)q(er)g(of)g(b)o(ytes)f(that)g(the)h +(primary)g(history)g(en)o(tries)g(are)g(using.)20 b(This)14 +b(function)195 1829 y(returns)h(the)g(sum)h(of)e(the)i(lengths)f(of)g +(all)h(the)g(lines)g(in)g(the)g(history)l(.)75 1932 y Fi(2.3.4)30 b(Mo)n(ving)21 b(Around)f(the)h(History)g(List)137 -1548 y Fo(These)16 b(functions)g(allo)o(w)f(the)g(curren)o(t)h(index)g +2026 y Fp(These)16 b(functions)g(allo)o(w)f(the)g(curren)o(t)h(index)g (in)o(to)f(the)h(history)f(list)h(to)e(b)q(e)i(set)f(or)g(c)o(hanged.) -1650 1640 y(F)l(unction)-1749 b Fh(int)20 b Fg(history)p -351 1640 V 20 w(set)p 442 1640 V 21 w(p)r(os)h Ff(\()p -Fn(int)15 b(pos)p Ff(\))195 1694 y Fo(Set)g(the)h(p)q(osition)g(in)g -(the)f(history)g(list)h(to)f Fj(p)q(os)p Fo(,)g(an)g(absolute)g(index)i -(in)o(to)e(the)g(list.)1650 1786 y(F)l(unction)-1749 -b Fh(HIST_ENTRY)21 b(*)e Fg(previous)p 615 1786 V 20 -w(history)k Ff(\(\))195 1841 y Fo(Bac)o(k)17 b(up)h(the)f(curren)o(t)g -(history)g(o\013set)f(to)h(the)g(previous)h(history)f(en)o(try)l(,)g -(and)g(return)g(a)195 1896 y(p)q(oin)o(ter)f(to)e(that)h(en)o(try)l(.)k -(If)d(there)f(is)h(no)f(previous)h(en)o(try)l(,)f(return)g(a)g -Fn(NULL)f Fo(p)q(oin)o(ter.)1650 1987 y(F)l(unction)-1749 -b Fh(HIST_ENTRY)21 b(*)e Fg(next)p 514 1987 V 21 w(history)k -Ff(\(\))195 2042 y Fo(Mo)o(v)o(e)17 b(the)h(curren)o(t)g(history)f -(o\013set)g(forw)o(ard)g(to)g(the)h(next)g(history)g(en)o(try)l(,)g -(and)g(return)195 2097 y(the)d(a)g(p)q(oin)o(ter)h(to)e(that)h(en)o -(try)l(.)20 b(If)15 b(there)g(is)h(no)f(next)g(en)o(try)l(,)g(return)g -(a)g Fn(NULL)g Fo(p)q(oin)o(ter.)75 2208 y Fi(2.3.5)30 -b(Searc)n(hing)21 b(the)f(History)h(List)137 2304 y Fo(These)14 -b(functions)g(allo)o(w)g(searc)o(hing)g(of)e(the)i(history)f(list)h -(for)f(en)o(tries)h(con)o(taining)g(a)f(sp)q(eci\014c)i(string.)75 -2359 y(Searc)o(hing)f(ma)o(y)g(b)q(e)g(p)q(erformed)g(b)q(oth)g(forw)o -(ard)e(and)i(bac)o(kw)o(ard)f(from)g(the)h(curren)o(t)g(history)f(p)q -(osition.)75 2414 y(The)j(searc)o(h)f(ma)o(y)g(b)q(e)i -Fj(anc)o(hored)p Fo(,)e(meaning)h(that)f(the)h(string)g(m)o(ust)f(matc) -o(h)g(at)g(the)h(b)q(eginning)i(of)d(the)75 2469 y(history)g(en)o(try)l -(.)1650 2560 y(F)l(unction)-1749 b Fh(int)20 b Fg(history)p -351 2560 V 20 w(searc)n(h)j Ff(\()p Fn(char)14 b(*string,)g(int)h -(direction)p Ff(\))195 2615 y Fo(Searc)o(h)g(the)h(history)f(for)f -Fj(string)p Fo(,)h(starting)f(at)h(the)g(curren)o(t)g(history)g -(o\013set.)k(If)d Fj(direction)195 2670 y Fn(<)j Fo(0,)g(then)g(the)h -(searc)o(h)e(is)i(through)e(previous)i(en)o(tries,)g(else)g(through)f -(subsequen)o(t.)32 b(If)p eop +1762 2128 y(F)l(unction)-1861 b Fh(int)20 b Fg(history)p +351 2128 V 20 w(set)p 442 2128 V 21 w(p)r(os)h Ff(\()p +Fo(int)15 b(pos)p Ff(\))195 2183 y Fp(Set)j(the)h(curren)o(t)f(history) +g(o\013set)g(to)f Fj(p)q(os)p Fp(,)i(an)f(absolute)h(index)h(in)o(to)e +(the)g(list.)30 b(Returns)18 b(1)g(on)195 2237 y(success,)d(0)g(if)h +Fj(p)q(os)h Fp(is)f(less)g(than)f(zero)g(or)g(greater)f(than)h(the)g(n) +o(um)o(b)q(er)h(of)e(history)i(en)o(tries.)1762 2340 +y(F)l(unction)-1861 b Fh(HIST_ENTRY)21 b(*)e Fg(previous)p +615 2340 V 20 w(history)k Ff(\()p Fo(void)p Ff(\))195 +2394 y Fp(Bac)o(k)14 b(up)h(the)g(curren)o(t)f(history)g(o\013set)g(to) +f(the)i(previous)g(history)f(en)o(try)l(,)g(and)h(return)f(a)g(p)q(oin) +o(ter)195 2449 y(to)h(that)f(en)o(try)l(.)20 b(If)15 +b(there)g(is)h(no)f(previous)h(en)o(try)l(,)f(return)g(a)g +Fo(NULL)g Fp(p)q(oin)o(ter.)1762 2552 y(F)l(unction)-1861 +b Fh(HIST_ENTRY)21 b(*)e Fg(next)p 514 2552 V 21 w(history)k +Ff(\()p Fo(void)p Ff(\))195 2606 y Fp(Mo)o(v)o(e)17 b(the)h(curren)o(t) +f(history)h(o\013set)f(forw)o(ard)f(to)h(the)h(next)g(history)g(en)o +(try)l(,)g(and)g(return)f(the)h(a)195 2661 y(p)q(oin)o(ter)e(to)e(that) +h(en)o(try)l(.)k(If)d(there)f(is)h(no)f(next)g(en)o(try)l(,)g(return)g +(a)g Fo(NULL)g Fp(p)q(oin)o(ter.)p eop %%Page: 8 10 -8 9 bop 75 -58 a Fo(8)1347 b(GNU)15 b(History)g(Library)195 -183 y Fj(string)k Fo(is)d(found,)f(then)h(the)f(curren)o(t)g(history)g -(index)i(is)f(set)f(to)f(that)h(history)g(en)o(try)l(,)g(and)195 -238 y(the)g(v)m(alue)h(returned)f(is)g(the)g(o\013set)f(in)h(the)g -(line)h(of)e(the)h(en)o(try)g(where)g Fj(string)j Fo(w)o(as)c(found.) -195 293 y(Otherwise,)i(nothing)f(is)h(c)o(hanged,)f(and)h(a)e(-1)h(is)h -(returned.)1650 396 y(F)l(unction)-1749 b Fh(int)20 b -Fg(history)p 351 396 18 3 v 20 w(searc)n(h)p 527 396 -V 21 w(pre\014x)i Ff(\()p Fn(char)15 b(*string,)f(int)g(direction)p -Ff(\))195 451 y Fo(Searc)o(h)i(the)f(history)g(for)g -Fj(string)p Fo(,)g(starting)g(at)g(the)g(curren)o(t)h(history)f -(o\013set.)k(The)d(searc)o(h)195 506 y(is)h(anc)o(hored:)23 -b(matc)o(hing)17 b(lines)h(m)o(ust)e(b)q(egin)i(with)f -Fj(string)p Fo(.)25 b(If)17 b Fj(direction)h Fn(<)e Fo(0,)h(then)g(the) -195 560 y(searc)o(h)f(is)g(through)f(previous)i(en)o(tries,)f(else)g -(through)g(subsequen)o(t.)22 b(If)16 b Fj(string)k Fo(is)c(found,)195 -615 y(then)i(the)g(curren)o(t)g(history)g(index)h(is)g(set)e(to)h(that) -f(en)o(try)l(,)h(and)g(the)g(return)g(v)m(alue)h(is)g(0.)195 -670 y(Otherwise,)d(nothing)f(is)h(c)o(hanged,)f(and)h(a)e(-1)h(is)h -(returned.)1650 773 y(F)l(unction)-1749 b Fh(int)20 b -Fg(history)p 351 773 V 20 w(searc)n(h)p 527 773 V 21 -w(p)r(os)h Ff(\()p Fn(char)15 b(*string,)f(int)g(direction,)g(int)283 -828 y(pos)p Ff(\))195 883 y Fo(Searc)o(h)h(for)g Fj(string)k -Fo(in)d(the)f(history)g(list,)g(starting)g(at)f Fj(p)q(os)p -Fo(,)h(an)g(absolute)g(index)i(in)o(to)e(the)195 937 -y(list.)21 b(If)15 b Fj(direction)h Fo(is)g(negativ)o(e,)f(the)g(searc) -o(h)g(pro)q(ceeds)g(bac)o(kw)o(ard)g(from)f Fj(p)q(os)p -Fo(,)h(otherwise)195 992 y(forw)o(ard.)27 b(Returns)18 -b(the)g(absolute)g(index)h(of)f(the)g(history)f(elemen)o(t)i(where)f -Fj(string)k Fo(w)o(as)195 1047 y(found,)15 b(or)g(-1)g(otherwise.)75 -1170 y Fi(2.3.6)30 b(Managing)20 b(the)g(History)h(File)137 -1272 y Fo(The)16 b(History)g(library)h(can)e(read)h(the)g(history)g -(from)f(and)h(write)g(it)g(to)f(a)h(\014le.)22 b(This)17 -b(section)f(do)q(cu-)75 1327 y(men)o(ts)f(the)g(functions)h(for)f -(managing)g(a)g(history)g(\014le.)1650 1430 y(F)l(unction)-1749 -b Fh(int)20 b Fg(read)p 286 1430 V 20 w(history)i Ff(\()p -Fn(char)15 b(*filename)p Ff(\))195 1485 y Fo(Add)h(the)f(con)o(ten)o -(ts)f(of)h Fj(\014lename)j Fo(to)d(the)g(history)g(list,)g(a)g(line)h -(at)f(a)f(time.)21 b(If)15 b Fj(\014lename)j Fo(is)195 -1539 y Fn(NULL)p Fo(,)c(then)i(read)f(from)f(`)p Fn(~/.history)p -Fo('.)k(Returns)e(0)f(if)g(successful,)i(or)d(errno)h(if)h(not.)1650 -1643 y(F)l(unction)-1749 b Fh(int)20 b Fg(read)p 286 -1643 V 20 w(history)p 481 1643 V 20 w(range)i Ff(\()p -Fn(char)15 b(*filename,)e(int)i(from,)g(int)f(to)p Ff(\))195 -1697 y Fo(Read)21 b(a)f(range)g(of)g(lines)i(from)e Fj(\014lename)p -Fo(,)i(adding)f(them)g(to)f(the)g(history)h(list.)36 -b(Start)195 1752 y(reading)15 b(at)e(line)j Fj(from)e -Fo(and)g(end)h(at)e Fj(to)p Fo(.)19 b(If)c Fj(from)e -Fo(is)i(zero,)f(start)f(at)g(the)h(b)q(eginning.)22 b(If)15 -b Fj(to)195 1807 y Fo(is)i(less)g(than)f Fj(from)p Fo(,)g(then)h(read)f -(un)o(til)i(the)e(end)h(of)f(the)h(\014le.)24 b(If)17 -b Fj(\014lename)j Fo(is)d Fn(NULL)p Fo(,)f(then)195 1862 -y(read)f(from)g(`)p Fn(~/.history)p Fo('.)i(Returns)f(0)f(if)h -(successful,)g(or)e Fn(errno)h Fo(if)h(not.)1650 1965 -y(F)l(unction)-1749 b Fh(int)20 b Fg(write)p 304 1965 -V 22 w(history)i Ff(\()p Fn(char)15 b(*filename)p Ff(\))195 -2020 y Fo(W)l(rite)23 b(the)f(curren)o(t)g(history)h(to)f -Fj(\014lename)p Fo(,)j(o)o(v)o(erwriting)d Fj(\014lename)k -Fo(if)d(necessary)l(.)42 b(If)195 2074 y Fj(\014lename)20 -b Fo(is)d Fn(NULL)p Fo(,)f(then)g(write)h(the)f(history)h(list)g(to)f -(`)p Fn(~/.history)p Fo('.)21 b(V)l(alues)d(returned)195 -2129 y(are)d(as)g(in)h Fn(read_history)d(\(\))p Fo(.)1650 -2232 y(F)l(unction)-1749 b Fh(int)20 b Fg(app)r(end)p -360 2232 V 19 w(history)j Ff(\()p Fn(int)14 b(nelements,)g(char)h -(*filename)p Ff(\))195 2287 y Fo(App)q(end)i(the)e(last)g -Fj(nelemen)o(ts)j Fo(of)d(the)g(history)g(list)h(to)f -Fj(\014lename)p Fo(.)1650 2390 y(F)l(unction)-1749 b -Fh(int)20 b Fg(history)p 351 2390 V 20 w(truncate)p 582 -2390 V 21 w(\014le)k Ff(\()p Fn(char)14 b(*filename,)g(int)h(nlines)p -Ff(\))195 2445 y Fo(T)l(runcate)g(the)h(history)f(\014le)h -Fj(\014lename)p Fo(,)g(lea)o(ving)g(only)g(the)f(last)g -Fj(nlines)k Fo(lines.)75 2568 y Fi(2.3.7)30 b(History)20 -b(Expansion)137 2670 y Fo(These)c(functions)g(implemen)o(t)g -Fn(csh)p Fo(-lik)o(e)g(history)g(expansion.)p eop +8 9 bop 75 -58 a Fp(8)1347 b(GNU)15 b(History)g(Library)75 +149 y Fi(2.3.5)30 b(Searc)n(hing)21 b(the)f(History)h(List)137 +245 y Fp(These)14 b(functions)g(allo)o(w)g(searc)o(hing)g(of)e(the)i +(history)f(list)h(for)f(en)o(tries)h(con)o(taining)g(a)f(sp)q(eci\014c) +i(string.)75 300 y(Searc)o(hing)f(ma)o(y)g(b)q(e)g(p)q(erformed)g(b)q +(oth)g(forw)o(ard)e(and)i(bac)o(kw)o(ard)f(from)g(the)h(curren)o(t)g +(history)f(p)q(osition.)75 355 y(The)j(searc)o(h)f(ma)o(y)g(b)q(e)i +Fj(anc)o(hored)p Fp(,)e(meaning)h(that)f(the)h(string)g(m)o(ust)f(matc) +o(h)g(at)g(the)h(b)q(eginning)i(of)d(the)75 410 y(history)g(en)o(try)l +(.)1762 524 y(F)l(unction)-1861 b Fh(int)20 b Fg(history)p +351 524 18 3 v 20 w(searc)n(h)j Ff(\()p Fo(const)14 b(char)h(*string,)f +(int)h(direction)p Ff(\))195 578 y Fp(Searc)o(h)g(the)f(history)g(for)g +Fj(string)p Fp(,)g(starting)g(at)g(the)h(curren)o(t)f(history)g +(o\013set.)19 b(If)c Fj(direction)g Fp(is)g(less)195 +633 y(than)20 b(0,)g(then)h(the)f(searc)o(h)f(is)i(through)f(previous)g +(en)o(tries,)i(otherwise)e(through)f(subsequen)o(t)195 +688 y(en)o(tries.)h(If)c Fj(string)j Fp(is)d(found,)f(then)g(the)h +(curren)o(t)f(history)g(index)h(is)g(set)f(to)g(that)f(history)h(en)o +(try)l(,)195 743 y(and)i(the)g(v)m(alue)h(returned)f(is)g(the)g +(o\013set)e(in)j(the)f(line)h(of)e(the)h(en)o(try)g(where)g +Fj(string)j Fp(w)o(as)c(found.)195 798 y(Otherwise,)g(nothing)f(is)h(c) +o(hanged,)f(and)h(a)e(-1)h(is)h(returned.)1762 912 y(F)l(unction)-1861 +b Fh(int)20 b Fg(history)p 351 912 V 20 w(searc)n(h)p +527 912 V 21 w(pre\014x)i Ff(\()p Fo(const)14 b(char)h(*string,)f(int)h +(direction)p Ff(\))195 966 y Fp(Searc)o(h)20 b(the)h(history)f(for)g +Fj(string)p Fp(,)h(starting)e(at)h(the)g(curren)o(t)h(history)f +(o\013set.)34 b(The)20 b(searc)o(h)g(is)195 1021 y(anc)o(hored:)g(matc) +o(hing)14 b(lines)j(m)o(ust)d(b)q(egin)i(with)f Fj(string)p +Fp(.)20 b(If)15 b Fj(direction)h Fp(is)f(less)g(than)g(0,)f(then)h(the) +195 1076 y(searc)o(h)g(is)i(through)e(previous)h(en)o(tries,)g +(otherwise)g(through)f(subsequen)o(t)h(en)o(tries.)22 +b(If)16 b Fj(string)j Fp(is)195 1131 y(found,)e(then)g(the)f(curren)o +(t)h(history)f(index)i(is)f(set)f(to)g(that)g(en)o(try)l(,)g(and)h(the) +f(return)h(v)m(alue)h(is)f(0.)195 1186 y(Otherwise,)f(nothing)f(is)h(c) +o(hanged,)f(and)h(a)e(-1)h(is)h(returned.)1762 1300 y(F)l(unction)-1861 +b Fh(int)20 b Fg(history)p 351 1300 V 20 w(searc)n(h)p +527 1300 V 21 w(p)r(os)h Ff(\()p Fo(const)14 b(char)h(*string,)f(int)h +(direction,)f(int)283 1355 y(pos)p Ff(\))195 1409 y Fp(Searc)o(h)j(for) +g Fj(string)k Fp(in)d(the)f(history)g(list,)h(starting)e(at)h +Fj(p)q(os)p Fp(,)g(an)g(absolute)h(index)g(in)o(to)f(the)h(list.)195 +1464 y(If)g Fj(direction)i Fp(is)e(negativ)o(e,)h(the)f(searc)o(h)g +(pro)q(ceeds)g(bac)o(kw)o(ard)g(from)f Fj(p)q(os)p Fp(,)h(otherwise)h +(forw)o(ard.)195 1519 y(Returns)j(the)g(absolute)g(index)h(of)f(the)g +(history)g(elemen)o(t)h(where)f Fj(string)k Fp(w)o(as)21 +b(found,)j(or)d(-1)195 1574 y(otherwise.)75 1684 y Fi(2.3.6)30 +b(Managing)20 b(the)g(History)h(File)137 1780 y Fp(The)16 +b(History)g(library)h(can)e(read)h(the)g(history)g(from)f(and)h(write)g +(it)g(to)f(a)h(\014le.)22 b(This)17 b(section)f(do)q(cu-)75 +1835 y(men)o(ts)f(the)g(functions)h(for)f(managing)g(a)g(history)g +(\014le.)1762 1949 y(F)l(unction)-1861 b Fh(int)20 b +Fg(read)p 286 1949 V 20 w(history)i Ff(\()p Fo(const)15 +b(char)f(*filename)p Ff(\))195 2003 y Fp(Add)h(the)g(con)o(ten)o(ts)f +(of)h Fj(\014lename)j Fp(to)c(the)h(history)g(list,)g(a)g(line)h(at)f +(a)f(time.)20 b(If)15 b Fj(\014lename)k Fp(is)c Fo(NULL)p +Fp(,)195 2058 y(then)h(read)f(from)f(`)p Fo(~/.history)p +Fp('.)k(Returns)d(0)f(if)i(successful,)g(or)f Fo(errno)f +Fp(if)i(not.)1762 2172 y(F)l(unction)-1861 b Fh(int)20 +b Fg(read)p 286 2172 V 20 w(history)p 481 2172 V 20 w(range)i +Ff(\()p Fo(const)14 b(char)h(*filename,)f(int)h(from,)f(int)h(to)p +Ff(\))195 2227 y Fp(Read)f(a)f(range)h(of)f(lines)j(from)d +Fj(\014lename)p Fp(,)i(adding)g(them)f(to)f(the)h(history)g(list.)20 +b(Start)13 b(reading)i(at)195 2282 y(line)g Fj(from)d +Fp(and)h(end)h(at)f Fj(to)p Fp(.)18 b(If)c Fj(from)e +Fp(is)i(zero,)f(start)f(at)g(the)h(b)q(eginning.)22 b(If)13 +b Fj(to)i Fp(is)e(less)h(than)f Fj(from)p Fp(,)195 2337 +y(then)i(read)g(un)o(til)i(the)e(end)g(of)g(the)g(\014le.)21 +b(If)15 b Fj(\014lename)k Fp(is)d Fo(NULL)p Fp(,)e(then)h(read)g(from)f +(`)p Fo(~/.history)p Fp('.)195 2392 y(Returns)h(0)g(if)g(successful,)h +(or)f Fo(errno)g Fp(if)g(not.)1762 2506 y(F)l(unction)-1861 +b Fh(int)20 b Fg(write)p 304 2506 V 22 w(history)i Ff(\()p +Fo(const)15 b(char)f(*filename)p Ff(\))195 2560 y Fp(W)l(rite)k(the)f +(curren)o(t)g(history)h(to)f Fj(\014lename)p Fp(,)h(o)o(v)o(erwriting)f +Fj(\014lename)k Fp(if)d(necessary)l(.)27 b(If)18 b Fj(\014lename)195 +2615 y Fp(is)f Fo(NULL)p Fp(,)e(then)h(write)h(the)f(history)g(list)h +(to)e(`)p Fo(~/.history)p Fp('.)21 b(Returns)16 b(0)f(on)h(success,)h +(or)f Fo(errno)195 2670 y Fp(on)f(a)g(read)g(or)g(write)g(error.)p +eop %%Page: 9 11 -9 10 bop 75 -58 a Fo(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g -(History)889 b(9)1650 183 y(F)l(unction)-1749 b Fh(int)20 -b Fg(history)p 351 183 18 3 v 20 w(expand)j Ff(\()p Fn(char)14 -b(*string,)g(char)h(**output)p Ff(\))195 238 y Fo(Expand)k -Fj(string)p Fo(,)g(placing)h(the)e(result)h(in)o(to)g -Fj(output)p Fo(,)g(a)f(p)q(oin)o(ter)h(to)f(a)g(string)h(\(see)f(Sec-) -195 293 y(tion)d(1.1)g([History)f(In)o(teraction],)h(page)g(1\).)k -(Returns:)195 370 y Fn(0)216 b Fo(If)16 b(no)g(expansions)h(to)q(ok)e -(place)i(\(or,)d(if)j(the)f(only)g(c)o(hange)g(in)h(the)e(text)h(w)o -(as)435 425 y(the)f(de-slashifying)j(of)c(the)i(history)f(expansion)h -(c)o(haracter\);)195 502 y Fn(1)216 b Fo(if)16 b(expansions)g(did)g -(tak)o(e)e(place;)195 580 y Fn(-1)192 b Fo(if)16 b(there)f(w)o(as)f(an) -h(error)g(in)h(expansion;)195 657 y Fn(2)216 b Fo(if)16 -b(the)g(returned)f(line)j(should)e(b)q(e)g(displa)o(y)o(ed,)h(but)e -(not)g(executed,)i(as)e(with)435 712 y(the)g Fn(:p)g -Fo(mo)q(di\014er)h(\(see)f(Section)i(1.1.3)c([Mo)q(di\014ers],)i(page)g -(2\).)195 789 y(If)g(an)g(error)f(o)q(curred)i(in)g(expansion,)f(then)h -Fj(output)f Fo(con)o(tains)g(a)g(descriptiv)o(e)i(error)d(mes-)195 -844 y(sage.)1650 932 y(F)l(unction)-1749 b Fh(char)20 -b(*)f Fg(history)p 422 932 V 21 w(arg)p 524 932 V 19 -w(extract)24 b Ff(\()p Fn(int)14 b(first,)h(int)g(last,)f(char)283 -987 y(*string)p Ff(\))195 1042 y Fo(Extract)g(a)g(string)g(segmen)o(t)g -(consisting)i(of)e(the)g Fj(\014rst)i Fo(through)e Fj(last)h -Fo(argumen)o(ts)f(presen)o(t)195 1097 y(in)i Fj(string)p -Fo(.)k(Argumen)o(ts)15 b(are)f(brok)o(en)i(up)f(as)g(in)h(Bash.)1650 -1185 y(F)l(unction)-1749 b Fh(char)20 b(*)f Fg(get)p -324 1185 V 21 w(history)p 520 1185 V 20 w(ev)n(en)n(t)25 -b Ff(\()p Fn(char)14 b(*string,)g(int)h(*cindex,)f(int)283 -1240 y(qchar)p Ff(\))195 1295 y Fo(Returns)h(the)g(text)f(of)g(the)h -(history)g(ev)o(en)o(t)f(b)q(eginning)j(at)d Fj(string)k -Fn(+)d Fj(*cindex)p Fo(.)20 b Fj(*cindex)f Fo(is)195 -1350 y(mo)q(di\014ed)e(to)e(p)q(oin)o(t)h(to)f(after)g(the)h(ev)o(en)o -(t)f(sp)q(eci\014er.)23 b(A)o(t)16 b(function)g(en)o(try)l(,)f -Fj(cindex)21 b Fo(p)q(oin)o(ts)195 1404 y(to)16 b(the)h(index)h(in)o -(to)e Fj(string)21 b Fo(where)c(the)g(history)f(ev)o(en)o(t)h(sp)q -(eci\014cation)h(b)q(egins.)26 b Fj(qc)o(har)19 b Fo(is)195 -1459 y(a)h(c)o(haracter)g(that)g(is)h(allo)o(w)o(ed)f(to)g(end)h(the)g -(ev)o(en)o(t)f(sp)q(eci\014cation)i(in)g(addition)f(to)f(the)195 -1514 y(\\normal")15 b(terminating)g(c)o(haracters.)1650 -1602 y(F)l(unction)-1749 b Fh(char)20 b(**)f Fg(history)p -448 1602 V 21 w(tok)n(enize)25 b Ff(\()p Fn(char)14 b(*string)p -Ff(\))195 1657 y Fo(Return)j(an)g(arra)o(y)f(of)g(tok)o(ens)g(parsed)h -(out)g(of)f Fj(string)p Fo(,)h(m)o(uc)o(h)g(as)f(the)h(shell)h(migh)o -(t.)25 b(The)195 1712 y(tok)o(ens)d(are)g(split)i(on)f(white)g(space)g -(and)f(on)h(the)g(c)o(haracters)f Fn(\(\)<>;&|$)p Fo(,)h(and)f(shell) -195 1767 y(quoting)15 b(con)o(v)o(en)o(tions)h(are)e(ob)q(ey)o(ed.)75 -1892 y Fm(2.4)33 b(History)22 b(V)-6 b(ariables)137 1987 -y Fo(This)23 b(section)f(describ)q(es)h(the)f(externally)h(visible)h(v) -m(ariables)f(exp)q(orted)f(b)o(y)g(the)g(GNU)f(History)75 -2042 y(Library)l(.)1661 2130 y(V)l(ariable)-1749 b Fh(int)20 -b Fg(history)p 351 2130 V 20 w(base)195 2185 y Fo(The)15 +9 10 bop 75 -58 a Fp(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g +(History)889 b(9)1762 149 y(F)l(unction)-1861 b Fh(int)20 +b Fg(app)r(end)p 360 149 18 3 v 19 w(history)j Ff(\()p +Fo(int)14 b(nelements,)g(const)h(char)f(*filename)p Ff(\))195 +204 y Fp(App)q(end)19 b(the)e(last)g Fj(nelemen)o(ts)k +Fp(of)16 b(the)i(history)f(list)h(to)f Fj(\014lename)p +Fp(.)27 b(If)18 b Fj(\014lename)j Fp(is)d Fo(NULL)p Fp(,)f(then)195 +259 y(app)q(end)f(to)f(`)p Fo(~/.history)p Fp('.)j(Returns)c(0)h(on)g +(success,)h(or)e Fo(errno)h Fp(on)g(a)g(read)g(or)g(write)g(error.)1762 +404 y(F)l(unction)-1861 b Fh(int)20 b Fg(history)p 351 +404 V 20 w(truncate)p 582 404 V 21 w(\014le)k Ff(\()p +Fo(const)14 b(char)h(*filename,)e(int)i(nlines)p Ff(\))195 +459 y Fp(T)l(runcate)k(the)h(history)f(\014le)h Fj(\014lename)p +Fp(,)h(lea)o(ving)f(only)g(the)f(last)g Fj(nlines)k Fp(lines.)34 +b(If)20 b Fj(\014lename)i Fp(is)195 513 y Fo(NULL)p Fp(,)14 +b(then)i(`)p Fo(~/.history)p Fp(')d(is)j(truncated.)j(Returns)c(0)g(on) +g(success,)h(or)e Fo(errno)h Fp(on)g(failure.)75 644 +y Fi(2.3.7)30 b(History)20 b(Expansion)137 750 y Fp(These)c(functions)g +(implemen)o(t)g(history)f(expansion.)1762 895 y(F)l(unction)-1861 +b Fh(int)20 b Fg(history)p 351 895 V 20 w(expand)j Ff(\()p +Fo(char)14 b(*string,)g(char)h(**output)p Ff(\))195 949 +y Fp(Expand)j Fj(string)p Fp(,)f(placing)h(the)g(result)f(in)o(to)g +Fj(output)p Fp(,)h(a)e(p)q(oin)o(ter)i(to)f(a)g(string)g(\(see)g +(Section)h(1.1)195 1004 y([History)d(In)o(teraction],)f(page)h(1\).)20 +b(Returns:)195 1098 y Fo(0)216 b Fp(If)19 b(no)g(expansions)g(to)q(ok)f +(place)i(\(or,)e(if)i(the)e(only)i(c)o(hange)e(in)i(the)f(text)f(w)o +(as)g(the)435 1152 y(remo)o(v)m(al)d(of)g(escap)q(e)h(c)o(haracters)e +(preceding)i(the)f(history)g(expansion)h(c)o(haracter\);)195 +1241 y Fo(1)216 b Fp(if)16 b(expansions)g(did)g(tak)o(e)e(place;)195 +1330 y Fo(-1)192 b Fp(if)16 b(there)f(w)o(as)f(an)h(error)g(in)h +(expansion;)195 1419 y Fo(2)216 b Fp(if)14 b(the)g(returned)g(line)i +(should)f(b)q(e)f(displa)o(y)o(ed,)h(but)f(not)f(executed,)i(as)e(with) +h(the)g Fo(:p)435 1474 y Fp(mo)q(di\014er)i(\(see)f(Section)h(1.1.3)e +([Mo)q(di\014ers],)h(page)g(2\).)195 1568 y(If)g(an)h(error)e(o)q +(curred)i(in)g(expansion,)f(then)h Fj(output)g Fp(con)o(tains)f(a)g +(descriptiv)o(e)i(error)d(message.)1762 1713 y(F)l(unction)-1861 +b Fh(char)20 b(*)f Fg(get)p 324 1713 V 21 w(history)p +520 1713 V 20 w(ev)n(en)n(t)25 b Ff(\()p Fo(const)14 +b(char)h(*string,)f(int)g(*cindex,)g(int)283 1767 y(qchar)p +Ff(\))195 1822 y Fp(Returns)22 b(the)h(text)f(of)h(the)f(history)h(ev)o +(en)o(t)g(b)q(eginning)h(at)f Fj(string)j Fo(+)d Fj(*cindex)p +Fp(.)43 b Fj(*cindex)27 b Fp(is)195 1877 y(mo)q(di\014ed)16 +b(to)e(p)q(oin)o(t)h(to)f(after)g(the)h(ev)o(en)o(t)f(sp)q(eci\014er.) +22 b(A)o(t)14 b(function)h(en)o(try)l(,)g Fj(cindex)k +Fp(p)q(oin)o(ts)c(to)f(the)195 1932 y(index)19 b(in)o(to)f +Fj(string)k Fp(where)c(the)g(history)g(ev)o(en)o(t)g(sp)q +(eci\014cation)h(b)q(egins.)30 b Fj(qc)o(har)21 b Fp(is)d(a)g(c)o +(haracter)195 1987 y(that)13 b(is)h(allo)o(w)o(ed)g(to)e(end)i(the)g +(ev)o(en)o(t)f(sp)q(eci\014cation)j(in)e(addition)g(to)f(the)h +(\\normal")f(terminating)195 2041 y(c)o(haracters.)1762 +2186 y(F)l(unction)-1861 b Fh(char)20 b(**)f Fg(history)p +448 2186 V 21 w(tok)n(enize)25 b Ff(\()p Fo(const)14 +b(char)h(*string)p Ff(\))195 2241 y Fp(Return)g(an)g(arra)o(y)g(of)g +(tok)o(ens)g(parsed)g(out)g(of)g Fj(string)p Fp(,)g(m)o(uc)o(h)h(as)f +(the)g(shell)i(migh)o(t.)k(The)15 b(tok)o(ens)195 2296 +y(are)h(split)h(on)e(the)h(c)o(haracters)g(in)g(the)g +Fj(history)p 1007 2296 14 2 v 17 w(w)o(ord)p 1122 2296 +V 15 w(delimiters)k Fp(v)m(ariable,)d(and)f(shell)i(quoting)195 +2351 y(con)o(v)o(en)o(tions)d(are)g(ob)q(ey)o(ed.)1762 +2496 y(F)l(unction)-1861 b Fh(char)20 b(*)f Fg(history)p +422 2496 18 3 v 21 w(arg)p 524 2496 V 19 w(extract)24 +b Ff(\()p Fo(int)14 b(first,)h(int)g(last,)f(const)g(char)283 +2550 y(*string)p Ff(\))195 2605 y Fp(Extract)19 b(a)h(string)g(segmen)o +(t)g(consisting)h(of)f(the)g Fj(\014rst)h Fp(through)f +Fj(last)h Fp(argumen)o(ts)e(presen)o(t)h(in)195 2660 +y Fj(string)p Fp(.)g(Argumen)o(ts)15 b(are)f(split)j(using)f +Fo(history_tokenize)p Fp(.)p eop +%%Page: 10 12 +10 11 bop 75 -58 a Fp(10)1324 b(GNU)15 b(History)g(Library)75 +149 y Fn(2.4)33 b(History)22 b(V)-6 b(ariables)137 251 +y Fp(This)18 b(section)f(describ)q(es)i(the)e(externally-visible)k(v)m +(ariables)d(exp)q(orted)f(b)o(y)g(the)g Fk(gnu)g Fp(History)g(Li-)75 +306 y(brary)l(.)1773 438 y(V)l(ariable)-1861 b Fh(int)20 +b Fg(history)p 351 438 18 3 v 20 w(base)195 493 y Fp(The)15 b(logical)i(o\013set)d(of)h(the)g(\014rst)g(en)o(try)g(in)h(the)f -(history)g(list.)1661 2274 y(V)l(ariable)-1749 b Fh(int)20 -b Fg(history)p 351 2274 V 20 w(length)195 2329 y Fo(The)15 +(history)g(list.)1773 625 y(V)l(ariable)-1861 b Fh(int)20 +b Fg(history)p 351 625 V 20 w(length)195 680 y Fp(The)15 b(n)o(um)o(b)q(er)h(of)f(en)o(tries)g(curren)o(tly)h(stored)f(in)h(the) -f(history)g(list.)1661 2417 y(V)l(ariable)-1749 b Fh(int)20 -b Fg(max)p 283 2417 V 19 w(input)p 435 2417 V 21 w(history)195 -2472 y Fo(The)14 b(maxim)o(um)f(n)o(um)o(b)q(er)h(of)e(history)i(en)o -(tries.)19 b(This)14 b(m)o(ust)f(b)q(e)h(c)o(hanged)g(using)g -Fn(stifle_)195 2527 y(history)g(\(\))p Fo(.)1661 2615 -y(V)l(ariable)-1749 b Fh(char)20 b Fg(history)p 377 2615 -V 20 w(expansion)p 644 2615 V 21 w(c)n(har)195 2670 y -Fo(The)15 b(c)o(haracter)g(that)f(starts)g(a)h(history)g(ev)o(en)o(t.) -20 b(The)15 b(default)h(is)g(`)p Fn(!)p Fo('.)p eop -%%Page: 10 12 -10 11 bop 75 -58 a Fo(10)1324 b(GNU)15 b(History)g(Library)1661 -183 y(V)l(ariable)-1749 b Fh(char)20 b Fg(history)p 377 -183 18 3 v 20 w(subst)p 529 183 V 20 w(c)n(har)195 238 -y Fo(The)13 b(c)o(haracter)e(that)h(in)o(v)o(ok)o(es)g(w)o(ord)g -(substitution)h(if)g(found)g(at)e(the)i(start)e(of)h(a)g(line.)21 -b(The)195 293 y(default)16 b(is)f(`)p Fn(^)p Fo('.)1661 -388 y(V)l(ariable)-1749 b Fh(char)20 b Fg(history)p 377 -388 V 20 w(commen)n(t)p 627 388 V 19 w(c)n(har)195 443 -y Fo(During)e(tok)o(enization,)h(if)f(this)h(c)o(haracter)e(is)i(seen)f -(as)g(the)g(\014rst)g(c)o(haracter)f(of)g(a)h(w)o(ord,)195 -498 y(then)e(it)g(and)g(all)h(subsequen)o(t)g(c)o(haracters)e(up)h(to)g -(a)f(newline)j(are)e(ignored,)g(suppressing)195 553 y(history)f -(expansion)h(for)f(the)g(remainder)h(of)f(the)g(line.)22 -b(This)15 b(is)h(disabled)h(b)o(y)e(default.)1661 648 -y(V)l(ariable)-1749 b Fh(char)20 b(*)f Fg(history)p 422 -648 V 21 w(no)p 504 648 V 20 w(expand)p 704 648 V 20 -w(c)n(hars)195 703 y Fo(The)j(list)h(of)f(c)o(haracters)f(whic)o(h)i -(inhibit)h(history)e(expansion)h(if)g(found)f(immediately)195 -758 y(follo)o(wing)16 b Fj(history)p 528 758 14 2 v 16 -w(expansion)p 739 758 V 18 w(c)o(har)p Fo(.)j(The)d(default)f(is)h -(whitespace)g(and)g(`)p Fn(=)p Fo('.)1661 853 y(V)l(ariable)-1749 -b Fh(char)20 b(*)f Fg(history)p 422 853 18 3 v 21 w(searc)n(h)p -599 853 V 20 w(delimiter)p 843 853 V 23 w(c)n(hars)195 -908 y Fo(The)f(list)h(of)e(additional)i(c)o(haracters)e(whic)o(h)i(can) -f(delimit)h(a)f(history)g(searc)o(h)f(string,)h(in)195 -963 y(addition)c(to)d(whitespace,)j(`)p Fn(:)p Fo(')d(and)i(`)p -Fn(?)p Fo(')f(in)h(the)f(case)h(of)f(a)g(substring)h(searc)o(h.)19 -b(The)12 b(default)195 1018 y(is)k(empt)o(y)l(.)1661 -1113 y(V)l(ariable)-1749 b Fh(int)20 b Fg(history)p 351 -1113 V 20 w(quotes)p 533 1113 V 21 w(inhibit)p 717 1113 -V 23 w(expansion)195 1168 y Fo(If)13 b(non-zero,)f(single-quoted)i(w)o -(ords)e(are)g(not)g(scanned)h(for)f(the)g(history)h(expansion)g(c)o -(har-)195 1223 y(acter.)19 b(The)d(default)g(v)m(alue)g(is)g(0.)1661 -1318 y(V)l(ariable)-1749 b Fh(Function)20 b(*)g Fg(history)p -527 1318 V 20 w(inhibit)p 710 1318 V 23 w(expansion)p -980 1318 V 21 w(function)195 1373 y Fo(This)12 b(should)g(b)q(e)g(set)f -(to)f(the)i(address)f(of)g(a)g(function)h(that)e(tak)o(es)h(t)o(w)o(o)f -(argumen)o(ts:)17 b(a)11 b Fn(char)195 1428 y(*)j Fo(\()p -Fj(string)t Fo(\))f(and)i(an)f(in)o(teger)g(index)h(in)o(to)f(that)g -(string)g(\()p Fj(i)r Fo(\).)20 b(It)14 b(should)h(return)f(a)g -(non-zero)195 1482 y(v)m(alue)g(if)e(the)h(history)f(expansion)h -(starting)f(at)g Fj(string[i])i Fo(should)f(not)f(b)q(e)h(p)q -(erformed;)g(zero)195 1537 y(if)g(the)h(expansion)f(should)h(b)q(e)g -(done.)20 b(It)13 b(is)g(in)o(tended)i(for)d(use)h(b)o(y)g -(applications)i(lik)o(e)f(Bash)195 1592 y(that)j(use)h(the)g(history)f -(expansion)i(c)o(haracter)e(for)g(additional)i(purp)q(oses.)28 -b(By)18 b(default,)195 1647 y(this)e(v)m(ariable)g(is)g(set)f(to)f -(NULL.)75 1780 y Fm(2.5)33 b(History)22 b(Programming)h(Example)137 -1878 y Fo(The)16 b(follo)o(wing)g(program)e(demonstrates)g(simple)j -(use)e(of)g(the)g(GNU)g(History)g(Library)l(.)195 1944 -y Fn(main)23 b(\(\))195 1995 y({)243 2047 y(char)g(line[1024],)f(*t;) -243 2099 y(int)h(len,)g(done)h(=)g(0;)243 2203 y(line[0])f(=)g(0;)243 -2307 y(using_history)f(\(\);)243 2359 y(while)h(\(!done\))290 -2411 y({)338 2462 y(printf)g(\("history$)g("\);)338 2514 -y(fflush)g(\(stdout\);)338 2566 y(t)h(=)g(fgets)f(\(line,)g(sizeof)g -(\(line\))g(-)h(1,)f(stdin\);)338 2618 y(if)h(\(t)f(&&)h(*t\))386 -2670 y({)p eop +f(history)g(list.)1773 812 y(V)l(ariable)-1861 b Fh(int)20 +b Fg(history)p 351 812 V 20 w(max)p 478 812 V 20 w(en)n(tries)195 +867 y Fp(The)j(maxim)o(um)g(n)o(um)o(b)q(er)g(of)g(history)g(en)o +(tries.)43 b(This)24 b(m)o(ust)e(b)q(e)i(c)o(hanged)f(using)h +Fo(stifle_)195 922 y(history\(\))p Fp(.)1773 1054 y(V)l(ariable)-1861 +b Fh(char)20 b Fg(history)p 377 1054 V 20 w(expansion)p +644 1054 V 21 w(c)n(har)195 1109 y Fp(The)e(c)o(haracter)f(that)g(in)o +(tro)q(duces)h(a)f(history)h(ev)o(en)o(t.)27 b(The)18 +b(default)g(is)g(`)p Fo(!)p Fp('.)26 b(Setting)18 b(this)g(to)f(0)195 +1164 y(inhibits)g(history)f(expansion.)1773 1296 y(V)l(ariable)-1861 +b Fh(char)20 b Fg(history)p 377 1296 V 20 w(subst)p 529 +1296 V 20 w(c)n(har)195 1351 y Fp(The)h(c)o(haracter)e(that)h(in)o(v)o +(ok)o(es)g(w)o(ord)g(substitution)h(if)g(found)f(at)g(the)h(start)e(of) +h(a)g(line.)37 b(The)195 1406 y(default)16 b(is)f(`)p +Fo(^)p Fp('.)1773 1538 y(V)l(ariable)-1861 b Fh(char)20 +b Fg(history)p 377 1538 V 20 w(commen)n(t)p 627 1538 +V 19 w(c)n(har)195 1593 y Fp(During)f(tok)o(enization,)h(if)f(this)h(c) +o(haracter)e(is)h(seen)h(as)e(the)h(\014rst)g(c)o(haracter)f(of)g(a)h +(w)o(ord,)g(then)195 1648 y(it)j(and)g(all)g(subsequen)o(t)h(c)o +(haracters)d(up)j(to)e(a)g(newline)i(are)f(ignored,)h(suppressing)g +(history)195 1702 y(expansion)16 b(for)f(the)g(remainder)h(of)f(the)g +(line.)21 b(This)16 b(is)g(disabled)h(b)o(y)e(default.)1773 +1835 y(V)l(ariable)-1861 b Fh(char)20 b(*)f Fg(history)p +422 1835 V 21 w(w)n(ord)p 567 1835 V 20 w(delimiters)195 +1889 y Fp(The)e(c)o(haracters)g(that)f(separate)h(tok)o(ens)g(for)f +Fo(\\)p Fp(fBhistory)p 1217 1889 14 2 v 17 w(tok)o(enize\(\))p +Fo(\\)p Fp(fP)l(.)g(The)i(default)g(v)m(alue)195 1944 +y(is)e Fo(")f(\\t\\n\(\)<>;&|")p Fp(.)1773 2077 y(V)l(ariable)-1861 +b Fh(char)20 b(*)f Fg(history)p 422 2077 18 3 v 21 w(no)p +504 2077 V 20 w(expand)p 704 2077 V 20 w(c)n(hars)195 +2131 y Fp(The)c(list)h(of)e(c)o(haracters)g(whic)o(h)i(inhibit)h +(history)e(expansion)h(if)f(found)h(immediately)g(follo)o(wing)195 +2186 y Fj(history)p 336 2186 14 2 v 16 w(expansion)p +547 2186 V 18 w(c)o(har)p Fp(.)j(The)d(default)f(is)h(space,)f(tab,)g +(newline,)h(carriage)f(return,)g(and)h(`)p Fo(=)p Fp('.)1773 +2318 y(V)l(ariable)-1861 b Fh(char)20 b(*)f Fg(history)p +422 2318 18 3 v 21 w(searc)n(h)p 599 2318 V 20 w(delimiter)p +843 2318 V 23 w(c)n(hars)195 2373 y Fp(The)13 b(list)h(of)f(additional) +h(c)o(haracters)e(whic)o(h)i(can)g(delimit)g(a)f(history)g(searc)o(h)g +(string,)g(in)h(addition)195 2428 y(to)h(space,)g(T)l(AB,)g(`)p +Fo(:)p Fp(')f(and)h(`)p Fo(?)p Fp(')g(in)h(the)f(case)g(of)g(a)g +(substring)g(searc)o(h.)20 b(The)c(default)f(is)h(empt)o(y)l(.)1773 +2560 y(V)l(ariable)-1861 b Fh(int)20 b Fg(history)p 351 +2560 V 20 w(quotes)p 533 2560 V 21 w(inhibit)p 717 2560 +V 23 w(expansion)195 2615 y Fp(If)15 b(non-zero,)f(single-quoted)j(w)o +(ords)c(are)i(not)f(scanned)h(for)f(the)h(history)g(expansion)g(c)o +(haracter.)195 2670 y(The)g(default)h(v)m(alue)h(is)e(0.)p +eop %%Page: 11 13 -11 12 bop 75 -58 a Fo(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g -(History)867 b(11)434 183 y Fn(len)23 b(=)h(strlen)f(\(t\);)434 -235 y(if)g(\(t[len)g(-)h(1])g(==)f('\\n'\))481 287 y(t[len)h(-)f(1])h -(=)g('\\0';)386 339 y(})338 443 y(if)g(\(!t\))386 495 -y(strcpy)f(\(line,)g("quit"\);)338 598 y(if)h(\(line[0]\))386 -650 y({)434 702 y(char)f(*expansion;)434 754 y(int)g(result;)434 -858 y(result)g(=)g(history_expand)f(\(line,)h(&expansion\);)434 -910 y(if)g(\(result\))481 962 y(fprintf)g(\(stderr,)g("\045s\\n",)g -(expansion\);)434 1065 y(if)g(\(result)g(<)h(0)g(||)f(result)g(==)h -(2\))481 1117 y({)529 1169 y(free)f(\(expansion\);)529 -1221 y(continue;)481 1273 y(})434 1377 y(add_history)f(\(expansion\);) -434 1429 y(strncpy)h(\(line,)g(expansion,)f(sizeof)h(\(line\))g(-)h -(1\);)434 1480 y(free)f(\(expansion\);)386 1532 y(})338 -1636 y(if)h(\(strcmp)f(\(line,)g("quit"\))g(==)g(0\))386 -1688 y(done)g(=)h(1;)338 1740 y(else)f(if)h(\(strcmp)f(\(line,)g -("save"\))g(==)h(0\))386 1792 y(write_history)e(\("history_file"\);)338 -1844 y(else)h(if)h(\(strcmp)f(\(line,)g("read"\))g(==)h(0\))386 -1896 y(read_history)e(\("history_file"\);)338 1947 y(else)h(if)h -(\(strcmp)f(\(line,)g("list"\))g(==)h(0\))386 1999 y({)434 -2051 y(register)e(HIST_ENTRY)h(**the_list;)434 2103 y(register)f(int)i -(i;)434 2207 y(the_list)e(=)i(history_list)e(\(\);)434 -2259 y(if)h(\(the_list\))481 2311 y(for)h(\(i)f(=)h(0;)g(the_list[i];)e -(i++\))529 2363 y(printf)h(\("\045d:)g(\045s\\n",)g(i)h(+)g -(history_base,)e(the_list[i]->line\);)386 2414 y(})338 -2466 y(else)h(if)h(\(strncmp)f(\(line,)g("delete",)g(6\))g(==)h(0\))386 -2518 y({)434 2570 y(int)f(which;)434 2622 y(if)g(\(\(sscanf)g(\(line)g -(+)h(6,)f("\045d",)h(&which\)\))e(==)i(1\))p eop +11 12 bop 75 -58 a Fp(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g +(History)867 b(11)1773 149 y(V)l(ariable)-1861 b Fh(rl_linebuf_func_t) +22 b(*)d Fg(history)p 762 149 18 3 v 21 w(inhibit)p 946 +149 V 23 w(expansion)p 1216 149 V 20 w(function)195 204 +y Fp(This)e(should)h(b)q(e)f(set)g(to)f(the)g(address)h(of)f(a)h +(function)g(that)f(tak)o(es)g(t)o(w)o(o)f(argumen)o(ts:)22 +b(a)17 b Fo(char)d(*)195 259 y Fp(\()p Fj(string)t Fp(\))e(and)i(an)f +Fo(int)g Fp(index)i(in)o(to)e(that)f(string)i(\()p Fj(i)r +Fp(\).)19 b(It)14 b(should)g(return)f(a)g(non-zero)h(v)m(alue)g(if)g +(the)195 314 y(history)h(expansion)g(starting)f(at)g +Fj(string[i])i Fp(should)g(not)e(b)q(e)h(p)q(erformed;)g(zero)f(if)h +(the)g(expansion)195 369 y(should)i(b)q(e)g(done.)22 +b(It)16 b(is)h(in)o(tended)g(for)e(use)i(b)o(y)f(applications)h(lik)o +(e)g(Bash)f(that)g(use)g(the)g(history)195 423 y(expansion)g(c)o +(haracter)f(for)f(additional)j(purp)q(oses.)j(By)c(default,)f(this)h(v) +m(ariable)g(is)g(set)f(to)f Fo(NULL)p Fp(.)75 543 y Fn(2.5)33 +b(History)22 b(Programming)h(Example)137 637 y Fp(The)16 +b(follo)o(wing)g(program)e(demonstrates)g(simple)j(use)e(of)g(the)g +Fk(gnu)g Fp(History)g(Library)l(.)195 698 y Fo(#include)23 +b( )195 750 y(#include)g( )195 +854 y(main)g(\(argc,)g(argv\))314 906 y(int)h(argc;)314 +958 y(char)g(**argv;)195 1010 y({)243 1061 y(char)f(line[1024],)f(*t;) +243 1113 y(int)h(len,)g(done)h(=)g(0;)243 1217 y(line[0])f(=)g(0;)243 +1321 y(using_history)f(\(\);)243 1373 y(while)h(\(!done\))290 +1425 y({)338 1477 y(printf)g(\("history$)g("\);)338 1528 +y(fflush)g(\(stdout\);)338 1580 y(t)h(=)g(fgets)f(\(line,)g(sizeof)g +(\(line\))g(-)h(1,)f(stdin\);)338 1632 y(if)h(\(t)f(&&)h(*t\))386 +1684 y({)434 1736 y(len)f(=)h(strlen)f(\(t\);)434 1788 +y(if)g(\(t[len)g(-)h(1])g(==)f('\\n'\))481 1840 y(t[len)h(-)f(1])h(=)g +('\\0';)386 1892 y(})338 1995 y(if)g(\(!t\))386 2047 +y(strcpy)f(\(line,)g("quit"\);)338 2151 y(if)h(\(line[0]\))386 +2203 y({)434 2255 y(char)f(*expansion;)434 2307 y(int)g(result;)434 +2411 y(result)g(=)g(history_expand)f(\(line,)h(&expansion\);)434 +2462 y(if)g(\(result\))481 2514 y(fprintf)g(\(stderr,)g("\045s\\n",)g +(expansion\);)434 2618 y(if)g(\(result)g(<)h(0)g(||)f(result)g(==)h +(2\))481 2670 y({)p eop %%Page: 12 14 -12 13 bop 75 -58 a Fo(12)1324 b(GNU)15 b(History)g(Library)481 -183 y Fn({)529 235 y(HIST_ENTRY)23 b(*entry)g(=)g(remove_history)f -(\(which\);)529 287 y(if)i(\(!entry\))577 339 y(fprintf)f(\(stderr,)f -("No)i(such)f(entry)g(\045d\\n",)g(which\);)529 391 y(else)577 -443 y({)625 495 y(free)g(\(entry->line\);)625 546 y(free)g(\(entry\);) -577 598 y(})481 650 y(})434 702 y(else)481 754 y({)529 -806 y(fprintf)g(\(stderr,)g("non-numeric)f(arg)h(given)h(to)f -(`delete'\\n"\);)481 858 y(})386 910 y(})290 962 y(})195 -1013 y(})p eop +12 13 bop 75 -58 a Fp(12)1324 b(GNU)15 b(History)g(Library)529 +149 y Fo(free)23 b(\(expansion\);)529 201 y(continue;)481 +253 y(})434 357 y(add_history)f(\(expansion\);)434 409 +y(strncpy)h(\(line,)g(expansion,)f(sizeof)h(\(line\))g(-)h(1\);)434 +461 y(free)f(\(expansion\);)386 513 y(})338 616 y(if)h(\(strcmp)f +(\(line,)g("quit"\))g(==)g(0\))386 668 y(done)g(=)h(1;)338 +720 y(else)f(if)h(\(strcmp)f(\(line,)g("save"\))g(==)h(0\))386 +772 y(write_history)e(\("history_file"\);)338 824 y(else)h(if)h +(\(strcmp)f(\(line,)g("read"\))g(==)h(0\))386 876 y(read_history)e +(\("history_file"\);)338 928 y(else)h(if)h(\(strcmp)f(\(line,)g +("list"\))g(==)h(0\))386 980 y({)434 1032 y(register)e(HIST_ENTRY)h +(**the_list;)434 1083 y(register)f(int)i(i;)434 1187 +y(the_list)e(=)i(history_list)e(\(\);)434 1239 y(if)h(\(the_list\))481 +1291 y(for)h(\(i)f(=)h(0;)g(the_list[i];)e(i++\))529 +1343 y(printf)h(\("\045d:)g(\045s\\n",)g(i)h(+)g(history_base,)e +(the_list[i]->line\);)386 1395 y(})338 1447 y(else)h(if)h(\(strncmp)f +(\(line,)g("delete",)g(6\))g(==)h(0\))386 1499 y({)434 +1550 y(int)f(which;)434 1602 y(if)g(\(\(sscanf)g(\(line)g(+)h(6,)f +("\045d",)h(&which\)\))e(==)i(1\))481 1654 y({)529 1706 +y(HIST_ENTRY)f(*entry)g(=)g(remove_history)f(\(which\);)529 +1758 y(if)i(\(!entry\))577 1810 y(fprintf)f(\(stderr,)f("No)i(such)f +(entry)g(\045d\\n",)g(which\);)529 1862 y(else)577 1914 +y({)625 1966 y(free)g(\(entry->line\);)625 2017 y(free)g(\(entry\);)577 +2069 y(})481 2121 y(})434 2173 y(else)481 2225 y({)529 +2277 y(fprintf)g(\(stderr,)g("non-numeric)f(arg)h(given)h(to)f +(`delete'\\n"\);)481 2329 y(})386 2381 y(})290 2433 y(})195 +2484 y(})p eop %%Page: 13 15 -13 14 bop 75 -58 a Fo(App)q(endix)17 b(A:)e(Concept)g(Index)1196 -b(13)75 183 y Fk(App)r(endix)25 b(A)41 b(Concept)27 b(Index)75 -359 y Fm(A)75 417 y Fe(anc)o(hored)14 b(searc)o(h)s Fd(.)7 -b(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)16 -b Fe(7)75 517 y Fm(E)75 575 y Fe(ev)o(en)o(t)d(designators)c -Fd(.)g(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)21 -b Fe(1)1012 359 y Fm(H)1012 417 y Fe(history)15 b(ev)o(en)o(ts)s -Fd(.)7 b(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)16 b Fe(1)1012 467 y(history)f(expansion)6 b Fd(.)j(.)d(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)19 b Fe(1)1012 517 y(History)14 -b(Searc)o(hing)5 b Fd(.)j(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)18 b Fe(7)p eop +13 14 bop 75 -58 a Fp(App)q(endix)17 b(A:)e(Concept)g(Index)1196 +b(13)75 149 y Fl(App)r(endix)25 b(A)41 b(Concept)27 b(Index)75 +321 y Fn(A)75 383 y Fe(anc)o(hored)14 b(searc)o(h)s Fd(.)8 +b(.)e(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g +(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)16 +b Fe(8)75 507 y Fn(E)75 568 y Fe(ev)o(en)o(t)d(designators)g +Fd(.)6 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)23 b +Fe(1)1012 321 y Fn(H)1012 431 y Fe(history)15 b(ev)o(en)o(ts)d +Fd(.)6 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) +g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)24 +b Fe(1)1012 500 y(history)15 b(expansion)8 b Fd(.)g(.)e(.)g(.)g(.)h(.)f +(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)g(.)21 b Fe(1)1012 568 y(History)14 b(Searc)o(hing)6 +b Fd(.)j(.)d(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) +g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)19 b +Fe(8)p eop %%Page: 14 16 -14 15 bop 75 -58 a Fo(14)1324 b(GNU)15 b(History)g(Library)p +14 15 bop 75 -58 a Fp(14)1324 b(GNU)15 b(History)g(Library)p eop %%Page: 15 17 -15 16 bop 75 -58 a Fo(App)q(endix)17 b(B:)e(F)l(unction)h(and)g(V)l -(ariable)g(Index)919 b(15)75 183 y Fk(App)r(endix)25 +15 16 bop 75 -58 a Fp(App)q(endix)17 b(B:)e(F)l(unction)h(and)g(V)l +(ariable)g(Index)919 b(15)75 149 y Fl(App)r(endix)25 b(B)41 b(F)-7 b(unction)26 b(and)h(V)-7 b(ariable)26 -b(Index)75 359 y Fm(A)75 417 y Fc(add)p 137 417 12 2 -v 13 w(history)6 b Fd(.)s(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)h(.)18 b Fe(6)75 467 y Fc(append)p -197 467 V 12 w(history)8 b Fd(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)23 b Fe(8)75 567 y Fm(C)75 625 y Fc(clear)p -177 625 V 12 w(history)s Fd(.)t(.)6 b(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)g(.)16 b Fe(6)75 675 y Fc(current)p -217 675 V 11 w(history)7 b Fd(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)22 b Fe(7)75 774 y Fm(G)75 832 y Fc(get)p -137 832 V 13 w(history)p 290 832 V 11 w(event)8 b Fd(.)e(.)g(.)g(.)g(.) -g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)g(.)g(.)22 b Fe(9)75 932 y Fm(H)75 -990 y Fc(history)p 217 990 V 11 w(arg)p 288 990 V 13 -w(extract)7 b Fd(.)t(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)20 -b Fe(9)75 1040 y Fc(history)p 217 1040 V 11 w(base)f -Fd(.)6 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)19 -b Fe(9)75 1090 y Fc(history_co)o(mm)o(ent)o(_c)o(har)g -Fd(.)6 b(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)g(.)23 b Fe(10)75 1139 y Fc(history)p -217 1139 V 11 w(expand)9 b Fd(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)23 b Fe(9)75 1189 y Fc(history)p 217 -1189 V 11 w(expansion)p 408 1189 V 11 w(char)17 b Fd(.)6 -b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)18 b Fe(9)75 1239 y Fc(history)p 217 -1239 V 11 w(get)6 b Fd(.)f(.)h(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)h(.)18 b Fe(7)75 1289 y Fc(history)p -217 1289 V 11 w(get)p 288 1289 V 13 w(history)p 441 1289 -V 12 w(state)9 b Fd(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)g(.)23 b Fe(6)75 1339 y Fc(history_in)o(hi)o -(bit)o(_e)o(xpa)o(nsi)o(on)o(_fu)o(nc)o(tio)o(n)c Fd(.)6 -b(.)g(.)g(.)g(.)g(.)g(.)22 b Fe(10)75 1389 y Fc(history)p -217 1389 V 11 w(is)p 268 1389 V 14 w(stifled)8 b Fd(.)s(.)f(.)f(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)21 b Fe(6)75 1438 y Fc(history)p -217 1438 V 11 w(length)15 b Fd(.)6 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)17 b Fe(9)75 1488 y Fc(history)p 217 -1488 V 11 w(list)5 b Fd(.)g(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.) -f(.)g(.)g(.)g(.)g(.)17 b Fe(7)75 1538 y Fc(history_no)o(_e)o(xpa)o(nd)o -(_ch)o(ars)e Fd(.)6 b(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)19 b Fe(10)75 1588 y Fc(history_qu)o(ot)o -(es_)o(in)o(hib)o(it_)o(ex)o(pan)o(si)o(on)13 b Fd(.)6 -b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)16 b Fe(10)75 1638 -y Fc(history)p 217 1638 V 11 w(search)9 b Fd(.)d(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)23 b Fe(7)75 1687 y Fc(history_se)o(ar)o -(ch_)o(de)o(lim)o(ite)o(r_)o(cha)o(rs)15 b Fd(.)6 b(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)h(.)f(.)g(.)18 b Fe(10)75 1737 y Fc(history)p -217 1737 V 11 w(search)p 348 1737 V 12 w(pos)8 b Fd(.)d(.)i(.)f(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)21 b Fe(8)75 1787 y Fc(history)p -217 1787 V 11 w(search)p 348 1787 V 12 w(prefix)5 b Fd(.)t(.)h(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) -g(.)g(.)g(.)17 b Fe(8)75 1837 y Fc(history)p 217 1837 -V 11 w(set)p 288 1837 V 13 w(history)p 441 1837 V 12 -w(state)9 b Fd(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)g(.)23 b Fe(6)75 1887 y Fc(history)p -217 1887 V 11 w(set)p 288 1887 V 13 w(pos)t Fd(.)5 b(.)h(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)16 b Fe(7)1012 359 -y Fc(history_sub)o(st)o(_ch)o(ar)d Fd(.)6 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) -17 b Fe(10)1012 409 y Fc(history)p 1154 409 V 12 w(tokenize)8 -b Fd(.)s(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21 -b Fe(9)1012 459 y Fc(history)p 1154 459 V 12 w(total)p -1266 459 V 12 w(bytes)7 b Fd(.)t(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)20 -b Fe(7)1012 509 y Fc(history)p 1154 509 V 12 w(truncate)p -1326 509 V 11 w(file)5 b Fd(.)t(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)18 -b Fe(8)1012 612 y Fm(M)1012 670 y Fc(max)p 1074 670 V -13 w(input)p 1187 670 V 13 w(history)13 b Fd(.)6 b(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)h(.)f(.)g(.)g(.)16 b Fe(9)1012 773 y Fm(N)1012 831 -y Fc(next)p 1094 831 V 13 w(history)5 b Fd(.)s(.)h(.)g(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.) -f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)18 b Fe(7)1012 -934 y Fm(P)1012 992 y Fc(previous)p 1174 992 V 11 w(history)8 -b Fd(.)t(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21 -b Fe(7)1012 1096 y Fm(R)1012 1154 y Fc(read)p 1094 1154 -V 13 w(history)5 b Fd(.)s(.)h(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)18 b Fe(8)1012 1204 y Fc(read)p 1094 -1204 V 13 w(history)p 1247 1204 V 11 w(range)8 b Fd(.)d(.)h(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)h(.)f(.)21 b Fe(8)1012 1253 y Fc(remove)p -1134 1253 V 12 w(history)8 b Fd(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)24 b Fe(6)1012 1303 y Fc(replace)p 1154 -1303 V 12 w(history)p 1306 1303 V 11 w(entry)5 b Fd(.)t(.)h(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)18 b Fe(6)1012 1406 y Fm(S)1012 1464 y Fc(stifle)p -1134 1464 V 12 w(history)8 b Fd(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)24 b Fe(6)1012 1568 y Fm(U)1012 1626 -y Fc(unstifle)p 1174 1626 V 11 w(history)8 b Fd(.)t(.)e(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)h(.)f(.)g(.)g(.)g(.)21 b Fe(6)1012 1676 y Fc(using)p -1114 1676 V 13 w(history)s Fd(.)s(.)6 b(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)g(.)17 b Fe(6)1012 1779 y Fm(W)1012 -1837 y Fc(where)p 1114 1837 V 13 w(history)s Fd(.)s(.)6 -b(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)17 -b Fe(7)1012 1887 y Fc(write)p 1114 1887 V 13 w(history)s -Fd(.)s(.)6 b(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)17 +b(Index)75 321 y Fn(A)75 382 y Fc(add_histor)o(y)8 b +Fd(.)e(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g +(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)23 +b Fe(6)75 428 y Fc(append_his)o(to)o(ry)8 b Fd(.)s(.)f(.)f(.)g(.)g(.)g +(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) +g(.)g(.)g(.)h(.)f(.)g(.)21 b Fe(9)75 557 y Fn(C)75 618 +y Fc(clear_hist)o(or)o(y)6 b Fd(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g +(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)22 b Fe(6)75 664 y Fc(current_hi)o(st)o(ory)7 +b Fd(.)s(.)f(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)20 b +Fe(7)75 793 y Fn(G)75 854 y Fc(get_histor)o(y_)o(eve)o(nt)5 +b Fd(.)t(.)h(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)19 b Fe(9)75 +984 y Fn(H)75 1044 y Fc(history_ar)o(g_)o(ext)o(ra)o(ct)5 +b Fd(.)s(.)h(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) +g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)18 b Fe(9)75 1090 y Fc(history_ba)o(se) +6 b Fd(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g +(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)22 +b Fe(10)75 1136 y Fc(history_co)o(mm)o(ent)o(_c)o(har)s +Fd(.)s(.)6 b(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)g(.)h(.)16 b Fe(10)75 1182 y Fc(history_ex)o(pa)o(nd)8 +b Fd(.)s(.)f(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) +g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)21 +b Fe(9)75 1227 y Fc(history_ex)o(pa)o(nsi)o(on)o(_ch)o(ar)8 +b Fd(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +h(.)f(.)g(.)24 b Fe(10)75 1273 y Fc(history_ge)o(t)8 +b Fd(.)e(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) +g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)23 +b Fe(7)75 1319 y Fc(history_ge)o(t_)o(his)o(to)o(ry_)o(sta)o(te)6 +b Fd(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) +f(.)22 b Fe(6)75 1364 y Fc(history_in)o(hi)o(bit)o(_e)o(xpa)o(nsi)o(on) +o(_fu)o(nc)o(tio)o(n)9 b Fd(.)d(.)g(.)g(.)g(.)g(.)h(.)24 +b Fe(11)75 1410 y Fc(history_is)o(_s)o(tif)o(le)o(d)6 +b Fd(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)18 b Fe(7)75 1456 +y Fc(history_le)o(ng)o(th)8 b Fd(.)s(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) +g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g +(.)g(.)21 b Fe(10)75 1501 y Fc(history_li)o(st)6 b Fd(.)h(.)f(.)g(.)g +(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) +g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)23 b Fe(7)75 +1547 y Fc(history_ma)o(x_)o(ent)o(ri)o(es)t Fd(.)s(.)6 +b(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g +(.)g(.)g(.)h(.)f(.)17 b Fe(10)75 1593 y Fc(history_no)o(_e)o(xpa)o(nd)o +(_ch)o(ars)7 b Fd(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g +(.)g(.)g(.)g(.)g(.)h(.)23 b Fe(10)75 1638 y Fc(history_qu)o(ot)o(es_)o +(in)o(hib)o(it_)o(ex)o(pan)o(si)o(on)t Fd(.)s(.)6 b(.)g(.)g(.)h(.)f(.)g +(.)g(.)g(.)17 b Fe(10)75 1684 y Fc(history_se)o(ar)o(ch)8 +b Fd(.)s(.)f(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) +g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)21 +b Fe(8)75 1730 y Fc(history_se)o(ar)o(ch_)o(de)o(lim)o(ite)o(r_)o(cha)o +(rs)5 b Fd(.)s(.)h(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)18 +b Fe(10)75 1776 y Fc(history_se)o(ar)o(ch_)o(po)o(s)6 +b Fd(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)18 b Fe(8)75 1821 +y Fc(history_se)o(ar)o(ch_)o(pr)o(efi)o(x)s Fd(.)t(.)6 +b(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g +(.)h(.)f(.)g(.)16 b Fe(8)75 1867 y Fc(history_se)o(t_)o(his)o(to)o(ry_) +o(sta)o(te)6 b Fd(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g +(.)g(.)g(.)h(.)f(.)22 b Fe(6)75 1913 y Fc(history_se)o(t_)o(pos)7 +b Fd(.)s(.)f(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)20 b +Fe(7)1012 321 y Fc(history_sub)o(st)o(_ch)o(ar)t Fd(.)t(.)6 +b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f +(.)g(.)g(.)g(.)g(.)g(.)19 b Fe(10)1012 368 y Fc(history_tok)o(en)o(ize) +6 b Fd(.)t(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g +(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)20 b Fe(9)1012 +414 y Fc(history_tot)o(al)o(_by)o(te)o(s)5 b Fd(.)s(.)h(.)g(.)h(.)f(.)g +(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) +g(.)18 b Fe(7)1012 460 y Fc(history_tru)o(nc)o(ate)o(_f)o(ile)s +Fd(.)s(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +h(.)f(.)g(.)g(.)g(.)g(.)17 b Fe(9)1012 507 y Fc(history_wor)o(d_)o(del) +o(im)o(ite)o(rs)7 b Fd(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g +(.)g(.)g(.)h(.)f(.)g(.)g(.)24 b Fe(10)1012 640 y Fn(N)1012 +702 y Fc(next_histor)o(y)7 b Fd(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g +(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) +g(.)g(.)h(.)f(.)23 b Fe(7)1012 836 y Fn(P)1012 898 y +Fc(previous_hi)o(st)o(ory)6 b Fd(.)t(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) +g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f +(.)20 b Fe(7)1012 1031 y Fn(R)1012 1094 y Fc(read_histor)o(y)7 +b Fd(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)23 +b Fe(8)1012 1140 y Fc(read_histor)o(y_)o(ran)o(ge)5 b +Fd(.)s(.)h(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g +(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)19 b Fe(8)1012 1186 +y Fc(remove_hist)o(or)o(y)9 b Fd(.)s(.)d(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) +g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g +(.)g(.)g(.)22 b Fe(6)1012 1233 y Fc(replace_his)o(to)o(ry_)o(en)o(try)s +Fd(.)s(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +h(.)f(.)g(.)g(.)g(.)g(.)17 b Fe(6)1012 1366 y Fn(S)1012 +1429 y Fc(stifle_hist)o(or)o(y)9 b Fd(.)s(.)d(.)g(.)g(.)g(.)h(.)f(.)g +(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)22 b Fe(7)1012 1562 y Fn(U)1012 1624 +y Fc(unstifle_hi)o(st)o(ory)6 b Fd(.)t(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f +(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) +f(.)20 b Fe(7)1012 1671 y Fc(using_histo)o(ry)6 b Fd(.)g(.)g(.)g(.)g(.) +g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g +(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)22 b Fe(6)1012 1804 +y Fn(W)1012 1866 y Fc(where_histo)o(ry)6 b Fd(.)g(.)g(.)g(.)g(.)g(.)h +(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +h(.)f(.)g(.)g(.)g(.)g(.)h(.)22 b Fe(7)1012 1913 y Fc(write_histo)o(ry)6 +b Fd(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) +g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)22 b Fe(8)p eop %%Page: 16 18 -16 17 bop 75 -58 a Fo(16)1324 b(GNU)15 b(History)g(Library)p +16 17 bop 75 -58 a Fp(16)1324 b(GNU)15 b(History)g(Library)p eop %%Page: -1 19 --1 18 bop 1862 -58 a Fo(i)75 183 y Fk(T)-7 b(able)27 -b(of)f(Con)n(ten)n(ts)75 354 y Fm(1)67 b(Using)22 b(History)h(In)n +-1 18 bop 1862 -58 a Fp(i)75 149 y Fl(T)-7 b(able)27 +b(of)f(Con)n(ten)n(ts)75 320 y Fn(1)67 b(Using)22 b(History)h(In)n (teractiv)n(ely)9 b Fb(.)k(.)d(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)h(.)31 b Fm(1)224 423 y Fo(1.1)45 b(History)15 +(.)f(.)g(.)g(.)h(.)31 b Fn(1)224 389 y Fp(1.1)45 b(History)15 b(Expansion)5 b Fa(.)j(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.) -f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)19 b Fo(1)374 478 y(1.1.1)44 +f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)19 b Fp(1)374 444 y(1.1.1)44 b(Ev)o(en)o(t)14 b(Designators)e Fa(.)7 b(.)h(.)f(.)h(.)f(.)h(.)f(.)h (.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) -f(.)h(.)f(.)h(.)26 b Fo(1)374 532 y(1.1.2)44 b(W)l(ord)15 +f(.)h(.)f(.)h(.)26 b Fp(1)374 499 y(1.1.2)44 b(W)l(ord)15 b(Designators)5 b Fa(.)h(.)i(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.) f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h -(.)19 b Fo(2)374 587 y(1.1.3)44 b(Mo)q(di\014ers)t Fa(.)8 +(.)19 b Fp(2)374 553 y(1.1.3)44 b(Mo)q(di\014ers)t Fa(.)8 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.) -f(.)h(.)f(.)19 b Fo(2)75 708 y Fm(2)67 b(Programming)23 +f(.)h(.)f(.)19 b Fp(2)75 675 y Fn(2)67 b(Programming)23 b(with)g(GNU)f(History)16 b Fb(.)10 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f -(.)g(.)38 b Fm(5)224 777 y Fo(2.1)45 b(In)o(tro)q(duction)16 +(.)g(.)38 b Fn(5)224 743 y Fp(2.1)45 b(In)o(tro)q(duction)16 b(to)f(History)10 b Fa(.)d(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f (.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.) -f(.)h(.)f(.)h(.)24 b Fo(5)224 832 y(2.2)45 b(History)15 +f(.)h(.)f(.)h(.)24 b Fp(5)224 798 y(2.2)45 b(History)15 b(Storage)c Fa(.)d(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f (.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.) -g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)26 b Fo(5)224 886 +g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)26 b Fp(5)224 853 y(2.3)45 b(History)15 b(F)l(unctions)d Fa(.)c(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.) f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)26 -b Fo(6)374 941 y(2.3.1)44 b(Initializing)18 b(History)d(and)h(State)e +b Fp(6)374 907 y(2.3.1)44 b(Initializing)18 b(History)d(and)h(State)e (Managemen)o(t)g Fa(.)7 b(.)h(.)g(.)f(.)h(.)f(.)29 b -Fo(6)374 996 y(2.3.2)44 b(History)15 b(List)h(Managemen)o(t)d +Fp(6)374 962 y(2.3.2)44 b(History)15 b(List)h(Managemen)o(t)d Fa(.)7 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.) -h(.)f(.)h(.)f(.)h(.)f(.)29 b Fo(6)374 1051 y(2.3.3)44 +h(.)f(.)h(.)f(.)h(.)f(.)29 b Fp(6)374 1017 y(2.3.3)44 b(Information)15 b(Ab)q(out)g(the)h(History)f(List)c Fa(.)d(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)26 -b Fo(7)374 1106 y(2.3.4)44 b(Mo)o(ving)15 b(Around)g(the)g(History)g +b Fp(7)374 1072 y(2.3.4)44 b(Mo)o(ving)15 b(Around)g(the)g(History)g (List)c Fa(.)d(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f -(.)h(.)25 b Fo(7)374 1160 y(2.3.5)44 b(Searc)o(hing)16 +(.)h(.)25 b Fp(7)374 1127 y(2.3.5)44 b(Searc)o(hing)16 b(the)f(History)g(List)7 b Fa(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f (.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)22 -b Fo(7)374 1215 y(2.3.6)44 b(Managing)15 b(the)g(History)g(File)6 +b Fp(8)374 1181 y(2.3.6)44 b(Managing)15 b(the)g(History)g(File)6 b Fa(.)i(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.) -f(.)h(.)f(.)h(.)f(.)h(.)20 b Fo(8)374 1270 y(2.3.7)44 +f(.)h(.)f(.)h(.)f(.)h(.)20 b Fp(8)374 1236 y(2.3.7)44 b(History)15 b(Expansion)9 b Fa(.)f(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h (.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.) -h(.)f(.)24 b Fo(8)224 1325 y(2.4)45 b(History)15 b(V)l(ariables)6 -b Fa(.)j(.)e(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) -f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h -(.)f(.)h(.)f(.)h(.)f(.)21 b Fo(9)224 1380 y(2.5)45 b(History)15 +h(.)f(.)24 b Fp(9)224 1291 y(2.4)45 b(History)15 b(V)l(ariables)6 +b Fa(.)i(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.) +f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f +(.)h(.)f(.)h(.)f(.)21 b Fp(10)224 1346 y(2.5)45 b(History)15 b(Programming)f(Example)7 b Fa(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)22 -b Fo(10)75 1501 y Fm(App)r(endix)i(A)67 b(Concept)22 +b Fp(11)75 1467 y Fn(App)r(endix)i(A)67 b(Concept)22 b(Index)17 b Fb(.)10 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g -(.)h(.)f(.)g(.)38 b Fm(13)75 1636 y(App)r(endix)24 b(B)67 +(.)h(.)f(.)g(.)38 b Fn(13)75 1602 y(App)r(endix)24 b(B)67 b(F)-6 b(unction)25 b(and)e(V)-6 b(ariable)24 b(Index)16 -b Fb(.)10 b(.)g(.)g(.)38 b Fm(15)p eop +b Fb(.)10 b(.)g(.)g(.)38 b Fn(15)p eop %%Page: -2 20 --2 19 bop 75 -58 a Fo(ii)1346 b(GNU)15 b(History)g(Library)p +-2 19 bop 75 -58 a Fp(ii)1346 b(GNU)15 b(History)g(Library)p eop %%Trailer end diff --git a/doc/history_3.ps b/doc/history_3.ps new file mode 100644 index 0000000..3aae637 --- /dev/null +++ b/doc/history_3.ps @@ -0,0 +1,798 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.16.1 +%%CreationDate: Mon Apr 16 10:53:07 2001 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Times-Italic +%%DocumentSuppliedResources: procset grops 1.16 1 +%%Pages: 7 +%%PageOrder: Ascend +%%Orientation: Portrait +%%EndComments +%%BeginProlog +%%BeginResource: procset grops 1.16 1 +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}bind def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/FL{ +currentgray exch setgray fill setgray +}bind def +/BL/fill load def +/LW/setlinewidth load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +}bind def +/PEND{ +clear +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Times-Italic +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron +/scaron/zcaron/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O +/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y +/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 ENC0/Times-Bold RE +/Times-Roman@0 ENC0/Times-Roman RE +%%EndProlog +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F +(OR)-.18 E(Y\(3\))-.65 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME) +.219 E F0(history \255 GNU History Library)108 96 Q F1(COPYRIGHT)72 +112.8 Q F0(The GNU History Library is Cop)108 124.8 Q +(yright \251 1989-2001 by the Free Softw)-.1 E(are F)-.1 E +(oundation, Inc.)-.15 E F1(DESCRIPTION)72 141.6 Q F0(Man)108 153.6 Q +2.81(yp)-.15 G .31(rograms read input from the user a line at a time.) +-2.81 F .309(The GNU History library is able to k)5.309 F .309 +(eep track of)-.1 F .024(those lines, associate arbitrary data with eac\ +h line, and utilize information from pre)108 165.6 R .024 +(vious lines in composing)-.25 F(ne)108 177.6 Q 2.5(wo)-.25 G(nes.)-2.5 +E F1(HIST)72 199.2 Q(OR)-.197 E 2.738(YE)-.383 G(XP)-2.738 E(ANSION)-.81 +E F0 .823(The history library supports a history e)108 211.2 R .822 +(xpansion feature that is identical to the history e)-.15 F .822 +(xpansion in)-.15 F/F2 10/Times-Bold@0 SF(bash.)3.322 E F0 +(This section describes what syntax features are a)108 223.2 Q -.25(va) +-.2 G(ilable.).25 E 1.305(History e)108 240 R 1.305 +(xpansions introduce w)-.15 F 1.306(ords from the history list into the\ + input stream, making it easy to repeat)-.1 F .21 +(commands, insert the ar)108 252 R .21(guments to a pre)-.18 F .209 +(vious command into the current input line, or \214x errors in pre)-.25 +F(vious)-.25 E(commands quickly)108 264 Q(.)-.65 E 1.296(History e)108 +280.8 R 1.297(xpansion is usually performed immediately after a complet\ +e line is read.)-.15 F 1.297(It tak)6.297 F 1.297(es place in tw)-.1 F +(o)-.1 E 2.855(parts. The)108 292.8 R .354(\214rst is to determine whic\ +h line from the history list to use during substitution.)2.855 F .354 +(The second is to)5.354 F .116 +(select portions of that line for inclusion into the current one.)108 +304.8 R .117(The line selected from the history is the)5.116 F/F3 10 +/Times-Italic@0 SF -.15(ev)2.617 G(ent).15 E F0(,)A .846 +(and the portions of that line that are acted upon are)108 316.8 R F3 +(wor)3.346 E(ds)-.37 E F0 5.846(.V)C(arious)-6.956 E F3(modi\214er)3.346 +E(s)-.1 E F0 .846(are a)3.346 F -.25(va)-.2 G .845(ilable to manipulate) +.25 F .304(the selected w)108 328.8 R 2.804(ords. The)-.1 F .304 +(line is brok)2.804 F .304(en into w)-.1 F .304(ords in the same f)-.1 F +.304(ashion as)-.1 F F2(bash)2.804 E F0 .305 +(does when reading input, so)2.804 F .539(that se)108 340.8 R -.15(ve) +-.25 G .539(ral w).15 F .539(ords that w)-.1 F .539 +(ould otherwise be separated are considered one w)-.1 F .538 +(ord when surrounded by quotes)-.1 F .307(\(see the description of)108 +352.8 R F2(history_tok)2.807 E(enize\(\))-.1 E F0(belo)2.807 E 2.807 +(w\). History)-.25 F -.15(ex)2.807 G .307 +(pansions are introduced by the appearance of).15 F .52(the history e) +108 364.8 R .52(xpansion character)-.15 F 3.02(,w)-.4 G .52(hich is) +-3.02 F F2(!)3.853 E F0 .52(by def)3.853 F 3.02(ault. Only)-.1 F .52 +(backslash \()3.02 F F2(\\).833 E F0 3.02(\)a).833 G .52 +(nd single quotes can quote the)-3.02 F(history e)108 376.8 Q +(xpansion character)-.15 E(.)-.55 E F2(Ev)87 393.6 Q(ent Designators)-.1 +E F0(An e)108 405.6 Q -.15(ve)-.25 G(nt designator is a reference to a \ +command line entry in the history list.).15 E F2(!)108 422.4 Q F0 +(Start a history substitution, e)32.67 E(xcept when follo)-.15 E +(wed by a)-.25 E F2(blank)2.5 E F0 2.5(,n)C -.25(ew)-2.5 G +(line, = or \(.).25 E F2(!)108 434.4 Q F3(n)A F0(Refer to command line) +27.67 E F3(n)2.5 E F0(.).24 E F2<21ad>108 446.4 Q F3(n)A F0 +(Refer to the current command line minus)21.97 E F3(n)2.5 E F0(.).24 E +F2(!!)108 458.4 Q F0(Refer to the pre)29.34 E(vious command.)-.25 E +(This is a synon)5 E(ym for `!\2551'.)-.15 E F2(!)108 470.4 Q F3(string) +A F0(Refer to the most recent command starting with)9.33 E F3(string)2.5 +E F0(.).22 E F2(!?)108 482.4 Q F3(string)A F2([?])A F0 1.057 +(Refer to the most recent command containing)144 494.4 R F3(string)3.557 +E F0 6.057(.T).22 G 1.057(he trailing)-6.057 F F2(?)3.557 E F0 1.057 +(may be omitted if)3.557 F F3(string)3.557 E F0(is)3.557 E(follo)144 +506.4 Q(wed immediately by a ne)-.25 E(wline.)-.25 E/F4 12/Times-Bold@0 +SF(^)108 523.4 Q F3(string1)-5 I F4(^)5 I F3(string2)-5 I F4(^)5 I F0 +2.66(Quick substitution.)144 530.4 R 2.66 +(Repeat the last command, replacing)7.66 F F3(string1)5.16 E F0(with) +5.16 E F3(string2)5.16 E F0 7.66(.E).02 G(qui)-7.66 E -.25(va)-.25 G +2.66(lent to).25 F -.74(``)144 542.4 S(!!:s/).74 E F3(string1)A F0(/)A +F3(string2)A F0(/')A 2.5('\()-.74 G(see)-2.5 E F2(Modi\214ers)2.5 E F0 +(belo)2.5 E(w\).)-.25 E F2(!#)108 554.4 Q F0 +(The entire command line typed so f)27.67 E(ar)-.1 E(.)-.55 E F2 -.75 +(Wo)87 571.2 S(rd Designators).75 E F0 -.8(Wo)108 583.2 S 1.313 +(rd designators are used to select desired w).8 F 1.314(ords from the e) +-.1 F -.15(ve)-.25 G 3.814(nt. A).15 F F2(:)3.814 E F0 1.314 +(separates the e)3.814 F -.15(ve)-.25 G 1.314(nt speci\214cation).15 F +.53(from the w)108 595.2 R .529(ord designator)-.1 F 5.529(.I)-.55 G +3.029(tm)-5.529 G .529(ay be omitted if the w)-3.029 F .529 +(ord designator be)-.1 F .529(gins with a)-.15 F F2(^)3.029 E F0(,)A F2 +($)3.029 E F0(,)A F2(*)3.029 E F0(,)A F2 3.029 E F0 3.029(,o)C(r) +-3.029 E F2(%)3.029 E F0 5.529(.W)C(ords)-6.329 E 1.3 +(are numbered from the be)108 607.2 R 1.3 +(ginning of the line, with the \214rst w)-.15 F 1.301 +(ord being denoted by 0 \(zero\).)-.1 F -.8(Wo)6.301 G 1.301(rds are).8 +F(inserted into the current line separated by single spaces.)108 619.2 Q +F2 2.5(0\()108 636 S(zer)-2.5 E(o\))-.18 E F0(The zeroth w)144 648 Q 2.5 +(ord. F)-.1 F(or the shell, this is the command w)-.15 E(ord.)-.1 E F3 +(n)108 660 Q F0(The)31 E F3(n)2.5 E F0(th w)A(ord.)-.1 E F2(^)108 672 Q +F0(The \214rst ar)32.67 E 2.5(gument. That)-.18 F(is, w)2.5 E(ord 1.)-.1 +E F2($)108 684 Q F0(The last ar)31 E(gument.)-.18 E F2(%)108 696 Q F0 +(The w)26 E(ord matched by the most recent `?)-.1 E F3(string)A F0 +(?' search.)A F3(x)108 708 Q F2 A F3(y)A F0 2.5(Ar)21.42 G(ange of w) +-2.5 E(ords; `\255)-.1 E F3(y)A F0 2.5('a)C(bbre)-2.5 E(viates `0\255) +-.25 E F3(y)A F0('.)A(GNU History 4.2)72 768 Q(2001 Mar 6)141.51 E(1) +205.67 E EP +%%Page: 2 2 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F +(OR)-.18 E(Y\(3\))-.65 E/F1 10/Times-Bold@0 SF(*)108 84 Q F0 .316 +(All of the w)31 F .316(ords b)-.1 F .316(ut the zeroth.)-.2 F .315 +(This is a synon)5.315 F .315(ym for `)-.15 F/F2 10/Times-Italic@0 SF +(1\255$)A F0 2.815('. It)B .315(is not an error to use)2.815 F F1(*) +2.815 E F0 .315(if there is)2.815 F(just one w)144 96 Q(ord in the e)-.1 +E -.15(ve)-.25 G(nt; the empty string is returned in that case.).15 E F1 +(x*)108 108 Q F0(Abbre)26 E(viates)-.25 E F2(x\255$)2.5 E F0(.)A F1 +<78ad>108 120 Q F0(Abbre)25.3 E(viates)-.25 E F2(x\255$)2.5 E F0(lik)2.5 +E(e)-.1 E F1(x*)2.5 E F0 2.5(,b)C(ut omits the last w)-2.7 E(ord.)-.1 E +(If a w)108 136.8 Q(ord designator is supplied without an e)-.1 E -.15 +(ve)-.25 G(nt speci\214cation, the pre).15 E +(vious command is used as the e)-.25 E -.15(ve)-.25 G(nt.).15 E F1 +(Modi\214ers)87 153.6 Q F0 .183(After the optional w)108 165.6 R .183 +(ord designator)-.1 F 2.683(,t)-.4 G .184 +(here may appear a sequence of one or more of the follo)-2.683 F .184 +(wing modi\214ers,)-.25 F(each preceded by a `:'.)108 177.6 Q F1(h)108 +194.4 Q F0(Remo)30.44 E .3 -.15(ve a t)-.15 H +(railing \214le name component, lea).15 E(ving only the head.)-.2 E F1 +(t)108 206.4 Q F0(Remo)32.67 E .3 -.15(ve a)-.15 H +(ll leading \214le name components, lea).15 E(ving the tail.)-.2 E F1(r) +108 218.4 Q F0(Remo)31.56 E .3 -.15(ve a t)-.15 H(railing suf).15 E +(\214x of the form)-.25 E F2(.xxx)2.5 E F0 2.5(,l)C(ea)-2.5 E +(ving the basename.)-.2 E F1(e)108 230.4 Q F0(Remo)31.56 E .3 -.15(ve a) +-.15 H(ll b).15 E(ut the trailing suf)-.2 E(\214x.)-.25 E F1(p)108 242.4 +Q F0(Print the ne)30.44 E 2.5(wc)-.25 G(ommand b)-2.5 E(ut do not e)-.2 +E -.15(xe)-.15 G(cute it.).15 E F1(q)108 254.4 Q F0 +(Quote the substituted w)30.44 E(ords, escaping further substitutions.) +-.1 E F1(x)108 266.4 Q F0(Quote the substituted w)31 E(ords as with)-.1 +E F1(q)2.5 E F0 2.5(,b)C(ut break into w)-2.7 E(ords at)-.1 E F1(blanks) +2.5 E F0(and ne)2.5 E(wlines.)-.25 E F1(s/)108 278.4 Q F2(old)A F1(/)A +F2(ne)A(w)-.15 E F1(/)A F0(Substitute)144 290.4 Q F2(ne)2.814 E(w)-.15 E +F0 .314(for the \214rst occurrence of)2.814 F F2(old)2.814 E F0 .314 +(in the e)2.814 F -.15(ve)-.25 G .314(nt line.).15 F(An)5.314 E 2.814 +(yd)-.15 G .314(elimiter can be used in place)-2.814 F .616(of /.)144 +302.4 R .617 +(The \214nal delimiter is optional if it is the last character of the e) +5.616 F -.15(ve)-.25 G .617(nt line.).15 F .617(The delimiter may)5.617 +F .75(be quoted in)144 314.4 R F2(old)3.25 E F0(and)3.25 E F2(ne)3.25 E +(w)-.15 E F0 .75(with a single backslash.)3.25 F .749(If & appears in) +5.75 F F2(ne)3.249 E(w)-.15 E F0 3.249(,i).31 G 3.249(ti)-3.249 G 3.249 +(sr)-3.249 G .749(eplaced by)-3.249 F F2(old)3.249 E F0 5.749(.A).77 G +.369(single backslash will quote the &.)144 326.4 R(If)5.369 E F2(old) +2.869 E F0 .37(is null, it is set to the last)2.869 F F2(old)2.87 E F0 +.37(substituted, or)2.87 F 2.87(,i)-.4 G 2.87(fn)-2.87 G 2.87(op)-2.87 G +(re)-2.87 E(vi-)-.25 E(ous history substitutions took place, the last) +144 338.4 Q F2(string)2.5 E F0(in a)2.5 E F1(!?)2.5 E F2(string)A F1 +([?])A F0(search.)5 E F1(&)108 350.4 Q F0(Repeat the pre)27.67 E +(vious substitution.)-.25 E F1(g)108 362.4 Q F0 .398 +(Cause changes to be applied o)31 F -.15(ve)-.15 G 2.898(rt).15 G .398 +(he entire e)-2.898 F -.15(ve)-.25 G .398(nt line.).15 F .397 +(This is used in conjunction with `)5.398 F F1(:s)A F0 2.897('\()C +(e.g.,)-2.897 E(`)144 374.4 Q F1(:gs/)A F2(old)A F1(/)A F2(ne)A(w)-.15 E +F1(/)A F0 1.218('\) or `)B F1(:&)A F0 3.718('. If)B 1.218(used with `) +3.718 F F1(:s)A F0 1.218(', an)B 3.718(yd)-.15 G 1.219 +(elimiter can be used in place of /, and the \214nal)-3.718 F +(delimiter is optional if it is the last character of the e)144 386.4 Q +-.15(ve)-.25 G(nt line.).15 E/F3 10.95/Times-Bold@0 SF(PR)72 403.2 Q +(OGRAMMING WITH HIST)-.329 E(OR)-.197 E 2.738(YF)-.383 G(UNCTIONS)-2.738 +E F0(This section describes ho)108 415.2 Q 2.5(wt)-.25 G 2.5(ou)-2.5 G +(se the History library in other programs.)-2.5 E F1(Intr)87 432 Q +(oduction to History)-.18 E F0 .797 +(The programmer using the History library has a)108 444 R -.25(va)-.2 G +.796(ilable functions for remembering lines on a history list,).25 F +.307(associating arbitrary data with a line, remo)108 456 R .308 +(ving lines from the list, searching through the list for a line con-) +-.15 F .303(taining an arbitrary te)108 468 R .303 +(xt string, and referencing an)-.15 F 2.803(yl)-.15 G .303 +(ine in the list directly)-2.803 F 5.303(.I)-.65 G 2.803(na)-5.303 G +.303(ddition, a history)-2.803 F F2 -.2(ex)2.802 G(pansion).2 E F0 +(function is a)108 480 Q -.25(va)-.2 G(ilable which pro).25 E +(vides for a consistent user interf)-.15 E(ace across dif)-.1 E +(ferent programs.)-.25 E .059(The user using programs written with the \ +History library has the bene\214t of a consistent user interf)108 496.8 +R .059(ace with a)-.1 F .918(set of well-kno)108 508.8 R .917 +(wn commands for manipulating the te)-.25 F .917(xt of pre)-.15 F .917 +(vious lines and using that te)-.25 F .917(xt in ne)-.15 F 3.417(wc)-.25 +G(om-)-3.417 E 4.183(mands. The)108 520.8 R 1.684(basic history manipul\ +ation commands are identical to the history substitution pro)4.183 F +1.684(vided by)-.15 F F1(bash)108 532.8 Q F0(.)A .904 +(If the programmer desires, he can use the Readline library)108 549.6 R +3.403(,w)-.65 G .903(hich includes some history manipulation by)-3.403 F +(def)108 561.6 Q(ault, and has the added adv)-.1 E +(antage of command line editing.)-.25 E .39(Before declaring an)108 +578.4 R 2.89(yf)-.15 G .39(unctions using an)-2.89 F 2.89(yf)-.15 G .39 +(unctionality the History library pro)-2.89 F .39 +(vides in other code, an appli-)-.15 F .067 +(cation writer should include the \214le)108 590.4 R F2( )-.55 E F0 .067(in an)4.233 F 2.566<798c>-.15 +G .066(le that uses the History library')-2.566 F 2.566(sf)-.55 G +(eatures.)-2.566 E .538(It supplies e)108 602.4 R .538 +(xtern declarations for all of the library')-.15 F 3.038(sp)-.55 G .538 +(ublic functions and v)-3.038 F .539(ariables, and declares all of the) +-.25 F(public data structures.)108 614.4 Q F1(History Storage)87 643.2 Q +F0(The history list is an array of history entries.)108 655.2 Q 2.5(Ah)5 +G(istory entry is declared as follo)-2.5 E(ws:)-.25 E F2(typedef void *) +108 672 Q F1(histdata_t;)2.5 E F0(typedef struct _hist_entry {)108 688.8 +Q(char *line;)113 700.8 Q(histdata_t data;)113 712.8 Q 2.5(}H)108 724.8 +S(IST_ENTR)-2.5 E -.92(Y;)-.65 G(GNU History 4.2)72 768 Q(2001 Mar 6) +141.51 E(2)205.67 E EP +%%Page: 3 3 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F +(OR)-.18 E(Y\(3\))-.65 E +(The history list itself might therefore be declared as)108 84 Q/F1 10 +/Times-Italic@0 SF(HIST_ENTR)108 100.8 Q 2.5(Y*)-.18 G(*)-2.5 E/F2 10 +/Times-Bold@0 SF(the_history_list;)2.5 E F0(The state of the History li\ +brary is encapsulated into a single structure:)108 117.6 Q(/*)108 134.4 +Q 2.5(*As)110.5 146.4 S +(tructure used to pass around the current state of the history)-2.5 E(.) +-.65 E(*/)110.5 158.4 Q(typedef struct _hist_state {)108 170.4 Q +(HIST_ENTR)113 182.4 Q 2.5(Y*)-.65 G +(*entries; /* Pointer to the entries themselv)-2.5 E(es. */)-.15 E +(int of)113 194.4 Q 25(fset; /*)-.25 F +(The location pointer within this array)2.5 E 2.5(.*)-.65 G(/)-2.5 E +(int length;)113 206.4 Q(/* Number of elements within this array)27.5 E +2.5(.*)-.65 G(/)-2.5 E(int size;)113 218.4 Q +(/* Number of slots allocated to this array)32.5 E 2.5(.*)-.65 G(/)-2.5 +E(int \215ags;)113 230.4 Q 2.5(}H)108 242.4 S(IST)-2.5 E(OR)-.18 E(Y_ST) +-.65 E -1.11(AT)-.93 G(E;)1.11 E(If the \215ags member includes)108 +259.2 Q F2(HS_STIFLED)2.5 E F0 2.5(,t)C(he history has been sti\215ed.) +-2.5 E/F3 10.95/Times-Bold@0 SF(History Functions)72 276 Q F0 +(This section describes the calling sequence for the v)108 288 Q +(arious functions e)-.25 E(xported by the GNU History library)-.15 E(.) +-.65 E F2(Initializing History and State Management)87 304.8 Q F0 1.274 +(This section describes functions used to initialize and manage the sta\ +te of the History library when you)108 316.8 R -.1(wa)108 328.8 S +(nt to use the history functions in your program.).1 E F1(void)108 352.8 +Q F2(using_history)2.5 E F0(\()4.166 E F1(void)A F0(\))1.666 E(Be)108 +364.8 Q(gin a session in which the history functions might be used.)-.15 +E(This initializes the interacti)5 E .3 -.15(ve v)-.25 H(ariables.)-.1 E +F1(HIST)108 388.8 Q(OR)-.18 E(Y_ST)-.18 E -.37(AT)-.5 G 2.5(E*).37 G F2 +(history_get_history_state)A F0(\()4.166 E F1(void)A F0(\))1.666 E +(Return a structure describing the current state of the input history) +108 400.8 Q(.)-.65 E F1(void)108 424.8 Q F2(history_set_history_state) +2.5 E F0(\()4.166 E F1(HIST)A(OR)-.18 E(Y_ST)-.18 E -.37(AT)-.5 G 2.5 +(E*).37 G(state)-2.5 E F0(\))1.666 E +(Set the state of the history list according to)108 436.8 Q F1(state)2.5 +E F0(.)A F2(History List Management)87 465.6 Q F0 +(These functions manage indi)108 477.6 Q(vidual entries on the history \ +list, or set parameters managing the list itself.)-.25 E F1(void)108 +501.6 Q F2(add_history)2.5 E F0(\()4.166 E F1(const c)A(har *string)-.15 +E F0(\))1.666 E(Place)108 513.6 Q F1(string)2.5 E F0 +(at the end of the history list.)2.5 E +(The associated data \214eld \(if an)5 E(y\) is set to)-.15 E F2(NULL) +2.5 E F0(.)A F1(HIST_ENTR)108 537.6 Q 2.5(Y*)-.18 G F2 -.18(re)C(mo).18 +E -.1(ve)-.1 G(_history).1 E F0(\()4.166 E F1(int whic)A(h)-.15 E F0(\)) +1.666 E(Remo)108 549.6 Q .352 -.15(ve h)-.15 H .052(istory entry at of) +.15 F(fset)-.25 E F1(whic)2.553 E(h)-.15 E F0 .053(from the history) +2.553 F 5.053(.T)-.65 G .053(he remo)-5.053 F -.15(ve)-.15 G 2.553(de) +.15 G .053(lement is returned so you can free the)-2.553 F +(line, data, and containing structure.)108 561.6 Q F1(HIST_ENTR)108 +585.6 Q 2.5(Y*)-.18 G F2 -.18(re)C(place_history_entry).18 E F0(\()4.166 +E F1(int whic)A -.834(h, const)-.15 F -.15(ch)2.5 G(ar *line).15 E 1.666 +(,h)-.1 G(istdata_t data)-1.666 E F0(\))3.332 E(Mak)108 597.6 Q 2.868 +(et)-.1 G .368(he history entry at of)-2.868 F(fset)-.25 E F1(whic)2.868 +E(h)-.15 E F0(ha)2.868 E -.15(ve)-.2 G F1(line)3.018 E F0(and)2.868 E F1 +(data)2.868 E F0 5.367(.T)C .367 +(his returns the old entry so you can dispose of)-5.367 F(the data.)108 +609.6 Q(In the case of an in)5 E -.25(va)-.4 G(lid).25 E F1(whic)2.5 E +(h)-.15 E F0 2.5(,a)C F2(NULL)A F0(pointer is returned.)2.5 E F1(void) +108 633.6 Q F2(clear_history)2.5 E F0(\()4.166 E F1(void)A F0(\))1.666 E +(Clear the history list by deleting all the entries.)108 645.6 Q F1 +(void)108 669.6 Q F2(sti\215e_history)2.5 E F0(\()4.166 E F1(int max)A +F0(\))1.666 E(Sti\215e the history list, remembering only the last)108 +681.6 Q F1(max)2.5 E F0(entries.)2.5 E F1(int)108 705.6 Q F2 +(unsti\215e_history)2.5 E F0(\()4.166 E F1(void)A F0(\))1.666 E .655 +(Stop sti\215ing the history)108 717.6 R 5.656(.T)-.65 G .656 +(his returns the pre)-5.656 F .656(vious amount the history w)-.25 F +.656(as sti\215ed.)-.1 F .656(The v)5.656 F .656(alue is positi)-.25 F +.956 -.15(ve i)-.25 H(f).15 E(the history w)108 729.6 Q +(as sti\215ed, ne)-.1 E -.05(ga)-.15 G(ti).05 E .3 -.15(ve i)-.25 H 2.5 +(fi).15 G 2.5(tw)-2.5 G(asn')-2.6 E(t.)-.18 E(GNU History 4.2)72 768 Q +(2001 Mar 6)141.51 E(3)205.67 E EP +%%Page: 4 4 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F +(OR)-.18 E(Y\(3\))-.65 E/F1 10/Times-Italic@0 SF(int)108 84 Q/F2 10 +/Times-Bold@0 SF(history_is_sti\215ed)2.5 E F0(\()4.166 E F1(void)A F0 +(\))1.666 E +(Returns non-zero if the history is sti\215ed, zero if it is not.)108 96 +Q F2(Inf)87 124.8 Q(ormation About the History List)-.25 E F0(These fun\ +ctions return information about the entire history list or indi)108 +136.8 Q(vidual list entries.)-.25 E F1(HIST_ENTR)108 160.8 Q 2.5(Y*)-.18 +G(*)-2.5 E F2(history_list)2.5 E F0(\()4.166 E F1(void)A F0(\))1.666 E +.708(Return a)108 172.8 R F2(NULL)3.208 E F0 .708(terminated array of) +3.208 F F1(HIST_ENTR)3.208 E 3.208(Y*)-.18 G F0 .708 +(which is the current input history)B 5.707(.E)-.65 G .707 +(lement 0 of this)-5.707 F(list is the be)108 184.8 Q(ginning of time.) +-.15 E(If there is no history)5 E 2.5(,r)-.65 G(eturn)-2.5 E F2(NULL)2.5 +E F0(.)A F1(int)108 208.8 Q F2(wher)2.5 E(e_history)-.18 E F0(\()4.166 E +F1(void)A F0(\))1.666 E(Returns the of)108 220.8 Q +(fset of the current history element.)-.25 E F1(HIST_ENTR)108 244.8 Q +2.5(Y*)-.18 G F2(curr)A(ent_history)-.18 E F0(\()4.166 E F1(void)A F0 +(\))1.666 E 1.373 +(Return the history entry at the current position, as determined by)108 +256.8 R F2(wher)3.873 E(e_history\(\))-.18 E F0 6.373(.I)C 3.873(ft) +-6.373 G 1.374(here is no entry)-3.873 F(there, return a)108 268.8 Q F2 +(NULL)2.5 E F0(pointer)2.5 E(.)-.55 E F1(HIST_ENTR)108 292.8 Q 2.5(Y*) +-.18 G F2(history_get)A F0(\()4.166 E F1(int of)A(fset)-.18 E F0(\)) +1.666 E .288(Return the history entry at position)108 304.8 R F1(of) +2.787 E(fset)-.18 E F0 2.787(,s)C .287(tarting from)-2.787 F F2 +(history_base)2.787 E F0 5.287(.I)C 2.787(ft)-5.287 G .287 +(here is no entry there, or if)-2.787 F F1(of)2.787 E(fset)-.18 E F0 +(is greater than the history length, return a)108 316.8 Q F2(NULL)2.5 E +F0(pointer)2.5 E(.)-.55 E F1(int)108 340.8 Q F2(history_total_bytes)2.5 +E F0(\()4.166 E F1(void)A F0(\))1.666 E .391 +(Return the number of bytes that the primary history entries are using.) +108 352.8 R .392(This function returns the sum of the)5.392 F +(lengths of all the lines in the history)108 364.8 Q(.)-.65 E F2(Mo)87 +393.6 Q(ving Ar)-.1 E(ound the History List)-.18 E F0 +(These functions allo)108 405.6 Q 2.5(wt)-.25 G(he current inde)-2.5 E +2.5(xi)-.15 G(nto the history list to be set or changed.)-2.5 E F1(int) +108 429.6 Q F2(history_set_pos)2.5 E F0(\()4.166 E F1(int pos)A F0(\)) +1.666 E .79(Set the current history of)108 441.6 R .79(fset to)-.25 F F1 +(pos)3.29 E F0 3.29(,a)C 3.29(na)-3.29 G .79(bsolute inde)-3.29 F 3.29 +(xi)-.15 G .79(nto the list.)-3.29 F .79(Returns 1 on success, 0 if)5.79 +F F1(pos)3.29 E F0 .79(is less)3.29 F +(than zero or greater than the number of history entries.)108 453.6 Q F1 +(HIST_ENTR)108 477.6 Q 2.5(Y*)-.18 G F2(pr)A -.15(ev)-.18 G +(ious_history).15 E F0(\()4.166 E F1(void)A F0(\))1.666 E .207 +(Back up the current history of)108 489.6 R .207(fset to the pre)-.25 F +.207(vious history entry)-.25 F 2.708(,a)-.65 G .208 +(nd return a pointer to that entry)-2.708 F 5.208(.I)-.65 G 2.708(ft) +-5.208 G .208(here is)-2.708 F(no pre)108 501.6 Q(vious entry)-.25 E 2.5 +(,r)-.65 G(eturn a)-2.5 E F2(NULL)2.5 E F0(pointer)2.5 E(.)-.55 E F1 +(HIST_ENTR)108 525.6 Q 2.5(Y*)-.18 G F2(next_history)A F0(\()4.166 E F1 +(void)A F0(\))1.666 E(Mo)108 537.6 Q 1.047 -.15(ve t)-.15 H .747 +(he current history of).15 F .747(fset forw)-.25 F .746(ard to the ne) +-.1 F .746(xt history entry)-.15 F 3.246(,a)-.65 G .746 +(nd return the a pointer to that entry)-3.246 F 5.746(.I)-.65 G(f)-5.746 +E(there is no ne)108 549.6 Q(xt entry)-.15 E 2.5(,r)-.65 G(eturn a)-2.5 +E F2(NULL)2.5 E F0(pointer)2.5 E(.)-.55 E F2(Sear)87 578.4 Q +(ching the History List)-.18 E F0 .005(These functions allo)108 590.4 R +2.505(ws)-.25 G .006(earching of the history list for entries containin\ +g a speci\214c string.)-2.505 F .006(Searching may be)5.006 F 1.452 +(performed both forw)108 602.4 R 1.452(ard and backw)-.1 F 1.451 +(ard from the current history position.)-.1 F 1.451(The search may be) +6.451 F F1(anc)3.951 E(hor)-.15 E(ed)-.37 E F0(,)A +(meaning that the string must match at the be)108 614.4 Q +(ginning of the history entry)-.15 E(.)-.65 E F1(int)108 638.4 Q F2 +(history_sear)2.5 E(ch)-.18 E F0(\()4.166 E F1(const c)A(har *string) +-.15 E 1.666(,i)-.1 G(nt dir)-1.666 E(ection)-.37 E F0(\))1.666 E .155 +(Search the history for)108 650.4 R F1(string)2.655 E F0 2.656(,s)C .156 +(tarting at the current history of)-2.656 F 2.656(fset. If)-.25 F F1 +(dir)2.656 E(ection)-.37 E F0 .156(is less than 0, then the search)2.656 +F .802(is through pre)108 662.4 R .802 +(vious entries, otherwise through subsequent entries.)-.25 F(If)5.801 E +F1(string)3.301 E F0 .801(is found, then the current his-)3.301 F .064 +(tory inde)108 674.4 R 2.564(xi)-.15 G 2.564(ss)-2.564 G .064 +(et to that history entry)-2.564 F 2.564(,a)-.65 G .064(nd the v)-2.564 +F .064(alue returned is the of)-.25 F .064 +(fset in the line of the entry where)-.25 F F1(string)2.565 E F0 -.1(wa) +108 686.4 S 2.5(sf).1 G 2.5(ound. Otherwise,)-2.5 F +(nothing is changed, and a -1 is returned.)2.5 E F1(int)108 710.4 Q F2 +(history_sear)2.5 E(ch_pr)-.18 E(e\214x)-.18 E F0(\()4.166 E F1(const c) +A(har *string)-.15 E 1.666(,i)-.1 G(nt dir)-1.666 E(ection)-.37 E F0(\)) +1.666 E .684(Search the history for)108 722.4 R F1(string)3.183 E F0 +3.183(,s)C .683(tarting at the current history of)-3.183 F 3.183 +(fset. The)-.25 F .683(search is anchored: matching lines)3.183 F +(GNU History 4.2)72 768 Q(2001 Mar 6)141.51 E(4)205.67 E EP +%%Page: 5 5 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F +(OR)-.18 E(Y\(3\))-.65 E 1.063(must be)108 84 R 1.063(gin with)-.15 F/F1 +10/Times-Italic@0 SF(string)3.563 E F0 6.063(.I)C(f)-6.063 E F1(dir) +3.563 E(ection)-.37 E F0 1.064 +(is less than 0, then the search is through pre)3.563 F 1.064 +(vious entries, otherwise)-.25 F 1.115(through subsequent entries.)108 +96 R(If)6.115 E F1(string)3.615 E F0 1.115 +(is found, then the current history inde)3.615 F 3.614(xi)-.15 G 3.614 +(ss)-3.614 G 1.114(et to that entry)-3.614 F 3.614(,a)-.65 G 1.114 +(nd the)-3.614 F(return v)108 108 Q(alue is 0.)-.25 E +(Otherwise, nothing is changed, and a -1 is returned.)5 E F1(int)108 132 +Q/F2 10/Times-Bold@0 SF(history_sear)2.5 E(ch_pos)-.18 E F0(\()4.166 E +F1(const c)A(har *string)-.15 E 1.666(,i)-.1 G(nt dir)-1.666 E -.834 +(ection, int)-.37 F(pos)2.5 E F0(\))3.332 E .603(Search for)108 144 R F1 +(string)3.103 E F0 .603(in the history list, starting at)3.103 F F1(pos) +3.104 E F0 3.104(,a)C 3.104(na)-3.104 G .604(bsolute inde)-3.104 F 3.104 +(xi)-.15 G .604(nto the list.)-3.104 F(If)5.604 E F1(dir)3.104 E(ection) +-.37 E F0 .604(is ne)3.104 F -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G(,) +.15 E .608(the search proceeds backw)108 156 R .608(ard from)-.1 F F1 +(pos)3.108 E F0 3.108(,o)C .608(therwise forw)-3.108 F 3.108 +(ard. Returns)-.1 F .608(the absolute inde)3.108 F 3.108(xo)-.15 G 3.108 +(ft)-3.108 G .608(he history ele-)-3.108 F(ment where)108 168 Q F1 +(string)2.5 E F0 -.1(wa)2.5 G 2.5(sf).1 G(ound, or -1 otherwise.)-2.5 E +F2(Managing the History File)87 196.8 Q F0 .035(The History library can\ + read the history from and write it to a \214le.)108 208.8 R .036 +(This section documents the functions for)5.035 F +(managing a history \214le.)108 220.8 Q F1(int)108 244.8 Q F2 -.18(re) +2.5 G(ad_history).18 E F0(\()4.166 E F1(const c)A(har *\214lename)-.15 E +F0(\))1.666 E .151(Add the contents of)108 256.8 R F1(\214lename)2.651 E +F0 .151(to the history list, a line at a time.)2.651 F(If)5.15 E F1 +(\214lename)2.65 E F0(is)2.65 E F2(NULL)2.65 E F0 2.65(,t)C .15 +(hen read from)-2.65 F F1(~/.his-)2.65 E(tory)108 268.8 Q F0 5(.R)C +(eturns 0 if successful, or)-5 E F2(err)2.5 E(no)-.15 E F0(if not.)2.5 E +F1(int)108 292.8 Q F2 -.18(re)2.5 G(ad_history_range).18 E F0(\()4.166 E +F1(const c)A(har *\214lename)-.15 E 1.666(,i)-.1 G(nt fr)-1.666 E -.834 +(om, int)-.45 F(to)2.5 E F0(\))3.332 E .052(Read a range of lines from) +108 304.8 R F1(\214lename)2.553 E F0 2.553(,a)C .053 +(dding them to the history list.)-2.553 F .053(Start reading at line) +5.053 F F1(fr)2.553 E(om)-.45 E F0 .053(and end at)2.553 F F1(to)2.553 E +F0(.)A(If)108 316.8 Q F1(fr)2.889 E(om)-.45 E F0 .389 +(is zero, start at the be)2.889 F 2.889(ginning. If)-.15 F F1(to)2.889 E +F0 .389(is less than)2.889 F F1(fr)2.889 E(om)-.45 E F0 2.889(,t)C .388 +(hen read until the end of the \214le.)-2.889 F(If)5.388 E F1 +(\214lename)2.888 E F0(is)108 328.8 Q F2(NULL)2.5 E F0 2.5(,t)C +(hen read from)-2.5 E F1(~/.history)2.5 E F0 5(.R)C +(eturns 0 if successful, or)-5 E F2(err)2.5 E(no)-.15 E F0(if not.)2.5 E +F1(int)108 352.8 Q F2(write_history)2.5 E F0(\()4.166 E F1(const c)A +(har *\214lename)-.15 E F0(\))1.666 E .961(Write the current history to) +108 364.8 R F1(\214lename)3.461 E F0 3.461(,o)C -.15(ve)-3.611 G +(rwriting).15 E F1(\214lename)3.461 E F0 .961(if necessary)3.461 F 5.961 +(.I)-.65 G(f)-5.961 E F1(\214lename)3.462 E F0(is)3.462 E F2(NULL)3.462 +E F0 3.462(,t)C .962(hen write)-3.462 F(the history list to)108 376.8 Q +F1(~/.history)2.5 E F0 5(.R)C(eturns 0 on success, or)-5 E F2(err)2.5 E +(no)-.15 E F0(on a read or write error)2.5 E(.)-.55 E F1(int)108 412.8 Q +F2(append_history)2.5 E F0(\()4.166 E F1(int nelements,)A(const c)1.666 +E(har *\214lename)-.15 E F0(\))1.666 E .839(Append the last)108 424.8 R +F1(nelements)3.339 E F0 .839(of the history list to)3.339 F F1 +(\214lename)3.339 E F0 5.839(.I)C(f)-5.839 E F1(\214lename)3.339 E F0 +(is)3.339 E F2(NULL)3.339 E F0 3.339(,t)C .838(hen append to)-3.339 F F1 +(~/.history)3.338 E F0(.)A(Returns 0 on success, or)108 436.8 Q F2(err) +2.5 E(no)-.15 E F0(on a read or write error)2.5 E(.)-.55 E F1(int)108 +460.8 Q F2(history_truncate_\214le)2.5 E F0(\()4.166 E F1(const c)A +(har *\214lename)-.15 E 1.666(,i)-.1 G(nt nlines)-1.666 E F0(\))1.666 E +-.35(Tr)108 472.8 S .38(uncate the history \214le).35 F F1(\214lename) +2.88 E F0 2.88(,l)C(ea)-2.88 E .38(ving only the last)-.2 F F1(nlines) +2.881 E F0 2.881(lines. If)2.881 F F1(\214lename)2.881 E F0(is)2.881 E +F2(NULL)2.881 E F0 2.881(,t)C(hen)-2.881 E F1(~/.history)2.881 E F0(is) +2.881 E 2.5(truncated. Returns)108 484.8 R 2.5(0o)2.5 G 2.5(ns)-2.5 G +(uccess, or)-2.5 E F2(err)2.5 E(no)-.15 E F0(on f)2.5 E(ailure.)-.1 E F2 +(History Expansion)87 513.6 Q F0(These functions implement history e)108 +525.6 Q(xpansion.)-.15 E F1(int)108 549.6 Q F2(history_expand)2.5 E F0 +(\()4.166 E F1 -.15(ch)C(ar *string).15 E 1.666(,c)-.1 G(har **output) +-1.816 E F0(\))1.666 E(Expand)108 561.6 Q F1(string)2.5 E F0 2.5(,p)C +(lacing the result into)-2.5 E F1(output)2.5 E F0 2.5(,ap)C +(ointer to a string.)-2.5 E(Returns:)5 E 31(0I)144 573.6 S 3.066(fn)-31 +G 3.066(oe)-3.066 G .566(xpansions took place \(or)-3.216 F 3.065(,i)-.4 +G 3.065(ft)-3.065 G .565(he only change in the te)-3.065 F .565(xt w) +-.15 F .565(as the remo)-.1 F -.25(va)-.15 G 3.065(lo).25 G 3.065(fe) +-3.065 G(scape)-3.065 E(characters preceding the history e)180 585.6 Q +(xpansion character\);)-.15 E 31(1i)144 597.6 S 2.5(fe)-31 G +(xpansions did tak)-2.65 E 2.5(ep)-.1 G(lace;)-2.5 E 25.17(-1 if)144 +609.6 R(there w)2.5 E(as an error in e)-.1 E(xpansion;)-.15 E 31(2i)144 +621.6 S 2.5(ft)-31 G(he returned line should be displayed, b)-2.5 E +(ut not e)-.2 E -.15(xe)-.15 G(cuted, as with the).15 E F2(:p)2.5 E F0 +(modi\214er)2.5 E(.)-.55 E(If an error ocurred in e)108 633.6 Q +(xpansion, then)-.15 E F1(output)2.5 E F0(contains a descripti)2.5 E .3 +-.15(ve e)-.25 H(rror message.).15 E F1 -.15(ch)108 657.6 S(ar *).15 E +F2(get_history_e)2.5 E -.1(ve)-.15 G(nt).1 E F0(\()4.166 E F1(const c)A +(har *string)-.15 E 1.666(,i)-.1 G(nt *cinde)-1.666 E -.834(x, int)-.2 F +(qc)2.5 E(har)-.15 E F0(\))3.332 E .262(Returns the te)108 669.6 R .262 +(xt of the history e)-.15 F -.15(ve)-.25 G .262(nt be).15 F .263 +(ginning at)-.15 F F1(string)2.763 E F0(+)2.763 E F1(*cinde)2.763 E(x) +-.2 E F0(.)A F1(*cinde)5.263 E(x)-.2 E F0 .263 +(is modi\214ed to point to after the)2.763 F -2.15 -.25(ev e)108 681.6 T +.71(nt speci\214er).25 F 5.71(.A)-.55 G 3.21(tf)-5.71 G .71 +(unction entry)-3.21 F(,)-.65 E F1(cinde)3.21 E(x)-.2 E F0 .709 +(points to the inde)3.21 F 3.209(xi)-.15 G(nto)-3.209 E F1(string)3.209 +E F0 .709(where the history e)3.209 F -.15(ve)-.25 G .709 +(nt speci\214ca-).15 F .527(tion be)108 693.6 R(gins.)-.15 E F1(qc)5.527 +E(har)-.15 E F0 .527(is a character that is allo)3.027 F .527 +(wed to end the e)-.25 F -.15(ve)-.25 G .528 +(nt speci\214cation in addition to the `).15 F(`normal')-.74 E(')-.74 E +(terminating characters.)108 705.6 Q F1 -.15(ch)108 729.6 S(ar **).15 E +F2(history_tok)2.5 E(enize)-.1 E F0(\()4.166 E F1(const c)A(har *string) +-.15 E F0(\))1.666 E(GNU History 4.2)72 768 Q(2001 Mar 6)141.51 E(5) +205.67 E EP +%%Page: 6 6 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F +(OR)-.18 E(Y\(3\))-.65 E .239(Return an array of tok)108 84 R .239 +(ens parsed out of)-.1 F/F1 10/Times-Italic@0 SF(string)2.739 E F0 2.739 +(,m)C .238(uch as the shell might.)-2.739 F .238(The tok)5.238 F .238 +(ens are split on the charac-)-.1 F(ters in the)108 96 Q/F2 10 +/Times-Bold@0 SF(history_w)2.5 E(ord_delimiters)-.1 E F0 -.25(va)2.5 G +(riable, and shell quoting con).25 E -.15(ve)-.4 G(ntions are obe).15 E +(yed.)-.15 E F1 -.15(ch)108 120 S(ar *).15 E F2(history_ar)2.5 E +(g_extract)-.1 E F0(\()4.166 E F1(int \214r)A -.834(st, int)-.1 F -.834 +(last, const)2.5 F -.15(ch)2.5 G(ar *string).15 E F0(\))3.332 E .025 +(Extract a string se)108 132 R .025(gment consisting of the)-.15 F F1 +<8c72>2.526 E(st)-.1 E F0(through)2.526 E F1(last)2.526 E F0(ar)2.526 E +.026(guments present in)-.18 F F1(string)2.526 E F0 5.026(.A)C -.18(rg) +-5.026 G .026(uments are split).18 F(using)108 144 Q F2(history_tok)2.5 +E(enize\(\))-.1 E F0(.)A F2(History V)87 172.8 Q(ariables)-.92 E F0 +(This section describes the e)108 184.8 Q(xternally-visible v)-.15 E +(ariables e)-.25 E(xported by the GNU History Library)-.15 E(.)-.65 E F1 +(int)108 208.8 Q F2(history_base)2.5 E F0(The logical of)108 220.8 Q +(fset of the \214rst entry in the history list.)-.25 E F1(int)108 244.8 +Q F2(history_length)2.5 E F0 +(The number of entries currently stored in the history list.)108 256.8 Q +F1(int)108 280.8 Q F2(history_max_entries)2.5 E F0 +(The maximum number of history entries.)108 292.8 Q +(This must be changed using)5 E F2(sti\215e_history\(\))2.5 E F0(.)A F1 +-.15(ch)108 316.8 S(ar).15 E F2(history_expansion_char)2.5 E F0 +(The character that introduces a history e)108 328.8 Q -.15(ve)-.25 G +2.5(nt. The).15 F(def)2.5 E(ault is)-.1 E F2(!)2.5 E F0 5(.S)C +(etting this to 0 inhibits history e)-5 E(xpansion.)-.15 E F1 -.15(ch) +108 352.8 S(ar).15 E F2(history_subst_char)2.5 E F0 +(The character that in)108 364.8 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(sw).1 G +(ord substitution if found at the start of a line.)-2.6 E(The def)5 E +(ault is)-.1 E F2(^)2.5 E F0(.)A F1 -.15(ch)108 388.8 S(ar).15 E F2 +(history_comment_char)2.5 E F0 .117(During tok)108 400.8 R .117 +(enization, if this character is seen as the \214rst character of a w) +-.1 F .117(ord, then it and all subsequent char)-.1 F(-)-.2 E .276 +(acters up to a ne)108 412.8 R .276 +(wline are ignored, suppressing history e)-.25 F .276 +(xpansion for the remainder of the line.)-.15 F .277(This is dis-)5.276 +F(abled by def)108 424.8 Q(ault.)-.1 E F1 -.15(ch)108 448.8 S(ar *).15 E +F2(history_w)2.5 E(ord_delimiters)-.1 E F0 +(The characters that separate tok)108 460.8 Q(ens for)-.1 E F2 +(history_tok)2.5 E(enize\(\))-.1 E F0 5(.T)C(he def)-5 E(ault v)-.1 E +(alue is)-.25 E F2 2.5("\\)2.5 G(t\\n\(\)<>;&|")-2.5 E F0(.)A F1 -.15 +(ch)108 484.8 S(ar *).15 E F2(history_no_expand_chars)2.5 E F0 2.054 +(The list of characters which inhibit history e)108 496.8 R 2.054 +(xpansion if found immediately follo)-.15 F(wing)-.25 E F2 +(history_expan-)4.554 E(sion_char)108 508.8 Q F0 5(.T)C(he def)-5 E +(ault is space, tab, ne)-.1 E(wline,)-.25 E F2(\\r)2.5 E F0 2.5(,a)C(nd) +-2.5 E F2(=)2.5 E F0(.)A F1 -.15(ch)108 532.8 S(ar *).15 E F2 +(history_sear)2.5 E(ch_delimiter_chars)-.18 E F0 .401(The list of addit\ +ional characters which can delimit a history search string, in addition\ + to space, tab,)108 544.8 R F1(:)2.901 E F0(and)2.901 E F1(?)2.902 E F0 +(in the case of a substring search.)108 556.8 Q(The def)5 E +(ault is empty)-.1 E(.)-.65 E F1(int)108 580.8 Q F2 +(history_quotes_inhibit_expansion)2.5 E F0 .625 +(If non-zero, single-quoted w)108 592.8 R .625 +(ords are not scanned for the history e)-.1 F .624(xpansion character) +-.15 F 5.624(.T)-.55 G .624(he def)-5.624 F .624(ault v)-.1 F .624 +(alue is)-.25 F(0.)108 604.8 Q F1(rl_lineb)108 628.8 Q(uf_func_t *)-.2 E +F2(history_inhibit_expansion_function)2.5 E F0 .347 +(This should be set to the address of a function that tak)108 640.8 R +.348(es tw)-.1 F 2.848(oa)-.1 G -.18(rg)-2.848 G .348(uments: a).18 F F2 +.348(char *)2.848 F F0(\()2.848 E F1(string)A F0 2.848(\)a)C .348(nd an) +-2.848 F F2(int)2.848 E F0(inde)2.848 E(x)-.15 E .228 +(into that string \()108 652.8 R F1(i)A F0 2.728(\). It)B .227 +(should return a non-zero v)2.727 F .227(alue if the history e)-.25 F +.227(xpansion starting at)-.15 F F1(string[i])2.727 E F0 .227 +(should not)2.727 F .019(be performed; zero if the e)108 664.8 R .019 +(xpansion should be done.)-.15 F .019 +(It is intended for use by applications lik)5.019 F(e)-.1 E F2(bash) +2.519 E F0 .019(that use)2.519 F(the history e)108 676.8 Q +(xpansion character for additional purposes.)-.15 E(By def)5 E +(ault, this v)-.1 E(ariable is set to)-.25 E F2(NULL)2.5 E F0(.)A/F3 +10.95/Times-Bold@0 SF(FILES)72 693.6 Q F1(~/.history)109.666 705.6 Q F0 +(Def)144 717.6 Q(ault \214lename for reading and writing sa)-.1 E -.15 +(ve)-.2 G 2.5(dh).15 G(istory)-2.5 E(GNU History 4.2)72 768 Q +(2001 Mar 6)141.51 E(6)205.67 E EP +%%Page: 7 7 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F +(OR)-.18 E(Y\(3\))-.65 E/F1 10.95/Times-Bold@0 SF(SEE ALSO)72 84 Q/F2 10 +/Times-Italic@0 SF(The Gnu Readline Libr)108 96 Q(ary)-.15 E F0 2.5(,B)C +(rian F)-2.5 E(ox and Chet Rame)-.15 E(y)-.15 E F2(The Gnu History Libr) +108 108 Q(ary)-.15 E F0 2.5(,B)C(rian F)-2.5 E(ox and Chet Rame)-.15 E +(y)-.15 E F2(bash)108 120 Q F0(\(1\))A F2 -.37(re)108 132 S(adline).37 E +F0(\(3\))A F1 -.548(AU)72 148.8 S(THORS).548 E F0(Brian F)108 160.8 Q +(ox, Free Softw)-.15 E(are F)-.1 E(oundation)-.15 E(bfox@gnu.or)108 +172.8 Q(g)-.18 E(Chet Rame)108 189.6 Q 1.3 -.65(y, C)-.15 H(ase W).65 E +(estern Reserv)-.8 E 2.5(eU)-.15 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E +(chet@ins.CWR)108 201.6 Q(U.Edu)-.4 E F1 -.11(BU)72 218.4 S 2.738(GR).11 +G(EPOR)-2.738 E(TS)-.438 E F0 .16(If you \214nd a b)108 230.4 R .16 +(ug in the)-.2 F/F3 10/Times-Bold@0 SF(history)2.66 E F0(library)2.66 E +2.66(,y)-.65 G .16(ou should report it.)-2.66 F .16 +(But \214rst, you should mak)5.16 F 2.66(es)-.1 G .16 +(ure that it really is)-2.66 F 2.5(ab)108 242.4 S +(ug, and that it appears in the latest v)-2.7 E(ersion of the)-.15 E F3 +(history)2.5 E F0(library that you ha)2.5 E -.15(ve)-.2 G(.).15 E .704 +(Once you ha)108 259.2 R 1.004 -.15(ve d)-.2 H .704(etermined that a b) +.15 F .704(ug actually e)-.2 F .704(xists, mail a b)-.15 F .705 +(ug report to)-.2 F F2 -.2(bu)3.205 G(g\255r).2 E(eadline)-.37 E F0(@)A +F2(gnu.or)A(g)-.37 E F0 5.705(.I)C 3.205(fy)-5.705 G(ou)-3.205 E(ha)108 +271.2 Q 1.81 -.15(ve a \214)-.2 H 1.51 +(x, you are welcome to mail that as well!).15 F 1.509 +(Suggestions and `philosophical' b)6.509 F 1.509(ug reports may be)-.2 F +(mailed to)108 283.2 Q F2 -.2(bu)2.5 G(g-r).2 E(eadline)-.37 E F0(@)A F2 +(gnu.or)A(g)-.37 E F0(or posted to the Usenet ne)2.5 E(wsgroup)-.25 E F3 +(gnu.bash.b)2.5 E(ug)-.2 E F0(.)A(Comments and b)108 300 Q +(ug reports concerning this manual page should be directed to)-.2 E F2 +-.15(ch)2.5 G(et@ins.CWR).15 E -.25(U.)-.4 G(Edu).25 E F0(.).25 E +(GNU History 4.2)72 768 Q(2001 Mar 6)141.51 E(7)205.67 E EP +%%Trailer +end +%%EOF diff --git a/doc/hstech.texinfo b/doc/hstech.texinfo index 12fff2c..e4ac50c 100644 --- a/doc/hstech.texinfo +++ b/doc/hstech.texinfo @@ -1,7 +1,7 @@ @ignore This file documents the user interface to the GNU History library. -Copyright (C) 1988, 1991, 1994, 1996 Free Software Foundation, Inc. +Copyright (C) 1988-2001 Free Software Foundation, Inc. Authored by Brian Fox and Chet Ramey. Permission is granted to make and distribute verbatim copies of this manual @@ -27,9 +27,9 @@ into another language, under the above conditions for modified versions. @chapter Programming with GNU History This chapter describes how to interface programs that you write -with the GNU History Library. +with the @sc{gnu} History Library. It should be considered a technical guide. -For information on the interactive use of GNU History, @pxref{Using +For information on the interactive use of @sc{gnu} History, @pxref{Using History Interactively}. @menu @@ -43,10 +43,10 @@ History Interactively}. @node Introduction to History @section Introduction to History -Many programs read input from the user a line at a time. The GNU History -library is able to keep track of those lines, associate arbitrary data with -each line, and utilize information from previous lines in composing new -ones. +Many programs read input from the user a line at a time. The @sc{gnu} +History library is able to keep track of those lines, associate arbitrary +data with each line, and utilize information from previous lines in +composing new ones. The programmer using the History library has available functions for remembering lines on a history list, associating arbitrary data @@ -80,9 +80,11 @@ The history list is an array of history entries. A history entry is declared as follows: @example +typedef void *histdata_t; + typedef struct _hist_entry @{ char *line; - char *data; + histdata_t data; @} HIST_ENTRY; @end example @@ -95,12 +97,14 @@ HIST_ENTRY **the_history_list; The state of the History library is encapsulated into a single structure: @example -/* A structure used to pass the current state of the history stuff around. */ +/* + * A structure used to pass around the current state of the history. + */ typedef struct _hist_state @{ - HIST_ENTRY **entries; /* Pointer to the entries themselves. */ - int offset; /* The location pointer within this array. */ - int length; /* Number of elements within this array. */ - int size; /* Number of slots allocated to this array. */ + HIST_ENTRY **entries; /* Pointer to the entries themselves. */ + int offset; /* The location pointer within this array. */ + int length; /* Number of elements within this array. */ + int size; /* Number of slots allocated to this array. */ int flags; @} HISTORY_STATE; @end example @@ -112,7 +116,7 @@ stifled. @section History Functions This section describes the calling sequence for the various functions -present in GNU History. +exported by the @sc{gnu} History library. @menu * Initializing History and State Management:: Functions to call when you @@ -139,12 +143,12 @@ This section describes functions used to initialize and manage the state of the History library when you want to use the history functions in your program. -@deftypefun void using_history () +@deftypefun void using_history (void) Begin a session in which the history functions might be used. This initializes the interactive variables. @end deftypefun -@deftypefun {HISTORY_STATE *} history_get_history_state () +@deftypefun {HISTORY_STATE *} history_get_history_state (void) Return a structure describing the current state of the input history. @end deftypefun @@ -158,7 +162,7 @@ Set the state of the history list according to @var{state}. These functions manage individual entries on the history list, or set parameters managing the list itself. -@deftypefun void add_history (char *string) +@deftypefun void add_history (const char *string) Place @var{string} at the end of the history list. The associated data field (if any) is set to @code{NULL}. @end deftypefun @@ -169,13 +173,13 @@ removed element is returned so you can free the line, data, and containing structure. @end deftypefun -@deftypefun {HIST_ENTRY *} replace_history_entry (int which, char *line, char *data) +@deftypefun {HIST_ENTRY *} replace_history_entry (int which, const char *line, histdata_t data) Make the history entry at offset @var{which} have @var{line} and @var{data}. This returns the old entry so you can dispose of the data. In the case of an invalid @var{which}, a @code{NULL} pointer is returned. @end deftypefun -@deftypefun void clear_history () +@deftypefun void clear_history (void) Clear the history list by deleting all the entries. @end deftypefun @@ -183,13 +187,13 @@ Clear the history list by deleting all the entries. Stifle the history list, remembering only the last @var{max} entries. @end deftypefun -@deftypefun int unstifle_history () +@deftypefun int unstifle_history (void) Stop stifling the history. This returns the previous amount the history was stifled. The value is positive if the history was stifled, negative if it wasn't. @end deftypefun -@deftypefun int history_is_stifled () +@deftypefun int history_is_stifled (void) Returns non-zero if the history is stifled, zero if it is not. @end deftypefun @@ -199,29 +203,30 @@ Returns non-zero if the history is stifled, zero if it is not. These functions return information about the entire history list or individual list entries. -@deftypefun {HIST_ENTRY **} history_list () -Return a @code{NULL} terminated array of @code{HIST_ENTRY} which is the +@deftypefun {HIST_ENTRY **} history_list (void) +Return a @code{NULL} terminated array of @code{HIST_ENTRY *} which is the current input history. Element 0 of this list is the beginning of time. If there is no history, return @code{NULL}. @end deftypefun -@deftypefun int where_history () +@deftypefun int where_history (void) Returns the offset of the current history element. @end deftypefun -@deftypefun {HIST_ENTRY *} current_history () +@deftypefun {HIST_ENTRY *} current_history (void) Return the history entry at the current position, as determined by -@code{where_history ()}. If there is no entry there, return a @code{NULL} +@code{where_history()}. If there is no entry there, return a @code{NULL} pointer. @end deftypefun @deftypefun {HIST_ENTRY *} history_get (int offset) Return the history entry at position @var{offset}, starting from -@code{history_base}. If there is no entry there, or if @var{offset} +@code{history_base} (@pxref{History Variables}). +If there is no entry there, or if @var{offset} is greater than the history length, return a @code{NULL} pointer. @end deftypefun -@deftypefun int history_total_bytes () +@deftypefun int history_total_bytes (void) Return the number of bytes that the primary history entries are using. This function returns the sum of the lengths of all the lines in the history. @@ -234,17 +239,19 @@ These functions allow the current index into the history list to be set or changed. @deftypefun int history_set_pos (int pos) -Set the position in the history list to @var{pos}, an absolute index +Set the current history offset to @var{pos}, an absolute index into the list. +Returns 1 on success, 0 if @var{pos} is less than zero or greater +than the number of history entries. @end deftypefun -@deftypefun {HIST_ENTRY *} previous_history () +@deftypefun {HIST_ENTRY *} previous_history (void) Back up the current history offset to the previous history entry, and return a pointer to that entry. If there is no previous entry, return a @code{NULL} pointer. @end deftypefun -@deftypefun {HIST_ENTRY *} next_history () +@deftypefun {HIST_ENTRY *} next_history (void) Move the current history offset forward to the next history entry, and return the a pointer to that entry. If there is no next entry, return a @code{NULL} pointer. @@ -260,26 +267,28 @@ from the current history position. The search may be @dfn{anchored}, meaning that the string must match at the beginning of the history entry. @cindex anchored search -@deftypefun int history_search (char *string, int direction) -Search the history for @var{string}, starting at the current history -offset. If @var{direction} < 0, then the search is through previous entries, -else through subsequent. If @var{string} is found, then +@deftypefun int history_search (const char *string, int direction) +Search the history for @var{string}, starting at the current history offset. +If @var{direction} is less than 0, then the search is through +previous entries, otherwise through subsequent entries. +If @var{string} is found, then the current history index is set to that history entry, and the value returned is the offset in the line of the entry where @var{string} was found. Otherwise, nothing is changed, and a -1 is returned. @end deftypefun -@deftypefun int history_search_prefix (char *string, int direction) +@deftypefun int history_search_prefix (const char *string, int direction) Search the history for @var{string}, starting at the current history offset. The search is anchored: matching lines must begin with -@var{string}. If @var{direction} < 0, then the search is through previous -entries, else through subsequent. If @var{string} is found, then the +@var{string}. If @var{direction} is less than 0, then the search is +through previous entries, otherwise through subsequent entries. +If @var{string} is found, then the current history index is set to that entry, and the return value is 0. Otherwise, nothing is changed, and a -1 is returned. @end deftypefun -@deftypefun int history_search_pos (char *string, int direction, int pos) +@deftypefun int history_search_pos (const char *string, int direction, int pos) Search for @var{string} in the history list, starting at @var{pos}, an absolute index into the list. If @var{direction} is negative, the search proceeds backward from @var{pos}, otherwise forward. Returns the absolute @@ -292,41 +301,46 @@ index of the history element where @var{string} was found, or -1 otherwise. The History library can read the history from and write it to a file. This section documents the functions for managing a history file. -@deftypefun int read_history (char *filename) -Add the contents of @var{filename} to the history list, a line at a -time. If @var{filename} is @code{NULL}, then read from -@file{~/.history}. Returns 0 if successful, or errno if not. +@deftypefun int read_history (const char *filename) +Add the contents of @var{filename} to the history list, a line at a time. +If @var{filename} is @code{NULL}, then read from @file{~/.history}. +Returns 0 if successful, or @code{errno} if not. @end deftypefun -@deftypefun int read_history_range (char *filename, int from, int to) +@deftypefun int read_history_range (const char *filename, int from, int to) Read a range of lines from @var{filename}, adding them to the history list. -Start reading at line @var{from} and end at @var{to}. If -@var{from} is zero, start at the beginning. If @var{to} is less than +Start reading at line @var{from} and end at @var{to}. +If @var{from} is zero, start at the beginning. If @var{to} is less than @var{from}, then read until the end of the file. If @var{filename} is @code{NULL}, then read from @file{~/.history}. Returns 0 if successful, or @code{errno} if not. @end deftypefun -@deftypefun int write_history (char *filename) +@deftypefun int write_history (const char *filename) Write the current history to @var{filename}, overwriting @var{filename} -if necessary. If @var{filename} is -@code{NULL}, then write the history list to @file{~/.history}. Values -returned are as in @code{read_history ()}. +if necessary. +If @var{filename} is @code{NULL}, then write the history list to +@file{~/.history}. +Returns 0 on success, or @code{errno} on a read or write error. @end deftypefun -@deftypefun int append_history (int nelements, char *filename) +@deftypefun int append_history (int nelements, const char *filename) Append the last @var{nelements} of the history list to @var{filename}. +If @var{filename} is @code{NULL}, then append to @file{~/.history}. +Returns 0 on success, or @code{errno} on a read or write error. @end deftypefun -@deftypefun int history_truncate_file (char *filename, int nlines) +@deftypefun int history_truncate_file (const char *filename, int nlines) Truncate the history file @var{filename}, leaving only the last @var{nlines} lines. +If @var{filename} is @code{NULL}, then @file{~/.history} is truncated. +Returns 0 on success, or @code{errno} on failure. @end deftypefun @node History Expansion @subsection History Expansion -These functions implement @code{csh}-like history expansion. +These functions implement history expansion. @deftypefun int history_expand (char *string, char **output) Expand @var{string}, placing the result into @var{output}, a pointer @@ -334,7 +348,7 @@ to a string (@pxref{History Interaction}). Returns: @table @code @item 0 If no expansions took place (or, if the only change in -the text was the de-slashifying of the history expansion +the text was the removal of escape characters preceding the history expansion character); @item 1 if expansions did take place; @@ -349,12 +363,7 @@ If an error ocurred in expansion, then @var{output} contains a descriptive error message. @end deftypefun -@deftypefun {char *} history_arg_extract (int first, int last, char *string) -Extract a string segment consisting of the @var{first} through @var{last} -arguments present in @var{string}. Arguments are broken up as in Bash. -@end deftypefun - -@deftypefun {char *} get_history_event (char *string, int *cindex, int qchar) +@deftypefun {char *} get_history_event (const char *string, int *cindex, int qchar) Returns the text of the history event beginning at @var{string} + @var{*cindex}. @var{*cindex} is modified to point to after the event specifier. At function entry, @var{cindex} points to the index into @@ -363,18 +372,24 @@ is a character that is allowed to end the event specification in addition to the ``normal'' terminating characters. @end deftypefun -@deftypefun {char **} history_tokenize (char *string) +@deftypefun {char **} history_tokenize (const char *string) Return an array of tokens parsed out of @var{string}, much as the -shell might. The tokens are split on white space and on the -characters @code{()<>;&|$}, and shell quoting conventions are -obeyed. +shell might. The tokens are split on the characters in the +@var{history_word_delimiters} variable, +and shell quoting conventions are obeyed. +@end deftypefun + +@deftypefun {char *} history_arg_extract (int first, int last, const char *string) +Extract a string segment consisting of the @var{first} through @var{last} +arguments present in @var{string}. Arguments are split using +@code{history_tokenize}. @end deftypefun @node History Variables @section History Variables -This section describes the externally visible variables exported by -the GNU History Library. +This section describes the externally-visible variables exported by +the @sc{gnu} History Library. @deftypevar int history_base The logical offset of the first entry in the history list. @@ -384,13 +399,14 @@ The logical offset of the first entry in the history list. The number of entries currently stored in the history list. @end deftypevar -@deftypevar int max_input_history +@deftypevar int history_max_entries The maximum number of history entries. This must be changed using -@code{stifle_history ()}. +@code{stifle_history()}. @end deftypevar @deftypevar char history_expansion_char -The character that starts a history event. The default is @samp{!}. +The character that introduces a history event. The default is @samp{!}. +Setting this to 0 inhibits history expansion. @end deftypevar @deftypevar char history_subst_char @@ -405,15 +421,20 @@ ignored, suppressing history expansion for the remainder of the line. This is disabled by default. @end deftypevar +@deftypevar {char *} history_word_delimiters +The characters that separate tokens for \fBhistory_tokenize()\fP. +The default value is @code{" \t\n()<>;&|"}. +@end deftypevar + @deftypevar {char *} history_no_expand_chars The list of characters which inhibit history expansion if found immediately -following @var{history_expansion_char}. The default is whitespace and -@samp{=}. +following @var{history_expansion_char}. The default is space, tab, newline, +carriage return, and @samp{=}. @end deftypevar @deftypevar {char *} history_search_delimiter_chars The list of additional characters which can delimit a history search -string, in addition to whitespace, @samp{:} and @samp{?} in the case of +string, in addition to space, TAB, @samp{:} and @samp{?} in the case of a substring search. The default is empty. @end deftypevar @@ -422,24 +443,30 @@ If non-zero, single-quoted words are not scanned for the history expansion character. The default value is 0. @end deftypevar -@deftypevar {Function *} history_inhibit_expansion_function +@deftypevar {rl_linebuf_func_t *} history_inhibit_expansion_function This should be set to the address of a function that takes two arguments: -a @code{char *} (@var{string}) and an integer index into that string (@var{i}). +a @code{char *} (@var{string}) +and an @code{int} index into that string (@var{i}). It should return a non-zero value if the history expansion starting at @var{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. +By default, this variable is set to @code{NULL}. @end deftypevar @node History Programming Example @section History Programming Example -The following program demonstrates simple use of the GNU History Library. +The following program demonstrates simple use of the @sc{gnu} History Library. @smallexample -main () +#include +#include + +main (argc, argv) + int argc; + char **argv; @{ char line[1024], *t; int len, done = 0; diff --git a/doc/hsuser.texinfo b/doc/hsuser.texinfo index 5f75f5d..6926b26 100644 --- a/doc/hsuser.texinfo +++ b/doc/hsuser.texinfo @@ -38,9 +38,9 @@ For information on using the @sc{gnu} History Library in other programs, see the @sc{gnu} Readline Library Manual. @end ifset @ifclear BashFeatures -This chapter describes how to use the GNU History Library interactively, +This chapter describes how to use the @sc{gnu} History Library interactively, from a user's standpoint. It should be considered a user's guide. For -information on using the GNU History Library in your own programs, +information on using the @sc{gnu} History Library in your own programs, @pxref{Programming with GNU History}. @end ifclear @@ -65,36 +65,36 @@ information on using the GNU History Library in your own programs, @cindex command history @cindex history list -When the @samp{-o history} option to the @code{set} builtin +When the @option{-o history} option to the @code{set} builtin is enabled (@pxref{The Set Builtin}), -the shell provides access to the @var{command history}, +the shell provides access to the @dfn{command history}, the list of commands previously typed. -The value of the @code{HISTSIZE} shell variable is used as the +The value of the @env{HISTSIZE} shell variable is used as the number of commands to save in a history list. -The text of the last @code{$HISTSIZE} +The text of the last @env{$HISTSIZE} commands (default 500) is saved. The shell stores each command in the history list prior to parameter and variable expansion but after history expansion is performed, subject to the values of the shell variables -@code{HISTIGNORE} and @code{HISTCONTROL}. +@env{HISTIGNORE} and @env{HISTCONTROL}. When the shell starts up, the history is initialized from the -file named by the @code{HISTFILE} variable (default @file{~/.bash_history}). -The file named by the value of @code{HISTFILE} is truncated, if +file named by the @env{HISTFILE} variable (default @file{~/.bash_history}). +The file named by the value of @env{HISTFILE} is truncated, if necessary, to contain no more than the number of lines specified by -the value of the @code{HISTFILESIZE} variable. +the value of the @env{HISTFILESIZE} variable. When an interactive shell exits, the last -@code{$HISTSIZE} lines are copied from the history list to the file -named by @code{$HISTFILE}. +@env{$HISTSIZE} lines are copied from the history list to the file +named by @env{$HISTFILE}. If the @code{histappend} shell option is set (@pxref{Bash Builtins}), the lines are appended to the history file, otherwise the history file is overwritten. -If @code{HISTFILE} +If @env{HISTFILE} is unset, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated -to contain no more than @code{$HISTFILESIZE} -lines. If @code{HISTFILESIZE} is not set, no truncation is performed. +to contain no more than @env{$HISTFILESIZE} +lines. If @env{HISTFILESIZE} is not set, no truncation is performed. The builtin command @code{fc} may be used to list or edit and re-execute a portion of the history list. @@ -105,7 +105,7 @@ are available in each editing mode that provide access to the history list (@pxref{Commands For History}). The shell allows control over which commands are saved on the history -list. The @code{HISTCONTROL} and @code{HISTIGNORE} +list. The @env{HISTCONTROL} and @env{HISTIGNORE} variables may be set to cause the shell to save only a subset of the commands entered. The @code{cmdhist} @@ -141,15 +141,15 @@ command beginning with that string) or as a number (an index into the history list, where a negative number is used as an offset from the current command number). If @var{last} is not specified it is set to @var{first}. If @var{first} is not specified it is set to the previous -command for editing and @minus{}16 for listing. If the @samp{-l} flag is -given, the commands are listed on standard output. The @samp{-n} flag -suppresses the command numbers when listing. The @samp{-r} flag +command for editing and @minus{}16 for listing. If the @option{-l} flag is +given, the commands are listed on standard output. The @option{-n} flag +suppresses the command numbers when listing. The @option{-r} flag reverses the order of the listing. Otherwise, the editor given by @var{ename} is invoked on a file containing those commands. If @var{ename} is not given, the value of the following variable expansion is used: @code{$@{FCEDIT:-$@{EDITOR:-vi@}@}}. This says to use the -value of the @code{FCEDIT} variable if set, or the value of the -@code{EDITOR} variable if that is set, or @code{vi} if neither is set. +value of the @env{FCEDIT} variable if set, or the value of the +@env{EDITOR} variable if that is set, or @code{vi} if neither is set. When editing is complete, the edited commands are echoed and executed. In the second form, @var{command} is re-executed after each instance @@ -170,7 +170,7 @@ history -ps @var{arg} @end example With no options, display the history list with line numbers. -Lines prefixed with with a @samp{*} have been modified. +Lines prefixed with a @samp{*} have been modified. An argument of @var{n} lists only the last @var{n} lines. Options, if supplied, have the following meanings: @@ -211,10 +211,10 @@ the history list as a single entry. @end table -When any of the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} options is +When any of the @option{-w}, @option{-r}, @option{-a}, or @option{-n} options is used, if @var{filename} is given, then it is used as the history file. If not, then -the value of the @code{HISTFILE} variable is used. +the value of the @env{HISTFILE} variable is used. @end table @end ifset @@ -260,9 +260,9 @@ editing buffer for further modification. If Readline is being used, and the @code{histreedit} shell option is enabled, a failed history expansion will be reloaded into the Readline editing buffer for correction. -The @samp{-p} option to the @code{history} builtin command +The @option{-p} option to the @code{history} builtin command may be used to see what a history expansion will do before using it. -The @samp{-s} option to the @code{history} builtin may be used to +The @option{-s} option to the @code{history} builtin may be used to add commands to the end of the history list without actually executing them, so that they are available for subsequent recall. This is most useful in conjunction with Readline. diff --git a/doc/manvers.texinfo b/doc/manvers.texinfo index 3122b6c..07fb02a 100644 --- a/doc/manvers.texinfo +++ b/doc/manvers.texinfo @@ -1,6 +1,6 @@ -@set EDITION 4.1 -@set VERSION 4.1 -@set UPDATED 2000 January 19 -@set UPDATE-MONTH January 2000 +@set EDITION 4.2 +@set VERSION 4.2 +@set UPDATED 2001 Apr 16 +@set UPDATE-MONTH Apr 2001 -@set LASTCHANGE Wed Jan 19 12:16:30 EST 2000 +@set LASTCHANGE Mon Apr 16 10:53:58 EDT 2001 diff --git a/doc/readline.0 b/doc/readline.0 index 8d453cd..398132d 100644 --- a/doc/readline.0 +++ b/doc/readline.0 @@ -9,59 +9,59 @@ NNAAMMEE SSYYNNOOPPSSIISS ##iinncclluuddee < > - ##iinncclluuddee <> - ##iinncclluuddee < > + ##iinncclluuddee < > + ##iinncclluuddee < > - cchhaarr **rreeaaddlliinnee ((pprroommpptt)) - cchhaarr **pprroommpptt;; + _c_h_a_r _* + rreeaaddlliinnee (_c_o_n_s_t _c_h_a_r _*_p_r_o_m_p_t); CCOOPPYYRRIIGGHHTT - Readline is Copyright (C) 1989, 1991, 1993, 1995, 1996 by - the Free Software Foundation, Inc. + Readline is Copyright (C) 1989-2001 by the Free Software + Foundation, Inc. DDEESSCCRRIIPPTTIIOONN rreeaaddlliinnee will read a line from the terminal and return it, - using pprroommpptt as a prompt. If pprroommpptt is null, no prompt is - issued. The line returned is allocated with _m_a_l_l_o_c(3), so - the caller must free it when finished. The line returned - has the final newline removed, so only the text of the - line remains. + using pprroommpptt as a prompt. If pprroommpptt is NNUULLLL or the empty + string, no prompt is issued. The line returned is allo- + cated with _m_a_l_l_o_c(3); the caller must free it when fin- + ished. The line returned has the final newline removed, + so only the text of the line remains. rreeaaddlliinnee offers editing capabilities while the user is entering the line. By default, the line editing commands are similar to those of emacs. A vi-style line editing interface is also available. + This manual page describes only the most basic use of + rreeaaddlliinnee. Much more functionality is available; see _T_h_e + _G_N_U _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y and _T_h_e _G_N_U _H_i_s_t_o_r_y _L_i_b_r_a_r_y for addi- + tional information. + RREETTUURRNN VVAALLUUEE - rreeaaddlliinnee returns the text of the line read. A blank line - returns the empty string. If EEOOFF is encountered while - reading a line, and the line is empty, NNUULLLL is returned. - If an EEOOFF is read with a non-empty line, it is treated as + rreeaaddlliinnee returns the text of the line read. A blank line + returns the empty string. If EEOOFF is encountered while + reading a line, and the line is empty, NNUULLLL is returned. + If an EEOOFF is read with a non-empty line, it is treated as a newline. NNOOTTAATTIIOONN - An emacs-style notation is used to denote keystrokes. - Control keys are denoted by C-_k_e_y, e.g., C-n means Con- + An emacs-style notation is used to denote keystrokes. + Control keys are denoted by C-_k_e_y, e.g., C-n means Con- trol-N. Similarly, _m_e_t_a keys are denoted by M-_k_e_y, so M-x means Meta-X. (On keyboards without a _m_e_t_a key, M-_x means - ESC _x, i.e., press the Escape key then the _x key. This - makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x means - ESC-Control-_x, or press the Escape key then hold the Con- + ESC _x, i.e., press the Escape key then the _x key. This + makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x means + ESC-Control-_x, or press the Escape key then hold the Con- trol key while pressing the _x key.) - Readline commands may be given numeric _a_r_g_u_m_e_n_t_s, which + Readline commands may be given numeric _a_r_g_u_m_e_n_t_s, which normally act as a repeat count. Sometimes, however, it is - the sign of the argument that is significant. Passing a - negative argument to a command that acts in the forward - direction (e.g., kkiillll--lliinnee) causes that command to act in - a backward direction. Commands whose behavior with argu- - ments deviates from this are noted. - - When a command is described as _k_i_l_l_i_n_g text, the text + the sign of the argument that is significant. Passing a + negative argument to a command that acts in the forward -GNU 1999 Jun 1 1 +GNU Readline 4.2 2001 Mar 5 1 @@ -70,24 +70,29 @@ GNU 1999 Jun 1 1 READLINE(3) READLINE(3) - deleted is saved for possible future retrieval (_y_a_n_k_i_n_g). - The killed text is saved in a _k_i_l_l _r_i_n_g. Consecutive - kills cause the text to be accumulated into one unit, - which can be yanked all at once. Commands which do not + direction (e.g., kkiillll--lliinnee) causes that command to act in + a backward direction. Commands whose behavior with argu- + ments deviates from this are noted. + + When a command is described as _k_i_l_l_i_n_g text, the text + deleted is saved for possible future retrieval (_y_a_n_k_i_n_g). + The killed text is saved in a _k_i_l_l _r_i_n_g. Consecutive + kills cause the text to be accumulated into one unit, + which can be yanked all at once. Commands which do not kill text separate the chunks of text on the kill ring. IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE - Readline is customized by putting commands in an initial- + Readline is customized by putting commands in an initial- ization file (the _i_n_p_u_t_r_c file). The name of this file is - taken from the value of the IINNPPUUTTRRCC environment variable. - If that variable is unset, the default is _~_/_._i_n_p_u_t_r_c. - When a program which uses the readline library starts up, - the init file is read, and the key bindings and variables + taken from the value of the IINNPPUUTTRRCC environment variable. + If that variable is unset, the default is _~_/_._i_n_p_u_t_r_c. + When a program which uses the readline library starts up, + the init file is read, and the key bindings and variables are set. There are only a few basic constructs allowed in - the readline init file. Blank lines are ignored. Lines + the readline init file. Blank lines are ignored. Lines beginning with a ## are comments. Lines beginning with a $$ - indicate conditional constructs. Other lines denote key - bindings and variable settings. Each program using this + indicate conditional constructs. Other lines denote key + bindings and variable settings. Each program using this library may add its own commands and bindings. For example, placing @@ -95,39 +100,34 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE M-Control-u: universal-argument or C-Meta-u: universal-argument - into the _i_n_p_u_t_r_c would make M-C-u execute the readline + + into the _i_n_p_u_t_r_c would make M-C-u execute the readline command _u_n_i_v_e_r_s_a_l_-_a_r_g_u_m_e_n_t. - The following symbolic character names are recognized - while processing key bindings: _R_U_B_O_U_T, _D_E_L, _E_S_C, _L_F_D, _N_E_W_- - _L_I_N_E, _R_E_T, _R_E_T_U_R_N, _S_P_C, _S_P_A_C_E, and _T_A_B. + The following symbolic character names are recognized + while processing key bindings: _D_E_L, _E_S_C, _E_S_C_A_P_E, _L_F_D, _N_E_W_- + _L_I_N_E, _R_E_T, _R_E_T_U_R_N, _R_U_B_O_U_T, _S_P_A_C_E, _S_P_C, and _T_A_B. - In addition to command names, readline allows keys to be + In addition to command names, readline allows keys to be bound to a string that is inserted when the key is pressed (a _m_a_c_r_o). KKeeyy BBiinnddiinnggss - The syntax for controlling key bindings in the _i_n_p_u_t_r_c - file is simple. All that is required is the name of the + The syntax for controlling key bindings in the _i_n_p_u_t_r_c + file is simple. All that is required is the name of the command or the text of a macro and a key sequence to which - it should be bound. The name may be specified in one of - two ways: as a symbolic key name, possibly with _M_e_t_a_- or - _C_o_n_t_r_o_l_- prefixes, or as a key sequence. When using the - form kkeeyynnaammee:_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, _k_e_y_n_a_m_e is the name - of a key spelled out in English. For example: + it should be bound. The name may be specified in one of + two ways: as a symbolic key name, possibly with _M_e_t_a_- or + _C_o_n_t_r_o_l_- prefixes, or as a key sequence. - Control-u: universal-argument - Meta-Rubout: backward-kill-word - Control-o: ">&output" - - In the above example, _C_-_u is bound to the function uunniivveerr-- - ssaall--aarrgguummeenntt, _M_-_D_E_L is bound to the function bbaacckk-- - wwaarrdd--kkiillll--wwoorrdd, and _C_-_o is bound to run the macro + When using the form kkeeyynnaammee:_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, _k_e_y_- + _n_a_m_e is the name of a key spelled out in English. For + example: -GNU 1999 Jun 1 2 +GNU Readline 4.2 2001 Mar 5 2 @@ -136,14 +136,22 @@ GNU 1999 Jun 1 2 READLINE(3) READLINE(3) - expressed on the right hand side (that is, to insert the - text _>_&_o_u_t_p_u_t into the line). + Control-u: universal-argument + Meta-Rubout: backward-kill-word + Control-o: "> output" - In the second form, ""kkeeyysseeqq"":_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, kkeeyy-- + In the above example, _C_-_u is bound to the function uunniivveerr-- + ssaall--aarrgguummeenntt, _M_-_D_E_L is bound to the function bbaacckk-- + wwaarrdd--kkiillll--wwoorrdd, and _C_-_o is bound to run the macro + expressed on the right hand side (that is, to insert the + text ``> output'' into the line). + + In the second form, ""kkeeyysseeqq"":_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, kkeeyy-- sseeqq differs from kkeeyynnaammee above in that strings denoting an - entire key sequence may be specified by placing the - sequence within double quotes. Some GNU Emacs style key - escapes can be used, as in the following example. + entire key sequence may be specified by placing the + sequence within double quotes. Some GNU Emacs style key + escapes can be used, as in the following example, but the + symbolic character names are not recognized. "\C-u": universal-argument "\C-x\C-r": re-read-init-file @@ -152,14 +160,16 @@ READLINE(3) READLINE(3) In this example, _C_-_u is again bound to the function uunnii-- vveerrssaall--aarrgguummeenntt. _C_-_x _C_-_r is bound to the function rree--rreeaadd--iinniitt--ffiillee, and _E_S_C _[ _1 _1 _~ is bound to insert the - text FFuunnccttiioonn KKeeyy 11. The full set of GNU Emacs style - escape sequences is + text ``Function Key 1''. + + The full set of GNU Emacs style escape sequences available + when specifying key sequences is \\CC-- control prefix \\MM-- meta prefix \\ee an escape character \\\\ backslash - \\"" literal " - \\'' literal ' + \\"" literal ", a double quote + \\'' literal ', a single quote In addition to the GNU Emacs style escape sequences, a second set of backslash escapes is available: @@ -179,21 +189,11 @@ READLINE(3) READLINE(3) When entering the text of a macro, single or double quotes should be used to indicate a macro definition. Unquoted text is assumed to be a function name. In the macro body, - the backslash escapes described above are expanded. Back- - slash will quote any other character in the macro text, - including " and '. - - BBaasshh allows the current readline key bindings to be dis- - played or modified with the bbiinndd builtin command. The - editing mode may be switched during interactive use by - using the --oo option to the sseett builtin command. Other - programs using this library provide similar mechanisms. - The _i_n_p_u_t_r_c file may be edited and re-read if a program - does not provide any other means to incorporate new + the backslash escapes described above are expanded. -GNU 1999 Jun 1 3 +GNU Readline 4.2 2001 Mar 5 3 @@ -202,7 +202,17 @@ GNU 1999 Jun 1 3 READLINE(3) READLINE(3) - bindings. + Backslash will quote any other character in the macro + text, including " and '. + + BBaasshh allows the current readline key bindings to be dis- + played or modified with the bbiinndd builtin command. The + editing mode may be switched during interactive use by + using the --oo option to the sseett builtin command. Other + programs using this library provide similar mechanisms. + The _i_n_p_u_t_r_c file may be edited and re-read if a program + does not provide any other means to incorporate new bind- + ings. VVaarriiaabblleess Readline has variables that can be used to further cus- @@ -212,54 +222,44 @@ READLINE(3) READLINE(3) sseett _v_a_r_i_a_b_l_e_-_n_a_m_e _v_a_l_u_e Except where noted, readline variables can take the values - OOnn or OOffff. The variables and their default values are: + OOnn or OOffff (without regard to case). The variables and + their default values are: bbeellll--ssttyyllee ((aauuddiibbllee)) - Controls what happens when readline wants to ring - the terminal bell. If set to nnoonnee, readline never + Controls what happens when readline wants to ring + the terminal bell. If set to nnoonnee, readline never rings the bell. If set to vviissiibbllee, readline uses a - visible bell if one is available. If set to aauuddii-- + visible bell if one is available. If set to aauuddii-- bbllee, readline attempts to ring the terminal's bell. ccoommmmeenntt--bbeeggiinn ((````##'''')) - The string that is inserted in vvii mode when the - iinnsseerrtt--ccoommmmeenntt command is executed. This command - is bound to MM--## in emacs mode and to ## in vi com- + The string that is inserted in vvii mode when the + iinnsseerrtt--ccoommmmeenntt command is executed. This command + is bound to MM--## in emacs mode and to ## in vi com- mand mode. ccoommpplleettiioonn--iiggnnoorree--ccaassee ((OOffff)) - If set to OOnn, readline performs filename matching + If set to OOnn, readline performs filename matching and completion in a case-insensitive fashion. ccoommpplleettiioonn--qquueerryy--iitteemmss ((110000)) - This determines when the user is queried about - viewing the number of possible completions gener- - ated by the ppoossssiibbllee--ccoommpplleettiioonnss command. It may - be set to any integer value greater than or equal - to zero. If the number of possible completions is - greater than or equal to the value of this vari- + This determines when the user is queried about + viewing the number of possible completions gener- + ated by the ppoossssiibbllee--ccoommpplleettiioonnss command. It may + be set to any integer value greater than or equal + to zero. If the number of possible completions is + greater than or equal to the value of this vari- able, the user is asked whether or not he wishes to - view them; otherwise they are simply listed on the + view them; otherwise they are simply listed on the terminal. ccoonnvveerrtt--mmeettaa ((OOnn)) If set to OOnn, readline will convert characters with - the eighth bit set to an ASCII key sequence by - stripping the eighth bit and prepending an escape - character (in effect, using escape as the _m_e_t_a _p_r_e_- - _f_i_x). - ddiissaabbllee--ccoommpplleettiioonn ((OOffff)) - If set to OOnn, readline will inhibit word comple- - tion. Completion characters will be inserted into - the line as if they had been mapped to sseellff--iinnsseerrtt. - eeddiittiinngg--mmooddee ((eemmaaccss)) - Controls whether readline begins with a set of key - bindings similar to _e_m_a_c_s or _v_i. eeddiittiinngg--mmooddee can - be set to either eemmaaccss or vvii. - eennaabbllee--kkeeyyppaadd ((OOffff)) - When set to OOnn, readline will try to enable the - application keypad when it is called. Some systems - need this to enable the arrow keys. + the eighth bit set to an ASCII key sequence by + stripping the eighth bit and prefixing it with an + escape character (in effect, using escape as the + _m_e_t_a _p_r_e_f_i_x). + -GNU 1999 Jun 1 4 +GNU Readline 4.2 2001 Mar 5 4 @@ -268,64 +268,64 @@ GNU 1999 Jun 1 4 READLINE(3) READLINE(3) + ddiissaabbllee--ccoommpplleettiioonn ((OOffff)) + If set to OOnn, readline will inhibit word comple- + tion. Completion characters will be inserted into + the line as if they had been mapped to sseellff--iinnsseerrtt. + eeddiittiinngg--mmooddee ((eemmaaccss)) + Controls whether readline begins with a set of key + bindings similar to emacs or vi. eeddiittiinngg--mmooddee can + be set to either eemmaaccss or vvii. + eennaabbllee--kkeeyyppaadd ((OOffff)) + When set to OOnn, readline will try to enable the + application keypad when it is called. Some systems + need this to enable the arrow keys. eexxppaanndd--ttiillddee ((OOffff)) - If set to oonn, tilde expansion is performed when + If set to oonn, tilde expansion is performed when readline attempts word completion. hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff)) - When set to OOnn, makes readline use a single line - for display, scrolling the input horizontally on a - single screen line when it becomes longer than the + When set to OOnn, makes readline use a single line + for display, scrolling the input horizontally on a + single screen line when it becomes longer than the screen width rather than wrapping to a new line. iinnppuutt--mmeettaa ((OOffff)) - If set to OOnn, readline will enable eight-bit input - (that is, it will not strip the high bit from the + If set to OOnn, readline will enable eight-bit input + (that is, it will not clear the eighth bit in the characters it reads), regardless of what the termi- nal claims it can support. The name mmeettaa--ffllaagg is a synonym for this variable. - iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[CC--JJ'''')) - The string of characters that should terminate an - incremental search without subsequently executing - the character as a command. If this variable has - not been given a value, the characters _E_S_C and _C_-_J + iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[ CC--JJ'''')) + The string of characters that should terminate an + incremental search without subsequently executing + the character as a command. If this variable has + not been given a value, the characters _E_S_C and _C_-_J will terminate an incremental search. kkeeyymmaapp ((eemmaaccss)) - Set the current readline keymap. The set of legal - keymap names is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, + Set the current readline keymap. The set of legal + keymap names is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is equivalent - to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the - value of eeddiittiinngg--mmooddee also affects the default + to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s. + The value of eeddiittiinngg--mmooddee also affects the default keymap. mmaarrkk--ddiirreeccttoorriieess ((OOnn)) - If set to OOnn, complete >)) Move to the end of the input history, i.e., the line currently being entered. + + + + +GNU Readline 4.2 2001 Mar 5 8 + + + + + +READLINE(3) READLINE(3) + + rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr)) Search backward starting at the current line and moving `up' through the history as necessary. This @@ -519,19 +553,6 @@ READLINE(3) READLINE(3) of characters between the start of the current line and the current cursor position (the _p_o_i_n_t). This is a non-incremental search. - - - - -GNU 1999 Jun 1 8 - - - - - -READLINE(3) READLINE(3) - - hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd Search backward through the history for the string of characters between the start of the current line @@ -539,11 +560,11 @@ READLINE(3) READLINE(3) yyaannkk--nntthh--aarrgg ((MM--CC--yy)) Insert the first argument to the previous command (usually the second word on the previous line) at - point (the current cursor position). With an argu- - ment _n, insert the _nth word from the previous com- - mand (the words in the previous command begin with - word 0). A negative argument inserts the _nth word - from the end of the previous command. + point. With an argument _n, insert the _nth word + from the previous command (the words in the previ- + ous command begin with word 0). A negative argu- + ment inserts the _nth word from the end of the pre- + vious command. yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__)) Insert the last argument to the previous command (the last word of the previous history entry). @@ -554,10 +575,10 @@ READLINE(3) READLINE(3) CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt ddeelleettee--cchhaarr ((CC--dd)) - Delete the character under the cursor. If point is - at the beginning of the line, there are no charac- - ters in the line, and the last character typed was - not bound to BBddeelleettee--cchhaarr, then return EEOOFF. + Delete the character at point. If point is at the + beginning of the line, there are no characters in + the line, and the last character typed was not + bound to ddeelleettee--cchhaarr, then return EEOOFF. bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt)) Delete the character behind the cursor. When given a numeric argument, save the deleted text on the @@ -565,31 +586,10 @@ READLINE(3) READLINE(3) ffoorrwwaarrdd--bbaacckkwwaarrdd--ddeelleettee--cchhaarr Delete the character under the cursor, unless the cursor is at the end of the line, in which case the - character behind the cursor is deleted. By - default, this is not bound to a key. - qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv)) - Add the next character that you type to the line - verbatim. This is how to insert characters like - CC--qq, for example. - ttaabb--iinnsseerrtt ((MM--TTAABB)) - Insert a tab character. - sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ......)) - Insert the character typed. - ttrraannssppoossee--cchhaarrss ((CC--tt)) - Drag the character before point forward over the - character at point. Point moves forward as well. - If point is at the end of the line, then transpose - the two characters before point. Negative argu- - ments don't work. - ttrraannssppoossee--wwoorrddss ((MM--tt)) - Drag the word behind the cursor past the word in - front of the cursor moving the cursor over that - word as well. - -GNU 1999 Jun 1 9 +GNU Readline 4.2 2001 Mar 5 9 @@ -598,6 +598,24 @@ GNU 1999 Jun 1 9 READLINE(3) READLINE(3) + character behind the cursor is deleted. + qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv)) + Add the next character that you type to the line + verbatim. This is how to insert characters like + CC--qq, for example. + ttaabb--iinnsseerrtt ((MM--TTAABB)) + Insert a tab character. + sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ......)) + Insert the character typed. + ttrraannssppoossee--cchhaarrss ((CC--tt)) + Drag the character before point forward over the + character at point, moving point forward as well. + If point is at the end of the line, then this + transposes the two characters before point. Nega- + tive arguments have no effect. + ttrraannssppoossee--wwoorrddss ((MM--tt)) + Drag the word before point past the word after + point, moving point over that word as well. uuppccaassee--wwoorrdd ((MM--uu)) Uppercase the current (or following) word. With a negative argument, uppercase the previous word, but @@ -613,33 +631,44 @@ READLINE(3) READLINE(3) KKiilllliinngg aanndd YYaannkkiinngg kkiillll--lliinnee ((CC--kk)) - Kill the text from the current cursor position to - the end of the line. + Kill the text from point to the end of the line. bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt)) Kill backward to the beginning of the line. uunniixx--lliinnee--ddiissccaarrdd ((CC--uu)) - Kill backward from point to the beginning of the + Kill backward from point to the beginning of the line. The killed text is saved on the kill-ring. kkiillll--wwhhoollee--lliinnee - Kill all characters on the current line, no matter - where the cursor is. + Kill all characters on the current line, no matter + where point is. kkiillll--wwoorrdd ((MM--dd)) - Kill from the cursor to the end of the current - word, or if between words, to the end of the next - word. Word boundaries are the same as those used - by ffoorrwwaarrdd--wwoorrdd. + Kill from point the end of the current word, or if + between words, to the end of the next word. Word + boundaries are the same as those used by ffoorr-- + wwaarrdd--wwoorrdd. bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt)) - Kill the word behind the cursor. Word boundaries - are the same as those used by bbaacckkwwaarrdd--wwoorrdd. + Kill the word behind point. Word boundaries are + the same as those used by bbaacckkwwaarrdd--wwoorrdd. uunniixx--wwoorrdd--rruubboouutt ((CC--ww)) - Kill the word behind the cursor, using white space - as a word boundary. The word boundaries are dif- - ferent from bbaacckkwwaarrdd--kkiillll--wwoorrdd. + Kill the word behind point, using white space as a + word boundary. The killed text is saved on the + kill-ring. + + + +GNU Readline 4.2 2001 Mar 5 10 + + + + + +READLINE(3) READLINE(3) + + ddeelleettee--hhoorriizzoonnttaall--ssppaaccee ((MM--\\)) Delete all spaces and tabs around point. kkiillll--rreeggiioonn - Kill the text between the point and _m_a_r_k (saved - cursor position). This text is referred to as the + Kill the text between the point and _m_a_r_k (saved + cursor position). This text is referred to as the _r_e_g_i_o_n. ccooppyy--rreeggiioonn--aass--kkiillll Copy the text in the region to the kill buffer. @@ -647,81 +676,52 @@ READLINE(3) READLINE(3) Copy the word before point to the kill buffer. The word boundaries are the same as bbaacckkwwaarrdd--wwoorrdd. ccooppyy--ffoorrwwaarrdd--wwoorrdd - Copy the word following point to the kill buffer. + Copy the word following point to the kill buffer. The word boundaries are the same as ffoorrwwaarrdd--wwoorrdd. yyaannkk ((CC--yy)) - Yank the top of the kill ring into the buffer at - the cursor. - - - -GNU 1999 Jun 1 10 - - - - - -READLINE(3) READLINE(3) - - + Yank the top of the kill ring into the buffer at + point. yyaannkk--ppoopp ((MM--yy)) - Rotate the kill ring, and yank the new top. Only + Rotate the kill ring, and yank the new top. Only works following yyaannkk or yyaannkk--ppoopp. NNuummeerriicc AArrgguummeennttss ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----)) - Add this digit to the argument already accumulat- - ing, or start a new argument. M-- starts a nega- + Add this digit to the argument already accumulat- + ing, or start a new argument. M-- starts a nega- tive argument. uunniivveerrssaall--aarrgguummeenntt - This is another way to specify an argument. If - this command is followed by one or more digits, - optionally with a leading minus sign, those digits + This is another way to specify an argument. If + this command is followed by one or more digits, + optionally with a leading minus sign, those digits define the argument. If the command is followed by digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the - numeric argument, but is otherwise ignored. As a - special case, if this command is immediately fol- - lowed by a character that is neither a digit or + numeric argument, but is otherwise ignored. As a + special case, if this command is immediately fol- + lowed by a character that is neither a digit or minus sign, the argument count for the next command - is multiplied by four. The argument count is ini- - tially one, so executing this function the first - time makes the argument count four, a second time + is multiplied by four. The argument count is ini- + tially one, so executing this function the first + time makes the argument count four, a second time makes the argument count sixteen, and so on. CCoommpplleettiinngg ccoommpplleettee ((TTAABB)) - Attempt to perform completion on the text before + Attempt to perform completion on the text before point. The actual completion performed is applica- - tion-specific. BBaasshh, for instance, attempts com- - pletion treating the text as a variable (if the - text begins with $$), username (if the text begins - with ~~), hostname (if the text begins with @@), or - command (including aliases and functions) in turn. + tion-specific. BBaasshh, for instance, attempts com- + pletion treating the text as a variable (if the + text begins with $$), username (if the text begins + with ~~), hostname (if the text begins with @@), or + command (including aliases and functions) in turn. If none of these produces a match, filename comple- - tion is attempted. GGddbb, on the other hand, allows - completion of program functions and variables, and - only attempts filename completion under certain - circumstances. - ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??)) - List the possible completions of the text before - point. - iinnsseerrtt--ccoommpplleettiioonnss ((MM--**)) - Insert all completions of the text before point - that would have been generated by ppoossssiibbllee--ccoommppllee-- - ttiioonnss. - mmeennuu--ccoommpplleettee - Similar to ccoommpplleettee, but replaces the word to be - completed with a single match from the list of pos- - sible completions. Repeated execution of mmeennuu--ccoomm-- - pplleettee steps through the list of possible comple- - tions, inserting each match in turn. At the end of - the list of completions, the bell is rung and the - original text is restored. An argument of _n moves - _n positions forward in the list of matches; a + tion is attempted. GGddbb, on the other hand, allows + completion of program functions and variables, and + only attempts filename completion under certain -GNU 1999 Jun 1 11 +GNU Readline 4.2 2001 Mar 5 11 @@ -730,64 +730,64 @@ GNU 1999 Jun 1 11 READLINE(3) READLINE(3) - negative argument may be used to move backward - through the list. This command is intended to be - bound to TTAABB, but is unbound by default. + circumstances. + ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??)) + List the possible completions of the text before + point. + iinnsseerrtt--ccoommpplleettiioonnss ((MM--**)) + Insert all completions of the text before point + that would have been generated by ppoossssiibbllee--ccoommppllee-- + ttiioonnss. + mmeennuu--ccoommpplleettee + Similar to ccoommpplleettee, but replaces the word to be + completed with a single match from the list of pos- + sible completions. Repeated execution of mmeennuu--ccoomm-- + pplleettee steps through the list of possible comple- + tions, inserting each match in turn. At the end of + the list of completions, the bell is rung (subject + to the setting of Bbell-style)) aanndd tthhee oorriiggiinnaall + tteexxtt iiss rreessttoorreedd.. AAnn aarrgguummeenntt ooff _n mmoovveess _n ppoossii-- + ttiioonnss ffoorrwwaarrdd iinn tthhee lliisstt ooff mmaattcchheess;; aa nneeggaattiivvee + aarrgguummeenntt mmaayy bbee uusseedd ttoo mmoovvee bbaacckkwwaarrdd tthhrroouugghh tthhee + lliisstt.. TThhiiss ccoommmmaanndd iiss iinntteennddeedd ttoo bbee bboouunndd ttoo TTAABB,, + bbuutt iiss uunnbboouunndd bbyy ddeeffaauulltt.. ddeelleettee--cchhaarr--oorr--lliisstt Deletes the character under the cursor if not at the beginning or end of the line (like ddeelleettee-- cchhaarr). If at the end of the line, behaves identi- - cally to ppoossssiibbllee--ccoommpplleettiioonnss. This command is - unbound by default. + cally to ppoossssiibbllee--ccoommpplleettiioonnss. KKeeyybbooaarrdd MMaaccrrooss ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (()) - Begin saving the characters typed into the current + Begin saving the characters typed into the current keyboard macro. eenndd--kkbbdd--mmaaccrroo ((CC--xx )))) - Stop saving the characters typed into the current + Stop saving the characters typed into the current keyboard macro and store the definition. ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee)) Re-execute the last keyboard macro defined, by mak- - ing the characters in the macro appear as if typed + ing the characters in the macro appear as if typed at the keyboard. MMiisscceellllaanneeoouuss rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr)) - Read in the contents of the _i_n_p_u_t_r_c file, and - incorporate any bindings or variable assignments + Read in the contents of the _i_n_p_u_t_r_c file, and + incorporate any bindings or variable assignments found there. aabboorrtt ((CC--gg)) Abort the current editing command and ring the ter- minal's bell (subject to the setting of bbeellll--ssttyyllee). ddoo--uuppppeerrccaassee--vveerrssiioonn ((MM--aa,, MM--bb,, MM--_x,, ......)) - If the metafied character _x is lowercase, run the - command that is bound to the corresponding upper- + If the metafied character _x is lowercase, run the + command that is bound to the corresponding upper- case character. pprreeffiixx--mmeettaa ((EESSCC)) - Metafy the next character typed. EESSCC ff is equiva- - lent to MMeettaa--ff. - uunnddoo ((CC--__,, CC--xx CC--uu)) - Incremental undo, separately remembered for each - line. - rreevveerrtt--lliinnee ((MM--rr)) - Undo all changes made to this line. This is like - executing the uunnddoo command enough times to return - the line to its initial state. - ttiillddee--eexxppaanndd ((MM--&&)) - Perform tilde expansion on the current word. - sseett--mmaarrkk ((CC--@@,, MM--< >)) - Set the mark to the current point. If a numeric - argument is supplied, the mark is set to that posi- - tion. - eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk ((CC--xx CC--xx)) - Swap the point with the mark. The current cursor - position is set to the saved position, and the old + Metafy the next character typed. EESSCC ff is -GNU 1999 Jun 1 12 +GNU Readline 4.2 2001 Mar 5 12 @@ -796,6 +796,22 @@ GNU 1999 Jun 1 12 READLINE(3) READLINE(3) + equivalent to MMeettaa--ff. + uunnddoo ((CC--__,, CC--xx CC--uu)) + Incremental undo, separately remembered for each + line. + rreevveerrtt--lliinnee ((MM--rr)) + Undo all changes made to this line. This is like + executing the uunnddoo command enough times to return + the line to its initial state. + ttiillddee--eexxppaanndd ((MM--&&)) + Perform tilde expansion on the current word. + sseett--mmaarrkk ((CC--@@,, MM--<>)) + Set the mark to the point. If a numeric argument + is supplied, the mark is set to that position. + eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk ((CC--xx CC--xx)) + Swap the point with the mark. The current cursor + position is set to the saved position, and the old cursor position is saved as the mark. cchhaarraacctteerr--sseeaarrcchh ((CC--]])) A character is read and point is moved to the next @@ -809,8 +825,8 @@ READLINE(3) READLINE(3) The value of the readline ccoommmmeenntt--bbeeggiinn variable is inserted at the beginning of the current line, and the line is accepted as if a newline had been - typed. This makes the current line a shell com- - ment. + typed. The default value of ccoommmmeenntt--bbeeggiinn makes + the current line a shell comment. dduummpp--ffuunnccttiioonnss Print all of the functions and their key bindings to the readline output stream. If a numeric argu- @@ -835,25 +851,9 @@ READLINE(3) READLINE(3) When in eemmaaccss editing mode, this causes a switch to vvii editing mode. -DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS - The following is a list of the default emacs and vi bind- - ings. Characters with the 8th bit set are written as - M-, and are referred to as _m_e_t_a_f_i_e_d characters. - The printable ASCII characters not mentioned in the list - of emacs standard bindings are bound to the _s_e_l_f_-_i_n_s_e_r_t - function, which just inserts the given character into the - input line. In vi insertion mode, all characters not - specifically mentioned are bound to _s_e_l_f_-_i_n_s_e_r_t. Charac- - ters assigned to signal generation by _s_t_t_y(1) or the ter- - minal driver, such as C-Z or C-C, retain that function. - Upper and lower case _m_e_t_a_f_i_e_d characters are bound to the - same function in the emacs mode meta keymap. The remain- - ing characters are unbound, which causes readline to ring - the bell (subject to the setting of the bbeellll--ssttyyllee - -GNU 1999 Jun 1 13 +GNU Readline 4.2 2001 Mar 5 13 @@ -862,7 +862,22 @@ GNU 1999 Jun 1 13 READLINE(3) READLINE(3) - variable). +DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS + The following is a list of the default emacs and vi bind- + ings. Characters with the eighth bit set are written as + M- , and are referred to as _m_e_t_a_f_i_e_d characters. + The printable ASCII characters not mentioned in the list + of emacs standard bindings are bound to the sseellff--iinnsseerrtt + function, which just inserts the given character into the + input line. In vi insertion mode, all characters not + specifically mentioned are bound to sseellff--iinnsseerrtt. Charac- + ters assigned to signal generation by _s_t_t_y(1) or the ter- + minal driver, such as C-Z or C-C, retain that function. + Upper and lower case metafied characters are bound to the + same function in the emacs mode meta keymap. The remain- + ing characters are unbound, which causes readline to ring + the bell (subject to the setting of the bbeellll--ssttyyllee vari- + able). EEmmaaccss MMooddee Emacs Standard bindings @@ -901,6 +916,18 @@ READLINE(3) READLINE(3) "M-C-G" abort "M-C-H" backward-kill-word + + + +GNU Readline 4.2 2001 Mar 5 14 + + + + + +READLINE(3) READLINE(3) + + "M-C-I" tab-insert "M-C-J" vi-editing-mode "M-C-M" vi-editing-mode @@ -916,18 +943,6 @@ READLINE(3) READLINE(3) "M-." yank-last-arg "M-0" digit-argument "M-1" digit-argument - - - -GNU 1999 Jun 1 14 - - - - - -READLINE(3) READLINE(3) - - "M-2" digit-argument "M-3" digit-argument "M-4" digit-argument @@ -953,7 +968,7 @@ READLINE(3) READLINE(3) "M-Y" yank-pop "M-\" delete-horizontal-space "M-~" tilde-expand - "M-C-?" backward-delete-word + "M-C-?" backward-kill-word "M-_" yank-last-arg Emacs Control-X bindings @@ -968,6 +983,17 @@ READLINE(3) READLINE(3) "C-XC-?" backward-kill-line + + +GNU Readline 4.2 2001 Mar 5 15 + + + + + +READLINE(3) READLINE(3) + + VVII MMooddee bbiinnddiinnggss VI Insert Mode functions @@ -982,18 +1008,6 @@ READLINE(3) READLINE(3) "C-U" unix-line-discard "C-V" quoted-insert "C-W" unix-word-rubout - - - -GNU 1999 Jun 1 15 - - - - - -READLINE(3) READLINE(3) - - "C-Y" yank "C-[" vi-movement-mode "C-_" undo @@ -1020,6 +1034,7 @@ READLINE(3) READLINE(3) "C-V" quoted-insert "C-W" unix-word-rubout "C-Y" yank + "C-_" vi-undo " " forward-char "#" insert-comment "$" end-of-line @@ -1033,6 +1048,18 @@ READLINE(3) READLINE(3) "/" vi-search "0" beginning-of-line "1" to "9" vi-arg-digit + + + +GNU Readline 4.2 2001 Mar 5 16 + + + + + +READLINE(3) READLINE(3) + + ";" vi-char-search "=" vi-complete "?" vi-search @@ -1048,18 +1075,6 @@ READLINE(3) READLINE(3) "P" vi-put "R" vi-replace "S" vi-subst - - - -GNU 1999 Jun 1 16 - - - - - -READLINE(3) READLINE(3) - - "T" vi-char-search "U" revert-line "W" vi-next-word @@ -1086,7 +1101,7 @@ READLINE(3) READLINE(3) "r" vi-change-char "s" vi-subst "t" vi-char-search - "u" undo + "u" vi-undo "w" vi-next-word "x" vi-delete "y" vi-yank-to @@ -1098,6 +1113,19 @@ SSEEEE AALLSSOO _T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey _b_a_s_h(1) + + + + +GNU Readline 4.2 2001 Mar 5 17 + + + + + +READLINE(3) READLINE(3) + + FFIILLEESS _~_/_._i_n_p_u_t_r_c Individual rreeaaddlliinnee initialization file @@ -1115,17 +1143,6 @@ BBUUGG RREEPPOORRTTSS that it appears in the latest version of the rreeaaddlliinnee library that you have. - - -GNU 1999 Jun 1 17 - - - - - -READLINE(3) READLINE(3) - - Once you have determined that a bug actually exists, mail a bug report to _b_u_g_-_r_e_a_d_l_i_n_e@_g_n_u_._o_r_g. If you have a fix, you are welcome to mail that as well! Suggestions and @@ -1166,23 +1183,6 @@ BBUUGGSS - - - - - - - - - - - - - - - - - -GNU 1999 Jun 1 18 +GNU Readline 4.2 2001 Mar 5 18 diff --git a/doc/readline.3 b/doc/readline.3 index c1ed9cf..037b1bb 100644 --- a/doc/readline.3 +++ b/doc/readline.3 @@ -6,9 +6,9 @@ .\" Case Western Reserve University .\" chet@ins.CWRU.Edu .\" -.\" Last Change: Tue Jun 1 13:28:03 EDT 1999 +.\" Last Change: Mon Mar 5 09:58:38 EST 2001 .\" -.TH READLINE 3 "1999 Jun 1" GNU +.TH READLINE 3 "2001 Mar 5" "GNU Readline 4.2" .\" .\" File Name macro. This used to be `.PN', for Path Name, .\" but Sun doesn't seem to like that very much. @@ -23,20 +23,19 @@ readline \- get a line from a user with editing .nf .ft B #include -#include -#include +#include +#include .ft .fi .LP .nf -.ft B -char *readline (prompt) -char *prompt; -.ft +\fIchar *\fP +.br +\fBreadline\fP (\fIconst char *prompt\fP); .fi .SH COPYRIGHT -.if n Readline is Copyright (C) 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc. -.if t Readline is Copyright \(co 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc. +.if n Readline is Copyright (C) 1989\-2001 by the Free Software Foundation, Inc. +.if t Readline is Copyright \(co 1989\-2001 by the Free Software Foundation, Inc. .SH DESCRIPTION .LP .B readline @@ -45,9 +44,10 @@ and return it, using .B prompt as a prompt. If .B prompt -is null, no prompt is issued. The line returned is allocated with -.IR malloc (3), -so the caller must free it when finished. The line returned +is \fBNULL\fP or the empty string, no prompt is issued. +The line returned is allocated with +.IR malloc (3); +the caller must free it when finished. The line returned has the final newline removed, so only the text of the line remains. .LP @@ -57,6 +57,11 @@ line. By default, the line editing commands are similar to those of emacs. A vi\-style line editing interface is also available. +.LP +This manual page describes only the most basic use of \fBreadline\fP. +Much more functionality is available; see +\fIThe GNU Readline Library\fP and \fIThe GNU History Library\fP +for additional information. .SH RETURN VALUE .LP .B readline @@ -130,6 +135,7 @@ or .RS C\-Meta\-u: universal\-argument .RE +.sp into the .I inputrc would make M\-C\-u execute the readline command @@ -137,15 +143,16 @@ would make M\-C\-u execute the readline command .PP The following symbolic character names are recognized while processing key bindings: -.IR RUBOUT , .IR DEL , .IR ESC , +.IR ESCAPE , .IR LFD , .IR NEWLINE , .IR RET , .IR RETURN , -.IR SPC , +.IR RUBOUT , .IR SPACE , +.IR SPC , and .IR TAB . .PP @@ -161,6 +168,7 @@ command or the text of a macro and a key sequence to which it should be bound. The name may be specified in one of two ways: as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP prefixes, or as a key sequence. +.PP When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP, .I keyname is the name of a key spelled out in English. For example: @@ -170,7 +178,7 @@ Control\-u: universal\-argument .br Meta\-Rubout: backward\-kill\-word .br -Control\-o: ">&output" +Control\-o: "> output" .RE .LP In the above example, @@ -184,7 +192,8 @@ and .I C\-o is bound to run the macro expressed on the right hand side (that is, to insert the text -.I >&output +.if t \f(CW> output\fP +.if n ``> output'' into the line). .PP In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, @@ -194,7 +203,8 @@ differs from above in that strings denoting an entire key sequence may be specified by placing the sequence within double quotes. Some GNU Emacs style key escapes can be -used, as in the following example. +used, as in the following example, but the symbolic character names +are not recognized. .sp .RS "\eC\-u": universal\-argument @@ -214,8 +224,11 @@ is bound to the function and .I "ESC [ 1 1 ~" is bound to insert the text -.BR "Function Key 1" . -The full set of GNU Emacs style escape sequences is +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences available when specifying +key sequences is .RS .PD 0 .TP @@ -232,10 +245,10 @@ an escape character backslash .TP .B \e" -literal " +literal ", a double quote .TP .B \e' -literal ' +literal ', a single quote .RE .PD .PP @@ -313,7 +326,8 @@ file with a statement of the form Except where noted, readline variables can take the values .B On or -.BR Off . +.B Off +(without regard to case). The variables and their default values are: .PP .PD 0 @@ -351,7 +365,7 @@ on the terminal. .B convert\-meta (On) If set to \fBOn\fP, readline will convert characters with the eighth bit set to an ASCII key sequence -by stripping the eighth bit and prepending an +by stripping the eighth bit and prefixing it with an escape character (in effect, using escape as the \fImeta prefix\fP). .TP .B disable\-completion (Off) @@ -361,7 +375,7 @@ mapped to \fBself-insert\fP. .TP .B editing\-mode (emacs) Controls whether readline begins with a set of key bindings similar -to \fIemacs\fP or \fIvi\fP. +to emacs or vi. .B editing\-mode can be set to either .B emacs @@ -384,12 +398,12 @@ becomes longer than the screen width rather than wrapping to a new line. .TP .B input\-meta (Off) If set to \fBOn\fP, readline will enable eight-bit input (that is, -it will not strip the high bit from the characters it reads), +it will not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. The name .B meta\-flag is a synonym for this variable. .TP -.B isearch\-terminators (``C\-[C\-J'') +.B isearch\-terminators (``C\-[ C\-J'') The string of characters that should terminate an incremental search without subsequently executing the character as a command. If this variable has not been given a value, the characters @@ -402,13 +416,13 @@ vi-command\fP, and .IR vi-insert . \fIvi\fP is equivalent to \fIvi-command\fP; \fIemacs\fP is equivalent to \fIemacs-standard\fP. The default value is -.IR emacs ; -the value of +.IR emacs . +The value of .B editing\-mode also affects the default keymap. .TP .B mark\-directories (On) -If set to \fBOn\fP, complete ) -Set the mark to the current point. If a +.B set\-mark (C\-@, M\- ) +Set the mark to the point. If a numeric argument is supplied, the mark is set to that position. .TP .B exchange\-point\-and\-mark (C\-x C\-x) @@ -894,8 +920,9 @@ character. A negative count searches for subsequent occurrences. The value of the readline .B comment\-begin variable is inserted at the beginning of the current line, and the line -is accepted as if a newline had been typed. This makes the current line -a shell comment. +is accepted as if a newline had been typed. The default value of +.B comment\-begin +makes the current line a shell comment. .TP .B dump\-functions Print all of the functions and their key bindings to the @@ -932,25 +959,23 @@ editing mode. .SH DEFAULT KEY BINDINGS .LP The following is a list of the default emacs and vi bindings. -Characters with the 8th bit set are written as M\- , and +Characters with the eighth bit set are written as M\- , and are referred to as .I metafied characters. The printable ASCII characters not mentioned in the list of emacs standard bindings are bound to the -.I self\-insert +.B self\-insert function, which just inserts the given character into the input line. In vi insertion mode, all characters not specifically mentioned are bound to -.IR self\-insert . +.BR self\-insert . Characters assigned to signal generation by .IR stty (1) or the terminal driver, such as C-Z or C-C, retain that function. -Upper and lower case -.I metafied -characters are bound to the same function in the emacs mode -meta keymap. +Upper and lower case metafied characters are bound to the same function in +the emacs mode meta keymap. The remaining characters are unbound, which causes readline to ring the bell (subject to the setting of the .B bell\-style @@ -1036,7 +1061,7 @@ Emacs Meta bindings "M-Y" yank-pop "M-\e" delete-horizontal-space "M-~" tilde-expand -"M-C-?" backward-delete-word +"M-C-?" backward-kill-word "M-_" yank-last-arg .PP Emacs Control-X bindings @@ -1096,6 +1121,7 @@ VI Command Mode functions "C-V" quoted-insert "C-W" unix-word-rubout "C-Y" yank +"C-_" vi-undo "\^ " forward-char "#" insert-comment "$" end-of-line @@ -1150,7 +1176,7 @@ VI Command Mode functions "r" vi-change-char "s" vi-subst "t" vi-char-search -"u" undo +"u" vi-undo "w" vi-next-word "x" vi-delete "y" vi-yank-to diff --git a/doc/readline.dvi b/doc/readline.dvi index 5d859d8..516c43c 100644 Binary files a/doc/readline.dvi and b/doc/readline.dvi differ diff --git a/doc/readline.html b/doc/readline.html index d8a2eda..8822671 100644 --- a/doc/readline.html +++ b/doc/readline.html @@ -1,14 +1,14 @@ + from /usr/homes/chet/src/bash/readline-src/doc/rlman.texinfo on 16 April 2001 --> GNU Readline Library GNU Readline Library
-Edition 4.1, for
-Readline Library
Version 4.1.January 2000
+Edition 4.2, for
+Readline Library
Version 4.2.Apr 2001
Brian Fox, Free Software Foundation Chet Ramey, Case Western Reserve University@@ -50,7 +50,7 @@
- Basic Behavior
- Custom Functions
- Readline Variables @@ -63,21 +63,24 @@
- Allowing Undoing
- Redisplay
- Modifying Text -
- Utility Functions -
- Alternate Interface -
- An Example +
- Character Input +
- Terminal Management +
- Utility Functions +
- Miscellaneous Functions +
- Alternate Interface +
- A Readline Example -
- Readline Signal Handling -
- Custom Completers +
- Readline Signal Handling +
- Custom Completers -
- Concept Index -
- Function and Variable Index +
- Concept Index +
- Function and Variable Index
@@ -114,7 +117,7 @@ by the Free Software Foundation.
-Copyright (C) 1988-1999 Free Software Foundation, Inc. +Copyright (C) 1988-2001 Free Software Foundation, Inc.
@@ -169,7 +172,7 @@ Compose key for typing accented characters.If you do not have a Meta or ALT key, or another key working as a Meta key, the identical keystroke can be generated by typing ESC -first, and then typing k. +first, and then typing k. Either process is known as metafying the k key.
@@ -204,8 +207,8 @@ as you type it in, allowing you to just fix your typo, and not forcing you to retype the majority of the line. Using these editing commands, you move the cursor to the place that needs correction, and delete or insert the text of the corrections. Then, when you are satisfied with -the line, you simply press RETURN. You do not have to be at the -end of the line to press RETURN; the entire line is accepted +the line, you simply press RET. You do not have to be at the +end of the line to press RET; the entire line is accepted regardless of the location of the cursor within the line. @@ -366,7 +369,7 @@ Kill from the cursor to the end of the current word, or, if between words, to the end of the next word. Word boundaries are the same as those used by M-f. -- M-DEL +
- M-DEL
- Kill from the cursor the start of the previous word, or, if between words, to the start of the previous word. @@ -375,7 +378,7 @@ Word boundaries are the same as those used by M-b.
- C-w
- Kill from the cursor to the previous whitespace. This is different than -M-DEL because the word boundaries differ. +M-DEL because the word boundaries differ.
Readline provides commands for searching through the command history for lines containing a specified string. -There are two search modes: incremental and non-incremental. +There are two search modes: incremental and non-incremental.
@@ -455,6 +459,8 @@ Any other key sequence bound to a Readline command will terminate the search and execute that command. For instance, a RET will terminate the search and accept the line, thereby executing the command from the history list. +A movement command will terminate the search, make the last line found +the current line, and begin editing.
@@ -477,7 +483,7 @@ of keybindings.
Any user can customize programs that use Readline by putting
commands in an inputrc file, conventionally in his home directory.
The name of this
-file is taken from the value of the environment variable INPUTRC
. If
+file is taken from the value of the environment variable @env{INPUTRC}. If
that variable is unset, the default is `~/.inputrc'.
set
command within the init file. Here is how to
+using the set
command within the init file.
+The syntax is simple:
+
+
++set variable value ++ +Here, for example, is how to change from the default Emacs-like key binding to use
vi
line editing commands:
@@ -528,14 +542,18 @@ change from the default Emacs-like key binding to use
set editing-mode vi
+Variable names and values, where appropriate, are recognized without regard
+to case.
+
A great deal of run-time behavior is changeable with the following
variables.
+
bell-style
comment-begin
insert-comment
command is executed. The default value
is "#"
.
@@ -557,17 +575,18 @@ The default value is `off'.
completion-query-items
100
.
+them; otherwise, they are simply listed.
+This variable must be set to an integer value greater than or equal to 0.
+The default limit is 100
.
convert-meta
disable-completion
self-insert
. The default is `off'.
editing-mode
editing-mode
variable controls which default set of
key bindings is used. By default, Readline starts up in Emacs editing
mode, where the keystrokes are most similar to Emacs. This variable can be
@@ -590,20 +609,20 @@ set to either `emacs' or `vi'.
enable-keypad
expand-tilde
horizontal-scroll-mode
input-meta
meta-flag
is a
synonym for this variable.
isearch-terminators
keymap
keymap
names are
emacs
,
@@ -638,6 +657,7 @@ Acceptable keymap
names are
emacs-meta
,
emacs-ctlx
,
vi
,
+vi-move
,
vi-command
, and
vi-insert
.
vi
is equivalent to vi-command
; emacs
is
@@ -652,14 +672,14 @@ appended. The default is `on'.
mark-modified-lines
output-meta
show-all-if-ambiguous
visible-stats
universal-argument
, and C-o is bound to run the macro
+universal-argument
,
+M-DEL is bound to the function backward-kill-word
, and
+C-o is bound to run the macro
expressed on the right hand side (that is, to insert the text
`> output' into the line).
+A number of symbolic character names are recognized while
+processing this key binding syntax:
+DEL,
+ESC,
+ESCAPE,
+LFD,
+NEWLINE,
+RET,
+RETURN,
+RUBOUT,
+SPACE,
+SPC,
+and
+TAB.
+
universal-argument
(just as it was in the first example),
`C-x C-r' is bound to the function re-read-init-file
,
and `ESC [ 1 1 ~' is bound to insert
@@ -798,11 +839,11 @@ horizontal tab
vertical tab
\nnn
ASCII
code is the octal value nnn
+the character whose ASCII code is the octal value nnn
(one to three digits)
\xnnn
ASCII
code is the hexadecimal value nnn
+the character whose ASCII code is the hexadecimal value nnn
(one to three digits)
@@ -866,7 +907,8 @@ for instance.
$include /etc/inputrc @@ -906,7 +949,7 @@ $include /etc/inputrcSample Init File
-Here is an example of an inputrc file. This illustrates key +Here is an example of an inputrc file. This illustrates key binding, variable assignment, and conditional syntax.
@@ -1030,14 +1073,14 @@ $endifThis section describes Readline commands that may be bound to key sequences. +Command names without an accompanying key sequence are unbound by default.
-Command names without an accompanying key sequence are unbound by default. -In the following descriptions, point refers to the current cursor -position, and mark refers to a cursor position saved by the +In the following descriptions, point refers to the current cursor +position, and mark refers to a cursor position saved by the
@@ -1047,45 +1090,45 @@ The text between the point and mark is referred to as the region.set-mark
command. -The text between the point and mark is referred to as the region. +The text between the point and mark is referred to as the region.
beginning-of-line (C-a)
end-of-line (C-e)
forward-char (C-f)
backward-char (C-b)
forward-word (M-f)
backward-word (M-b)
clear-screen (C-l)
redraw-current-line ()
accept-line (Newline, Return)
+accept-line (Newline or Return)
add_history()
.
+If this line is a modified history line, the history line is restored
+to its original state.
previous-history (C-p)
next-history (C-n)
beginning-of-history (M-<)
end-of-history (M->)
reverse-search-history (C-r)
forward-search-history (C-s)
non-incremental-reverse-search-history (M-p)
non-incremental-forward-search-history (M-n)
history-search-forward ()
history-search-backward ()
yank-nth-arg (M-C-y)
yank-last-arg (M-., M-_)
+yank-last-arg (M-. or M-_)
yank-nth-arg
.
@@ -1193,44 +1240,44 @@ list, inserting the last argument of each line in turn.
delete-char (C-d)
delete-char
, then
-return EOF
.
+return EOF.
backward-delete-char (Rubout)
forward-backward-delete-char ()
quoted-insert (C-q, C-v)
+quoted-insert (C-q or C-v)
tab-insert (M-TAB)
+tab-insert (M-TAB)
self-insert (a, b, A, 1, !, ...)
transpose-chars (C-t)
transpose-words (M-t)
upcase-word (M-u)
downcase-word (M-l)
capitalize-word (M-c)
kill-line (C-k)
backward-kill-line (C-x Rubout)
unix-line-discard (C-u)
kill-whole-line ()
kill-word (M-d)
forward-word
.
-backward-kill-word (M-DEL)
+backward-kill-word (M-DEL)
backward-word
.
unix-word-rubout (C-w)
delete-horizontal-space ()
kill-region ()
copy-region-as-kill ()
copy-backward-word ()
backward-word
.
By default, this command is unbound.
copy-forward-word ()
forward-word
.
By default, this command is unbound.
yank (C-y)
yank-pop (M-y)
yank
or yank-pop
.
digit-argument (M-0, M-1, ... M--)
+digit-argument (M-0, M-1, ... M--)
universal-argument ()
complete (TAB)
+complete (TAB)
possible-completions (M-?)
insert-completions (M-*)
possible-completions
.
menu-complete ()
complete
, but replaces the word to be completed
with a single match from the list of possible completions.
Repeated execution of menu-complete
steps through the list
of possible completions, inserting each match in turn.
-At the end of the list of completions, the bell is rung and the
-original text is restored.
+At the end of the list of completions, the bell is rung
+(subject to the setting of bell-style
)
+and the original text is restored.
An argument of n moves n positions forward in the list
of matches; a negative argument may be used to move backward
through the list.
-This command is intended to be bound to TAB
, but is unbound
+This command is intended to be bound to TAB, but is unbound
by default.
delete-char-or-list ()
delete-char
).
If at the end of the line, behaves identically to
@@ -1442,18 +1486,18 @@ This command is unbound by default.
start-kbd-macro (C-x ()
end-kbd-macro (C-x ))
call-last-kbd-macro (C-x e)
re-read-init-file (C-x C-r)
abort (C-g)
bell-style
).
do-uppercase-version (M-a, M-b, M-x, ...)
prefix-meta (ESC)
+prefix-meta (ESC)
undo (C-_, C-x C-u)
+undo (C-_ or C-x C-u)
revert-line (M-r)
undo
command enough times to get back to the beginning.
tilde-expand (M-~)
set-mark (C-@)
exchange-point-and-mark (C-x C-x)
character-search (C-])
character-search-backward (M-C-])
insert-comment (M-#)
comment-begin
variable is inserted at the beginning of the current line,
and the line is accepted as if a newline had been typed.
dump-functions ()
dump-variables ()
dump-macros ()
In order to switch interactively between emacs
and vi
-editing modes, use the command M-C-j (toggle-editing-mode).
+editing modes, use the command M-C-j (bound to emacs-editing-mode
+when in vi
mode and to vi-editing-mode in emacs
mode).
The Readline default is emacs
mode.
mail
,
ftp
, and sh
. For such programs, the default behaviour of
Readline is sufficient. This section describes how to use Readline in
the simplest way possible, perhaps to replace calls in your code to
-gets()
or fgets ()
.
+gets()
or fgets()
.
-
-The function readline ()
prints a prompt and then reads and returns
-a single line of text from the user. The line readline
-returns is allocated with malloc ()
; you should free ()
-the line when you are done with it. The declaration for readline
-in ANSI C is
+
+
+
+The function readline()
prints a prompt prompt
+and then reads and returns a single line of text from the user.
+If prompt is NULL
or the empty string, no prompt is displayed.
+The line readline
returns is allocated with malloc()
;
+the caller should free()
the line when it has finished with it.
+The declaration for readline
in ANSI C is
-char *readline (char *prompt);
+char *readline (const char *prompt);
@@ -1665,7 +1714,7 @@ Otherwise, the line is ended just as if a newline had been typed.
If you want the user to be able to get at the line later, (with
-C-p for example), you must call add_history ()
to save the
+C-p for example), you must call add_history()
to save the
line away in a history list of such lines.
It is preferable to avoid saving empty lines on the history list, since
users rarely have a burning need to reuse a blank line. Here is
-a function which usefully replaces the standard gets ()
library
+a function which usefully replaces the standard gets()
library
function, and has the advantage of no static buffer to overflow:
rl_bind_key ()
.
+with rl_bind_key()
.
-int rl_bind_key (int key, int (*function)());
+int rl_bind_key (int key, rl_command_func_t *function);
-rl_bind_key ()
takes two arguments: key is the character that
+rl_bind_key()
takes two arguments: key is the character that
you want to bind, and function is the address of the function to
-call when key is pressed. Binding TAB to rl_insert ()
+call when key is pressed. Binding TAB to rl_insert()
makes TAB insert itself.
-rl_bind_key ()
returns non-zero if key is not a valid
+rl_bind_key()
returns non-zero if key is not a valid
ASCII character code (between 0 and 255).
This code should be executed once at the start of your program; you
-might write a function called initialize_readline ()
which
+might write a function called initialize_readline()
which
performs this and other desired initializations, such as installing
-custom completers (see section Custom Completers).
+custom completers (see section Custom Completers).
readline.h
use the stdio
library, the file
-For readabilty, we declare a new type of object, called
-Function. A Function
is a C function which
-returns an int
. The type declaration for Function
is:
+For readabilty, we declare a number of new object types, all pointers
+to functions.
-typedef int Function ();
+The reason for declaring these new types is to make it easier to write
+code describing pointers to C functions with appropriately prototyped
+arguments and return values.
-The reason for declaring this new type is to make it easier to write
-code describing pointers to C functions. Let us say we had a variable
-called func which was a pointer to a function. Instead of the
-classic C declaration
+For instance, say we want to declare a variable func as a pointer
+to a function which takes two int
arguments and returns an
+int
(this is the type of all of the Readline bindable functions).
+Instead of the classic C declaration
-int (*)()func;
+int (*func)();
-we may write +or the ANSI-C style declaration
-Function *func;
+int (*func)(int, int);
-Similarly, there are +we may write
+
+rl_command_func_t *func;
-
-typedef void VFunction (); -typedef char *CPFunction (); and -typedef char **CPPFunction (); -- +
-for functions returning no value, pointer to char
, and
-pointer to pointer to char
, respectively.
+The full list of function pointer types available is
typedef int rl_command_func_t (int, int);
+typedef char *rl_compentry_func_t (const char *, int);
+typedef char **rl_completion_func_t (const char *, int, int);
+typedef char *rl_quote_func_t (char *, int, char *);
+typedef char *rl_dequote_func_t (char *, int);
+typedef int rl_compignore_func_t (char **);
+typedef void rl_compdisp_func_t (char **, int, int);
+typedef int rl_hook_func_t (void);
+typedef int rl_getc_func_t (FILE *);
+typedef int rl_linebuf_func_t (char *, int);
+typedef int rl_intfunc_t (int);
+#define rl_ivoidfunc_t rl_hook_func_t
+typedef int rl_icpfunc_t (char *);
+typedef int rl_icppfunc_t (char **);
+typedef void rl_voidfunc_t (void);
+typedef void rl_vintfunc_t (int);
+typedef void rl_vcpfunc_t (char *);
+typedef void rl_vcppfunc_t (char **);
+
rl_extend_line_buffer
is available to increase
@@ -1882,7 +1968,7 @@ the memory allocated to rl_line_buffer
.
@@ -1891,7 +1977,7 @@ The offset of the current cursor position in
rl_line_buffer
rl_line_buffer
. When
rl_point
is at the end of the line, rl_point
and
rl_end
are equal.
@@ -1901,8 +1987,8 @@ The number of characters present in rl_line_buffer
. When
+
readline()
causes
+Readline to return after accepting that many characters, rather
+than reading up to a character bound to accept-line
.
+
+
readline ()
, and should not be assigned to directly.
+readline()
, and should not be assigned to directly.
+The rl_set_prompt()
function (see section Redisplay) may
+be used to modify the prompt string after calling readline()
.
readline()
is called, it should set
this variable to a non-zero value after displaying the prompt.
@@ -1961,24 +2069,35 @@ never sets it.
+
@@ -1996,15 +2115,25 @@ The stdio stream from which Readline reads input.
+
readline
prints the first prompt.
readline
prints the first prompt.
readline
starts reading input characters.
@@ -2022,39 +2151,65 @@ starts reading input characters.
readline
will call indirectly through this pointer
+rl_getc
, the default readline
character input function
-(see section Utility Functions).
+rl_getc
, the default Readline character input function
+(see section Character Input).
readline
will call indirectly through this pointer
+rl_redisplay
, the default readline
+By default, it is set to rl_redisplay
, the default Readline
redisplay function (see section Redisplay).
+
int
flag that says whether or not to use eight-bit characters.
+By default, this is set to rl_prep_terminal
+(see section Terminal Management).
++
rl_prep_term_function
.
+By default, this is set to rl_deprep_terminal
+(see section Terminal Management).
+
+
+
RL_SETSTATE
macro, and unset with the
+RL_UNSETSTATE
macro. Use the RL_ISSTATE
macro to test
+whether a particular state bit is set. Current state bits include:
+
+
+RL_STATE_NONE
+RL_STATE_INITIALIZING
+RL_STATE_INITIALIZED
+RL_STATE_TERMPREPPED
+RL_STATE_READCMD
+RL_STATE_METANEXT
+RL_STATE_DISPATCHING
+RL_STATE_MOREINPUT
+RL_STATE_ISEARCH
+RL_STATE_NSEARCH
+RL_STATE_SEARCH
+RL_STATE_NUMERICARG
+RL_STATE_MACROINPUT
+RL_STATE_MACRODEF
+RL_STATE_OVERWRITE
+RL_STATE_COMPLETING
+RL_STATE_SIGHANDLER
+RL_STATE_UNDOING
+RL_STATE_DONE
+accept-line
+and is about to return the line to the caller.
++
+
+
rl_line_buffer
.
-
rl_bind_key ()
.
+function using rl_bind_key()
.
malloc ()
; you should free ()
it when you are done.
+malloc()
; the caller should free it by calling
+rl_discard_keymap()
when done.
@@ -2181,8 +2454,8 @@ change which keymap is active.
set keymap
inputrc line (see section Readline Init File).
set keymap
inputrc line (see section
+set keymap
inputrc line (see section Readline Init File).
set keymap
inputrc line (see section Binding Keys
-You associate keys with functions through the keymap. Readline has
-several internal keymaps: emacs_standard_keymap
,
+Key sequences are associate with functions through the keymap.
+Readline has several internal keymaps: emacs_standard_keymap
,
emacs_meta_keymap
, emacs_ctlx_keymap
,
vi_movement_keymap
, and vi_insertion_keymap
.
emacs_standard_keymap
is the default, and the examples in
@@ -2227,9 +2500,9 @@ this manual assume that.
-Since readline
installs a set of default key bindings the first
+Since readline()
installs a set of default key bindings the first
time it is called, there is always the danger that a custom binding
-installed before the first call to readline
will be overridden.
+installed before the first call to readline()
will be overridden.
An alternate mechanism is to install custom key bindings in an
initialization function assigned to the rl_startup_hook
variable
(see section Readline Variables).
@@ -2241,8 +2514,8 @@ These functions manage key bindings.
+
ISFUNC
), a macro
@@ -2306,7 +2589,7 @@ necessary. The initial keymap in which to do bindings is map.
inputrc
file and
perform any key bindings and variable assignments found
(see section Readline Init File).
@@ -2315,8 +2598,8 @@ perform any key bindings and variable assignments found
These functions allow you to find out what keys invoke named functions -and the functions invoked by a particular key sequence. +and the functions invoked by a particular key sequence. You may also +associate a new function name with an arbitrary function.
ISFUNC
,
-ISKMAP
, or ISMACR
).
+If map is NULL
, the current keymap is used. If type is
+not NULL
, the type of the object is returned in the int
variable
+it points to (one of ISFUNC
, ISKMAP
, or ISMACR
).
rl_outstream
. If readable is non-zero,
the list is formatted in such a way that it can be made part of an
@@ -2381,19 +2665,28 @@ the list is formatted in such a way that it can be made part of an
rl_outstream
.
free()
the array when you are done, but not the pointers.
++
Supporting the undo command is a painless thing, and makes your functions much more useful. It is certainly easy to try -something if you know you can undo it. I could use an undo function for -the stock market. +something if you know you can undo it.
If your function simply inserts text once, or deletes text once, and
-uses rl_insert_text ()
or rl_delete_text ()
to do it, then
+uses rl_insert_text()
or rl_delete_text()
to do it, then
undoing is already done for you automatically.
If you do multiple insertions or multiple deletions, or any combination
of these operations, you should group them together into one operation.
-This is done with rl_begin_undo_group ()
and
-rl_end_undo_group ()
.
+This is done with rl_begin_undo_group()
and
+rl_end_undo_group()
.
@@ -2433,36 +2725,36 @@ enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END };
Notice that UNDO_DELETE
means to insert some text, and
UNDO_INSERT
means to delete some text. That is, the undo code
-tells undo what to undo, not how to undo it. UNDO_BEGIN
and
-UNDO_END
are tags added by rl_begin_undo_group ()
and
-rl_end_undo_group ()
.
+tells what to undo, not how to undo it. UNDO_BEGIN
and
+UNDO_END
are tags added by rl_begin_undo_group()
and
+rl_end_undo_group()
.
rl_insert_text ()
and
-rl_delete_text ()
, but could be the result of calls to
-rl_add_undo ()
.
+information usually comes from calls to rl_insert_text()
and
+rl_delete_text()
, but could be the result of calls to
+rl_add_undo()
.
rl_begin_undo_group
-()
. There should be one call to rl_end_undo_group ()
-for each call to rl_begin_undo_group ()
.
+(). There should be one call to rl_end_undo_group()
+for each call to rl_begin_undo_group()
.
0
if there was
nothing to undo, non-zero if something was undone.
Finally, if you neither insert nor delete text, but directly modify the
-existing text (e.g., change its case), call rl_modifying ()
+existing text (e.g., change its case), call rl_modifying()
once, just before you modify the text. You must supply the indices of
the text range that you are going to modify.
@@ -2495,7 +2787,7 @@ the text range that you are going to modify.
rl_line_buffer
.
rl_line_buffer
.
printf
. The
-resulting string is displayed in the echo area. The echo area
++
rl_outstream
.
+If Readline has not been set to display meta characters directly, this
+will convert meta characters to a meta-prefixed key sequence.
+This is intended for use by applications which wish to do their own
+redisplay.
++
printf
,
+possibly containing conversion specifications such as `%d', and
+any additional arguments necessary to satisfy the conversion specifications.
+The resulting string is displayed in the echo area. The echo area
is also used to display numeric arguments and search strings.
rl_message
.
+displaying a new message in the message area with rl_message()
.
rl_save_prompt
.
+
readline()
. It may also be called to
+expand the primary prompt if the rl_on_new_line_with_prompt()
+function or rl_already_prompted
variable is used.
+It returns the number of visible characters on the last line of the
+(possibly multi-line) prompt.
++
rl_expand_prompt()
to expand the prompt and sets rl_prompt
+to the result.
+rl_save_prompt
.
+
rl_insert_text()
instead.
+
rl_stuff_char ()
, macros, and characters read from the keyboard.
+rl_stuff_char()
, macros, and characters read from the keyboard.
+While waiting for input, this function will call any function assigned to
+the rl_event_hook
variable.
rl_read_key ()
.
+rl_read_key()
.
rl_line_buffer
has enough space to hold len
-characters, possibly reallocating it if necessary.
+rl_read_key()
+is called. This sets rl_pending_input.
rl_execute_next()
. This works only if the
+pending input has not already been read with rl_read_key()
.
rl_read_key()
, Readline will
+wait for u microseconds for input before calling any function
+assigned to rl_event_hook
. The default waiting period is
+one-tenth of a second. Returns the old timeout value.
++
readline()
+can read a single character at a time from the keyboard.
+The meta_flag argument should be non-zero if Readline should
+read eight-bit input.
++
rl_prep_terminal()
, leaving the terminal in
+the state in which it was before the most recent call to
+rl_prep_terminal()
.
++
stty
) to their Readline equivalents. The bindings are performed
+in kmap.
++
vt100
).
-If terminal_name is NULL, the value of the TERM
+If terminal_name is NULL
, the value of the TERM
environment variable is used.
rl_line_buffer
has enough space to hold len
+characters, possibly reallocating it if necessary.
readline()
calls it before
+reading any input.
bell-style
.
+
+
matches
is the list
of strings, in argv format, such as a list of completion matches.
@@ -2732,37 +3147,38 @@ matches are displayed (see section Readline Init F
-The following are implemented as macros, defined in chartypes.h
.
+The following are implemented as macros, defined in chardefs.h
.
+Applications should refrain from using them.
+
rl_generic_bind()
instead.
++
rl_outstream
.
+If readable is non-zero, the list is formatted in such a way
+that it can be made part of an inputrc
file and re-read.
++
inputrc
+file (see section Readline Init File Syntax).
++
rl_outstream
.
+If readable is non-zero, the list is formatted in such a way
+that it can be made part of an inputrc
file and re-read.
++
blink-matching-paren
has been enabled.
+
An alternate interface is available to plain readline()
. Some
@@ -2800,18 +3273,19 @@ are functions available to make this easy.
rl_callback_read_char()
, which will read the next
character from the current input source. If that character completes the
@@ -2824,8 +3298,8 @@ line. EOF
is indicated by calling lhandler with a
Here is a function which changes lowercase characters to their uppercase @@ -2891,10 +3365,10 @@ invert_case_line (count, key) for (i = start; i != end; i++) { - if (uppercase_p (rl_line_buffer[i])) - rl_line_buffer[i] = to_lower (rl_line_buffer[i]); - else if (lowercase_p (rl_line_buffer[i])) - rl_line_buffer[i] = to_upper (rl_line_buffer[i]); + if (_rl_uppercase_p (rl_line_buffer[i])) + rl_line_buffer[i] = _rl_to_lower (rl_line_buffer[i]); + else if (_rl_lowercase_p (rl_line_buffer[i])) + rl_line_buffer[i] = _rl_to_upper (rl_line_buffer[i]); } /* Move point to on top of the last character changed. */ rl_point = (direction == 1) ? end - 1 : start; @@ -2904,18 +3378,18 @@ invert_case_line (count, key) -
Signals are asynchronous events sent to a process by the Unix kernel, sometimes on behalf of another process. They are intended to indicate -exceptional events, like a user pressing the interrupt key on his -terminal, or a network connection being broken. There is a class of -signals that can be sent to the process currently reading input from -the keyboard. Since Readline changes the terminal attributes when it -is called, it needs to perform special processing when a signal is -received to restore the terminal to a sane state, or provide application -writers with functions to do so manually. +exceptional events, like a user pressing the interrupt key on his terminal, +or a network connection being broken. There is a class of signals that can +be sent to the process currently reading input from the keyboard. Since +Readline changes the terminal attributes when it is called, it needs to +perform special processing when such a signal is received in order to +restore the terminal to a sane state, or provide application writers with +functions to do so manually.
@@ -2924,27 +3398,27 @@ number of signals (SIGINT
, SIGQUIT
, SIGTERMSIGALRM
, SIGTSTP
, SIGTTIN
, and SIGTTOU
).
When one of these signals is received, the signal handler
will reset the terminal attributes to those that were in effect before
-readline ()
was called, reset the signal handling to what it was
-before readline ()
was called, and resend the signal to the calling
+readline()
was called, reset the signal handling to what it was
+before readline()
was called, and resend the signal to the calling
application.
If and when the calling application's signal handler returns, Readline
will reinitialize the terminal and continue to accept input.
When a SIGINT
is received, the Readline signal handler performs
some additional work, which will cause any partially-entered line to be
-aborted (see the description of rl_free_line_state ()
).
+aborted (see the description of rl_free_line_state()
below).
There is an additional Readline signal handler, for SIGWINCH
, which
the kernel sends to a process whenever the terminal's size changes (for
example, if a user resizes an xterm
). The Readline SIGWINCH
-handler updates Readline's internal screen size state, and then calls any
-SIGWINCH
signal handler the calling application has installed.
+handler updates Readline's internal screen size information, and then calls
+any SIGWINCH
signal handler the calling application has installed.
Readline calls the application's SIGWINCH
signal handler without
resetting the terminal to its original state. If the application's signal
handler does more than update its idea of the terminal size and return (for
example, a longjmp
back to a main processing loop), it must
-call rl_cleanup_after_signal ()
(described below), to restore the
+call rl_cleanup_after_signal()
(described below), to restore the
terminal state.
readline ()
, not in
+values of these variables only when calling readline()
, not in
a signal handler, so Readline's internal signal state is not corrupted.
SIGINT
, SIGQUIT
, SIGTERM
, SIGALRM
,
SIGTSTP
, SIGTTIN
, and SIGTTOU
.
@@ -2973,7 +3447,7 @@ The default value of rl_catch_signals
is 1.
SIGWINCH
.
@@ -2994,9 +3468,9 @@ and internal state cleanup upon receipt of a signal.
readline ()
was called, and remove the Readline signal handlers for
+readline()
was called, and remove the Readline signal handlers for
all signals, depending on the values of rl_catch_signals
and
rl_catch_sigwinch
.
rl_catch_signals
and
rl_cleanup_after_signal ()
. The
+should be called before rl_cleanup_after_signal()
. The
Readline signal handler for SIGINT
calls this to abort the
current input line.
rl_catch_signals
and
rl_catch_sigwinch
.
@@ -3027,15 +3501,40 @@ handlers, depending on the values of rl_catch_signals
and
If an application does not wish Readline to catch SIGWINCH
, it may
-call rl_resize_terminal ()
to force Readline to update its idea of
-the terminal size when a SIGWINCH
is received.
+call rl_resize_terminal()
or rl_set_screen_size()
to force
+Readline to update its idea of the terminal size when a SIGWINCH
+is received.
+
+If an application does not want to install a SIGWINCH
handler, but
+is still interested in the screen dimensions, Readline's idea of the screen
+size may be queried.
+
+
+
SIGINT
, SIGQUIT
,
SIGTERM
, SIGALRM
, SIGTSTP
, SIGTTIN
,
SIGTTOU
, and SIGWINCH
, depending on the values of
@@ -3057,15 +3556,15 @@ Install Readline's signal handler for SIGINT
, SIGQUIT
,
rl_set_signals ()
.
+rl_set_signals()
.
Typically, a program that reads commands from the user has a way of @@ -3077,15 +3576,15 @@ cooperate to provide this service.
In order to complete some text, the full list of possible completions @@ -3106,32 +3605,33 @@ There are three major functions used to perform completion:
rl_complete ()
. This function is
-called with the same arguments as other Readline
-functions intended for interactive use: count and
-invoking_key. It isolates the word to be completed and calls
-completion_matches ()
to generate a list of possible completions.
+The user-interface function rl_complete()
. This function is
+called with the same arguments as other bindable Readline functions:
+count and invoking_key.
+It isolates the word to be completed and calls
+rl_completion_matches()
to generate a list of possible completions.
It then either lists the possible completions, inserts the possible
completions, or actually performs the
completion, depending on which behavior is desired.
completion_matches ()
uses your
-generator function to generate the list of possible matches, and
-then returns the array of these matches. You should place the address
-of your generator function in rl_completion_entry_function
.
+The internal function rl_completion_matches()
uses an
+application-supplied generator function to generate the list of
+possible matches, and then returns the array of these matches.
+The caller should place the address of its generator function in
+rl_completion_entry_function
.
completion_matches ()
, returning a string each time. The
+rl_completion_matches()
, returning a string each time. The
arguments to the generator function are text and state.
text is the partial word to be completed. state is zero the
first time the function is called, allowing the generator to perform
any necessary initialization, and a positive non-zero integer for
-each subsequent call. When the generator function returns
-(char *)NULL
this signals completion_matches ()
that there are
+each subsequent call. The generator function returns
+(char *)NULL
to inform rl_completion_matches()
that there are
no more possibilities left. Usually the generator function computes the
list of possible completions when state is zero, and returns them
one at a time on subsequent calls. Each string the generator function
@@ -3143,27 +3643,28 @@ frees the strings when it has finished with them.
completion_matches ()
). The default is to do filename completion.
+rl_completion_matches()
). The default is to do filename completion.
completion_matches
-()
. If the value of rl_completion_entry_function
is
-(Function *)NULL
then the default filename generator function,
-filename_completion_function ()
, is used.
+rl_completion_matches()
.
+If the value of rl_completion_entry_function
is
+NULL
then the default filename generator
+function, rl_filename_completion_function()
, is used.
Here is the complete list of callable completion functions present in @@ -3173,7 +3674,7 @@ Readline.
completion_matches ()
and rl_completion_entry_function
).
+rl_completion_matches()
and rl_completion_entry_function
).
The default is to do filename
-completion. This calls rl_complete_internal ()
with an
+completion. This calls rl_complete_internal()
with an
argument depending on invoking_key.
rl_complete
-()
. This calls rl_complete_internal ()
with an argument of
+(). This calls rl_complete_internal()
with an argument of
`?'.
rl_complete ()
.
-This calls rl_complete_internal ()
with an argument of `*'.
+partially-completed word. See description of rl_complete()
.
+This calls rl_complete_internal()
with an argument of `*'.
(char *)
which is a list of completions for
-text. If there are no completions, returns (char **)NULL
.
+NULL
.
The first entry in the returned array is the substitution for text.
The remaining entries are the possible completions. The array is
terminated with a NULL
pointer.
@@ -3229,7 +3730,7 @@ terminated with a NULL
pointer.
entry_func is a function of two args, and returns a
-(char *)
. The first argument is text. The second is a
+char *
. The first argument is text. The second is a
state argument; it is zero on the first call, and non-zero on subsequent
calls. entry_func returns a NULL
pointer to the caller
when there are no more matches.
@@ -3238,20 +3739,20 @@ when there are no more matches.
completion_matches ()
.
-NULL
means to use filename_completion_function ()
, the default
+rl_completion_matches()
.
+NULL
means to use rl_filename_completion_function()
, the default
filename completer.
rl_line_buffer
saying
-what the boundaries of text are. If this function exists and
-returns NULL
, or if this variable is set to NULL
, then
-rl_complete ()
will call the value of
+start and end are indices in rl_line_buffer
defining
+the boundaries of text, which is a character string.
+If this function exists and returns NULL
, or if this variable is
+set to NULL
, then rl_complete()
will call the value of
rl_completion_entry_function
to generate matches, otherwise the
array of strings returned will be used.
+If this function sets the rl_attempted_completion_over
+variable to a non-zero value, Readline will not perform its default
+completion even if this function returns no matches.
rl_filename_quote_characters
appears in a completed filename. The function is called with
text, match_type, and quote_pointer. The text
@@ -3308,8 +3812,8 @@ to reset this character.
rl_completer_word_break_characters
should be
@@ -3337,7 +3841,7 @@ used to break words for the completer.
" \t\n\"\\'`@$><=;|&{("
.
rl_complete_internal ()
. The default list is the value of
+rl_complete_internal()
. The default list is the value of
rl_basic_word_break_characters
.
rl_completer_word_break_characters
are treated as any other character,
unless they also appear within this list.
@@ -3386,8 +3890,8 @@ unless they also appear within this list.
rl_filename_quote_characters
and rl_filename_quoting_desired
+is set to a non-zero value.
rl_filename_quoting_function
.
+
rl_attempted_completion_function
sets this variable to a non-zero
+value, Readline will not perform its default filename completion even
+if the application's completion function returns no matches.
+It should be set only by an application's completion function.
++
rl_complete_internal()
+(see section Completion Functions) for the list of characters.
+
self-insert
.
NULL
terminated array of matches.
@@ -3479,19 +4007,25 @@ from the array must be freed.
Here is a small application demonstrating the use of the GNU Readline @@ -3533,19 +4067,25 @@ history list. #include <readline/readline.h> #include <readline/history.h> -extern char *getwd (); extern char *xmalloc (); /* The names of functions that actually do the manipulation. */ -int com_list (), com_view (), com_rename (), com_stat (), com_pwd (); -int com_delete (), com_help (), com_cd (), com_quit (); +int com_list __P((char *)); +int com_view __P((char *)); +int com_rename __P((char *)); +int com_stat __P((char *)); +int com_pwd __P((char *)); +int com_delete __P((char *)); +int com_help __P((char *)); +int com_cd __P((char *)); +int com_quit __P((char *)); /* A structure which contains information on the commands this program can understand. */ typedef struct { char *name; /* User printable name of the function. */ - Function *func; /* Function to call to do the job. */ + rl_icpfunc_t *func; /* Function to call to do the job. */ char *doc; /* Documentation for this function. */ } COMMAND; @@ -3561,7 +4101,7 @@ COMMAND commands[] = { { "rename", com_rename, "Rename FILE to NEWNAME" }, { "stat", com_stat, "Print out statistics on FILE" }, { "view", com_view, "View the contents of FILE" }, - { (char *)NULL, (Function *)NULL, (char *)NULL } + { (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL } }; /* Forward declarations. */ @@ -3571,7 +4111,7 @@ COMMAND *find_command (); /* The name of this program, as taken from argv[0]. */ char *progname; -/* When non-zero, this global means the user is done using this program. */ +/* When non-zero, this means the user is done using this program. */ int done; char * @@ -3701,29 +4241,29 @@ stripwhite (string) /* */ /* **************************************************************** */ -char *command_generator (); -char **fileman_completion (); +char *command_generator __P((const char *, int)); +char **fileman_completion __P((const char *, int, int)); -/* Tell the GNU Readline library how to complete. We want to try to complete - on command names if this is the first word in the line, or on filenames - if not. */ +/* Tell the GNU Readline library how to complete. We want to try to + complete on command names if this is the first word in the line, or + on filenames if not. */ initialize_readline () { /* Allow conditional parsing of the ~/.inputrc file. */ rl_readline_name = "FileMan"; /* Tell the completer that we want a crack first. */ - rl_attempted_completion_function = (CPPFunction *)fileman_completion; + rl_attempted_completion_function = fileman_completion; } -/* Attempt to complete on the contents of TEXT. START and END bound the - region of rl_line_buffer that contains the word to complete. TEXT is - the word to complete. We can use the entire contents of rl_line_buffer - in case we want to do some simple parsing. Return the array of matches, - or NULL if there aren't any. */ +/* Attempt to complete on the contents of TEXT. START and END + bound the region of rl_line_buffer that contains the word to + complete. TEXT is the word to complete. We can use the entire + contents of rl_line_buffer in case we want to do some simple + parsing. Returnthe array of matches, or NULL if there aren't any. */ char ** fileman_completion (text, start, end) - char *text; + const char *text; int start, end; { char **matches; @@ -3734,32 +4274,33 @@ fileman_completion (text, start, end) to complete. Otherwise it is the name of a file in the current directory. */ if (start == 0) - matches = completion_matches (text, command_generator); + matches = rl_completion_matches (text, command_generator); return (matches); } -/* Generator function for command completion. STATE lets us know whether - to start from scratch; without any state (i.e. STATE == 0), then we - start at the top of the list. */ +/* Generator function for command completion. STATE lets us + know whether to start from scratch; without any state + (i.e. STATE == 0), then we start at the top of the list. */ char * command_generator (text, state) - char *text; + const char *text; int state; { static int list_index, len; char *name; - /* If this is a new word to complete, initialize now. This includes - saving the length of TEXT for efficiency, and initializing the index - variable to 0. */ + /* If this is a new word to complete, initialize now. This + includes saving the length of TEXT for efficiency, and + initializing the index variable to 0. */ if (!state) { list_index = 0; len = strlen (text); } - /* Return the next name which partially matches from the command list. */ + /* Return the next name which partially matches from the + command list. */ while (name = commands[list_index].name) { list_index++; @@ -3904,7 +4445,7 @@ com_pwd (ignore) { char dir[1024], *s; - s = getwd (dir); + s = getcwd (dir, sizeof(dir) - 1); if (s == 0) { printf ("Error getting pwd: %s\n", dir); @@ -3915,7 +4456,8 @@ com_pwd (ignore) return 0; } -/* The user wishes to quit using this program. Just set DONE non-zero. */ +/* The user wishes to quit using this program. Just set DONE + non-zero. */ com_quit (arg) char *arg; { @@ -3950,7 +4492,7 @@ valid_argument (caller, arg) -
Jump to: c @@ -3965,6 +4507,8 @@ Jump to: - r - +v +- y
Jump to: +_ +- a - b @@ -4022,8 +4572,6 @@ Jump to: - k - -l -- m - n @@ -4046,281 +4594,313 @@ Jump to: - y
+
-This document was generated on 1 March 2000 using the +This document was generated on 16 April 2001 using the texi2html translator version 1.52.
diff --git a/doc/readline.info b/doc/readline.info index ae6767f..ad721c5 100644 --- a/doc/readline.info +++ b/doc/readline.info @@ -1,5 +1,5 @@ -This is Info file readline.info, produced by Makeinfo version 1.68 from -the input file /usr/homes/chet/src/bash/readline-src/doc/rlman.texinfo. +This is readline.info, produced by makeinfo version 4.0 from +/usr/homes/chet/src/bash/readline-src/doc/rlman.texinfo. INFO-DIR-SECTION Libraries START-INFO-DIR-ENTRY @@ -10,7 +10,7 @@ END-INFO-DIR-ENTRY aids in the consistency of user interface across discrete programs that need to provide a command line interface. - Copyright (C) 1988-1999 Free Software Foundation, Inc. + Copyright (C) 1988-2001 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice pare @@ -72,10 +72,10 @@ Introduction to Line Editing The following paragraphs describe the notation used to represent keystrokes. - The text