version 1.12, 2019/04/07 19:33:27 |
version 1.19, 2019/04/12 11:37:09 |
|
|
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_ERRORNAME, |
|
|
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_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_SUBTITLE, |
NODE_SUBTITLE, |
|
|
ATTRKEY_CLASS, |
ATTRKEY_CLASS, |
ATTRKEY_CLOSE, |
ATTRKEY_CLOSE, |
ATTRKEY_COLS, |
ATTRKEY_COLS, |
|
ATTRKEY_DEFINITION, |
ATTRKEY_ENDTERM, |
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_URL, |
ATTRKEY_XLINK_HREF, |
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". */ |
|
size_t bsz; /* strlen(b) */ |
|
int spc; /* Whitespace before this node. */ |
int spc; /* Whitespace before this node. */ |
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 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); |