From d759c948debd9e2dd79eb220b10682681c446e3e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 24 May 2005 06:15:44 +0200 Subject: put infernal parser api on top of mini-dom to hide it --- include/samus/xml.h | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/samus/xml.h b/include/samus/xml.h index 04308b66..fa798cd3 100644 --- a/include/samus/xml.h +++ b/include/samus/xml.h @@ -1,22 +1,26 @@ /* - * XML mini-dom based on Inferno's XML parser API. - * This one uses expat and in-memory objects though... :( + * A simple XML parsing API based on Inferno's. + * Under the surface this one uses expat and in-memory objects, + * but that should not be visible through the API. */ -typedef struct sa_xmlnode_s sa_xmlnode; +typedef struct sa_xmlparser_s sa_xmlparser; +typedef struct sa_xmlitem_s sa_xmlitem; -fz_error *sa_parsexml(sa_xmlnode **nodep, fz_file *file, int ns); -void sa_debugxml(sa_xmlnode *node, int level); -void sa_dropxml(sa_xmlnode *node); +fz_error *sa_openxml(sa_xmlparser **spp, fz_file *file, int ns); +void sa_debugxml(sa_xmlitem *item, int level); +void sa_closexml(sa_xmlparser *sp); -sa_xmlnode *sa_xmlup(sa_xmlnode *node); -sa_xmlnode *sa_xmlnext(sa_xmlnode *node); -sa_xmlnode *sa_xmldown(sa_xmlnode *node); +sa_xmlitem *sa_xmlnext(sa_xmlparser *sp); +void sa_xmldown(sa_xmlparser *sp); +void sa_xmlup(sa_xmlparser *sp); -int sa_isxmltext(sa_xmlnode *node); -int sa_isxmltag(sa_xmlnode *node); +int sa_isxmlerror(sa_xmlitem *item); +int sa_isxmltext(sa_xmlitem *item); +int sa_isxmltag(sa_xmlitem *item); -char *sa_getxmlname(sa_xmlnode *node); -char *sa_getxmlatt(sa_xmlnode *node, char *att); -char *sa_getxmltext(sa_xmlnode *node); +char *sa_getxmlerror(sa_xmlitem *item); +char *sa_getxmlname(sa_xmlitem *item); +char *sa_getxmlatt(sa_xmlitem *item, char *att); +char *sa_getxmltext(sa_xmlitem *item); -- cgit v1.2.3