@@ -2,7 +2,6 @@
22#include <stdint.h>
33
44typedef struct document document;
5−typedef struct node node;
65
76// Pair of indexes into the input string
87typedef struct
@@ -17,6 +16,15 @@ typedef struct
1716 str value;
1817} attr;
1918
19+typedef struct
20+{
21+ str name; // tag name, e.g. <[foo]>
22+ str inner; // inner text, <foo>[bar]</foo>
23+ str outer; // outer text, [<foo>bar</foo>]
24+ str attrs; // all the attributes, in the attribute buffer (not usable)
25+ str nodes; // all the nodes, in the node buffer (not usable)
26+} node;
27+
2028// Convention: if slen can be -1 for nul-terminated, or given explicitly
2129
2230// Parse a document, returns a potentially invalid document - use document_error to check
@@ -36,10 +44,6 @@ char* document_error(document* d);
3644// return the root node of the document - imagine the document is wrapped in <>$DOC</> tags
3745node* document_node(document* d);
3846
39−// Get the span of a node
40−str node_inner(node* n);
41−str node_outer(node* n);
42−
4347// List all items within a node
4448node* node_children(document* d, node* n, int* res);
4549attr* node_attributes(document* d, node* n, int* res);