diff options
Diffstat (limited to 'hist.h')
-rw-r--r-- | hist.h | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: hist.h,v 1.3 1997/01/11 06:47:56 lukem Exp $ */ +/* $NetBSD: hist.h,v 1.6 2001/01/10 07:45:41 jdolecek Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -42,25 +42,25 @@ * 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) @@ -70,10 +70,11 @@ typedef struct el_history_t { #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 */ |