Enlightenment CVS committal Author : glassy_ape Project : misc Module : erss
Dir : misc/erss/src Modified Files: config.h.in net.c parse.c Log Message: Parse with recursion added; some urls fixed =================================================================== RCS file: /cvsroot/enlightenment/misc/erss/src/config.h.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- config.h.in 12 Jan 2004 22:59:34 -0000 1.2 +++ config.h.in 12 Sep 2004 10:13:24 -0000 1.3 @@ -1,4 +1,8 @@ -/* src/config.h.in. Generated from configure.in by autoheader. */ +/* src/config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + #undef ENABLE_NLS #undef HAVE_CATGETS #undef HAVE_GETTEXT @@ -18,23 +22,6 @@ /* Name of package */ #undef PACKAGE -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - /* Version number of package */ #undef VERSION + =================================================================== RCS file: /cvsroot/enlightenment/misc/erss/src/net.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- net.c 14 Apr 2004 18:15:48 -0000 1.7 +++ net.c 12 Sep 2004 10:13:24 -0000 1.8 @@ -95,7 +95,7 @@ Erss_Feed *f = (Erss_Feed *)data; Ecore_Con_Event_Server_Del *e = event; char *buf = f->main_buffer; - char *temp; + char *temp = NULL; if (f->total_connects == 1) printf ("%s info: disconnecting from %s...\n", PACKAGE, f->cfg->hostname?f->cfg->hostname:"host"); @@ -123,7 +123,7 @@ f->server = NULL; if (ecore_list_is_empty (f->list)) { - if (buf) + if (buf && temp) printf ("%s\n", temp); else printf ("%s error: could not connect to '%s'\n", PACKAGE, f->cfg->url); =================================================================== RCS file: /cvsroot/enlightenment/misc/erss/src/parse.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- parse.c 14 Apr 2004 18:15:48 -0000 1.29 +++ parse.c 12 Sep 2004 10:13:24 -0000 1.30 @@ -115,6 +115,35 @@ return TRUE; } +/* GLS 12/09/04: add recursion */ +void erss_parse_down(Erss_Feed *f, xmlNodePtr ptr) +{ + xmlNodePtr cur; + Erss_Config *cfg = f->cfg; + + if(ptr == NULL) + return; + + cur = ptr->xmlChildrenNode; + while(cur) { + if (ecore_list_nodes (f->list) >= cfg->num_stories) + break; + + if (cfg->item_root) { + if (cur->name && !strcmp(cur->name, cfg->item_root)) { + erss_parse_story (f, cur); + } + } else if (cur->name && !strcmp(cur->name, cfg->item_start)) { + erss_parse_story_new (f); + erss_parse_story (f, cur); + erss_parse_story_end (f); + } + + erss_parse_down(f, cur); + + cur = cur->next; + } +} int erss_parse (Erss_Feed *f) @@ -137,27 +166,15 @@ } ret=ecore_list_nodes (f->list); - cur = cur->xmlChildrenNode; - - while (cur != NULL) { - if (ecore_list_nodes (f->list) >= cfg->num_stories) { - ret=cfg->num_stories; - break; - } - - if (cfg->item_root) { - if (!strcmp(cur->name, cfg->item_root)) { - erss_parse_story (f, cur); - } - } else if (!strcmp(cur->name, cfg->item_start)) { - erss_parse_story_new (f); - erss_parse_story (f, cur); - erss_parse_story_end (f); - } - - cur = cur->next; + + erss_parse_down(f, cur); + + if (ecore_list_nodes (f->list) >= cfg->num_stories) { + ret=cfg->num_stories; + } else { + ret = ecore_list_nodes (f->list); } - + erss_parse_free(f); return ret; ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs