1typedef enum {
2  Element, Text, Comment, Declaration, Procins, Root
3} Nodetype;
4typedef struct _node {
5  Nodetype tp;
6  string name;
7  pairlist attribs;
8  string text;
9  string url;
10  struct _node *parent;
11  struct _node *sister;
12  struct _node *children;
13} Node, *Tree;
14extern Tree create(void);
15extern void tree_delete(Tree t);
16extern Tree get_root(Tree t);
17extern conststring get_attrib(const Node *e, const conststring attname);
18extern void set_attrib(Node *e, string name, conststring value);
19extern _Bool
20           delete_attrib(Node *e, const conststring name);
21extern Tree get_elt_by_id(Node *n, const conststring id);
22extern Tree wrap_contents(Node *n, const string elem, pairlist attr);
23extern Tree wrap_elt(Node *n, const conststring elem, pairlist attr);
24extern void rename_elt(Node *n, const string elem);
25extern _Bool
26           is_known(const string e);
27extern _Bool
28           is_pre(const string e);
29extern _Bool
30           need_stag(const string e);
31extern _Bool
32           need_etag(const string e);
33extern _Bool
34           is_empty(const string e);
35extern _Bool
36           has_parent(const string c, const string p);
37extern _Bool
38           is_mixed(const string e);
39extern _Bool
40           break_before(const string e);
41extern _Bool
42           break_after(const string e);
43extern _Bool
44           is_cdata_elt(const string e);
45extern Tree tree_push(Tree t, string elem, pairlist attr);
46extern Tree html_push(Tree t, string elem, pairlist attr);
47extern Tree tree_pop(Tree t, string elem);
48extern Tree html_pop(Tree t, string elem);
49extern Tree append_comment(Tree t, string comment);
50extern Tree append_declaration(Tree t, string gi,
51          string fpi, string url);
52extern Tree append_procins(Tree t, string procins);
53extern Tree tree_append_text(Tree t, string text);
54extern Tree append_text(Tree t, string text);
55extern void dumptree(Tree t, FILE *f);
56