commit 359b46ad56bb1b9225af58adeaa87bb588a072f3 Author: Gavin Smith Date: Sun Mar 9 15:41:52 2014 +0000 * nodes.h (NODE): New fields references, up, prev, next. * info-utils.h, nodes.h (REFERENCE): New field 'type'. typedef declaration moved. * nodes.h (REFERENCE_XREF, REFERENCE_MENU_ITEM): New preprocessor symbols. diff --git a/info-utils.h b/info-utils.h index 79e690f..ec3be15 100644 --- a/info-utils.h +++ b/info-utils.h @@ -26,17 +26,6 @@ #include "window.h" #include "search.h" -/* Structure which describes a node reference, such as a menu entry or - cross reference. Arrays of such references can be built by calling - info_menus_of_node () or info_xrefs_of_node (). */ -typedef struct { - char *label; /* User Label. */ - char *filename; /* File where this node can be found. */ - char *nodename; /* Name of the node. */ - int start, end; /* Offsets within the containing node of LABEL. */ - int line_number; /* Specific line number a menu item points to. */ -} REFERENCE; - /* When non-zero, various display and input functions handle ISO Latin character sets correctly. */ extern int ISO_Latin_p; diff --git a/nodes.h b/nodes.h index ca45eb4..2220784 100644 --- a/nodes.h +++ b/nodes.h @@ -26,6 +26,22 @@ /* User code interface. */ +/* Structure which describes a node reference, such as a menu entry or + cross reference. Arrays of such references can be built by calling + info_menus_of_node () or info_xrefs_of_node (). */ +typedef struct { + char *label; /* User Label. */ + char *filename; /* File where this node can be found. */ + char *nodename; /* Name of the node. */ + int start, end; /* Offsets within the containing node of LABEL. */ + int line_number; /* Specific line number a menu item points to. */ + int type; /* Whether reference is a xref or a menu item */ +} REFERENCE; + +/* Possible values of REFERENCE.type */ +#define REFERENCE_XREF 0 +#define REFERENCE_MENU_ITEM 1 + /* Callers generally only want the node itself. This structure is used to pass node information around. None of the information in this structure should ever be directly freed. The structure itself can @@ -43,10 +59,14 @@ typedef struct { unsigned long display_pos; /* Where to display at, if nonzero. */ long body_start; /* Offset of the actual node body */ int flags; /* See immediately below. */ + REFERENCE **references; /* Cross-references or menu items in node. + references == 0 implies uninitialized, + not empty */ long nodestart; /* The offset of the start of this node. */ char *content_cache; /* Cache of the node contents; used if the node contents must be preprocessed before displaying it. */ + char *up, *prev, *next; /* Names of nearby nodes. */ } NODE; /* Defines that can appear in NODE->flags. All informative. */