Support for \cfg{input-charset}. Input files can now be in ASCII,
[sgt/halibut] / halibut.h
index f9d22a2..9aa2c59 100644 (file)
--- a/halibut.h
+++ b/halibut.h
@@ -6,6 +6,8 @@
 #include <time.h>
 #include <string.h>
 
+#include "charset.h"
+
 #ifdef __GNUC__
 #define NORETURN __attribute__((__noreturn__))
 #else
@@ -66,6 +68,10 @@ struct input_Tag {
     filepos pos;
     int reportcols;                   /* report column numbers in errors */
     macrostack *stack;                /* macro expansions in force */
+    int defcharset, charset;          /* character sets for input files */
+    charset_state csstate;
+    wchar_t wc[16];                   /* wide chars from input conversion */
+    int nwc, wcpos;                   /* size of, and position in, wc[] */
 };
 
 /*
@@ -114,6 +120,10 @@ enum {
     para_LcontPop,                    /* end continuation of list item */
     para_QuotePush,                   /* begin block quote */
     para_QuotePop,                    /* end block quote */
+    /*
+     * Back ends may define their own paragraph types beyond here,
+     * in case they need to use them internally.
+     */
     para_NotParaType                  /* placeholder value */
 };
 
@@ -153,7 +163,12 @@ enum {
     word_XrefEnd,                     /* (invisible; no text) */
     word_IndexRef,                    /* (always an invisible one) */
     word_HyperLink,                   /* (invisible) */
-    word_HyperEnd                     /* (also invisible; no text) */
+    word_HyperEnd,                    /* (also invisible; no text) */
+    /*
+     * Back ends may define their own word types beyond here, in
+     * case they need to use them internally.
+     */
+    word_NotWordType                  /* placeholder value */
 };
 /* aux values for attributed words */
 enum {