2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: history.h /main/3 1995/11/01 16:40:17 rswiston $ */
24 /***************************************************************
26 * AT&T - PROPRIETARY *
28 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF *
29 * AT&T BELL LABORATORIES *
30 * AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN *
31 * ACCORDANCE WITH APPLICABLE AGREEMENTS *
33 * Copyright (c) 1995 AT&T Corp. *
34 * Unpublished & Not for Publication *
35 * All Rights Reserved *
37 * The copyright notice above does not evidence any *
38 * actual or intended publication of such source code *
40 * This software was created by the *
41 * Advanced Software Technology Department *
42 * AT&T Bell Laboratories *
44 * For further information contact *
45 * {research,attmail}!dgk *
47 ***************************************************************/
49 /* : : generated by proto : : */
52 #if !defined(__PROTO__)
53 #if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
54 #if defined(__cplusplus)
55 #define __MANGLE__ "C"
60 #define __PROTO__(x) x
62 #define __PARAM__(n,o) n
63 #if !defined(__STDC__) && !defined(__cplusplus)
64 #if !defined(c_plusplus)
75 #define __PROTO__(x) ()
76 #define __OTORP__(x) x
77 #define __PARAM__(n,o) o
85 #if defined(__cplusplus) || defined(c_plusplus)
86 #define __VARARG__ ...
90 #if defined(__STDARG__)
91 #define __VA_START__(p,a) va_start(p,a)
93 #define __VA_START__(p,a) va_start(p)
98 * Interface for history mechanism
99 * written by David Korn
106 #define HIST_CHAR '!'
107 #define HIST_VERSION 1 /* history file format version no. */
111 Sfdisc_t histdisc; /* discipline for history */
112 Sfio_t *histfp; /* history file stream pointer */
113 char *histname; /* name of history file */
114 long histind; /* current command number index */
115 int histsize; /* number of accessible history lines */
118 #endif /* _HIST_PRIVATE */
128 /* the following are readonly */
129 extern __MANGLE__ const char hist_fname[];
131 extern __MANGLE__ int _Hist;
132 #define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
133 #define hist_max(hp) ((int)((hp)->histind))
134 /* these are the history interface routines */
135 extern __MANGLE__ int sh_histinit __PROTO__((void));
136 extern __MANGLE__ void hist_cancel __PROTO__((History_t*));
137 extern __MANGLE__ void hist_close __PROTO__((History_t*));
138 extern __MANGLE__ int hist_copy __PROTO__((char*, int, int, int));
139 extern __MANGLE__ void hist_eof __PROTO__((History_t*));
140 extern __MANGLE__ Histloc_t hist_find __PROTO__((History_t*,char*,int, int, int));
141 extern __MANGLE__ void hist_flush __PROTO__((History_t*));
142 extern __MANGLE__ void hist_list __PROTO__((History_t*,Sfio_t*, off_t, int, char*));
143 extern __MANGLE__ int hist_match __PROTO__((History_t*,off_t, char*, int*));
144 extern __MANGLE__ off_t hist_tell __PROTO__((History_t*,int));
145 extern __MANGLE__ off_t hist_seek __PROTO__((History_t*,int));
146 extern __MANGLE__ char *hist_word __PROTO__((char*, int, int));
148 extern __MANGLE__ Histloc_t hist_locate __PROTO__((History_t*,int, int, int));
149 #endif /* SHOPT_ESH */
151 #endif /* HIST_VERSION */