From e6c1d16b60384de66e05598967c11647e3a31ad0 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 20 Sep 2000 16:38:16 +0000 Subject: Use a local sax handler. 2000-09-20 JP Rosevear * pcs/cal-backend.c (cal_backend_get_log_entries): Use a local sax handler. * conduits/todo/todo-conduit.c (pre_sync): Use xmlSAXParseFile (map_sax_parse): Delete svn path=/trunk/; revision=5524 --- calendar/conduits/todo/todo-conduit.c | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'calendar/conduits') diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c index 6b9659f70f..f456b6e81d 100644 --- a/calendar/conduits/todo/todo-conduit.c +++ b/calendar/conduits/todo/todo-conduit.c @@ -186,36 +186,6 @@ map_sax_start_element (void *data, const xmlChar *name, } } -static int -map_sax_parse (xmlSAXHandler *handler, EToDoConduitContext *ctxt, const char *filename) -{ - int ret = 0; - xmlParserCtxtPtr xc; - - if (!g_file_exists (filename)) - return 0; - - xc = xmlCreateFileParserCtxt (filename); - if (xc == NULL) - return -1; - - xc->sax = handler; - xc->userData = (void *)ctxt; - - xmlParseDocument (xc); - - if (xc->wellFormed) - ret = 0; - else - ret = -1; - - if (handler != NULL) - xc->sax = NULL; - xmlFreeParserCtxt(xc); - - return ret; -} - static void map_write_foreach (gpointer key, gpointer value, gpointer data) { @@ -615,9 +585,8 @@ pre_sync (GnomePilotConduit *conduit, handler.startElement = map_sax_start_element; filename = map_name (ctxt); - ret = map_sax_parse (&handler, ctxt, filename); - if (ret < 0) - return ret; + if (xmlSAXUserParseFile (&logSAXParser, ctxt, filename) < 0) + return -1; g_free (filename); -- cgit