1 /* histlib.h -- internal definitions for the history library. */
2 /* Copyright (C) 1989, 1992 Free Software Foundation, Inc.
4 This file contains the GNU History Library (the Library), a set of
5 routines for managing the text of previously typed lines.
7 The Library is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 The Library is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 The GNU General Public License is often shipped with GNU software, and
18 is generally kept in a file called COPYING or LICENSE. If you do not
19 have a copy of the license, write to the Free Software Foundation,
20 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
22 #if !defined (_HISTLIB_H_)
25 /* Function pointers can be declared as (Function *)foo. */
26 #if !defined (_FUNCTION_DEF)
27 # define _FUNCTION_DEF
28 typedef int Function ();
29 typedef void VFunction ();
30 typedef char *CPFunction ();
31 typedef char **CPPFunction ();
32 #endif /* _FUNCTION_DEF */
35 #define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0))
36 #define STREQN(a, b, n) (((n) == 0) ? (1) \
37 : ((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0))
42 extern char *strcpy ();
44 #define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))
48 #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
52 #define _rl_digit_p(c) ((c) >= '0' && (c) <= '9')
55 #ifndef _rl_digit_value
56 #define _rl_digit_value(c) ((c) - '0')
61 extern char *strchr ();
63 #define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0)
67 # define FREE(x) if (x) free (x)
70 /* Possible history errors passed to hist_error. */
71 #define EVENT_NOT_FOUND 0
72 #define BAD_WORD_SPEC 1
73 #define SUBST_FAILED 2
74 #define BAD_MODIFIER 3
75 #define NO_PREV_SUBST 4
77 /* Possible definitions for history starting point specification. */
78 #define ANCHORED_SEARCH 1
79 #define NON_ANCHORED_SEARCH 0
81 /* Possible definitions for what style of writing the history file we want. */
82 #define HISTORY_APPEND 0
83 #define HISTORY_OVERWRITE 1
85 /* Some variable definitions shared across history source files. */
86 extern int history_offset
;
88 #endif /* !_HISTLIB_H_ */
This page took 0.031639 seconds and 4 git commands to generate.