1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1982-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * David Korn <dgk@research.att.com> *
19 ***********************************************************************/
23 * Interface for history mechanism
24 * written by David Korn
31 #define HIST_VERSION 1 /* history file format version no. */
35 Sfdisc_t histdisc
; /* discipline for history */
36 Sfio_t
*histfp
; /* history file stream pointer */
37 char *histname
; /* name of history file */
38 int32_t histind
; /* current command number index */
39 int histsize
; /* number of accessible history lines */
42 #endif /* _HIST_PRIVATE */
52 /* the following are readonly */
53 extern const char hist_fname
[];
56 #define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
57 #define hist_max(hp) ((int)((hp)->histind))
58 /* these are the history interface routines */
59 extern int sh_histinit(void *);
60 extern void hist_cancel(History_t
*);
61 extern void hist_close(History_t
*);
62 extern int hist_copy(char*, int, int, int);
63 extern void hist_eof(History_t
*);
64 extern Histloc_t
hist_find(History_t
*,char*,int, int, int);
65 extern void hist_flush(History_t
*);
66 extern void hist_list(History_t
*,Sfio_t
*, off_t
, int, char*);
67 extern int hist_match(History_t
*,off_t
, char*, int*);
68 extern off_t
hist_tell(History_t
*,int);
69 extern off_t
hist_seek(History_t
*,int);
70 extern char *hist_word(char*, int, int);
72 extern Histloc_t
hist_locate(History_t
*,int, int, int);
73 #endif /* SHOPT_ESH */
75 #endif /* HIST_VERSION */