From 0bb808b9bc9c673a086bcb3c5129b3b0691dd063 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 16 May 2015 15:54:22 +0200 Subject: xml: adjust for API change: read from fd --- sfeed.c | 4 ++-- sfeed_opml_import.c | 4 ++-- sfeed_web.c | 12 ++++++------ sfeed_xmlenc.c | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sfeed.c b/sfeed.c index 07392e7..344b7f8 100644 --- a/sfeed.c +++ b/sfeed.c @@ -778,14 +778,14 @@ main(int argc, char *argv[]) ctx.item.contenttype = ContentTypePlain; ctx.item.feedtype = FeedTypeNone; - xmlparser_init(&parser, stdin); + memset(&parser, 0, sizeof(parser)); parser.xmltagstart = xml_handler_start_element; parser.xmltagend = xml_handler_end_element; parser.xmldata = xml_handler_data; parser.xmldataentity = xml_handler_data_entity; parser.xmlattr = xml_handler_attr; parser.xmlcdata = xml_handler_cdata; - xmlparser_parse(&parser); + xmlparser_parse_fd(&parser, 0); return 0; } diff --git a/sfeed_opml_import.c b/sfeed_opml_import.c index adf5c45..e79a2ef 100644 --- a/sfeed_opml_import.c +++ b/sfeed_opml_import.c @@ -73,7 +73,7 @@ xml_handler_attr(XMLParser *p, const char *tag, size_t taglen, int main(void) { - xmlparser_init(&parser, stdin); + memset(&parser, 0, sizeof(parser)); parser.xmltagstart = xml_handler_start_element; parser.xmltagend = xml_handler_end_element; parser.xmlattr = xml_handler_attr; @@ -88,7 +88,7 @@ main(void) "# list of feeds to fetch:\n" "feeds() {\n" " # feed [encoding]\n", stdout); - xmlparser_parse(&parser); + xmlparser_parse_fd(&parser, 0); fputs("}\n", stdout); return 0; diff --git a/sfeed_web.c b/sfeed_web.c index 77f22cb..2824ab6 100644 --- a/sfeed_web.c +++ b/sfeed_web.c @@ -73,18 +73,18 @@ xmlattr(XMLParser *p, const char *tag, size_t taglen, const char *name, int main(int argc, char *argv[]) { - XMLParser x; + XMLParser parser; /* base href */ if(argc > 1) strlcpy(basehref, argv[1], sizeof(basehref)); - xmlparser_init(&x, stdin); - x.xmltagstart = xmltagstart; - x.xmlattr = xmlattr; - x.xmltagstartparsed = xmltagstartparsed; + memset(&parser, 0, sizeof(parser)); + parser.xmltagstart = xmltagstart; + parser.xmlattr = xmlattr; + parser.xmltagstartparsed = xmltagstartparsed; - xmlparser_parse(&x); + xmlparser_parse_fd(&parser, 0); return found > 0 ? 0: 1; } diff --git a/sfeed_xmlenc.c b/sfeed_xmlenc.c index 1dbfb5b..7bd54a6 100644 --- a/sfeed_xmlenc.c +++ b/sfeed_xmlenc.c @@ -54,14 +54,14 @@ xmlattr(XMLParser *p, const char *tag, size_t taglen, const char *name, int main(void) { - XMLParser x; + XMLParser parser; - xmlparser_init(&x, stdin); - x.xmltagstart = xmltagstart; - x.xmltagend = xmltagend; - x.xmlattr = xmlattr; + memset(&parser, 0, sizeof(parser)); + parser.xmltagstart = xmltagstart; + parser.xmltagend = xmltagend; + parser.xmlattr = xmlattr; - xmlparser_parse(&x); + xmlparser_parse_fd(&parser, 0); return 1; } -- cgit v1.2.3