1999-01-14 19:35:19 +00:00
|
|
|
|
/* info.h -- Header file which includes all of the other headers.
|
2000-01-17 10:39:58 +00:00
|
|
|
|
$Id: info.h,v 1.14 1999/09/25 16:10:04 karl Exp $
|
1997-01-11 02:12:38 +00:00
|
|
|
|
|
2000-01-17 10:39:58 +00:00
|
|
|
|
Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
|
1997-01-11 02:12:38 +00:00
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
|
|
Written by Brian Fox (bfox@ai.mit.edu). */
|
|
|
|
|
|
2000-01-17 10:39:58 +00:00
|
|
|
|
#ifndef INFO_H
|
1999-01-14 19:35:19 +00:00
|
|
|
|
#define INFO_H
|
|
|
|
|
|
|
|
|
|
/* We always want these, so why clutter up the compile command? */
|
|
|
|
|
#define HANDLE_MAN_PAGES
|
|
|
|
|
#define NAMED_FUNCTIONS
|
|
|
|
|
|
|
|
|
|
/* System dependencies. */
|
|
|
|
|
#include "system.h"
|
|
|
|
|
|
|
|
|
|
/* Some of our other include files use these. */
|
|
|
|
|
typedef int Function ();
|
|
|
|
|
typedef void VFunction ();
|
|
|
|
|
typedef char *CFunction ();
|
|
|
|
|
|
1997-01-11 02:12:38 +00:00
|
|
|
|
|
|
|
|
|
#include "filesys.h"
|
|
|
|
|
#include "display.h"
|
|
|
|
|
#include "session.h"
|
1999-01-14 19:35:19 +00:00
|
|
|
|
#include "echo-area.h"
|
1997-01-11 02:12:38 +00:00
|
|
|
|
#include "doc.h"
|
|
|
|
|
#include "footnotes.h"
|
|
|
|
|
#include "gc.h"
|
|
|
|
|
|
1999-01-14 19:35:19 +00:00
|
|
|
|
#define info_toupper(x) (islower (x) ? toupper (x) : x)
|
|
|
|
|
#define info_tolower(x) (isupper (x) ? tolower (x) : x)
|
|
|
|
|
|
|
|
|
|
#if !defined (whitespace)
|
|
|
|
|
# define whitespace(c) ((c == ' ') || (c == '\t'))
|
|
|
|
|
#endif /* !whitespace */
|
|
|
|
|
|
|
|
|
|
#if !defined (whitespace_or_newline)
|
|
|
|
|
# define whitespace_or_newline(c) (whitespace (c) || (c == '\n'))
|
|
|
|
|
#endif /* !whitespace_or_newline */
|
|
|
|
|
|
|
|
|
|
/* Add POINTER to the list of pointers found in ARRAY. SLOTS is the number
|
|
|
|
|
of slots that have already been allocated. INDEX is the index into the
|
|
|
|
|
array where POINTER should be added. GROW is the number of slots to grow
|
|
|
|
|
ARRAY by, in the case that it needs growing. TYPE is a cast of the type
|
|
|
|
|
of object stored in ARRAY (e.g., NODE_ENTRY *. */
|
|
|
|
|
#define add_pointer_to_array(pointer, idx, array, slots, grow, type) \
|
|
|
|
|
do { \
|
|
|
|
|
if (idx + 2 >= slots) \
|
|
|
|
|
array = (type *)(xrealloc (array, (slots += grow) * sizeof (type))); \
|
|
|
|
|
array[idx++] = (type)pointer; \
|
|
|
|
|
array[idx] = (type)NULL; \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
#define maybe_free(x) do { if (x) free (x); } while (0)
|
|
|
|
|
|
|
|
|
|
#if !defined (zero_mem) && defined (HAVE_MEMSET)
|
|
|
|
|
# define zero_mem(mem, length) memset (mem, 0, length)
|
|
|
|
|
#endif /* !zero_mem && HAVE_MEMSET */
|
|
|
|
|
|
|
|
|
|
#if !defined (zero_mem) && defined (HAVE_BZERO)
|
|
|
|
|
# define zero_mem(mem, length) bzero (mem, length)
|
|
|
|
|
#endif /* !zero_mem && HAVE_BZERO */
|
|
|
|
|
|
|
|
|
|
#if !defined (zero_mem)
|
|
|
|
|
# define zero_mem(mem, length) \
|
|
|
|
|
do { \
|
|
|
|
|
register int zi; \
|
|
|
|
|
register unsigned char *place; \
|
|
|
|
|
\
|
|
|
|
|
place = (unsigned char *)mem; \
|
|
|
|
|
for (zi = 0; zi < length; zi++) \
|
|
|
|
|
place[zi] = 0; \
|
|
|
|
|
} while (0)
|
|
|
|
|
#endif /* !zero_mem */
|
|
|
|
|
|
|
|
|
|
|
1997-01-11 02:12:38 +00:00
|
|
|
|
/* A structure associating the nodes visited in a particular window. */
|
|
|
|
|
typedef struct {
|
1999-01-14 19:35:19 +00:00
|
|
|
|
WINDOW *window; /* The window that this list is attached to. */
|
|
|
|
|
NODE **nodes; /* Array of nodes visited in this window. */
|
|
|
|
|
int *pagetops; /* For each node in NODES, the pagetop. */
|
|
|
|
|
long *points; /* For each node in NODES, the point. */
|
|
|
|
|
int current; /* Index in NODES of the current node. */
|
|
|
|
|
int nodes_index; /* Index where to add the next node. */
|
|
|
|
|
int nodes_slots; /* Number of slots allocated to NODES. */
|
1997-01-11 02:12:38 +00:00
|
|
|
|
} INFO_WINDOW;
|
|
|
|
|
|
|
|
|
|
/* Array of structures describing for each window which nodes have been
|
|
|
|
|
visited in that window. */
|
|
|
|
|
extern INFO_WINDOW **info_windows;
|
|
|
|
|
|
|
|
|
|
/* For handling errors. If you initialize the window system, you should
|
|
|
|
|
also set info_windows_initialized_p to non-zero. It is used by the
|
|
|
|
|
info_error () function to determine how to format and output errors. */
|
|
|
|
|
extern int info_windows_initialized_p;
|
|
|
|
|
|
|
|
|
|
/* Non-zero if an error message has been printed. */
|
|
|
|
|
extern int info_error_was_printed;
|
|
|
|
|
|
|
|
|
|
/* Non-zero means ring terminal bell on errors. */
|
|
|
|
|
extern int info_error_rings_bell_p;
|
|
|
|
|
|
2000-01-17 10:39:58 +00:00
|
|
|
|
/* Non-zero means default keybindings are loosely modeled on vi(1). */
|
|
|
|
|
extern int vi_keys_p;
|
|
|
|
|
|
1997-01-11 02:12:38 +00:00
|
|
|
|
/* Print FORMAT with ARG1 and ARG2. If the window system was initialized,
|
|
|
|
|
then the message is printed in the echo area. Otherwise, a message is
|
|
|
|
|
output to stderr. */
|
|
|
|
|
extern void info_error ();
|
|
|
|
|
|
|
|
|
|
/* The version numbers of Info. */
|
1999-01-14 19:35:19 +00:00
|
|
|
|
extern int info_major_version, info_minor_version;
|
1997-01-11 02:12:38 +00:00
|
|
|
|
|
|
|
|
|
/* Error message defines. */
|
2000-01-17 10:39:58 +00:00
|
|
|
|
extern char *msg_cant_find_node;
|
|
|
|
|
extern char *msg_cant_file_node;
|
|
|
|
|
extern char *msg_cant_find_window;
|
|
|
|
|
extern char *msg_cant_find_point;
|
|
|
|
|
extern char *msg_cant_kill_last;
|
|
|
|
|
extern char *msg_no_menu_node;
|
|
|
|
|
extern char *msg_no_foot_node;
|
|
|
|
|
extern char *msg_no_xref_node;
|
|
|
|
|
extern char *msg_no_pointer;
|
|
|
|
|
extern char *msg_unknown_command;
|
|
|
|
|
extern char *msg_term_too_dumb;
|
|
|
|
|
extern char *msg_at_node_bottom;
|
|
|
|
|
extern char *msg_at_node_top;
|
|
|
|
|
extern char *msg_one_window;
|
|
|
|
|
extern char *msg_win_too_small;
|
|
|
|
|
extern char *msg_cant_make_help;
|
1999-01-14 19:35:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Found in info-utils.c. */
|
|
|
|
|
extern char *filename_non_directory ();
|
|
|
|
|
|
|
|
|
|
#if !defined (BUILDING_LIBRARY)
|
|
|
|
|
/* Found in session.c */
|
|
|
|
|
extern int info_windows_initialized_p;
|
|
|
|
|
|
|
|
|
|
/* Found in window.c. */
|
|
|
|
|
extern void message_in_echo_area (), unmessage_in_echo_area ();
|
|
|
|
|
#endif /* !BUILDING_LIBRARY */
|
1997-01-11 02:12:38 +00:00
|
|
|
|
|
1999-01-14 19:35:19 +00:00
|
|
|
|
#endif /* !INFO_H */
|