2 /* : : generated by proto : : */
3 /***********************************************************************
5 * This software is part of the ast package *
6 * Copyright (c) 1982-2010 AT&T Intellectual Property *
7 * and is licensed under the *
8 * Common Public License, Version 1.0 *
9 * by AT&T Intellectual Property *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
15 * Information and Software Systems Research *
19 * David Korn <dgk@research.att.com> *
21 ***********************************************************************/
24 #if !defined(__PROTO__)
25 #include <prototyped.h>
27 #if !defined(__LINKAGE__)
28 #define __LINKAGE__ /* 2004-08-11 transition */
32 * Interface for history mechanism
33 * written by David Korn
40 #define HIST_VERSION 1 /* history file format version no. */
44 Sfdisc_t histdisc
; /* discipline for history */
45 Sfio_t
*histfp
; /* history file stream pointer */
46 char *histname
; /* name of history file */
47 int32_t histind
; /* current command number index */
48 int histsize
; /* number of accessible history lines */
51 #endif /* _HIST_PRIVATE */
61 /* the following are readonly */
62 extern __MANGLE__
const char hist_fname
[];
64 extern __MANGLE__
int _Hist
;
65 #define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
66 #define hist_max(hp) ((int)((hp)->histind))
67 /* these are the history interface routines */
68 extern __MANGLE__
int sh_histinit
__PROTO__((__V_
*));
69 extern __MANGLE__
void hist_cancel
__PROTO__((History_t
*));
70 extern __MANGLE__
void hist_close
__PROTO__((History_t
*));
71 extern __MANGLE__
int hist_copy
__PROTO__((char*, int, int, int));
72 extern __MANGLE__
void hist_eof
__PROTO__((History_t
*));
73 extern __MANGLE__ Histloc_t hist_find
__PROTO__((History_t
*,char*,int, int, int));
74 extern __MANGLE__
void hist_flush
__PROTO__((History_t
*));
75 extern __MANGLE__
void hist_list
__PROTO__((History_t
*,Sfio_t
*, off_t
, int, char*));
76 extern __MANGLE__
int hist_match
__PROTO__((History_t
*,off_t
, char*, int*));
77 extern __MANGLE__ off_t hist_tell
__PROTO__((History_t
*,int));
78 extern __MANGLE__ off_t hist_seek
__PROTO__((History_t
*,int));
79 extern __MANGLE__
char *hist_word
__PROTO__((char*, int, int));
81 extern __MANGLE__ Histloc_t hist_locate
__PROTO__((History_t
*,int, int, int));
82 #endif /* SHOPT_ESH */
84 #endif /* HIST_VERSION */