diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-05-16 15:53:16 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-05-16 15:53:16 +0200 |
commit | 5eb71daeacda95d4f93ecb0f3966cf69b09b8553 (patch) | |
tree | 6f3bdb5ec518224f77cd41296d711183915adccb /xml.h | |
parent | e2302de375e20914711c713c973622dd953b0469 (diff) |
xml: allow to read from fd or string buffer
+ minor code style.
Diffstat (limited to 'xml.h')
-rw-r--r-- | xml.h | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 *); |