From 900ea24740c39ac60dc1763fedb03cfa3e865b86 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 5 Jun 2013 12:41:59 -0400 Subject: Remove EMailReaderHeader struct. No longer used. Also remove related helper functions: e_mail_reader_header_from_xml() e_mail_reader_header_to_xml() e_mail_reader_header_free() --- mail/e-mail-reader-utils.c | 109 --------------------------------------------- 1 file changed, 109 deletions(-) (limited to 'mail/e-mail-reader-utils.c') diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index d1b8d88e8a..8a711a52a1 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -2350,115 +2350,6 @@ e_mail_reader_create_vfolder_from_selected (EMailReader *reader, em_utils_uids_free (uids); } -static EMailReaderHeader * -emr_header_from_xmldoc (xmlDocPtr doc) -{ - EMailReaderHeader *h; - xmlNodePtr root; - xmlChar *name; - - if (doc == NULL) - return NULL; - - root = doc->children; - if (strcmp ((gchar *) root->name, "header") != 0) - return NULL; - - name = xmlGetProp (root, (const guchar *)"name"); - if (name == NULL) - return NULL; - - h = g_malloc0 (sizeof (EMailReaderHeader)); - h->name = g_strdup ((gchar *) name); - xmlFree (name); - - if (xmlHasProp (root, (const guchar *)"enabled")) - h->enabled = 1; - else - h->enabled = 0; - - return h; -} - -/** - * e_mail_reader_header_from_xml - * @xml: XML configuration data - * - * Parses passed XML data, which should be of - * the format
, and - * returns a EMailReaderHeader structure, or NULL if there - * is an error. - **/ -EMailReaderHeader * -e_mail_reader_header_from_xml (const gchar *xml) -{ - EMailReaderHeader *header; - xmlDocPtr doc; - - if (!(doc = xmlParseDoc ((guchar *) xml))) - return NULL; - - header = emr_header_from_xmldoc (doc); - xmlFreeDoc (doc); - - return header; -} - -/** - * e_mail_reader_header_to_xml - * @header: header from which to generate XML - * - * Returns the passed header as a XML structure, - * or NULL on error - */ -gchar * -e_mail_reader_header_to_xml (EMailReaderHeader *header) -{ - xmlDocPtr doc; - xmlNodePtr root; - xmlChar *xml; - gchar *out; - gint size; - - g_return_val_if_fail (header != NULL, NULL); - g_return_val_if_fail (header->name != NULL, NULL); - - doc = xmlNewDoc ((const guchar *)"1.0"); - - root = xmlNewDocNode (doc, NULL, (const guchar *)"header", NULL); - xmlSetProp (root, (const guchar *)"name", (guchar *) header->name); - if (header->enabled) - xmlSetProp (root, (const guchar *)"enabled", NULL); - - xmlDocSetRootElement (doc, root); - xmlDocDumpMemory (doc, &xml, &size); - xmlFreeDoc (doc); - - out = g_malloc (size + 1); - memcpy (out, xml, size); - out[size] = '\0'; - xmlFree (xml); - - return out; -} - -/** - * e_mail_reader_header_free - * @header: header to free - * - * Frees the memory associated with the passed header - * structure. - */ -void -e_mail_reader_header_free (EMailReaderHeader *header) -{ - if (header == NULL) - return; - - g_free (header->name); - g_free (header); -} - static void mail_reader_parse_message_run (GSimpleAsyncResult *simple, GObject *object, -- cgit v1.2.3