acpica: Exclude nsdumpdv.c, it's obsolete & its code is #ifdef'd out.
[dragonfly.git] / contrib / texinfo / info / info.h
1 /* info.h -- Header file which includes all of the other headers.
2    $Id: info.h,v 1.9 2008/05/10 14:39:05 gray Exp $
3
4    Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2007
5    Free Software Foundation, Inc.
6
7    This program 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 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20    Written by Brian Fox (bfox@ai.mit.edu). */
21
22 #ifndef INFO_H
23 #define INFO_H
24
25 /* We always want these, so why clutter up the compile command?  */
26 #define HANDLE_MAN_PAGES
27 #define NAMED_FUNCTIONS
28 #define INFOKEY
29
30 /* System dependencies.  */
31 #include "system.h"
32
33 /* Some of our other include files use these.  */
34 typedef int Function ();
35 typedef void VFunction ();
36 typedef char *CFunction ();
37
38 #include "filesys.h"
39 #include "doc.h"
40 #include "display.h"
41 #include "session.h"
42 #include "echo-area.h"
43 #include "footnotes.h"
44 #include "gc.h"
45
46 #include "string.h"
47 #include "mbiter.h"
48 #include "mbchar.h"
49
50 #define info_toupper(x) (islower (x) ? toupper (x) : x)
51 #define info_tolower(x) (isupper (x) ? tolower (x) : x)
52
53 #if !defined (whitespace)
54 #  define whitespace(c) ((c == ' ') || (c == '\t'))
55 #endif /* !whitespace */
56
57 #if !defined (whitespace_or_newline)
58 #  define whitespace_or_newline(c) (whitespace (c) || (c == '\n'))
59 #endif /* !whitespace_or_newline */
60
61 /* Add POINTER to the list of pointers found in ARRAY.  SLOTS is the number
62    of slots that have already been allocated.  INDEX is the index into the
63    array where POINTER should be added.  GROW is the number of slots to grow
64    ARRAY by, in the case that it needs growing.  TYPE is a cast of the type
65    of object stored in ARRAY (e.g., NODE_ENTRY *. */
66 #define add_pointer_to_array(pointer, idx, array, slots, grow, type) \
67   do { \
68     if (idx + 2 >= slots) \
69       array = (type *)(xrealloc (array, (slots += grow) * sizeof (type))); \
70     array[idx++] = (type)pointer; \
71     array[idx] = (type)NULL; \
72   } while (0)
73
74 #define maybe_free(x) do { if (x) free (x); } while (0)
75
76 #if !defined (zero_mem) && defined (HAVE_MEMSET)
77 #  define zero_mem(mem, length) memset (mem, 0, length)
78 #endif /* !zero_mem && HAVE_MEMSET */
79
80 #if !defined (zero_mem) && defined (HAVE_BZERO)
81 #  define zero_mem(mem, length) bzero (mem, length)
82 #endif /* !zero_mem && HAVE_BZERO */
83
84 #if !defined (zero_mem)
85 #  define zero_mem(mem, length) \
86   do {                                  \
87         register int zi;                \
88         register unsigned char *place;  \
89                                         \
90         place = (unsigned char *)mem;   \
91         for (zi = 0; zi < length; zi++) \
92           place[zi] = 0;                \
93       } while (0)
94 #endif /* !zero_mem */
95
96 \f
97 /* A structure associating the nodes visited in a particular window. */
98 typedef struct {
99   WINDOW *window;               /* The window that this list is attached to. */
100   NODE **nodes;                 /* Array of nodes visited in this window. */
101   int *pagetops;                /* For each node in NODES, the pagetop. */
102   long *points;                 /* For each node in NODES, the point. */
103   int current;                  /* Index in NODES of the current node. */
104   int nodes_index;              /* Index where to add the next node. */
105   int nodes_slots;              /* Number of slots allocated to NODES. */
106 } INFO_WINDOW;
107
108 /* Array of structures describing for each window which nodes have been
109    visited in that window. */
110 extern INFO_WINDOW **info_windows;
111
112 /* For handling errors.  If you initialize the window system, you should
113    also set info_windows_initialized_p to non-zero.  It is used by the
114    info_error () function to determine how to format and output errors. */
115 extern int info_windows_initialized_p;
116
117 /* Non-zero if an error message has been printed. */
118 extern int info_error_was_printed;
119
120 /* Non-zero means ring terminal bell on errors. */
121 extern int info_error_rings_bell_p;
122
123 /* Non-zero means default keybindings are loosely modeled on vi(1).  */
124 extern int vi_keys_p;
125
126 /* Non-zero means don't remove ANSI escape sequences from man pages.  */
127 extern int raw_escapes_p;
128
129 /* Print FORMAT with ARG1 and ARG2.  If the window system was initialized,
130    then the message is printed in the echo area.  Otherwise, a message is
131    output to stderr. */
132 extern void info_error (const char *format, void *arg1, void *arg2);
133
134 extern void add_file_directory_to_path (char *filename);
135
136 /* Error message defines. */
137 extern const char *msg_cant_find_node;
138 extern const char *msg_cant_file_node;
139 extern const char *msg_cant_find_window;
140 extern const char *msg_cant_find_point;
141 extern const char *msg_cant_kill_last;
142 extern const char *msg_no_menu_node;
143 extern const char *msg_no_foot_node;
144 extern const char *msg_no_xref_node;
145 extern const char *msg_no_pointer;
146 extern const char *msg_unknown_command;
147 extern const char *msg_term_too_dumb;
148 extern const char *msg_at_node_bottom;
149 extern const char *msg_at_node_top;
150 extern const char *msg_one_window;
151 extern const char *msg_win_too_small;
152 extern const char *msg_cant_make_help;
153
154 \f
155 #if defined(INFOKEY)
156 /* Found in variables.c. */
157 extern void set_variable_to_value (char *name, char *value);
158 #endif /* INFOKEY */
159
160 /* Found in m-x.c.  */
161 extern char *read_function_name (const char *prompt, WINDOW *window);
162
163 #endif /* !INFO_H */