Home | History | Annotate | Download | only in libedit

Lines Matching defs:history

1 /*	$NetBSD: history.c,v 1.64 2024/07/11 05:41:24 kre Exp $	*/
38 static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
40 __RCSID("$NetBSD: history.c,v 1.64 2024/07/11 05:41:24 kre Exp $");
45 * hist.c: TYPE(History) access functions
100 struct TYPE(history) {
101 void *h_ref; /* Argument for history fcns */
102 int h_ent; /* Last entry point for history */
110 history_vfun_t h_clear; /* Clear the history list */
137 static int history_setsize(TYPE(History) *, TYPE(HistEvent) *, int);
138 static int history_getsize(TYPE(History) *, TYPE(HistEvent) *);
139 static int history_setunique(TYPE(History) *, TYPE(HistEvent) *, int);
140 static int history_getunique(TYPE(History) *, TYPE(HistEvent) *);
141 static int history_set_fun(TYPE(History) *, TYPE(History) *);
142 static int history_load(TYPE(History) *, const char *);
143 static int history_save(TYPE(History) *, const char *);
144 static int history_save_fp(TYPE(History) *, size_t, FILE *);
145 static int history_prev_event(TYPE(History) *, TYPE(HistEvent) *, int);
146 static int history_next_event(TYPE(History) *, TYPE(HistEvent) *, int);
147 static int history_next_string(TYPE(History) *, TYPE(HistEvent) *,
149 static int history_prev_string(TYPE(History) *, TYPE(HistEvent) *,
156 * Builtin- history implementation
171 int flags; /* TYPE(History) flags */
220 STR("can't read history from file"),
221 STR("can't write history"),
223 STR("history size negative"),
224 STR("function not allowed with other history-functions-set the default"),
246 * Default function to return the first event in the history.
266 * Default function to return the last event in the history.
286 * Default function to return the next event in the history.
311 * Default function to return the previous event in the history.
337 * Default function to return the current event in the history.
357 * Default function to set the current event in the history to the
384 * Default function to set the current event in the history to the
445 /* magic value to skip delete (just set to n-th history) */
532 * Default function to enter an item in the history
558 * Default history initialization function
584 * Default history cleanup function
606 TYPE(History) *
607 FUN(history,init)(void)
610 TYPE(History) *h = (TYPE(History) *) h_malloc(sizeof(*h));
635 * clean up history;
638 FUN(history,end)(TYPE(History) *h)
651 * Set history number of events
654 history_setsize(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
671 * Get number of events currently in history
674 history_getsize(TYPE(History) *h, TYPE(HistEvent) *ev)
690 * Set if adjacent equal events should not be entered in history.
693 history_setunique(TYPE(History) *h, TYPE(HistEvent) *ev, int uni)
706 * Get if adjacent equal events should not be entered in history.
709 history_getunique(TYPE(History) *h, TYPE(HistEvent) *ev)
721 * Set history functions
724 history_set_fun(TYPE(History) *h, TYPE(History) *nh)
768 * TYPE(History) load function
771 history_load(TYPE(History) *h, const char *fname)
832 * TYPE(History) save function
835 history_save_fp(TYPE(History) *h, size_t nelem, FILE *fp)
885 * History save function
888 history_save(TYPE(History) *h, const char *fname)
911 history_prev_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
925 history_next_evdata(TYPE(History) *h, TYPE(HistEvent) *ev, int num, void **d)
945 history_next_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
962 history_prev_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
980 history_next_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
994 /* history():
995 * User interface to history functions.
998 FUNW(history)(TYPE(History) *h, TYPE(HistEvent) *ev, int fun, ...)
1120 TYPE(History) hf;
1141 FUN(history,end)(h);