summaryrefslogtreecommitdiff
path: root/buttress.h
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>1999-01-30 21:35:36 +0000
committerSimon Tatham <anakin@pobox.com>1999-01-30 21:35:36 +0000
commitf91811f57de0561cc7c8efb5897a6b62f5c0e0b2 (patch)
tree0f942e70bd4936e5806874193d17ba90693cd313 /buttress.h
downloadhalibut-f91811f57de0561cc7c8efb5897a6b62f5c0e0b2.zip
halibut-f91811f57de0561cc7c8efb5897a6b62f5c0e0b2.tar.gz
halibut-f91811f57de0561cc7c8efb5897a6b62f5c0e0b2.tar.bz2
halibut-f91811f57de0561cc7c8efb5897a6b62f5c0e0b2.tar.xz
Initial checkin of skeleton application. About to start reading files
[originally from svn r22]
Diffstat (limited to 'buttress.h')
-rw-r--r--buttress.h113
1 files changed, 113 insertions, 0 deletions
diff --git a/buttress.h b/buttress.h
new file mode 100644
index 0000000..afb38ae
--- /dev/null
+++ b/buttress.h
@@ -0,0 +1,113 @@
+#ifndef BUTTRESS_BUTTRESS_H
+#define BUTTRESS_BUTTRESS_H
+
+#ifdef __GNUC__
+#define NORETURN __attribute__((__noreturn__))
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+/*
+ * Structure tags
+ */
+typedef struct input_Tag input;
+typedef struct paragraph_Tag paragraph;
+typedef struct word_Tag word;
+
+/*
+ * Data structure to hold all the file names etc for input
+ */
+#define INPUT_PUSHBACK_MAX 16
+struct input_Tag {
+ char **filenames; /* complete list of input files */
+ int nfiles; /* how many in the list */
+ FILE *currfp; /* the currently open one */
+ int currindex; /* which one is that in the list */
+ char pushback[INPUT_PUSHBACK_MAX]; /* pushed-back input characters */
+ int npushback;
+};
+
+/*
+ * Data structure to hold the input form of the source, ie a linked
+ * list of paragraphs
+ */
+struct paragraph_Tag {
+ paragraph *next;
+ int type;
+ char *keyword; /* for IR, IA, and heading paras */
+ word *words; /* list of words in paragraph */
+} paragraph;
+enum {
+ para_IA, /* index alias */
+ para_IR, /* index rewrite */
+ para_Chapter,
+ para_Appendix,
+ para_Heading,
+ para_Subsect,
+ para_Normal,
+ para_Bullet,
+ para_Code
+};
+
+/*
+ * Data structure to hold an individual word
+ */
+struct word_Tag {
+ word *next;
+ int type;
+ char *text;
+}
+enum {
+ word_Normal,
+ word_Emph,
+ word_Code,
+ word_IndexRef /* always invisible */
+}
+
+/*
+ * error.c
+ */
+void fatal(int code, ...) NORETURN;
+void error(int code, ...);
+enum {
+ err_nomemory, /* out of memory */
+ err_optnoarg, /* option `-%s' requires an argument */
+ err_nosuchopt, /* unrecognised option `-%s' */
+ err_noinput, /* no input files */
+};
+
+/*
+ * malloc.c
+ */
+void *smalloc(int size);
+void *srealloc(void *p, int size);
+void sfree(void *p);
+
+/*
+ * help.c
+ */
+void help(void);
+void usage(void);
+void showversion(void);
+
+/*
+ * licence.c
+ */
+void licence(void);
+
+/*
+ * version.c
+ */
+const char *const version;
+
+/*
+ * input.c
+ */
+paragraph *read_input(input *in);
+
+#endif