]> git.ipfire.org Git - thirdparty/bash.git/blame - lib/readline/histlib.h
Imported from ../bash-2.05.tar.gz.
[thirdparty/bash.git] / lib / readline / histlib.h
CommitLineData
ccc6cda3
JA
1/* histlib.h -- internal definitions for the history library. */
2/* Copyright (C) 1989, 1992 Free Software Foundation, Inc.
3
4 This file contains the GNU History Library (the Library), a set of
5 routines for managing the text of previously typed lines.
6
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
bb70624e 9 the Free Software Foundation; either version 2, or (at your option)
ccc6cda3
JA
10 any later version.
11
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.
16
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,
bb70624e 20 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
ccc6cda3
JA
21
22#if !defined (_HISTLIB_H_)
23#define _HISTLIB_H_
24
bb70624e 25#if !defined (STREQ)
ccc6cda3 26#define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0))
bb70624e
JA
27#define STREQN(a, b, n) (((n) == 0) ? (1) \
28 : ((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0))
29#endif
ccc6cda3
JA
30
31#ifndef savestring
32# ifndef strcpy
33extern char *strcpy ();
34# endif
35#define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))
36#endif
37
38#ifndef whitespace
39#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
40#endif
41
42#ifndef _rl_digit_p
43#define _rl_digit_p(c) ((c) >= '0' && (c) <= '9')
44#endif
45
46#ifndef _rl_digit_value
47#define _rl_digit_value(c) ((c) - '0')
48#endif
49
50#ifndef member
51# ifndef strchr
52extern char *strchr ();
53# endif
54#define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0)
55#endif
56
57#ifndef FREE
58# define FREE(x) if (x) free (x)
59#endif
60
61/* Possible history errors passed to hist_error. */
62#define EVENT_NOT_FOUND 0
63#define BAD_WORD_SPEC 1
64#define SUBST_FAILED 2
65#define BAD_MODIFIER 3
b72432fd 66#define NO_PREV_SUBST 4
ccc6cda3
JA
67
68/* Possible definitions for history starting point specification. */
69#define ANCHORED_SEARCH 1
70#define NON_ANCHORED_SEARCH 0
71
72/* Possible definitions for what style of writing the history file we want. */
73#define HISTORY_APPEND 0
74#define HISTORY_OVERWRITE 1
75
bb70624e
JA
76/* Some variable definitions shared across history source files. */
77extern int history_offset;
78
ccc6cda3 79#endif /* !_HISTLIB_H_ */