version 1.14, 2019/04/09 01:39:09 |
version 1.17, 2019/04/12 04:39:24 |
|
|
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_EQN (1 << 2) /* The document needs inline eqn(7). */ |
|
#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); |