diff options
Diffstat (limited to 'lib/libedit/hist.h')
-rw-r--r-- | lib/libedit/hist.h | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/lib/libedit/hist.h b/lib/libedit/hist.h index 3f0fb9ed39e6..7fbaaa4a5c78 100644 --- a/lib/libedit/hist.h +++ b/lib/libedit/hist.h @@ -34,44 +34,47 @@ * SUCH DAMAGE. * * @(#)hist.h 8.1 (Berkeley) 6/4/93 + * $NetBSD: hist.h,v 1.5 2000/09/04 22:06:30 lukem Exp $ + * $FreeBSD$ */ /* * el.hist.c: History functions */ #ifndef _h_el_hist -#define _h_el_hist +#define _h_el_hist #include "histedit.h" -typedef const HistEvent * (*hist_fun_t) __P((ptr_t, int, ...)); +typedef int (*hist_fun_t)(ptr_t, HistEvent *, int, ...); typedef struct el_history_t { - char *buf; /* The history buffer */ - char *last; /* The last character */ - int eventno; /* Event we are looking for */ - ptr_t ref; /* Argument for history fcns */ - hist_fun_t fun; /* Event access */ - const HistEvent *ev; /* Event cookie */ + char *buf; /* The history buffer */ + size_t sz; /* Size of history buffer */ + char *last; /* The last character */ + int eventno; /* Event we are looking for */ + ptr_t ref; /* Argument for history fcns */ + hist_fun_t fun; /* Event access */ + HistEvent ev; /* Event cookie */ } el_history_t; -#define HIST_FUN(el, fn, arg) \ - ((((el)->el_history.ev = \ - (*(el)->el_history.fun)((el)->el_history.ref, fn, arg)) == NULL) ? \ - NULL : (el)->el_history.ev->str) +#define HIST_FUN(el, fn, arg) \ + ((((*(el)->el_history.fun) ((el)->el_history.ref, &(el)->el_history.ev, \ + fn, arg)) == -1) ? NULL : (el)->el_history.ev.str) #define HIST_NEXT(el) HIST_FUN(el, H_NEXT, NULL) #define HIST_FIRST(el) HIST_FUN(el, H_FIRST, NULL) #define HIST_LAST(el) HIST_FUN(el, H_LAST, NULL) #define HIST_PREV(el) HIST_FUN(el, H_PREV, NULL) #define HIST_EVENT(el, num) HIST_FUN(el, H_EVENT, num) -#define HIST_LOAD(el, fname) HIST_FUN(el, H_LOAD fname) -#define HIST_SAVE(el, fname) HIST_FUN(el, H_SAVE fname) +#define HIST_LOAD(el, fname) HIST_FUN(el, H_LOAD fname) +#define HIST_SAVE(el, fname) HIST_FUN(el, H_SAVE fname) -protected int hist_init __P((EditLine *)); -protected void hist_end __P((EditLine *)); -protected el_action_t hist_get __P((EditLine *)); -protected int hist_set __P((EditLine *, hist_fun_t, ptr_t)); -protected int hist_list __P((EditLine *, int, char **)); +protected int hist_init(EditLine *); +protected void hist_end(EditLine *); +protected el_action_t hist_get(EditLine *); +protected int hist_set(EditLine *, hist_fun_t, ptr_t); +protected int hist_list(EditLine *, int, char **); +protected int hist_enlargebuf(EditLine *, size_t, size_t); #endif /* _h_el_hist */ |