X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/ea6ed8eb4a9349ba679125913c5a03c1027783b2..41c0c172fa779a830e564f1257bee34c155ba2d0:/mdoc.h diff --git a/mdoc.h b/mdoc.h index d56a35fa..0c9408bb 100644 --- a/mdoc.h +++ b/mdoc.h @@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.74 2010/03/31 07:13:53 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.79 2010/05/15 16:24:38 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -202,10 +202,10 @@ enum mdoc_sec { SEC_SYNOPSIS, SEC_DESCRIPTION, SEC_IMPLEMENTATION, - SEC_EXIT_STATUS, SEC_RETURN_VALUES, SEC_ENVIRONMENT, SEC_FILES, + SEC_EXIT_STATUS, SEC_EXAMPLES, SEC_DIAGNOSTICS, SEC_COMPATIBILITY, @@ -217,12 +217,13 @@ enum mdoc_sec { SEC_CAVEATS, SEC_BUGS, SEC_SECURITY, - SEC_CUSTOM /* User-defined. */ + SEC_CUSTOM, /* User-defined. */ + SEC__MAX }; /* Information from prologue. */ struct mdoc_meta { - int msec; + char *msec; char *vol; char *arch; time_t date; @@ -248,20 +249,21 @@ struct mdoc_arg { /* Node in AST. */ struct mdoc_node { - struct mdoc_node *parent; - struct mdoc_node *child; - struct mdoc_node *next; - struct mdoc_node *prev; - int nchild; - int line; - int pos; - enum mdoct tok; + struct mdoc_node *parent; /* parent AST node */ + struct mdoc_node *child; /* first child AST node */ + struct mdoc_node *next; /* sibling AST node */ + struct mdoc_node *prev; /* prior sibling AST node */ + int nchild; /* number children */ + int line; /* parse line */ + int pos; /* parse column */ + enum mdoct tok; /* tok or MDOC__MAX if none */ int flags; -#define MDOC_VALID (1 << 0) -#define MDOC_ACTED (1 << 1) - enum mdoc_type type; - enum mdoc_sec sec; - +#define MDOC_VALID (1 << 0) /* has been validated */ +#define MDOC_ACTED (1 << 1) /* has been acted upon */ +#define MDOC_EOS (1 << 2) /* at sentence boundary */ +#define MDOC_LINE (1 << 3) /* first macro/text on line */ + enum mdoc_type type; /* AST node type */ + enum mdoc_sec sec; /* current named section */ struct mdoc_arg *args; /* BLOCK/ELEM */ #ifdef UGLY struct mdoc_node *pending; /* BLOCK */ @@ -275,7 +277,6 @@ struct mdoc_node { #define MDOC_IGN_SCOPE (1 << 0) /* Ignore scope violations. */ #define MDOC_IGN_ESCAPE (1 << 1) /* Ignore bad escape sequences. */ #define MDOC_IGN_MACRO (1 << 2) /* Ignore unknown macros. */ -#define MDOC_IGN_CHARS (1 << 3) /* Ignore disallowed chars. */ /* Call-backs for parse messages. */