version 1.6, 2019/03/28 20:41:33 |
version 1.19, 2019/04/12 11:37:09 |
|
|
NODE_IGNORE, |
NODE_IGNORE, |
/* Alpha-ordered hereafter. */ |
/* Alpha-ordered hereafter. */ |
NODE_AFFILIATION, |
NODE_AFFILIATION, |
|
NODE_APPENDIX, |
NODE_APPLICATION, |
NODE_APPLICATION, |
NODE_ARG, |
NODE_ARG, |
NODE_AUTHOR, |
NODE_AUTHOR, |
NODE_AUTHORGROUP, |
NODE_AUTHORGROUP, |
NODE_BLOCKQUOTE, |
NODE_BLOCKQUOTE, |
NODE_BOOK, |
|
NODE_BOOKINFO, |
NODE_BOOKINFO, |
NODE_CAUTION, |
NODE_CAUTION, |
NODE_CITEREFENTRY, |
NODE_CITEREFENTRY, |
NODE_CITETITLE, |
NODE_CITETITLE, |
NODE_CMDSYNOPSIS, |
NODE_CMDSYNOPSIS, |
NODE_CODE, |
|
NODE_COLSPEC, |
NODE_COLSPEC, |
NODE_COMMAND, |
NODE_COMMAND, |
NODE_CONSTANT, |
NODE_CONSTANT, |
NODE_CONTRIB, |
NODE_CONTRIB, |
NODE_COPYRIGHT, |
NODE_COPYRIGHT, |
NODE_DATE, |
NODE_DATE, |
|
NODE_DOCTYPE, |
NODE_EDITOR, |
NODE_EDITOR, |
NODE_EMAIL, |
NODE_EMAIL, |
NODE_EMPHASIS, |
NODE_EMPHASIS, |
|
NODE_ENTITY, |
NODE_ENTRY, |
NODE_ENTRY, |
NODE_ENVAR, |
NODE_ENVAR, |
|
NODE_ERRORNAME, |
|
NODE_ESCAPE, |
NODE_FIELDSYNOPSIS, |
NODE_FIELDSYNOPSIS, |
NODE_FILENAME, |
NODE_FILENAME, |
NODE_FIRSTTERM, |
NODE_FIRSTTERM, |
|
|
NODE_GLOSSTERM, |
NODE_GLOSSTERM, |
NODE_GROUP, |
NODE_GROUP, |
NODE_HOLDER, |
NODE_HOLDER, |
|
NODE_INCLUDE, |
NODE_INDEX, |
NODE_INDEX, |
NODE_INFO, |
NODE_INFO, |
NODE_INFORMALEQUATION, |
NODE_INFORMALEQUATION, |
NODE_INFORMALTABLE, |
|
NODE_INLINEEQUATION, |
NODE_INLINEEQUATION, |
NODE_ITEMIZEDLIST, |
NODE_ITEMIZEDLIST, |
NODE_KEYSYM, |
NODE_KEYSYM, |
|
|
NODE_LITERAL, |
NODE_LITERAL, |
NODE_LITERALLAYOUT, |
NODE_LITERALLAYOUT, |
NODE_MANVOLNUM, |
NODE_MANVOLNUM, |
|
NODE_MARKUP, |
NODE_MEMBER, |
NODE_MEMBER, |
NODE_MML_MATH, |
NODE_MML_MATH, |
NODE_MML_MFENCED, |
NODE_MML_MFENCED, |
|
|
NODE_SBR, |
NODE_SBR, |
NODE_SCREEN, |
NODE_SCREEN, |
NODE_SECTION, |
NODE_SECTION, |
NODE_SGMLTAG, |
|
NODE_SIMPLELIST, |
NODE_SIMPLELIST, |
NODE_SPANSPEC, |
NODE_SPANSPEC, |
NODE_STRUCTNAME, |
|
NODE_SUBTITLE, |
NODE_SUBTITLE, |
NODE_SYNOPSIS, |
NODE_SYNOPSIS, |
NODE_TABLE, |
NODE_TABLE, |
|
|
NODE_TITLE, |
NODE_TITLE, |
NODE_TYPE, |
NODE_TYPE, |
NODE_ULINK, |
NODE_ULINK, |
NODE_USERINPUT, |
|
NODE_VARIABLELIST, |
NODE_VARIABLELIST, |
NODE_VARLISTENTRY, |
NODE_VARLISTENTRY, |
NODE_VARNAME, |
NODE_VARNAME, |
|
|
ATTRKEY_CHOICE = 0, |
ATTRKEY_CHOICE = 0, |
ATTRKEY_CLASS, |
ATTRKEY_CLASS, |
ATTRKEY_CLOSE, |
ATTRKEY_CLOSE, |
|
ATTRKEY_COLS, |
|
ATTRKEY_DEFINITION, |
|
ATTRKEY_ENDTERM, |
|
ATTRKEY_HREF, |
ATTRKEY_ID, |
ATTRKEY_ID, |
ATTRKEY_LINKEND, |
ATTRKEY_LINKEND, |
|
ATTRKEY_NAME, |
ATTRKEY_OPEN, |
ATTRKEY_OPEN, |
|
ATTRKEY_PUBLIC, |
ATTRKEY_REP, |
ATTRKEY_REP, |
|
ATTRKEY_SYSTEM, |
|
ATTRKEY_URL, |
|
ATTRKEY_XLINK_HREF, |
ATTRKEY__MAX |
ATTRKEY__MAX |
}; |
}; |
|
|
|
|
struct pnode { |
struct pnode { |
enum nodeid node; /* Node type. */ |
enum nodeid node; /* Node type. */ |
char *b; /* String value. */ |
char *b; /* String value. */ |
char *real; /* Storage for "b". */ |
int spc; /* Whitespace before this node. */ |
size_t bsz; /* strlen(b) */ |
|
struct pnode *parent; /* Parent node or NULL. */ |
struct pnode *parent; /* Parent node or NULL. */ |
struct pnodeq childq; /* Queue of children. */ |
struct pnodeq childq; /* Queue of children. */ |
struct pattrq attrq; /* Attributes of the node. */ |
struct pattrq attrq; /* Attributes of the node. */ |
|
|
struct ptree { |
struct ptree { |
struct pnode *root; /* The document element. */ |
struct pnode *root; /* The document element. */ |
int flags; |
int flags; |
#define TREE_FAIL (1 << 0) /* A fatal parse error occurred. */ |
#define TREE_ERROR (1 << 0) /* A parse error occurred. */ |
#define TREE_EQN (1 << 1) /* The document needs inline eqn(7). */ |
#define TREE_WARN (1 << 1) /* A parser warning occurred. */ |
#define TREE_CLOSED (1 << 2) /* The document element was closed. */ |
#define TREE_CLOSED (1 << 3) /* The document element was closed. */ |
}; |
}; |
|
|
|
|
enum attrkey attrkey_parse(const char *); |
enum attrkey attrkey_parse(const char *); |
enum attrval attrval_parse(const char *); |
enum attrval attrval_parse(const char *); |
|
struct pnode *pnode_alloc(struct pnode *); |
void pnode_unlink(struct pnode *); |
void pnode_unlink(struct pnode *); |
void pnode_unlinksub(struct pnode *); |
void pnode_unlinksub(struct pnode *); |
enum attrval pnode_getattr(struct pnode *, enum attrkey); |
enum attrval pnode_getattr(struct pnode *, enum attrkey); |