- void *data;
- struct mdoc_cb cb;
- int flags;
-#define MDOC_HALT (1 << 0) /* Error in parse. Halt. */
-#define MDOC_LITERAL (1 << 1) /* In a literal scope. */
-#define MDOC_PBODY (1 << 2) /* In the document body. */
- int pflags;
- enum mdoc_next next;
- struct mdoc_node *last;
- struct mdoc_node *first;
- struct mdoc_meta meta;
- enum mdoc_sec lastnamed;
- enum mdoc_sec lastsec;
-};
-
-enum merr {
- ETAILWS = 0,
- EQUOTPARM,
- EQUOTTERM,
- EMALLOC,
- EARGVAL,
- EBODYPROL,
- EPROLBODY,
- ETEXTPROL,
- ENOBLANK,
- ETOOLONG,
- EESCAPE,
- EPRINT,
- ENODAT,
- ENOPROLOGUE,
- ELINE,
- EATT,
- ENAME,
- ELISTTYPE,
- EDISPTYPE,
- EMULTIDISP,
- EMULTILIST,
- ESECNAME,
- ENAMESECINC,
- EARGREP,
- EBOOL,
- ECOLMIS,
- ENESTDISP,
- EMISSWIDTH,
- EWRONGMSEC,
- ESECOOO,
- ESECREP,
- EBADSTAND,
- ENOMULTILINE,
- EMULTILINE,
- ENOLINE,
- EPROLOOO,
- EPROLREP,
- EBADMSEC,
- EBADSEC,
- EFONT,
- EBADDATE,
- ENUMFMT,
- ENOWIDTH,
- EUTSNAME,
- EOBS,
- EIMPBRK,
- EIGNE,
- EOPEN,
- EQUOTPHR,
- ENOCTX,
- ELIB,
- EBADCHILD,
- MERRMAX
+ struct mparse *parse; /* parse pointer */
+ const char *defos; /* default argument for .Os */
+ int quick; /* abort parse early */
+ int flags; /* parse flags */
+#define MDOC_LITERAL (1 << 1) /* in a literal scope */
+#define MDOC_PBODY (1 << 2) /* in the document body */
+#define MDOC_NEWLINE (1 << 3) /* first macro/text in a line */
+#define MDOC_PHRASELIT (1 << 4) /* literal within a partila phrase */
+#define MDOC_PPHRASE (1 << 5) /* within a partial phrase */
+#define MDOC_FREECOL (1 << 6) /* `It' invocation should close */
+#define MDOC_SYNOPSIS (1 << 7) /* SYNOPSIS-style formatting */
+#define MDOC_KEEP (1 << 8) /* in a word keep */
+#define MDOC_SMOFF (1 << 9) /* spacing is off */
+#define MDOC_NODELIMC (1 << 10) /* disable closing delimiter handling */
+ enum mdoc_next next; /* where to put the next node */
+ struct roff_node *last; /* the last node parsed */
+ struct roff_node *first; /* the first node parsed */
+ struct roff_node *last_es; /* the most recent Es node */
+ struct roff_meta meta; /* document meta-data */
+ enum roff_sec lastnamed;
+ enum roff_sec lastsec;
+ struct roff *roff;