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/pcs/cal-backend.c | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) (limited to 'calendar/pcs') diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c index 106fab28f8..350c53a78d 100644 --- a/calendar/pcs/cal-backend.c +++ b/calendar/pcs/cal-backend.c @@ -637,36 +637,10 @@ cal_backend_log_sax_end_element (CalBackendParseState *state, const CHAR *name) } } -static xmlSAXHandler logSAXParser = { - 0, /* internalSubset */ - 0, /* isStandalone */ - 0, /* hasInternalSubset */ - 0, /* hasExternalSubset */ - 0, /* resolveEntity */ - 0, /* getEntity */ - 0, /* entityDecl */ - 0, /* notationDecl */ - 0, /* attributeDecl */ - 0, /* elementDecl */ - 0, /* unparsedEntityDecl */ - 0, /* setDocumentLocator */ - 0, /* startDocument */ - 0, /* endDocument */ - (startElementSAXFunc)cal_backend_log_sax_start_element, /* startElement */ - (endElementSAXFunc)cal_backend_log_sax_end_element, /* endElement */ - 0, /* reference */ - 0, /* characters */ - 0, /* ignorableWhitespace */ - 0, /* processingInstruction */ - 0, /* comment */ - 0, /* warning */ - 0, /* error */ - 0, /* fatalError */ -}; - static GHashTable * cal_backend_get_log_entries (CalBackend *backend, CalObjType type, time_t since) { + xmlSAXHandler handler; CalBackendParseState state; GHashTable *hash; char *filename; @@ -678,7 +652,9 @@ cal_backend_get_log_entries (CalBackend *backend, CalObjType type, time_t since) if (!cal_backend_log_sync (backend)) return NULL; - filename = cal_backend_log_name (backend->uri); + memset (&handler, 0, sizeof (xmlSAXHandler)); + handler.startElement = (startElementSAXFunc)cal_backend_log_sax_start_element; + handler.endElement = (endElementSAXFunc)cal_backend_log_sax_end_element; hash = g_hash_table_new (g_str_hash, g_str_equal); @@ -687,6 +663,7 @@ cal_backend_get_log_entries (CalBackend *backend, CalObjType type, time_t since) state.in_valid_timestamp = FALSE; state.hash = hash; + filename = cal_backend_log_name (backend->uri); if (xmlSAXUserParseFile (&logSAXParser, &state, filename) < 0) return NULL; -- cgit v1.2.3