summaryrefslogtreecommitdiff
path: root/src/info2html/data.h
blob: 581e4ca5671ec292c735a1182263e83b5288ca8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef DATA_H
#define DATA_H

/* data.h - first cut at data structures for info2html filter */
/* many of these are motivated by the source code to the 'info' program */

/* be quiet or not? */
static int be_quiet=1;

/* line_number we're on */
static int work_line_number;

/* file we're working on */
char work_filename[1024];

/* node we're working on */
char work_node[1024];

/* some type's we'll want to use below */
typedef struct info_menu_entry MENU_ENTRY;

/* the basic component of an info file is a Node */
/* a node is described by (FILENAME)NODENAME */
/* .next and .prev are normally along the same branch as current node */
/* .up is normally 'one branch' up the tree above current branch. */
/* All can be arbitrary links however                             */
/* menu entry is just a linked list of references */

typedef struct {
  char *filename;                /* file in which this node exists */
  char *nodename;                /* name of this node */
  char *contents;                /* text within this node */
  int  contlen;                  /* length of contents */
  char *next;                    /* node which follows this one */
  char *prev;                    /* node previous to this one */
  char *up;                      /* node above this one */
  MENU_ENTRY *menu;              /* linked list of refs from this node */
  char *menu_start;              /* ptr to start of menu text in contents */
} NODE;

/* a reference is a link to a node */
typedef struct {
  char *refname;                  /* menu name for reference */
  NODE *node;                     /* descriptor of node we point at */
} REFERENCE;


struct info_menu_entry{
  char          *header;          /* header to go before menu */
  REFERENCE     *ref;
  struct info_menu_entry    *next;
};

#define INFO_FF '\014'
#define INFO_COOKIE '\037'


#define MENU_START "* Menu:"
#define MENU_ENTRY "* "


#endif /* DATA_H */