summaryrefslogtreecommitdiff
path: root/xml.h
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-06-21 00:18:44 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-06-21 00:18:44 +0200
commit5646132f6b0389d7d1b0b1b464e9fde95c25381c (patch)
tree4e562ea2d8c7602a4a3518e56fba8519c8b9a7e3 /xml.h
parent4e1438caf5d36d6278ed1e33daf937e71f063236 (diff)
separate xml specific code into xml.c
Diffstat (limited to 'xml.h')
-rw-r--r--xml.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/xml.h b/xml.h
index ee69e15..03abdbf 100644
--- a/xml.h
+++ b/xml.h
@@ -29,22 +29,35 @@ typedef struct xmlparser {
int (*getnext)(struct xmlparser *);
- int readerrno; /* errno set from read(). */
- int fd; /* fd to read from */
+ /* for use with xmlparser_parse_fd */
+ /* errno set from read(). */
+ int readerrno;
+ int fd;
- const char *str; /* "read" from string */
+ /* for use with "read" from string: xmlparser_parse_string */
+ const char *str;
/* private; internal state */
- char tag[1024]; /* current tag */
- int isshorttag; /* current tag is in short form ? */
+
+ /* current tag */
+ char tag[1024];
+ /* current tag is in short form ? */
+ int isshorttag;
size_t taglen;
- char name[256]; /* current attribute name */
- char data[BUFSIZ]; /* data buffer used for tag and attribute data */
+ /* current attribute name */
+ char name[256];
+ /* data buffer used for tag data, cdata and attribute data */
+ char data[BUFSIZ];
size_t readoffset;
size_t readlastbytes;
/* read buffer used by xmlparser_getnext */
unsigned char readbuf[BUFSIZ];
} XMLParser;
+int xml_codepointtoutf8(uint32_t, uint32_t *);
+ssize_t xml_entitytostr(const char *, char *, size_t);
+ssize_t xml_namedentitytostr(const char *, char *, size_t);
+ssize_t xml_numericetitytostr(const char *, char *, size_t);
+
void xmlparser_parse_fd(XMLParser *, int);
void xmlparser_parse_string(XMLParser *, const char *);