summaryrefslogtreecommitdiff
path: root/fitz/fitz.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-11-24 15:42:10 +0100
committerRobin Watts <robin.watts@artifex.com>2012-11-26 12:49:50 +0000
commita980d3d030b6cad801110a36ff9b09d5ec38b7d1 (patch)
treeaba7c816b3717d4bfea541618b7d9d1d48c86be4 /fitz/fitz.h
parent11032ab74abc9f74161a7c2d138e894c7a7854da (diff)
downloadmupdf-a980d3d030b6cad801110a36ff9b09d5ec38b7d1.tar.xz
Move XML parser into fitz directory.
Diffstat (limited to 'fitz/fitz.h')
-rw-r--r--fitz/fitz.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 77e690e7..0ea3cb2c 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -656,6 +656,59 @@ extern int fz_optind;
extern char *fz_optarg;
/*
+ XML document model
+*/
+
+typedef struct fz_xml_s fz_xml;
+
+/*
+ fz_parse_xml: Parse a zero-terminated string into a tree of xml nodes.
+*/
+fz_xml *fz_parse_xml(fz_context *ctx, unsigned char *buf, int len);
+
+/*
+ fz_xml_next: Return next sibling of XML node.
+*/
+fz_xml *fz_xml_next(fz_xml *item);
+
+/*
+ fz_xml_down: Return first child of XML node.
+*/
+fz_xml *fz_xml_down(fz_xml *item);
+
+/*
+ fz_xml_tag: Return tag of XML node. Return the empty string for text nodes.
+*/
+char *fz_xml_tag(fz_xml *item);
+
+/*
+ fz_xml_att: Return the value of an attribute of an XML node.
+ NULL if the attribute doesn't exist.
+*/
+char *fz_xml_att(fz_xml *item, const char *att);
+
+/*
+ fz_xml_text: Return the text content of an XML node.
+ NULL if the node is a tag.
+*/
+char *fz_xml_text(fz_xml *item);
+
+/*
+ fz_free_xml: Free the XML node and all its children and siblings.
+*/
+void fz_free_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);
+
+/*
fz_point is a point in a two-dimensional space.
*/
typedef struct fz_point_s fz_point;