sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit 0bb808b9bc9c673a086bcb3c5129b3b0691dd063
parent 5eb71daeacda95d4f93ecb0f3966cf69b09b8553
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sat, 16 May 2015 15:54:22 +0200

xml: adjust for API change: read from fd

Diffstat:
Msfeed.c | 4++--
Msfeed_opml_import.c | 4++--
Msfeed_web.c | 12++++++------
Msfeed_xmlenc.c | 12++++++------
4 files changed, 16 insertions(+), 16 deletions(-)

diff --git 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 @@ -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 <name> <feedurl> <basesiteurl> [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 @@ -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 @@ -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; }