Home | History | Annotate | Download | only in ksh

Lines Matching refs:HISTORY

1 /*	$NetBSD: history.c,v 1.20 2024/09/08 17:28:36 rillig Exp $	*/
4 * command history
6 * only implements in-memory history.
11 * a) the original in-memory history mechanism
12 * b) a simple file saving history mechanism done by sjg@zen
22 __RCSID("$NetBSD: history.c,v 1.20 2024/09/08 17:28:36 rillig Exp $");
29 #ifdef HISTORY
71 static char **current; /* current position in history[] */
72 static int curpos; /* current index in history[] */
73 static char *hname; /* current name of history file */
214 /* List history */
295 /* Save cmd in history, execute cmd (cmd gets trashed) */
383 * get pointer to history given pattern
401 bi_errorf("%s: not in history", str);
408 bi_errorf("%s: not in history", str);
421 bi_errorf("%s: not in history", str);
429 /* Return a pointer to the newest command in the history */
435 bi_errorf("no history (yet)");
443 /* Return a pointer to the newest command in the history */
448 bi_errorf("no history (yet)");
532 * set history
542 /* save most recent history */
556 * set history file
557 * This can mean reloading/resetting/starting history file
588 /* let's reset the history */
598 * initialise the history vector
612 * save command in history
663 * A simple history file implementation.
664 * At present we only save the history when we exit.
667 * to save its history.
684 # if 1 /* Don't use history file unless the user asks for it */
729 * save our history.
731 * If the history file is read-only we do nothing.
732 * Handy for having all shells start with a useful history set.
771 * a) permit HISTSIZE to control number of lines of history stored
772 * b) maintain a physical history file
779 * save command in history
809 * Write history data to a file nominated by HISTFILE
810 * if HISTFILE is unset then history still happens, but
813 * same history. This is ksh behaviour.
820 * Open a history file
943 * Shrink the history file to histsize lines
1026 * load the history structure from the stored data
1079 * Insert a line into the history at a specified number
1098 * write a command to the end of the history file
1100 * that the history file has not changed in size.
1102 * and we should read those commands to update our history
1171 * add magic to the history file
1183 #else /* HISTORY */
1185 /* No history to be compiled in: dummy routines to avoid lots more ifdefs */
1205 errorf("history not enabled");
1207 #endif /* HISTORY */