summaryrefslogtreecommitdiff
path: root/xml.h
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-05-16 15:53:16 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-05-16 15:53:16 +0200
commit5eb71daeacda95d4f93ecb0f3966cf69b09b8553 (patch)
tree6f3bdb5ec518224f77cd41296d711183915adccb /xml.h
parente2302de375e20914711c713c973622dd953b0469 (diff)
xml: allow to read from fd or string buffer
+ minor code style.
Diffstat (limited to 'xml.h')
-rw-r--r--xml.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/xml.h b/xml.h
index 5f72494..ee69e15 100644
--- a/xml.h
+++ b/xml.h
@@ -27,7 +27,12 @@ typedef struct xmlparser {
void (*xmlcomment)(struct xmlparser *, const char *, size_t);
void (*xmlcommentend)(struct xmlparser *);
- FILE *fp; /* file stream to read from */
+ int (*getnext)(struct xmlparser *);
+
+ int readerrno; /* errno set from read(). */
+ int fd; /* fd to read from */
+
+ const char *str; /* "read" from string */
/* private; internal state */
char tag[1024]; /* current tag */
@@ -41,5 +46,5 @@ typedef struct xmlparser {
unsigned char readbuf[BUFSIZ];
} XMLParser;
-void xmlparser_init(XMLParser *, FILE *);
-void xmlparser_parse(XMLParser *);
+void xmlparser_parse_fd(XMLParser *, int);
+void xmlparser_parse_string(XMLParser *, const char *);