modified: makefile
[GalaxyCodeBases.git] / c_cpp / etc / calc / hist.h
blob08bf9dc21156aa0c5263f7a23d5d231ff7c84b63
1 /*
2 * hist - definitions for command history module
4 * Copyright (C) 1999-2007 David I. Bell
6 * Calc is open software; you can redistribute it and/or modify it under
7 * the terms of the version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
10 * Calc is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 * Public License for more details.
15 * A copy of version 2.1 of the GNU Lesser General Public License is
16 * distributed with calc under the filename COPYING-LGPL. You should have
17 * received a copy with calc; if not, write to Free Software Foundation, Inc.
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * @(#) $Revision: 30.1 $
21 * @(#) $Id: hist.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
22 * @(#) $Source: /usr/local/src/bin/calc/RCS/hist.h,v $
24 * Under source code control: 1993/05/02 20:09:20
25 * File existed as early as: 1993
27 * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
31 #if !defined(__HIST_H__)
32 #define __HIST_H__
36 * Default binding file and history size.
38 #ifndef HIST_BINDING_FILE
39 #define HIST_BINDING_FILE "/usr/lib/hist.bind"
40 #endif
42 #ifndef HIST_SIZE
43 #define HIST_SIZE (1024*10)
44 #endif
48 * path search defines
50 #define HOMECHAR '~' /* char which indicates home directory */
51 #define DOTCHAR '.' /* char which indicates current directory */
52 #define PATHCHAR '/' /* char which separates path components */
53 #if defined(__MSDOS__) || defined(__WIN32)
54 #define LISTCHAR ';' /* char which separates paths in a list */
55 #else
56 #define LISTCHAR ':' /* char which separates paths in a list */
57 #endif
61 * Possible returns from hist_init. Note that an error from hist_init does
62 * not prevent calling the other routines, but fancy command line editing
63 * is then disabled.
65 #define HIST_SUCCESS 0 /* successfully inited */
66 #define HIST_INITED 1 /* initialization is already done */
67 #define HIST_NOFILE 2 /* bindings file could not be read */
68 #define HIST_NOTTY 3 /* terminal modes could not be set */
71 E_FUNC int hist_init(char *filename);
72 E_FUNC void hist_term(void);
73 E_FUNC size_t hist_getline(char *prompt, char *buf, size_t len);
74 E_FUNC void hist_saveline(char *line, int len);
77 #endif /* !__HIST_H__ */