summaryrefslogtreecommitdiff
path: root/src/info2html/data.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/info2html/data.h')
-rw-r--r--src/info2html/data.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/info2html/data.h b/src/info2html/data.h
new file mode 100644
index 00000000..581e4ca5
--- /dev/null
+++ b/src/info2html/data.h
@@ -0,0 +1,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 */