diff options
author | JP Rosevear <jpr@helixcode.com> | 2000-09-21 00:38:16 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2000-09-21 00:38:16 +0800 |
commit | e6c1d16b60384de66e05598967c11647e3a31ad0 (patch) | |
tree | 5c07e88e9777c1f48621dcf92b3868f135c19a3c /calendar/pcs | |
parent | 30392b4e49833a64ae612f3b55c6e220cbe24bd2 (diff) | |
download | gsoc2013-evolution-e6c1d16b60384de66e05598967c11647e3a31ad0.tar.gz gsoc2013-evolution-e6c1d16b60384de66e05598967c11647e3a31ad0.tar.zst gsoc2013-evolution-e6c1d16b60384de66e05598967c11647e3a31ad0.zip |
Use a local sax handler.
2000-09-20 JP Rosevear <jpr@helixcode.com>
* 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
Diffstat (limited to 'calendar/pcs')
-rw-r--r-- | calendar/pcs/cal-backend.c | 33 |
1 files changed, 5 insertions, 28 deletions
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; |