diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-12-07 15:15:26 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-12-13 15:01:05 +0100 |
commit | eacd070190d0c7a7fbc905a2a292f38e282b5a82 (patch) | |
tree | 57971ec5acec6b5867cc313c3d2f6f6f619e35fe /include | |
parent | fa9cd085533f68367c299e058ab3fbb7ad8a2dc6 (diff) | |
download | mupdf-eacd070190d0c7a7fbc905a2a292f38e282b5a82.tar.xz |
Parse XML using pool allocator.
This needs adding a fz_xml_doc type to hold the pool.
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/fitz/xml.h | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/include/mupdf/fitz/xml.h b/include/mupdf/fitz/xml.h index caf5b3ba..d3cbd647 100644 --- a/include/mupdf/fitz/xml.h +++ b/include/mupdf/fitz/xml.h @@ -8,6 +8,7 @@ XML document model */ +typedef struct fz_xml_doc_s fz_xml_doc; typedef struct fz_xml_s fz_xml; /* @@ -15,7 +16,23 @@ typedef struct fz_xml_s fz_xml; preserve_white: whether to keep or delete all-whitespace nodes. */ -fz_xml *fz_parse_xml(fz_context *ctx, fz_buffer *buf, int preserve_white); +fz_xml_doc *fz_parse_xml(fz_context *ctx, fz_buffer *buf, int preserve_white); + +/* + fz_drop_xml: Free the XML node and all its children and siblings. +*/ +void fz_drop_xml(fz_context *ctx, fz_xml_doc *xml); + +/* + fz_detach_xml: Detach a node from the tree, unlinking it from its parent, + and setting the document root to the node. +*/ +void fz_detach_xml(fz_context *ctx, fz_xml_doc *xml, fz_xml *node); + +/* + fz_xml_root: Get the root node for the document. +*/ +fz_xml *fz_xml_root(fz_xml_doc *xml); /* fz_xml_prev: Return previous sibling of XML node. @@ -60,16 +77,6 @@ char *fz_xml_att(fz_xml *item, const char *att); char *fz_xml_text(fz_xml *item); /* - fz_drop_xml: Free the XML node and all its children and siblings. -*/ -void fz_drop_xml(fz_context *doc, fz_xml *item); - -/* - fz_detach_xml: Detach a node from the tree, unlinking it from its parent. -*/ -void fz_detach_xml(fz_xml *node); - -/* fz_debug_xml: Pretty-print an XML tree to stdout. */ void fz_debug_xml(fz_xml *item, int level); |