temporarily reverting my camel namespace patches until after we merge in some of...
authorJeffrey Stedfast <fejj@src.gnome.org>
Tue, 26 Aug 2003 18:16:51 +0000 (18:16 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Tue, 26 Aug 2003 18:16:51 +0000 (18:16 +0000)
45 files changed:
camel/ChangeLog
camel/camel-data-wrapper.c
camel/camel-digest-folder.c
camel/camel-filter-driver.c
camel/camel-filter-search.c
camel/camel-folder-search.c
camel/camel-folder-summary.c
camel/camel-folder-summary.h
camel/camel-http-stream.c
camel/camel-http-stream.h
camel/camel-internet-address.c
camel/camel-medium.c
camel/camel-medium.h
camel/camel-mime-message.c
camel/camel-mime-parser.c
camel/camel-mime-parser.h
camel/camel-mime-part-utils.c
camel/camel-mime-part.c
camel/camel-mime-part.h
camel/camel-mime-utils.c
camel/camel-mime-utils.h
camel/camel-movemail.c
camel/camel-multipart-encrypted.c
camel/camel-multipart-signed.c
camel/camel-multipart.c
camel/camel-search-private.c
camel/camel-search-private.h
camel/camel-types.h
camel/providers/imap/camel-imap-folder.c
camel/providers/imap/camel-imap-store-summary.c
camel/providers/imap/camel-imap-utils.c
camel/providers/imapp/camel-imapp-utils.c
camel/providers/imapp/camel-imapp-utils.h
camel/providers/local/camel-local-summary.c
camel/providers/local/camel-local-summary.h
camel/providers/local/camel-maildir-summary.c
camel/providers/local/camel-mbox-folder.c
camel/providers/local/camel-mbox-summary.c
camel/providers/local/camel-mh-summary.c
camel/providers/local/camel-spool-summary.h
camel/providers/nntp/camel-nntp-summary.c
camel/providers/nntp/camel-nntp-utils.c
camel/providers/pop3/camel-pop3-folder.c
camel/providers/sendmail/camel-sendmail-transport.c
camel/providers/smtp/camel-smtp-transport.c

index 78268c2..717c393 100644 (file)
@@ -1,139 +1,3 @@
-2003-08-26  Jeffrey Stedfast  <fejj@ximian.com>
-
-       * camel-mime-parser.[c,h]: s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g and
-       s/_header_state/_camel_mime_parser_state/g
-
-       * camel-filter-driver.c: Same.
-
-       * camel-folder-summary.c: Here too.
-
-       * camel-http-stream.c: And here.
-
-       * camel-mime-message.c: ...
-
-       * camel-mime-part-utils.c: ...
-
-       * camel-mime-part.c: ...
-
-       * camel-movemail.c: ...
-
-       * camel-multipart-signed.c: ...
-
-       * camel-multipart.c: ...
-
-       * providers/local/camel-mbox-folder.c: ...
-
-       * providers/local/camel-mbox-summary.c: ...
-
-       * providers/local/camel-mh-summary.c: ...
-
-       * providers/nntp/camel-nntp-summary.c: ...
-
-       * providers/pop3/camel-pop3-folder.c: ...
-
-2003-08-25  Jeffrey Stedfast  <fejj@ximian.com>
-
-       * camel-mime-utils.[c,h]: Namespaced.
-
-       * camel-data-wrapper.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-digest-folder.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-filter-driver.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-filter-search.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-folder-search.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-folder-summary.[c,h]: updated for namespace changed made
-       to camel-mime-utils.[c,h]
-
-       * camel-http-stream.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-http-stream.h: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-internet-address.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-medium.[c,h]: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-mime-message.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-mime-parser.[c,h]: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-mime-part-utils.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-mime-part.[c,h]: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-movemail.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-multipart-encrypted.c: updated for namespace changed made
-       to camel-mime-utils.[c,h]
-
-       * camel-multipart-signed.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-multipart.c: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * camel-search-private.[c,h]: updated for namespace changed made
-       to camel-mime-utils.[c,h]
-
-       * camel-types.h: updated for namespace changed made to
-       camel-mime-utils.[c,h]
-
-       * providers/imap/camel-imap-folder.c: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
-       * providers/imap/camel-imap-store-summary.c: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
-       * providers/imap/camel-imap-utils.c: updated for namespace changed
-       made to camel-mime-utils.[c,h]
-
-       * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
-       * providers/local/camel-local-summary.[c,h]: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
-       * providers/local/camel-maildir-summary.c: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
-       * providers/local/camel-mbox-summary.c: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
-       * providers/local/camel-spool-summary.h: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
-       * providers/nntp/camel-nntp-summary.c: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
-       * providers/nntp/camel-nntp-utils.c: updated for namespace changed
-       made to camel-mime-utils.[c,h]
-
-       * providers/pop3/camel-pop3-folder.c: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
-       * providers/sendmail/camel-sendmail-transport.c: updated for
-       namespace changed made to camel-mime-utils.[c,h]
-
-       * providers/smtp/camel-smtp-transport.c: updated for namespace
-       changed made to camel-mime-utils.[c,h]
-
 2003-08-25  Jeffrey Stedfast  <fejj@ximian.com>
 
        * camel-filter-driver.c (pipe_to_system): Added some more error
index 9cacbaf..7230f77 100644 (file)
@@ -75,7 +75,7 @@ camel_data_wrapper_init (gpointer object, gpointer klass)
        camel_data_wrapper->priv = g_malloc (sizeof (struct _CamelDataWrapperPrivate));
        pthread_mutex_init (&camel_data_wrapper->priv->stream_lock, NULL);
        
-       camel_data_wrapper->mime_type = camel_content_type_new ("application", "octet-stream");
+       camel_data_wrapper->mime_type = header_content_type_new ("application", "octet-stream");
        camel_data_wrapper->encoding = CAMEL_MIME_PART_ENCODING_DEFAULT;
        camel_data_wrapper->offline = FALSE;
 }
@@ -90,7 +90,7 @@ camel_data_wrapper_finalize (CamelObject *object)
        g_free (camel_data_wrapper->priv);
        
        if (camel_data_wrapper->mime_type)
-               camel_content_type_unref (camel_data_wrapper->mime_type);
+               header_content_type_unref (camel_data_wrapper->mime_type);
        
        if (camel_data_wrapper->stream)
                camel_object_unref (camel_data_wrapper->stream);
@@ -198,7 +198,7 @@ decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
                break;
        }
        
-       if (camel_content_type_is (data_wrapper->mime_type, "text", "*")) {
+       if (header_content_type_is (data_wrapper->mime_type, "text", "*")) {
                filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE,
                                                     CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
                camel_stream_filter_add (CAMEL_STREAM_FILTER (fstream), filter);
@@ -270,8 +270,8 @@ static void
 set_mime_type (CamelDataWrapper *data_wrapper, const char *mime_type)
 {
        if (data_wrapper->mime_type)
-               camel_content_type_unref (data_wrapper->mime_type);
-       data_wrapper->mime_type = camel_content_type_decode (mime_type);
+               header_content_type_unref (data_wrapper->mime_type);
+       data_wrapper->mime_type = header_content_type_decode (mime_type);
 }
 
 /**
@@ -299,7 +299,7 @@ camel_data_wrapper_set_mime_type (CamelDataWrapper *data_wrapper,
 static char *
 get_mime_type (CamelDataWrapper *data_wrapper)
 {
-       return camel_content_type_simple (data_wrapper->mime_type);
+       return header_content_type_simple (data_wrapper->mime_type);
 }
 
 /**
@@ -354,10 +354,10 @@ set_mime_type_field (CamelDataWrapper *data_wrapper,
        g_return_if_fail (mime_type != NULL);
 
        if (data_wrapper->mime_type)
-               camel_content_type_unref (data_wrapper->mime_type);
+               header_content_type_unref (data_wrapper->mime_type);
        data_wrapper->mime_type = mime_type;
        if (mime_type)
-               camel_content_type_ref (data_wrapper->mime_type);
+               header_content_type_ref (data_wrapper->mime_type);
 }
 
 void
index 595be88..2f4ae06 100644 (file)
@@ -221,7 +221,7 @@ camel_digest_folder_new (CamelStore *parent_store, CamelMimeMessage *message)
                return NULL;
        
        /* Make sure we have a multipart/digest subpart or at least some message/rfc822 attachments... */
-       if (!camel_content_type_is (CAMEL_DATA_WRAPPER (message)->mime_type, "multipart", "digest")) {
+       if (!header_content_type_is (CAMEL_DATA_WRAPPER (message)->mime_type, "multipart", "digest")) {
                if (!multipart_contains_message_parts (CAMEL_MULTIPART (wrapper)))
                        return NULL;
        }
index 8ac4d86..204da43 100644 (file)
@@ -1127,7 +1127,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, co
        
        source_url = g_strdup_printf ("file://%s", mbox);
        
-       while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) {
+       while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) {
                CamelMessageInfo *info;
                CamelMimeMessage *msg;
                int pc = 0;
@@ -1349,7 +1349,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
        }
        
        if (info == NULL) {
-               struct _camel_header_raw *h;
+               struct _header_raw *h;
                
                if (message) {
                        camel_object_ref (CAMEL_OBJECT (message));
index 0fa2c59..5f9e5eb 100644 (file)
@@ -163,7 +163,7 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
                        else {
                                ct = camel_mime_part_get_content_type (CAMEL_MIME_PART (message));
                                if (ct) {
-                                       charset = camel_content_type_param (ct, "charset");
+                                       charset = header_content_type_param (ct, "charset");
                                        charset = e_iconv_charset_name (charset);
                                }
                        }
@@ -262,7 +262,7 @@ get_full_header (CamelMimeMessage *message)
        CamelMimePart *mp = CAMEL_MIME_PART (message);
        GString *str = g_string_new ("");
        char   *ret;
-       struct _camel_header_raw *h;
+       struct _header_raw *h;
        
        for (h = mp->headers; h; h = h->next) {
                if (h->value != NULL) {
index 646e009..89fb8f1 100644 (file)
@@ -1,6 +1,5 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- *  Copyright (C) 2000-2003 Ximian Inc.
+ *  Copyright (C) 2000,2001 Ximian Inc.
  *
  *  Authors: Michael Zucchi <notzed@ximian.com>
  *
@@ -856,7 +855,7 @@ match_words_1message (CamelDataWrapper *object, struct _camel_search_words *word
        } else if (CAMEL_IS_MIME_MESSAGE (containee)) {
                /* for messages we only look at its contents */
                truth = match_words_1message((CamelDataWrapper *)containee, words, mask);
-       } else if (camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
+       } else if (header_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
                /* for all other text parts, we look inside, otherwise we dont care */
                CamelStreamMem *mem = (CamelStreamMem *)camel_stream_mem_new ();
 
index d7c0821..5efc369 100644 (file)
@@ -90,14 +90,14 @@ static int my_list_size(struct _node **list);
 static int summary_header_load(CamelFolderSummary *, FILE *);
 static int summary_header_save(CamelFolderSummary *, FILE *);
 
-static CamelMessageInfo * message_info_new(CamelFolderSummary *, struct _camel_header_raw *);
+static CamelMessageInfo * message_info_new(CamelFolderSummary *, struct _header_raw *);
 static CamelMessageInfo * message_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
 static CamelMessageInfo * message_info_new_from_message(CamelFolderSummary *s, CamelMimeMessage *msg);
 static CamelMessageInfo * message_info_load(CamelFolderSummary *, FILE *);
 static int               message_info_save(CamelFolderSummary *, FILE *, CamelMessageInfo *);
 static void              message_info_free(CamelFolderSummary *, CamelMessageInfo *);
 
-static CamelMessageContentInfo * content_info_new(CamelFolderSummary *, struct _camel_header_raw *);
+static CamelMessageContentInfo * content_info_new(CamelFolderSummary *, struct _header_raw *);
 static CamelMessageContentInfo * content_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
 static CamelMessageContentInfo * content_info_new_from_message(CamelFolderSummary *s, CamelMimePart *mp);
 static CamelMessageContentInfo * content_info_load(CamelFolderSummary *, FILE *);
@@ -810,7 +810,7 @@ void camel_folder_summary_add(CamelFolderSummary *s, CamelMessageInfo *info)
  * 
  * Return value: The newly added record.
  **/
-CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
+CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *s, struct _header_raw *h)
 {
        CamelMessageInfo *info = camel_folder_summary_info_new_from_header(s, h);
 
@@ -869,7 +869,7 @@ CamelMessageInfo *camel_folder_summary_add_from_message(CamelFolderSummary *s, C
  * Return value: Guess?  This info record MUST be freed using
  * camel_folder_summary_info_free(), camel_message_info_free() will not work.
  **/
-CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
+CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *s, struct _header_raw *h)
 {
        return ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s))) -> message_info_new(s, h);
 }
@@ -907,7 +907,7 @@ CamelMessageInfo *camel_folder_summary_info_new_from_parser(CamelFolderSummary *
        /* should this check the parser is in the right state, or assume it is?? */
 
        start = camel_mime_parser_tell(mp);
-       if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_EOF) {
+       if (camel_mime_parser_step(mp, &buffer, &len) != HSCAN_EOF) {
                info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new_from_parser(s, mp);
 
                camel_mime_parser_unstep(mp);
@@ -1452,9 +1452,9 @@ static CamelMessageInfo * message_info_new_from_parser(CamelFolderSummary *s, Ca
 
        state = camel_mime_parser_state(mp);
        switch (state) {
-       case CAMEL_MIME_PARSER_STATE_HEADER:
-       case CAMEL_MIME_PARSER_STATE_MESSAGE:
-       case CAMEL_MIME_PARSER_STATE_MULTIPART:
+       case HSCAN_HEADER:
+       case HSCAN_MESSAGE:
+       case HSCAN_MULTIPART:
                mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new(s, camel_mime_parser_headers_raw(mp));
                break;
        default:
@@ -1469,13 +1469,13 @@ static CamelMessageContentInfo * content_info_new_from_parser(CamelFolderSummary
        CamelMessageContentInfo *ci = NULL;
 
        switch (camel_mime_parser_state(mp)) {
-       case CAMEL_MIME_PARSER_STATE_HEADER:
-       case CAMEL_MIME_PARSER_STATE_MESSAGE:
-       case CAMEL_MIME_PARSER_STATE_MULTIPART:
+       case HSCAN_HEADER:
+       case HSCAN_MESSAGE:
+       case HSCAN_MULTIPART:
                ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new(s, camel_mime_parser_headers_raw(mp));
                if (ci) {
                        ci->type = camel_mime_parser_content_type(mp);
-                       camel_content_type_ref(ci->type);
+                       header_content_type_ref(ci->type);
                }
                break;
        default:
@@ -1504,17 +1504,17 @@ static CamelMessageContentInfo * content_info_new_from_message(CamelFolderSummar
 }
 
 static char *
-summary_format_address(struct _camel_header_raw *h, const char *name, const char *charset)
+summary_format_address(struct _header_raw *h, const char *name, const char *charset)
 {
-       struct _camel_header_address *addr;
+       struct _header_address *addr;
        const char *text;
        char *ret;
 
-       text = camel_header_raw_find (&h, name, NULL);
-       addr = camel_header_address_decode (text, charset);
+       text = header_raw_find (&h, name, NULL);
+       addr = header_address_decode (text, charset);
        if (addr) {
-               ret = camel_header_address_list_format (addr);
-               camel_header_address_list_clear (&addr);
+               ret = header_address_list_format (addr);
+               header_address_list_clear (&addr);
        } else {
                ret = g_strdup (text);
        }
@@ -1523,15 +1523,15 @@ summary_format_address(struct _camel_header_raw *h, const char *name, const char
 }
 
 static char *
-summary_format_string (struct _camel_header_raw *h, const char *name, const char *charset)
+summary_format_string (struct _header_raw *h, const char *name, const char *charset)
 {
        const char *text;
        
-       text = camel_header_raw_find (&h, name, NULL);
+       text = header_raw_find (&h, name, NULL);
        if (text) {
                while (isspace ((unsigned) *text))
                        text++;
-               return camel_header_decode_string (text, charset);
+               return header_decode_string (text, charset);
        } else {
                return NULL;
        }
@@ -1593,23 +1593,23 @@ camel_folder_summary_content_info_new(CamelFolderSummary *s)
 }
 
 static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
+message_info_new(CamelFolderSummary *s, struct _header_raw *h)
 {
        CamelMessageInfo *mi;
        const char *received;
        guchar digest[16];
-       struct _camel_header_references *refs, *irt, *scan;
+       struct _header_references *refs, *irt, *scan;
        char *msgid;
        int count;
        char *subject, *from, *to, *cc, *mlist;
-       CamelContentType *ct = NULL;
+       struct _header_content_type *ct = NULL;
        const char *content, *charset = NULL;
 
        mi = camel_folder_summary_info_new(s);
 
-       if ((content = camel_header_raw_find(&h, "Content-Type", NULL))
-            && (ct = camel_content_type_decode(content))
-            && (charset = camel_content_type_param(ct, "charset"))
+       if ((content = header_raw_find(&h, "Content-Type", NULL))
+            && (ct = header_content_type_decode(content))
+            && (charset = header_content_type_param(ct, "charset"))
             && (strcasecmp(charset, "us-ascii") == 0))
                charset = NULL;
        
@@ -1619,10 +1619,10 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
        from = summary_format_address(h, "from", charset);
        to = summary_format_address(h, "to", charset);
        cc = summary_format_address(h, "cc", charset);
-       mlist = camel_header_raw_check_mailing_list(&h);
+       mlist = header_raw_check_mailing_list(&h);
 
        if (ct)
-               camel_content_type_unref(ct);
+               header_content_type_unref(ct);
 
 #ifdef DOEPOOLV
        e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject, TRUE);
@@ -1646,16 +1646,16 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
 
        mi->user_flags = NULL;
        mi->user_tags = NULL;
-       mi->date_sent = camel_header_decode_date(camel_header_raw_find(&h, "date", NULL), NULL);
-       received = camel_header_raw_find(&h, "received", NULL);
+       mi->date_sent = header_decode_date(header_raw_find(&h, "date", NULL), NULL);
+       received = header_raw_find(&h, "received", NULL);
        if (received)
                received = strrchr(received, ';');
        if (received)
-               mi->date_received = camel_header_decode_date(received + 1, NULL);
+               mi->date_received = header_decode_date(received + 1, NULL);
        else
                mi->date_received = 0;
 
-       msgid = camel_header_msgid_decode(camel_header_raw_find(&h, "message-id", NULL));
+       msgid = header_msgid_decode(header_raw_find(&h, "message-id", NULL));
        if (msgid) {
                md5_get_digest(msgid, strlen(msgid), digest);
                memcpy(mi->message_id.id.hash, digest, sizeof(mi->message_id.id.hash));
@@ -1663,8 +1663,8 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
        }
        
        /* decode our references and in-reply-to headers */
-       refs = camel_header_references_decode (camel_header_raw_find (&h, "references", NULL));
-       irt = camel_header_references_inreplyto_decode (camel_header_raw_find (&h, "in-reply-to", NULL));
+       refs = header_references_decode (header_raw_find (&h, "references", NULL));
+       irt = header_references_inreplyto_decode (header_raw_find (&h, "in-reply-to", NULL));
        if (refs || irt) {
                if (irt) {
                        /* The References field is populated from the ``References'' and/or ``In-Reply-To''
@@ -1677,7 +1677,7 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
                        refs = irt;
                }
                
-               count = camel_header_references_list_size(&refs);
+               count = header_references_list_size(&refs);
                mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
                count = 0;
                scan = refs;
@@ -1688,7 +1688,7 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
                        scan = scan->next;
                }
                mi->references->size = count;
-               camel_header_references_list_clear(&refs);
+               header_references_list_clear(&refs);
        }
 
        return mi;
@@ -1867,7 +1867,7 @@ message_info_free(CamelFolderSummary *s, CamelMessageInfo *mi)
 }
 
 static CamelMessageContentInfo *
-content_info_new (CamelFolderSummary *s, struct _camel_header_raw *h)
+content_info_new (CamelFolderSummary *s, struct _header_raw *h)
 {
        CamelMessageContentInfo *ci;
        const char *charset;
@@ -1875,9 +1875,9 @@ content_info_new (CamelFolderSummary *s, struct _camel_header_raw *h)
        ci = camel_folder_summary_content_info_new (s);
        
        charset = e_iconv_locale_charset ();
-       ci->id = camel_header_msgid_decode (camel_header_raw_find (&h, "content-id", NULL));
-       ci->description = camel_header_decode_string (camel_header_raw_find (&h, "content-description", NULL), NULL);
-       ci->encoding = camel_header_content_encoding_decode (camel_header_raw_find (&h, "content-transfer-encoding", NULL));
+       ci->id = header_msgid_decode (header_raw_find (&h, "content-id", NULL));
+       ci->description = header_decode_string (header_raw_find (&h, "content-description", NULL), NULL);
+       ci->encoding = header_content_encoding_decode (header_raw_find (&h, "content-transfer-encoding", NULL));
        
        return ci;
 }
@@ -1888,7 +1888,7 @@ content_info_load(CamelFolderSummary *s, FILE *in)
        CamelMessageContentInfo *ci;
        char *type, *subtype;
        guint32 count, i;
-       CamelContentType *ct;
+       struct _header_content_type *ct;
 
        io(printf("Loading content info\n"));
 
@@ -1896,7 +1896,7 @@ content_info_load(CamelFolderSummary *s, FILE *in)
        
        camel_folder_summary_decode_token(in, &type);
        camel_folder_summary_decode_token(in, &subtype);
-       ct = camel_content_type_new(type, subtype);
+       ct = header_content_type_new(type, subtype);
        g_free(type);           /* can this be removed? */
        g_free(subtype);
        if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
@@ -1909,7 +1909,7 @@ content_info_load(CamelFolderSummary *s, FILE *in)
                if (!(name && value))
                        goto error;
                
-               camel_content_type_set_param(ct, name, value);
+               header_content_type_set_param(ct, name, value);
                /* TODO: do this so we dont have to double alloc/free */
                g_free(name);
                g_free(value);
@@ -1935,8 +1935,8 @@ content_info_load(CamelFolderSummary *s, FILE *in)
 static int
 content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
 {
-       CamelContentType *ct;
-       struct _camel_header_param *hp;
+       struct _header_content_type *ct;
+       struct _header_param *hp;
 
        io(printf("Saving content info\n"));
 
@@ -1965,7 +1965,7 @@ content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
 static void
 content_info_free(CamelFolderSummary *s, CamelMessageContentInfo *ci)
 {
-       camel_content_type_unref(ci->type);
+       header_content_type_unref(ci->type);
        g_free(ci->id);
        g_free(ci->description);
        g_free(ci->encoding);
@@ -1992,7 +1992,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
        size_t len;
        char *buffer;
        CamelMessageContentInfo *info = NULL;
-       CamelContentType *ct;
+       struct _header_content_type *ct;
        int body;
        int enc_id = -1, chr_id = -1, html_id = -1, idx_id = -1;
        struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
@@ -2009,20 +2009,20 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
                info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_parser(s, mp);
 
        switch(state) {
-       case CAMEL_MIME_PARSER_STATE_HEADER:
+       case HSCAN_HEADER:
                /* check content type for indexing, then read body */
                ct = camel_mime_parser_content_type(mp);
                /* update attachments flag as we go */
-               if (!camel_content_type_is(ct, "text", "*"))
+               if (!header_content_type_is(ct, "text", "*"))
                        msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
 
-               if (p->index && camel_content_type_is(ct, "text", "*")) {
+               if (p->index && header_content_type_is(ct, "text", "*")) {
                        char *encoding;
                        const char *charset;
 
                        d(printf("generating index:\n"));
                        
-                       encoding = camel_header_content_encoding_decode(camel_mime_parser_header(mp, "content-transfer-encoding", NULL));
+                       encoding = header_content_encoding_decode(camel_mime_parser_header(mp, "content-transfer-encoding", NULL));
                        if (encoding) {
                                if (!strcasecmp(encoding, "base64")) {
                                        d(printf(" decoding base64\n"));
@@ -2051,7 +2051,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
                                g_free(encoding);
                        }
 
-                       charset = camel_content_type_param(ct, "charset");
+                       charset = header_content_type_param(ct, "charset");
                        if (charset!=NULL
                            && !(strcasecmp(charset, "us-ascii")==0
                                 || strcasecmp(charset, "utf-8")==0)) {
@@ -2073,7 +2073,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
 
                        /* we do charset conversions before this filter, which isn't strictly correct,
                           but works in most cases */
-                       if (camel_content_type_is(ct, "text", "html")) {
+                       if (header_content_type_is(ct, "text", "html")) {
                                if (p->filter_html == NULL)
                                        p->filter_html = camel_mime_filter_html_new();
                                else
@@ -2085,7 +2085,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
                        idx_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_index);
                }
                /* and scan/index everything */
-               while (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_BODY_END)
+               while (camel_mime_parser_step(mp, &buffer, &len) != HSCAN_BODY_END)
                        ;
                /* and remove the filters */
                camel_mime_parser_filter_remove(mp, enc_id);
@@ -2093,14 +2093,14 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
                camel_mime_parser_filter_remove(mp, html_id);
                camel_mime_parser_filter_remove(mp, idx_id);
                break;
-       case CAMEL_MIME_PARSER_STATE_MULTIPART:
+       case HSCAN_MULTIPART:
                d(printf("Summarising multipart\n"));
                /* update attachments flag as we go */
                ct = camel_mime_parser_content_type(mp);
-               if (camel_content_type_is(ct, "multipart", "mixed"))
+               if (header_content_type_is(ct, "multipart", "mixed"))
                        msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
 
-               while (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
+               while (camel_mime_parser_step(mp, &buffer, &len) != HSCAN_MULTIPART_END) {
                        camel_mime_parser_unstep(mp);
                        part = summary_build_content_info(s, msginfo, mp);
                        if (part) {
@@ -2109,7 +2109,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
                        }
                }
                break;
-       case CAMEL_MIME_PARSER_STATE_MESSAGE:
+       case HSCAN_MESSAGE:
                d(printf("Summarising message\n"));
                /* update attachments flag as we go */
                msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
@@ -2120,7 +2120,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
                        my_list_append((struct _node **)&info->childs, (struct _node *)part);
                }
                state = camel_mime_parser_step(mp, &buffer, &len);
-               if (state != CAMEL_MIME_PARSER_STATE_MESSAGE_END) {
+               if (state != HSCAN_MESSAGE_END) {
                        g_error("Bad parser state: Expecing MESSAGE_END or MESSAGE_EOF, got: %d", state);
                        camel_mime_parser_unstep(mp);
                }
@@ -2154,10 +2154,10 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
           add a reference, probably need fixing for multithreading */
 
        /* check for attachments */
-       if (camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "*")) {
-               if (camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "mixed"))
+       if (header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "*")) {
+               if (header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "mixed"))
                        msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
-       } else if (!camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*"))
+       } else if (!header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*"))
                msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
 
        /* using the object types is more accurate than using the mime/types */
@@ -2180,11 +2180,11 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
                        my_list_append((struct _node **)&info->childs, (struct _node *)child);
                }
        } else if (p->filter_stream
-                  && camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*")) {
+                  && header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*")) {
                int html_id = -1, idx_id = -1;
 
                /* pre-attach html filter if required, otherwise just index filter */
-               if (camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "html")) {
+               if (header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "html")) {
                        if (p->filter_html == NULL)
                                p->filter_html = camel_mime_filter_html_new();
                        else
@@ -2588,16 +2588,16 @@ void camel_message_info_ref(CamelMessageInfo *info)
  * Returns a new CamelMessageInfo structure populated by the header.
  **/
 CamelMessageInfo *
-camel_message_info_new_from_header (struct _camel_header_raw *header)
+camel_message_info_new_from_header (struct _header_raw *header)
 {
        CamelMessageInfo *info;
        char *subject, *from, *to, *cc, *mlist;
-       CamelContentType *ct = NULL;
+       struct _header_content_type *ct = NULL;
        const char *content, *date, *charset = NULL;
        
-       if ((content = camel_header_raw_find(&header, "Content-Type", NULL))
-           && (ct = camel_content_type_decode(content))
-           && (charset = camel_content_type_param(ct, "charset"))
+       if ((content = header_raw_find(&header, "Content-Type", NULL))
+           && (ct = header_content_type_decode(content))
+           && (charset = header_content_type_param(ct, "charset"))
            && (strcasecmp(charset, "us-ascii") == 0))
                charset = NULL;
        
@@ -2607,11 +2607,11 @@ camel_message_info_new_from_header (struct _camel_header_raw *header)
        from = summary_format_address(header, "from", charset);
        to = summary_format_address(header, "to", charset);
        cc = summary_format_address(header, "cc", charset);
-       date = camel_header_raw_find(&header, "date", NULL);
-       mlist = camel_header_raw_check_mailing_list(&header);
+       date = header_raw_find(&header, "date", NULL);
+       mlist = header_raw_check_mailing_list(&header);
 
        if (ct)
-               camel_content_type_unref(ct);
+               header_content_type_unref(ct);
 
        info = camel_message_info_new();
 
@@ -2622,16 +2622,16 @@ camel_message_info_new_from_header (struct _camel_header_raw *header)
        camel_message_info_set_mlist(info, mlist);
        
        if (date)
-               info->date_sent = camel_header_decode_date (date, NULL);
+               info->date_sent = header_decode_date (date, NULL);
        else
                info->date_sent = time (NULL);
        
-       date = camel_header_raw_find (&header, "received", NULL);
+       date = header_raw_find (&header, "received", NULL);
        if (date && (date = strrchr (date, ';')))
                date++;
        
        if (date)
-               info->date_received = camel_header_decode_date (date, NULL);
+               info->date_received = header_decode_date (date, NULL);
        else
                info->date_received = time (NULL);
        
index 48713b1..0f92ff6 100644 (file)
@@ -48,7 +48,7 @@ struct _CamelMessageContentInfo {
        struct _CamelMessageContentInfo *childs;
        struct _CamelMessageContentInfo *parent;
        
-       CamelContentType *type;
+       struct _header_content_type *type;
        char *id;
        char *description;
        char *encoding;         /* this should be an enum?? */
@@ -191,7 +191,7 @@ struct _CamelFolderSummaryClass {
        int (*summary_header_save)(CamelFolderSummary *, FILE *);
 
        /* create/save/load an individual message info */
-       CamelMessageInfo * (*message_info_new)(CamelFolderSummary *, struct _camel_header_raw *);
+       CamelMessageInfo * (*message_info_new)(CamelFolderSummary *, struct _header_raw *);
        CamelMessageInfo * (*message_info_new_from_parser)(CamelFolderSummary *, CamelMimeParser *);
        CamelMessageInfo * (*message_info_new_from_message)(CamelFolderSummary *, CamelMimeMessage *);
        CamelMessageInfo * (*message_info_load)(CamelFolderSummary *, FILE *);
@@ -199,7 +199,7 @@ struct _CamelFolderSummaryClass {
        void               (*message_info_free)(CamelFolderSummary *, CamelMessageInfo *);
 
        /* save/load individual content info's */
-       CamelMessageContentInfo * (*content_info_new)(CamelFolderSummary *, struct _camel_header_raw *);
+       CamelMessageContentInfo * (*content_info_new)(CamelFolderSummary *, struct _header_raw *);
        CamelMessageContentInfo * (*content_info_new_from_parser)(CamelFolderSummary *, CamelMimeParser *);
        CamelMessageContentInfo * (*content_info_new_from_message)(CamelFolderSummary *, CamelMimePart *);
        CamelMessageContentInfo * (*content_info_load)(CamelFolderSummary *, FILE *);
@@ -235,13 +235,13 @@ void camel_folder_summary_touch(CamelFolderSummary *s);
 void camel_folder_summary_add(CamelFolderSummary *, CamelMessageInfo *info);
 
 /* build/add raw summary items */
-CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *, struct _camel_header_raw *);
+CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *, struct _header_raw *);
 CamelMessageInfo *camel_folder_summary_add_from_parser(CamelFolderSummary *, CamelMimeParser *);
 CamelMessageInfo *camel_folder_summary_add_from_message(CamelFolderSummary *, CamelMimeMessage *);
 
 /* Just build raw summary items */
 CamelMessageInfo *camel_folder_summary_info_new(CamelFolderSummary *s);
-CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *, struct _camel_header_raw *);
+CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *, struct _header_raw *);
 CamelMessageInfo *camel_folder_summary_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
 CamelMessageInfo *camel_folder_summary_info_new_from_message(CamelFolderSummary *, CamelMimeMessage *);
 
@@ -267,8 +267,8 @@ GPtrArray *camel_folder_summary_array(CamelFolderSummary *s);
 void camel_folder_summary_array_free(CamelFolderSummary *s, GPtrArray *array);
 
 /* summary formatting utils */
-char *camel_folder_summary_format_address(struct _camel_header_raw *h, const char *name);
-char *camel_folder_summary_format_string(struct _camel_header_raw *h, const char *name);
+char *camel_folder_summary_format_address(struct _header_raw *h, const char *name);
+char *camel_folder_summary_format_string(struct _header_raw *h, const char *name);
 
 /* basically like strings, but certain keywords can be compressed and de-cased */
 int camel_folder_summary_encode_token(FILE *, const char *);
@@ -296,7 +296,7 @@ void                camel_tag_list_free(CamelTag **list);
    other external interfaces that use message info's */
 CamelMessageInfo *camel_message_info_new(void);
 void camel_message_info_ref(CamelMessageInfo *info);
-CamelMessageInfo *camel_message_info_new_from_header(struct _camel_header_raw *header);
+CamelMessageInfo *camel_message_info_new_from_header(struct _header_raw *header);
 void camel_message_info_dup_to(const CamelMessageInfo *from, CamelMessageInfo *to);
 void camel_message_info_free(CamelMessageInfo *mi);
 
index cf462af..d9dc6e0 100644 (file)
@@ -96,10 +96,10 @@ camel_http_stream_finalize (CamelObject *object)
                camel_object_unref(http->parser);
        
        if (http->content_type)
-               camel_content_type_unref (http->content_type);
+               header_content_type_unref (http->content_type);
        
        if (http->headers)
-               camel_header_raw_clear (&http->headers);
+               header_raw_clear (&http->headers);
        
        if (http->session)
                camel_object_unref(http->session);
@@ -261,7 +261,7 @@ http_get_statuscode (CamelHttpStream *http)
        /* parse the HTTP status code */
        if (!strncasecmp (buffer, "HTTP/", 5)) {
                token = http_next_token (buffer);
-               http->statuscode = camel_header_decode_int (&token);
+               http->statuscode = header_decode_int (&token);
                return http->statuscode;
        }
 
@@ -273,7 +273,7 @@ http_get_statuscode (CamelHttpStream *http)
 static int
 http_get_headers (CamelHttpStream *http)
 {
-       struct _camel_header_raw *headers, *node, *tail;
+       struct _header_raw *headers, *node, *tail;
        const char *type;
        char *buf;
        size_t len;
@@ -286,27 +286,27 @@ http_get_headers (CamelHttpStream *http)
        camel_mime_parser_init_with_stream (http->parser, http->read);
        
        switch (camel_mime_parser_step (http->parser, &buf, &len)) {
-       case CAMEL_MIME_PARSER_STATE_MESSAGE:
-       case CAMEL_MIME_PARSER_STATE_HEADER:
+       case HSCAN_MESSAGE:
+       case HSCAN_HEADER:
                headers = camel_mime_parser_headers_raw (http->parser);
                if (http->content_type)
-                       camel_content_type_unref (http->content_type);
-               type = camel_header_raw_find (&headers, "Content-Type", NULL);
+                       header_content_type_unref (http->content_type);
+               type = header_raw_find (&headers, "Content-Type", NULL);
                if (type)
-                       http->content_type = camel_content_type_decode (type);
+                       http->content_type = header_content_type_decode (type);
                else
                        http->content_type = NULL;
                
                if (http->headers)
-                       camel_header_raw_clear (&http->headers);
+                       header_raw_clear (&http->headers);
                
                http->headers = NULL;
-               tail = (struct _camel_header_raw *) &http->headers;
+               tail = (struct _header_raw *) &http->headers;
                
                d(printf("HTTP Headers:\n"));
                while (headers) {
                        d(printf(" %s:%s\n", headers->name, headers->value));
-                       node = g_new (struct _camel_header_raw, 1);
+                       node = g_new (struct _header_raw, 1);
                        node->next = NULL;
                        node->name = g_strdup (headers->name);
                        node->value = g_strdup (headers->value);
@@ -432,13 +432,13 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                case 302: {
                        char *loc;
 
-                       camel_content_type_unref (http->content_type);
+                       header_content_type_unref (http->content_type);
                        http->content_type = NULL;
                        http_disconnect(http);
 
-                       loc = g_strdup(camel_header_raw_find(&http->headers, "Location", NULL));
+                       loc = g_strdup(header_raw_find(&http->headers, "Location", NULL));
                        if (loc == NULL) {
-                               camel_header_raw_clear(&http->headers);
+                               header_raw_clear(&http->headers);
                                return -1;
                        }
 
@@ -449,11 +449,11 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                        http->url = camel_url_new(loc, NULL);
                        if (http->url == NULL) {
                                printf("redirect url '%s' cannot be parsed\n", loc);
-                               camel_header_raw_clear (&http->headers);
+                               header_raw_clear (&http->headers);
                                return -1;
                        }
                        d(printf(" redirect url = %p\n", http->url));
-                       camel_header_raw_clear (&http->headers);
+                       header_raw_clear (&http->headers);
 
                        goto redirect;
                        break; }
@@ -536,7 +536,7 @@ camel_http_stream_get_content_type (CamelHttpStream *http_stream)
        }
        
        if (http_stream->content_type)
-               camel_content_type_ref (http_stream->content_type);
+               header_content_type_ref (http_stream->content_type);
        
        return http_stream->content_type;
 }
index 94272ee..41a82d0 100644 (file)
@@ -59,7 +59,7 @@ struct _CamelHttpStream {
        CamelMimeParser *parser;
        
        CamelContentType *content_type;
-       struct _camel_header_raw *headers;
+       struct _header_raw *headers;
        
        CamelHttpMethod method;
        struct _CamelSession *session;
index bc65ea7..80b68ab 100644 (file)
@@ -84,18 +84,18 @@ camel_internet_address_get_type(void)
 static int
 internet_decode        (CamelAddress *a, const char *raw)
 {
-       struct _camel_header_address *ha, *n;
+       struct _header_address *ha, *n;
        int count = a->addresses->len;
 
        /* Should probably use its own decoder or something */
-       ha = camel_header_address_decode(raw, NULL);
+       ha = header_address_decode(raw, NULL);
        if (ha) {
                n = ha;
                while (n) {
                        if (n->type == HEADER_ADDRESS_NAME) {
                                camel_internet_address_add((CamelInternetAddress *)a, n->name, n->v.addr);
                        } else if (n->type == HEADER_ADDRESS_GROUP) {
-                               struct _camel_header_address *g = n->v.members;
+                               struct _header_address *g = n->v.members;
                                while (g) {
                                        if (g->type == HEADER_ADDRESS_NAME)
                                                camel_internet_address_add((CamelInternetAddress *)a, g->name, g->v.addr);
@@ -105,7 +105,7 @@ internet_decode     (CamelAddress *a, const char *raw)
                        }
                        n = n->next;
                }
-               camel_header_address_list_clear(&ha);
+               header_address_list_clear(&ha);
        }
        
        return a->addresses->len - count;
@@ -413,7 +413,7 @@ camel_internet_address_find_address(CamelInternetAddress *a, const char *address
 char *
 camel_internet_address_encode_address(int *inlen, const char *real, const char *addr)
 {
-       char *name = camel_header_encode_phrase(real);
+       char *name = header_encode_phrase(real);
        char *ret = NULL, *addra = NULL;
        int len = *inlen;
        GString *out = g_string_new("");
@@ -422,7 +422,7 @@ camel_internet_address_encode_address(int *inlen, const char *real, const char *
 
        if (name && name[0]) {
                if (strlen(name) + len > CAMEL_FOLD_SIZE) {
-                       char *folded = camel_header_address_fold(name, len);
+                       char *folded = header_address_fold(name, len);
                        char *last;
                        g_string_append(out, folded);
                        g_free(folded);
index b3964f2..5699a29 100644 (file)
@@ -40,11 +40,11 @@ static CamelDataWrapperClass *parent_class = NULL;
 #define CM_CLASS(so) CAMEL_MEDIUM_CLASS (CAMEL_OBJECT_GET_CLASS(so))
 
 static gboolean is_offline (CamelDataWrapper *data_wrapper);
-static void add_header (CamelMedium *medium, const char *name,
-                       const void *value);
-static void set_header (CamelMedium *medium, const char *name, const void *value);
-static void remove_header (CamelMedium *medium, const char *name);
-static const void *get_header (CamelMedium *medium, const char *name);
+static void add_header (CamelMedium *medium, const gchar *header_name,
+                       const void *header_value);
+static void set_header (CamelMedium *medium, const gchar *header_name, const void *header_value);
+static void remove_header (CamelMedium *medium, const gchar *header_name);
+static const void *get_header (CamelMedium *medium, const gchar *header_name);
 
 static GArray *get_headers (CamelMedium *medium);
 static void free_headers (CamelMedium *medium, GArray *headers);
@@ -121,16 +121,17 @@ is_offline (CamelDataWrapper *data_wrapper)
 }
 
 static void
-add_header (CamelMedium *medium, const char *name, const void *value)
+add_header (CamelMedium *medium, const gchar *header_name,
+           const void *header_value)
 {
-       g_warning("No %s::add_header implemented, adding %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
+       g_warning("No %s::add_header implemented, adding %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), header_name);
 }
 
 /**
  * camel_medium_add_header:
  * @medium: a CamelMedium
- * @name: name of the header
- * @value: value of the header
+ * @header_name: name of the header
+ * @header_value: value of the header
  *
  * Adds a header to a medium.
  *
@@ -139,78 +140,78 @@ add_header (CamelMedium *medium, const char *name, const void *value)
  * headers.   No we dont, order isn't important! Z
  **/
 void
-camel_medium_add_header (CamelMedium *medium, const char *name, const void *value)
+camel_medium_add_header (CamelMedium *medium, const gchar *header_name, const void *header_value)
 {
        g_return_if_fail (CAMEL_IS_MEDIUM (medium));
-       g_return_if_fail (name != NULL);
-       g_return_if_fail (value != NULL);
+       g_return_if_fail (header_name != NULL);
+       g_return_if_fail (header_value != NULL);
 
-       CM_CLASS (medium)->add_header(medium, name, value);
+       CM_CLASS (medium)->add_header(medium, header_name, header_value);
 }
 
 static void
-set_header (CamelMedium *medium, const char *name, const void *value)
+set_header (CamelMedium *medium, const char *header_name, const void *header_value)
 {
-       g_warning("No %s::set_header implemented, setting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
+       g_warning("No %s::set_header implemented, setting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), header_name);
 }
 
 /**
  * camel_medium_set_header:
  * @medium: a CamelMedium
- * @name: name of the header
- * @value: value of the header
+ * @header_name: name of the header
+ * @header_value: value of the header
  *
  * Sets the value of a header.  Any other occurances of the header
  * will be removed.  Setting a %NULL header can be used to remove
  * the header also.
  **/
 void
-camel_medium_set_header (CamelMedium *medium, const char *name, const void *value)
+camel_medium_set_header (CamelMedium *medium, const char *header_name, const void *header_value)
 {
        g_return_if_fail (CAMEL_IS_MEDIUM (medium));
-       g_return_if_fail (name != NULL);
+       g_return_if_fail (header_name != NULL);
 
-       if (value == NULL)
-               CM_CLASS(medium)->remove_header(medium, name);
+       if (header_value == NULL)
+               CM_CLASS(medium)->remove_header(medium, header_name);
        else
-               CM_CLASS(medium)->set_header(medium, name, value);
+               CM_CLASS(medium)->set_header(medium, header_name, header_value);
 }
 
 static void
-remove_header(CamelMedium *medium, const char *name)
+remove_header(CamelMedium *medium, const char *header_name)
 {
-       g_warning("No %s::remove_header implemented, removing %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
+       g_warning("No %s::remove_header implemented, removing %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), header_name);
 }
 
 /**
  * camel_medium_remove_header:
  * @medium: a medium
- * @name: the name of the header
+ * @header_name: the name of the header
  *
  * Removes the named header from the medium.  All occurances of the
  * header are removed.
  **/
 void
-camel_medium_remove_header(CamelMedium *medium, const char *name)
+camel_medium_remove_header(CamelMedium *medium, const char *header_name)
 {
        g_return_if_fail (CAMEL_IS_MEDIUM (medium));
-       g_return_if_fail (name != NULL);
+       g_return_if_fail (header_name != NULL);
 
-       CM_CLASS(medium)->remove_header(medium, name);
+       CM_CLASS(medium)->remove_header(medium, header_name);
 }
 
 
 static const void *
-get_header(CamelMedium *medium, const char *name)
+get_header(CamelMedium *medium, const char *header_name)
 {
-       g_warning("No %s::get_header implemented, getting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
+       g_warning("No %s::get_header implemented, getting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), header_name);
        return NULL;
 }
 
 /**
  * camel_medium_get_header:
  * @medium: a medium
- * @name: the name of the header
+ * @header_name: the name of the header
  *
  * Returns the value of the named header in the medium, or %NULL if
  * it is unset. The caller should not modify or free the data.
@@ -222,12 +223,12 @@ get_header(CamelMedium *medium, const char *name)
  * Return value: the value of the named header, or %NULL
  **/
 const void *
-camel_medium_get_header(CamelMedium *medium, const char *name)
+camel_medium_get_header(CamelMedium *medium, const char *header_name)
 {
        g_return_val_if_fail (CAMEL_IS_MEDIUM (medium), NULL);
-       g_return_val_if_fail (name != NULL, NULL);
+       g_return_val_if_fail (header_name != NULL, NULL);
 
-       return CM_CLASS (medium)->get_header (medium, name);
+       return CM_CLASS (medium)->get_header (medium, header_name);
 }
 
 
index 7b01eae..26040b2 100644 (file)
@@ -31,7 +31,7 @@
 #ifdef __cplusplus
 extern "C" {
 #pragma }
-#endif /* __cplusplus */
+#endif /* __cplusplus }*/
 
 #include <camel/camel-data-wrapper.h>
 
@@ -46,7 +46,8 @@ typedef struct {
        const char *value;
 } CamelMediumHeader;
 
-struct _CamelMedium {
+struct _CamelMedium
+{
        CamelDataWrapper parent_object;
 
        /* The content of the medium, as opposed to our parent
@@ -54,32 +55,34 @@ struct _CamelMedium {
         * content.
         */
        CamelDataWrapper *content;
+
 };
 
 typedef struct {
        CamelDataWrapperClass parent_class;
 
        /* Virtual methods */
-       void  (*add_header) (CamelMedium *medium, const char *name, const void *value);
-       void  (*set_header) (CamelMedium *medium, const char *name, const void *value);
-       void  (*remove_header) (CamelMedium *medium, const char *name);
-       const void * (*get_header) (CamelMedium *medium,  const char *name);
+       void  (*add_header) (CamelMedium *medium, const gchar *header_name, const void *header_value);
+       void  (*set_header) (CamelMedium *medium, const gchar *header_name, const void *header_value);
+       void  (*remove_header) (CamelMedium *medium, const gchar *header_name);
+       const void * (*get_header) (CamelMedium *medium,  const gchar *header_name);
 
        GArray * (*get_headers) (CamelMedium *medium);
        void (*free_headers) (CamelMedium *medium, GArray *headers);
 
        CamelDataWrapper * (*get_content_object) (CamelMedium *medium);
        void (*set_content_object) (CamelMedium *medium, CamelDataWrapper *content);
+
 } CamelMediumClass;
 
 /* Standard Camel function */
 CamelType camel_medium_get_type (void);
 
 /* Header get/set interface */
-void camel_medium_add_header (CamelMedium *medium, const char *name, const void *value);
-void camel_medium_set_header (CamelMedium *medium, const char *name, const void *value);
-void camel_medium_remove_header (CamelMedium *medium, const char *name);
-const void *camel_medium_get_header (CamelMedium *medium, const char *name);
+void camel_medium_add_header (CamelMedium *medium, const gchar *header_name, const void *header_value);
+void camel_medium_set_header (CamelMedium *medium, const gchar *header_name, const void *header_value);
+void camel_medium_remove_header (CamelMedium *medium, const gchar *header_name);
+const void *camel_medium_get_header (CamelMedium *medium, const gchar *header_name);
 
 GArray *camel_medium_get_headers (CamelMedium *medium);
 void camel_medium_free_headers (CamelMedium *medium, GArray *headers);
index 65e4207..a0700fc 100644 (file)
@@ -80,9 +80,9 @@ static char *recipient_names[] = {
 };
 
 static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static void add_header (CamelMedium *medium, const char *name, const void *value);
-static void set_header (CamelMedium *medium, const char *name, const void *value);
-static void remove_header (CamelMedium *medium, const char *name);
+static void add_header (CamelMedium *medium, const char *header_name, const void *header_value);
+static void set_header (CamelMedium *medium, const char *header_name, const void *header_value);
+static void remove_header (CamelMedium *medium, const char *header_name);
 static int construct_from_parser (CamelMimePart *, CamelMimeParser *);
 static void unref_recipient (gpointer key, gpointer value, gpointer user_data);
 
@@ -99,10 +99,10 @@ camel_mime_message_class_init (CamelMimeMessageClass *camel_mime_message_class)
        CamelMediumClass *camel_medium_class = CAMEL_MEDIUM_CLASS (camel_mime_message_class);
        int i;
        
-       parent_class = CAMEL_MIME_PART_CLASS (camel_type_get_global_classfuncs (camel_mime_part_get_type ()));
-       
+       parent_class = CAMEL_MIME_PART_CLASS(camel_type_get_global_classfuncs (camel_mime_part_get_type ()));
+
        header_name_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
-       for (i = 0;header_names[i]; i++)
+       for (i=0;header_names[i];i++)
                g_hash_table_insert (header_name_table, header_names[i], GINT_TO_POINTER(i+1));
 
        /* virtual method overload */
@@ -211,7 +211,7 @@ camel_mime_message_set_date (CamelMimeMessage *message,  time_t date, int offset
        message->date = date;
        message->date_offset = offset;
        
-       datestr = camel_header_format_date (date, offset);
+       datestr = header_format_date (date, offset);
        CAMEL_MEDIUM_CLASS (parent_class)->set_header ((CamelMedium *)message, "Date", datestr);
        g_free (datestr);
 }
@@ -235,7 +235,7 @@ camel_mime_message_get_date_received (CamelMimeMessage *msg, int *offset)
                if (received)
                        received = strrchr (received, ';');
                if (received)
-                       msg->date_received = camel_header_decode_date (received + 1, &msg->date_received_offset);
+                       msg->date_received = header_decode_date (received + 1, &msg->date_received_offset);
        }
        
        if (offset)
@@ -258,7 +258,7 @@ camel_mime_message_set_message_id (CamelMimeMessage *mime_message, const char *m
        if (message_id) {
                id = g_strstrip (g_strdup (message_id));
        } else {
-               id = camel_header_msgid_generate ();
+               id = header_msgid_generate ();
        }
        
        mime_message->message_id = id;
@@ -321,7 +321,7 @@ camel_mime_message_set_subject (CamelMimeMessage *mime_message, const char *subj
        
        g_free (mime_message->subject);
        mime_message->subject = g_strstrip (g_strdup (subject));
-       text = camel_header_encode_string((unsigned char *)mime_message->subject);
+       text = header_encode_string((unsigned char *)mime_message->subject);
        CAMEL_MEDIUM_CLASS(parent_class)->set_header(CAMEL_MEDIUM (mime_message), "Subject", text);
        g_free (text);
 }
@@ -466,9 +466,9 @@ construct_from_parser (CamelMimePart *dw, CamelMimeParser *mp)
        /* ... then clean up the follow-on state */
        state = camel_mime_parser_step (mp, &buf, &len);
        switch (state) {
-       case CAMEL_MIME_PARSER_STATE_EOF: case CAMEL_MIME_PARSER_STATE_FROM_END: /* these doesn't belong to us */
+       case HSCAN_EOF: case HSCAN_FROM_END: /* these doesn't belong to us */
                camel_mime_parser_unstep (mp);
-       case CAMEL_MIME_PARSER_STATE_MESSAGE_END:
+       case HSCAN_MESSAGE_END:
                break;
        default:
                g_error ("Bad parser state: Expecing MESSAGE_END or EOF or EOM, got: %d", camel_mime_parser_state (mp));
@@ -516,35 +516,35 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
 
 /* FIXME: check format of fields. */
 static gboolean
-process_header (CamelMedium *medium, const char *name, const char *value)
+process_header (CamelMedium *medium, const char *header_name, const char *header_value)
 {
        CamelHeaderType header_type;
        CamelMimeMessage *message = CAMEL_MIME_MESSAGE (medium);
        CamelInternetAddress *addr;
        const char *charset;
        
-       header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, name);
+       header_type = (CamelHeaderType)g_hash_table_lookup (header_name_table, header_name);
        switch (header_type) {
        case HEADER_FROM:
                if (message->from)
                        camel_object_unref (CAMEL_OBJECT (message->from));
                message->from = camel_internet_address_new ();
-               camel_address_decode (CAMEL_ADDRESS (message->from), value);
+               camel_address_decode (CAMEL_ADDRESS (message->from), header_value);
                break;
        case HEADER_REPLY_TO:
                if (message->reply_to)
                        camel_object_unref (CAMEL_OBJECT (message->reply_to));
                message->reply_to = camel_internet_address_new ();
-               camel_address_decode (CAMEL_ADDRESS (message->reply_to), value);
+               camel_address_decode (CAMEL_ADDRESS (message->reply_to), header_value);
                break;
        case HEADER_SUBJECT:
                g_free (message->subject);
                if (((CamelDataWrapper *) message)->mime_type) {
-                       charset = camel_content_type_param (((CamelDataWrapper *) message)->mime_type, "charset");
+                       charset = header_content_type_param (((CamelDataWrapper *) message)->mime_type, "charset");
                        charset = e_iconv_charset_name (charset);
                } else
                        charset = NULL;
-               message->subject = g_strstrip (camel_header_decode_string (value, charset));
+               message->subject = g_strstrip (header_decode_string (header_value, charset));
                break;
        case HEADER_TO:
        case HEADER_CC:
@@ -552,15 +552,15 @@ process_header (CamelMedium *medium, const char *name, const char *value)
        case HEADER_RESENT_TO:
        case HEADER_RESENT_CC:
        case HEADER_RESENT_BCC:
-               addr = g_hash_table_lookup (message->recipients, name);
-               if (value)
-                       camel_address_decode (CAMEL_ADDRESS (addr), value);
+               addr = g_hash_table_lookup (message->recipients, header_name);
+               if (header_value)
+                       camel_address_decode (CAMEL_ADDRESS (addr), header_value);
                else
                        camel_address_remove (CAMEL_ADDRESS (addr), -1);
                break;
        case HEADER_DATE:
-               if (value) {
-                       message->date = camel_header_decode_date (value, &message->date_offset);
+               if (header_value) {
+                       message->date = header_decode_date (header_value, &message->date_offset);
                } else {
                        message->date = CAMEL_MESSAGE_DATE_CURRENT;
                        message->date_offset = 0;
@@ -568,8 +568,8 @@ process_header (CamelMedium *medium, const char *name, const char *value)
                break;
        case HEADER_MESSAGE_ID:
                g_free (message->message_id);
-               if (value)
-                       message->message_id = camel_header_msgid_decode (value);
+               if (header_value)
+                       message->message_id = header_msgid_decode (header_value);
                else
                        message->message_id = NULL;
                break;
@@ -581,27 +581,27 @@ process_header (CamelMedium *medium, const char *name, const char *value)
 }
 
 static void
-set_header (CamelMedium *medium, const char *name, const void *value)
+set_header (CamelMedium *medium, const char *header_name, const void *header_value)
 {
-       process_header (medium, name, value);
-       parent_class->parent_class.set_header (medium, name, value);
+       process_header (medium, header_name, header_value);
+       parent_class->parent_class.set_header (medium, header_name, header_value);
 }
 
 static void
-add_header (CamelMedium *medium, const char *name, const void *value)
+add_header (CamelMedium *medium, const char *header_name, const void *header_value)
 {
        /* if we process it, then it must be forced unique as well ... */
-       if (process_header (medium, name, value))
-               parent_class->parent_class.set_header (medium, name, value);
+       if (process_header (medium, header_name, header_value))
+               parent_class->parent_class.set_header (medium, header_name, header_value);
        else
-               parent_class->parent_class.add_header (medium, name, value);
+               parent_class->parent_class.add_header (medium, header_name, header_value);
 }
 
 static void
-remove_header (CamelMedium *medium, const char *name)
+remove_header (CamelMedium *medium, const char *header_name)
 {
-       process_header (medium, name, NULL);
-       parent_class->parent_class.remove_header (medium, name);
+       process_header (medium, header_name, NULL);
+       parent_class->parent_class.remove_header (medium, header_name);
 }
 
 typedef gboolean (*CamelPartFunc)(CamelMimeMessage *, CamelMimePart *, void *data);
@@ -698,7 +698,7 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
                return CAMEL_MIME_PART_ENCODING_DEFAULT;
        }
        
-       istext = camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*");
+       istext = header_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*");
        if (istext) {
                flags = CAMEL_BESTENC_GET_CHARSET | CAMEL_BESTENC_GET_ENCODING;
                enctype |= CAMEL_BESTENC_TEXT;
@@ -718,7 +718,7 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
        
        /* if we're looking for the best charset, then we need to convert to UTF-8 */
        if (istext && (required & CAMEL_BESTENC_GET_CHARSET) != 0
-           && (charsetin = camel_content_type_param (content->mime_type, "charset"))) {
+           && (charsetin = header_content_type_param (content->mime_type, "charset"))) {
                charenc = camel_mime_filter_charset_new_convert (charsetin, "UTF-8");
                if (charenc != NULL)
                        idc = camel_stream_filter_add (filter, (CamelMimeFilter *)charenc);
@@ -741,7 +741,7 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
                d(printf("best charset = %s\n", charsetin ? charsetin : "(null)"));
                charset = g_strdup (charsetin);
                
-               charsetin = camel_content_type_param (content->mime_type, "charset");
+               charsetin = header_content_type_param (content->mime_type, "charset");
        } else {
                charset = NULL;
        }
@@ -813,13 +813,13 @@ best_encoding (CamelMimeMessage *msg, CamelMimePart *part, void *datap)
                camel_mime_part_set_encoding (part, encoding);
                
                if ((data->required & CAMEL_BESTENC_GET_CHARSET) != 0) {
-                       if (camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*")) {
+                       if (header_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*")) {
                                char *newct;
                                
                                /* FIXME: ick, the part content_type interface needs fixing bigtime */
-                               camel_content_type_set_param (((CamelDataWrapper *) part)->mime_type, "charset",
+                               header_content_type_set_param (((CamelDataWrapper *) part)->mime_type, "charset",
                                                               charset ? charset : "us-ascii");
-                               newct = camel_content_type_format (((CamelDataWrapper *) part)->mime_type);
+                               newct = header_content_type_format (((CamelDataWrapper *) part)->mime_type);
                                if (newct) {
                                        d(printf("Setting content-type to %s\n", newct));
                                        
@@ -909,7 +909,7 @@ static char *tz_days[] = {
 char *
 camel_mime_message_build_mbox_from (CamelMimeMessage *message)
 {
-       struct _camel_header_raw *header = ((CamelMimePart *)message)->headers;
+       struct _header_raw *header = ((CamelMimePart *)message)->headers;
        GString *out = g_string_new("From ");
        char *ret;
        const char *tmp;
@@ -917,11 +917,11 @@ camel_mime_message_build_mbox_from (CamelMimeMessage *message)
        int offset;
        struct tm tm;
        
-       tmp = camel_header_raw_find (&header, "Sender", NULL);
+       tmp = header_raw_find (&header, "Sender", NULL);
        if (tmp == NULL)
-               tmp = camel_header_raw_find (&header, "From", NULL);
+               tmp = header_raw_find (&header, "From", NULL);
        if (tmp != NULL) {
-               struct _camel_header_address *addr = camel_header_address_decode (tmp, NULL);
+               struct _header_address *addr = header_address_decode (tmp, NULL);
                
                tmp = NULL;
                if (addr) {
@@ -929,7 +929,7 @@ camel_mime_message_build_mbox_from (CamelMimeMessage *message)
                                g_string_append (out, addr->v.addr);
                                tmp = "";
                        }
-                       camel_header_address_unref (addr);
+                       header_address_unref (addr);
                }
        }
        
@@ -937,7 +937,7 @@ camel_mime_message_build_mbox_from (CamelMimeMessage *message)
                g_string_append (out, "unknown@nodomain.now.au");
        
        /* try use the received header to get the date */
-       tmp = camel_header_raw_find (&header, "Received", NULL);
+       tmp = header_raw_find (&header, "Received", NULL);
        if (tmp) {
                tmp = strrchr(tmp, ';');
                if (tmp)
@@ -946,9 +946,9 @@ camel_mime_message_build_mbox_from (CamelMimeMessage *message)
        
        /* if there isn't one, try the Date field */
        if (tmp == NULL)
-               tmp = camel_header_raw_find (&header, "Date", NULL);
+               tmp = header_raw_find (&header, "Date", NULL);
        
-       thetime = camel_header_decode_date (tmp, &offset);
+       thetime = header_decode_date (tmp, &offset);
        thetime += ((offset / 100) * (60 * 60)) + (offset % 100) * 60;
        gmtime_r (&thetime, &tm);
        g_string_append_printf (out, " %s %s %2d %02d:%02d:%02d %4d\n",
index 7f2c515..decac00 100644 (file)
@@ -203,7 +203,7 @@ struct _header_scan_state {
 
     /* global state */
 
-       enum _camel_mime_parser_state state;
+       enum _header_state state;
 
        /* for building headers during scanning */
        char *outbuf;
@@ -248,14 +248,14 @@ struct _header_scan_state {
 struct _header_scan_stack {
        struct _header_scan_stack *parent;
 
-       enum _camel_mime_parser_state savestate; /* state at invocation of this part */
+       enum _header_state savestate; /* state at invocation of this part */
 
 #ifdef MEMPOOL
        MemPool *pool;          /* memory pool to keep track of headers/etc at this level */
 #endif
-       struct _camel_header_raw *headers;      /* headers for this part */
+       struct _header_raw *headers;    /* headers for this part */
 
-       CamelContentType *content_type;
+       struct _header_content_type *content_type;
 
        /* I dont use GString's casue you can't efficiently append a buffer to them */
        GByteArray *pretext;    /* for multipart types, save the pre-boundary data here */
@@ -297,23 +297,23 @@ static void camel_mime_parser_init       (CamelMimeParser *obj);
 
 #if d(!)0
 static char *states[] = {
-       "CAMEL_MIME_PARSER_STATE_INITIAL",
-       "CAMEL_MIME_PARSER_STATE_PRE_FROM",     /* pre-from data */
-       "CAMEL_MIME_PARSER_STATE_FROM",         /* got 'From' line */
-       "CAMEL_MIME_PARSER_STATE_HEADER",               /* toplevel header */
-       "CAMEL_MIME_PARSER_STATE_BODY",         /* scanning body of message */
-       "CAMEL_MIME_PARSER_STATE_MULTIPART",    /* got multipart header */
-       "CAMEL_MIME_PARSER_STATE_MESSAGE",      /* rfc822/news message */
-
-       "CAMEL_MIME_PARSER_STATE_PART",         /* part of a multipart */
-
-       "CAMEL_MIME_PARSER_STATE_EOF",          /* end of file */
-       "CAMEL_MIME_PARSER_STATE_PRE_FROM_END",
-       "CAMEL_MIME_PARSER_STATE_FROM_END",
-       "CAMEL_MIME_PARSER_STATE_HEAER_END",
-       "CAMEL_MIME_PARSER_STATE_BODY_END",
-       "CAMEL_MIME_PARSER_STATE_MULTIPART_END",
-       "CAMEL_MIME_PARSER_STATE_MESSAGE_END",
+       "HSCAN_INITIAL",
+       "HSCAN_PRE_FROM",       /* pre-from data */
+       "HSCAN_FROM",           /* got 'From' line */
+       "HSCAN_HEADER",         /* toplevel header */
+       "HSCAN_BODY",           /* scanning body of message */
+       "HSCAN_MULTIPART",      /* got multipart header */
+       "HSCAN_MESSAGE",        /* rfc822/news message */
+
+       "HSCAN_PART",           /* part of a multipart */
+
+       "HSCAN_EOF",            /* end of file */
+       "HSCAN_PRE_FROM_END",
+       "HSCAN_FROM_END",
+       "HSCAN_HEAER_END",
+       "HSCAN_BODY_END",
+       "HSCAN_MULTIPART_END",
+       "HSCAN_MESSAGE_END",
 };
 #endif
 
@@ -388,7 +388,7 @@ camel_mime_parser_new (void)
  *
  * Note that filters are only applied to the body content of messages, and once
  * a filter has been set, all content returned by a filter_step() with a state
- * of CAMEL_MIME_PARSER_STATE_BODY will have passed through the filter.
+ * of HSCAN_BODY will have passed through the filter.
  * 
  * Return value: An id that may be passed to filter_remove() to remove
  * the filter, or -1 if the operation failed.
@@ -462,7 +462,7 @@ camel_mime_parser_header(CamelMimeParser *m, const char *name, int *offset)
 
        if (s->parts &&
            s->parts->headers) {
-               return camel_header_raw_find(&s->parts->headers, name, offset);
+               return header_raw_find(&s->parts->headers, name, offset);
        }
        return NULL;
 }
@@ -478,7 +478,7 @@ camel_mime_parser_header(CamelMimeParser *m, const char *name, int *offset)
  * Return value: The raw headers, or NULL if there are no headers
  * defined for the current part or state.  These are READ ONLY.
  **/
-struct _camel_header_raw *
+struct _header_raw *
 camel_mime_parser_headers_raw(CamelMimeParser *m)
 {
        struct _header_scan_state *s = _PRIVATE(m);
@@ -505,7 +505,7 @@ byte_array_to_string(GByteArray *array)
  * @m: 
  * 
  * Retrieve the preface text for the current multipart.
- * Can only be used when the state is CAMEL_MIME_PARSER_STATE_MULTIPART_END.
+ * Can only be used when the state is HSCAN_MULTIPART_END.
  * 
  * Return value: The preface text, or NULL if there wasn't any.
  **/
@@ -526,7 +526,7 @@ camel_mime_parser_preface(CamelMimeParser *m)
  * 
  * Retrieve the postface text for the current multipart.
  * Only returns valid data when the current state if
- * CAMEL_MIME_PARSER_STATE_MULTIPART_END.
+ * HSCAN_MULTIPART_END.
  * 
  * Return value: The postface text, or NULL if there wasn't any.
  **/
@@ -546,10 +546,10 @@ camel_mime_parser_postface(CamelMimeParser *m)
  * @m: 
  * 
  * Get the last scanned "From " line, from a recently scanned from.
- * This should only be called in the CAMEL_MIME_PARSER_STATE_FROM state.  The
+ * This should only be called in the HSCAN_FROM state.  The
  * from line will include the closing \n found (if there was one).
  *
- * The return value will remain valid while in the CAMEL_MIME_PARSER_STATE_FROM
+ * The return value will remain valid while in the HSCAN_FROM
  * state, or any deeper state.
  * 
  * Return value: The From line, or NULL if called out of context.
@@ -607,48 +607,46 @@ camel_mime_parser_init_with_stream(CamelMimeParser *m, CamelStream *stream)
 
 /**
  * camel_mime_parser_scan_from:
- * @parser: MIME parser object
+ * @m: 
  * @scan_from: #TRUE if the scanner should scan From lines.
  * 
  * Tell the scanner if it should scan "^From " lines or not.
  *
  * If the scanner is scanning from lines, two additional
- * states CAMEL_MIME_PARSER_STATE_FROM and CAMEL_MIME_PARSER_STATE_FROM_END will be returned
+ * states HSCAN_FROM and HSCAN_FROM_END will be returned
  * to the caller during parsing.
  *
  * This may also be preceeded by an optional
- * CAMEL_MIME_PARSER_STATE_PRE_FROM state which contains the scanned data
+ * HSCAN_PRE_FROM state which contains the scanned data
  * found before the From line is encountered.  See also
  * scan_pre_from().
  **/
 void
-camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from)
+camel_mime_parser_scan_from(CamelMimeParser *m, int scan_from)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
+       struct _header_scan_state *s = _PRIVATE(m);
        s->scan_from = scan_from;
 }
 
 /**
  * camel_mime_parser_scan_pre_from:
- * @parser: MIME parser object
+ * @
  * @scan_pre_from: #TRUE if we want to get pre-from data.
  * 
  * Tell the scanner whether we want to know abou the pre-from
  * data during a scan.  If we do, then we may get an additional
- * state CAMEL_MIME_PARSER_STATE_PRE_FROM which returns the specified data.
+ * state HSCAN_PRE_FROM which returns the specified data.
  **/
 void
-camel_mime_parser_scan_pre_from (CamelMimeParser *parser, gboolean scan_pre_from)
+camel_mime_parser_scan_pre_from(CamelMimeParser *m, int scan_pre_from)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
+       struct _header_scan_state *s = _PRIVATE(m);
        s->scan_pre_from = scan_pre_from;
 }
 
 /**
  * camel_mime_parser_content_type:
- * @parser: MIME parser object
+ * @m: 
  * 
  * Get the content type defined in the current part.
  * 
@@ -656,22 +654,21 @@ camel_mime_parser_scan_pre_from (CamelMimeParser *parser, gboolean scan_pre_from
  * is no content-type defined for this part of state of the
  * parser.
  **/
-CamelContentType *
-camel_mime_parser_content_type (CamelMimeParser *parser)
+struct _header_content_type *
+camel_mime_parser_content_type(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
+       struct _header_scan_state *s = _PRIVATE(m);
+
        /* FIXME: should this search up until it's found the 'right'
           content-type?  can it? */
        if (s->parts)
                return s->parts->content_type;
-       
        return NULL;
 }
 
 /**
  * camel_mime_parser_unstep:
- * @parser: MIME parser object
+ * @m: 
  * 
  * Cause the last step operation to repeat itself.  If this is 
  * called repeated times, then the same step will be repeated
@@ -680,17 +677,16 @@ camel_mime_parser_content_type (CamelMimeParser *parser)
  * Note that it is not possible to scan back using this function,
  * only to have a way of peeking the next state.
  **/
-void
-camel_mime_parser_unstep (CamelMimeParser *parser)
+void camel_mime_parser_unstep(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
+       struct _header_scan_state *s = _PRIVATE(m);
+
        s->unstep++;
 }
 
 /**
  * camel_mime_parser_drop_step:
- * @parser: MIME parser object
+ * @m: 
  * 
  * Drop the last step call.  This should only be used
  * in conjunction with seeking of the stream as the
@@ -699,18 +695,17 @@ camel_mime_parser_unstep (CamelMimeParser *parser)
  *
  * Use this call with care.
  **/
-void
-camel_mime_parser_drop_step (CamelMimeParser *parser)
+void camel_mime_parser_drop_step(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
+       struct _header_scan_state *s = _PRIVATE(m);
+
        s->unstep = 0;
        folder_scan_drop_step(s);
 }
 
 /**
  * camel_mime_parser_step:
- * @parser: MIME parser object 
+ * @m: 
  * @databuffer: Pointer to accept a pointer to the data
  * associated with this step (if any).  May be #NULL,
  * in which case datalength is also ingored.
@@ -721,7 +716,7 @@ camel_mime_parser_drop_step (CamelMimeParser *parser)
  * has been called, then continue to return the same state
  * for that many calls.
  *
- * If the step is CAMEL_MIME_PARSER_STATE_BODY then the databuffer and datalength
+ * If the step is HSCAN_BODY then the databuffer and datalength
  * pointers will be setup to point to the internal data buffer
  * of the scanner and may be processed as required.  Any
  * filters will have already been applied to this data.
@@ -733,10 +728,10 @@ camel_mime_parser_drop_step (CamelMimeParser *parser)
  * Return value: The current new state of the parser
  * is returned.
  **/
-enum _camel_mime_parser_state
-camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *datalength)
+enum _header_state
+camel_mime_parser_step(CamelMimeParser *m, char **databuffer, size_t *datalength)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
+       struct _header_scan_state *s = _PRIVATE(m);
 
        d(printf("OLD STATE:  '%s' :\n", states[s->state]));
 
@@ -760,7 +755,7 @@ camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *data
 
 /**
  * camel_mime_parser_read:
- * @parser: MIME parser object
+ * @m: 
  * @databuffer: 
  * @len: 
  * 
@@ -779,9 +774,9 @@ camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *data
  * Return value: The number of bytes available, or -1 on error.
  **/
 int
-camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int len)
+camel_mime_parser_read(CamelMimeParser *m, const char **databuffer, int len)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
+       struct _header_scan_state *s = _PRIVATE(m);
        int there;
 
        if (len == 0)
@@ -811,35 +806,34 @@ camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int le
 
 /**
  * camel_mime_parser_tell:
- * @parser: MIME parser object
+ * @m: 
  * 
  * Return the current scanning offset.  The meaning of this
  * value will depend on the current state of the parser.
  *
  * An incomplete listing of the states:
  *
- * CAMEL_MIME_PARSER_STATE_INITIAL, The start of the current message.
- * CAMEL_MIME_PARSER_STATE_HEADER, CAMEL_MIME_PARSER_STATE_MESSAGE, CAMEL_MIME_PARSER_STATE_MULTIPART, the character
+ * HSCAN_INITIAL, The start of the current message.
+ * HSCAN_HEADER, HSCAN_MESSAGE, HSCAN_MULTIPART, the character
  * position immediately after the end of the header.
- * CAMEL_MIME_PARSER_STATE_BODY, Position within the message of the start
+ * HSCAN_BODY, Position within the message of the start
  * of the current data block.
- * CAMEL_MIME_PARSER_STATE_*_END, The position of the character starting
+ * HSCAN_*_END, The position of the character starting
  * the next section of the scan (the last position + 1 of
  * the respective current state).
  * 
  * Return value: See above.
  **/
-off_t
-camel_mime_parser_tell (CamelMimeParser *parser)
+off_t camel_mime_parser_tell(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
+       struct _header_scan_state *s = _PRIVATE(m);
 
        return folder_tell(s);
 }
 
 /**
  * camel_mime_parser_tell_start_headers:
- * @parser: MIME parser object
+ * @m: 
  * 
  * Find out the position within the file of where the
  * headers started, this is cached by the parser
@@ -848,17 +842,16 @@ camel_mime_parser_tell (CamelMimeParser *parser)
  * Return value: The header start position, or -1 if
  * no headers were scanned in the current state.
  **/
-off_t
-camel_mime_parser_tell_start_headers (CamelMimeParser *parser)
+off_t camel_mime_parser_tell_start_headers(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
+       struct _header_scan_state *s = _PRIVATE(m);
 
        return s->start_of_headers;
 }
 
 /**
  * camel_mime_parser_tell_start_from:
- * @parser: MIME parser object
+ * @m: 
  * 
  * If the parser is scanning From lines, then this returns
  * the position of the start of the From line.
@@ -866,18 +859,17 @@ camel_mime_parser_tell_start_headers (CamelMimeParser *parser)
  * Return value: The start of the from line, or -1 if there
  * was no From line, or From lines are not being scanned.
  **/
-off_t
-camel_mime_parser_tell_start_from (CamelMimeParser *parser)
+off_t camel_mime_parser_tell_start_from(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
+       struct _header_scan_state *s = _PRIVATE(m);
 
        return s->start_of_from;
 }
 
 /**
  * camel_mime_parser_seek:
- * @parser: MIME parser object
- * @offset: Number of bytes to offset the seek by.
+ * @m: 
+ * @off: Number of bytes to offset the seek by.
  * @whence: SEEK_SET, SEEK_CUR, SEEK_END
  * 
  * Reset the source position to a known value.
@@ -891,33 +883,29 @@ camel_mime_parser_tell_start_from (CamelMimeParser *parser)
  * an error (for example, trying to seek on a non-seekable
  * stream or file descriptor).
  **/
-off_t
-camel_mime_parser_seek(CamelMimeParser *parser, off_t offset, int whence)
+off_t camel_mime_parser_seek(CamelMimeParser *m, off_t off, int whence)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
-       return folder_seek(s, offset, whence);
+       struct _header_scan_state *s = _PRIVATE(m);
+       return folder_seek(s, off, whence);
 }
 
 /**
  * camel_mime_parser_state:
- * @parser: MIME parser object
+ * @m: 
  * 
  * Get the current parser state.
  * 
  * Return value: The current parser state.
  **/
-enum _camel_mime_parser_state
-camel_mime_parser_state (CamelMimeParser *parser)
+enum _header_state camel_mime_parser_state(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
+       struct _header_scan_state *s = _PRIVATE(m);
        return s->state;
 }
 
 /**
  * camel_mime_parser_stream:
- * @parser: MIME parser object
+ * @m: 
  * 
  * Get the stream, if any, the parser has been initialised
  * with.  May be used to setup sub-streams, but should not
@@ -928,17 +916,15 @@ camel_mime_parser_state (CamelMimeParser *parser)
  * if the parser is reading from a file descriptor or is
  * uninitialised.
  **/
-CamelStream *
-camel_mime_parser_stream (CamelMimeParser *parser)
+CamelStream *camel_mime_parser_stream(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
+       struct _header_scan_state *s = _PRIVATE(m);
        return s->stream;
 }
 
 /**
  * camel_mime_parser_fd:
- * @parser: MIME parser object
+ * @m: 
  * 
  * Return the file descriptor, if any, the parser has been
  * initialised with.
@@ -950,20 +936,17 @@ camel_mime_parser_stream (CamelMimeParser *parser)
  * Return value: The file descriptor or -1 if the parser
  * is reading from a stream or has not been initialised.
  **/
-int
-camel_mime_parser_fd (CamelMimeParser *parser)
+int camel_mime_parser_fd(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
+       struct _header_scan_state *s = _PRIVATE(m);
        return s->fd;
 }
 
 /* Return errno of the parser, incase any error occured during processing */
-int
-camel_mime_parser_errno (CamelMimeParser *parser)
+int camel_mime_parser_errno(CamelMimeParser *m)
 {
-       struct _header_scan_state *s = _PRIVATE (parser);
-       
+       struct _header_scan_state *s = _PRIVATE(m);
+
        return s->ioerrno;
 }
 
@@ -1088,9 +1071,9 @@ folder_pull_part(struct _header_scan_state *s)
 #ifdef MEMPOOL
                mempool_free(h->pool);
 #else
-               camel_header_raw_clear(&h->headers);
+               header_raw_clear(&h->headers);
 #endif
-               camel_content_type_unref(h->content_type);
+               header_content_type_unref(h->content_type);
                if (h->pretext)
                        g_byte_array_free(h->pretext, TRUE);
                if (h->posttext)
@@ -1186,7 +1169,7 @@ folder_boundary_check(struct _header_scan_state *s, const char *boundary, int *l
 static void
 header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h, char *header, int offset)
 {
-       struct _camel_header_raw *l, *n;
+       struct _header_raw *l, *n;
        char *content;
        
        content = strchr(header, ':');
@@ -1209,7 +1192,7 @@ header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h
                
                n->offset = offset;
                
-               l = (struct _camel_header_raw *)&h->headers;
+               l = (struct _header_raw *)&h->headers;
                while (l->next) {
                        l = l->next;
                }
@@ -1536,7 +1519,7 @@ folder_scan_init(void)
 
        s->parts = NULL;
 
-       s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
+       s->state = HSCAN_INITIAL;
        return s;
 }
 
@@ -1547,7 +1530,7 @@ drop_states(struct _header_scan_state *s)
                folder_scan_drop_step(s);
        }
        s->unstep = 0;
-       s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
+       s->state = HSCAN_INITIAL;
 }
 
 static void
@@ -1598,7 +1581,7 @@ folder_scan_step(struct _header_scan_state *s, char **databuffer, size_t *datale
        const char *bound;
        int type;
        int state;
-       CamelContentType *ct = NULL;
+       struct _header_content_type *ct = NULL;
        struct _header_scan_filter *f;
        size_t presize;
 
@@ -1625,7 +1608,7 @@ tail_recurse:
        switch (s->state) {
 
 #ifdef USE_FROM
-       case CAMEL_MIME_PARSER_STATE_INITIAL:
+       case HSCAN_INITIAL:
                if (s->scan_from) {
                        h = g_malloc0(sizeof(*h));
                        h->boundary = g_strdup("From ");
@@ -1633,13 +1616,13 @@ tail_recurse:
                        h->boundarylenfinal = h->boundarylen;
                        h->from_line = g_byte_array_new();
                        folder_push_part(s, h);
-                       s->state = CAMEL_MIME_PARSER_STATE_PRE_FROM;
+                       s->state = HSCAN_PRE_FROM;
                } else {
                        s->start_of_from = -1;
                        goto scan_header;
                }
 
-       case CAMEL_MIME_PARSER_STATE_PRE_FROM:
+       case HSCAN_PRE_FROM:
 
                h = s->parts;
                do {
@@ -1654,68 +1637,68 @@ tail_recurse:
                        d(printf("found 'From '\n"));
                        s->start_of_from = folder_tell(s);
                        folder_scan_skip_line(s, h->from_line);
-                       h->savestate = CAMEL_MIME_PARSER_STATE_INITIAL;
-                       s->state = CAMEL_MIME_PARSER_STATE_FROM;
+                       h->savestate = HSCAN_INITIAL;
+                       s->state = HSCAN_FROM;
                } else {
                        folder_pull_part(s);
-                       s->state = CAMEL_MIME_PARSER_STATE_EOF;
+                       s->state = HSCAN_EOF;
                }
                return;
 #else
-       case CAMEL_MIME_PARSER_STATE_INITIAL:
-       case CAMEL_MIME_PARSER_STATE_PRE_FROM:
+       case HSCAN_INITIAL:
+       case HSCAN_PRE_FROM:
 #endif /* !USE_FROM */
 
        scan_header:
-       case CAMEL_MIME_PARSER_STATE_FROM:
+       case HSCAN_FROM:
                s->start_of_headers = folder_tell(s);
                h = folder_scan_header(s, &state);
 #ifdef USE_FROM
                if (s->scan_from)
-                       h->savestate = CAMEL_MIME_PARSER_STATE_FROM_END;
+                       h->savestate = HSCAN_FROM_END;
                else
 #endif
-                       h->savestate = CAMEL_MIME_PARSER_STATE_EOF;
+                       h->savestate = HSCAN_EOF;
 
                /* FIXME: should this check for MIME-Version: 1.0 as well? */
 
-               type = CAMEL_MIME_PARSER_STATE_HEADER;
-               if ( (content = camel_header_raw_find(&h->headers, "Content-Type", NULL))
-                    && (ct = camel_content_type_decode(content))) {
+               type = HSCAN_HEADER;
+               if ( (content = header_raw_find(&h->headers, "Content-Type", NULL))
+                    && (ct = header_content_type_decode(content))) {
                        if (!strcasecmp(ct->type, "multipart")) {
-                               if (!camel_content_type_is(ct, "multipart", "signed")
-                                   && (bound = camel_content_type_param(ct, "boundary"))) {
+                               if (!header_content_type_is(ct, "multipart", "signed")
+                                   && (bound = header_content_type_param(ct, "boundary"))) {
                                        d(printf("multipart, boundary = %s\n", bound));
                                        h->boundarylen = strlen(bound)+2;
                                        h->boundarylenfinal = h->boundarylen+2;
                                        h->boundary = g_malloc(h->boundarylen+3);
                                        sprintf(h->boundary, "--%s--", bound);
-                                       type = CAMEL_MIME_PARSER_STATE_MULTIPART;
+                                       type = HSCAN_MULTIPART;
                                } else {
-                                       /*camel_content_type_unref(ct);
-                                         ct = camel_content_type_decode("text/plain");*/
+                                       /*header_content_type_unref(ct);
+                                         ct = header_content_type_decode("text/plain");*/
 /* We can't quite do this, as it will mess up all the offsets ... */
-/*                                     camel_header_raw_replace(&h->headers, "Content-Type", "text/plain", offset);*/
+/*                                     header_raw_replace(&h->headers, "Content-Type", "text/plain", offset);*/
                                        /*g_warning("Multipart with no boundary, treating as text/plain");*/
                                }
                        } else if (!strcasecmp(ct->type, "message")) {
                                if (!strcasecmp(ct->subtype, "rfc822")
                                    || !strcasecmp(ct->subtype, "news")
                                    /*|| !strcasecmp(ct->subtype, "partial")*/) {
-                                       type = CAMEL_MIME_PARSER_STATE_MESSAGE;
+                                       type = HSCAN_MESSAGE;
                                }
                        }
                } else {
                        /* make the default type for multipart/digest be message/rfc822 */
                        if ((s->parts
-                            && camel_content_type_is(s->parts->content_type, "multipart", "digest"))) {
-                               ct = camel_content_type_decode("message/rfc822");
-                               type = CAMEL_MIME_PARSER_STATE_MESSAGE;
+                            && header_content_type_is(s->parts->content_type, "multipart", "digest"))) {
+                               ct = header_content_type_decode("message/rfc822");
+                               type = HSCAN_MESSAGE;
                                d(printf("parent was multipart/digest, autoupgrading to message/rfc822?\n"));
                                /* maybe we should do this too?
                                   header_raw_append_parse(&h->headers, "Content-Type: message/rfc822", -1);*/
                        } else {
-                               ct = camel_content_type_decode("text/plain");
+                               ct = header_content_type_decode("text/plain");
                        }
                }
                h->content_type = ct;
@@ -1723,10 +1706,10 @@ tail_recurse:
                s->state = type;
                return;
                
-       case CAMEL_MIME_PARSER_STATE_HEADER:
-               s->state = CAMEL_MIME_PARSER_STATE_BODY;
+       case HSCAN_HEADER:
+               s->state = HSCAN_BODY;
                
-       case CAMEL_MIME_PARSER_STATE_BODY:
+       case HSCAN_BODY:
                h = s->parts;
                *datalength = 0;
                presize = SCAN_HEAD;
@@ -1762,10 +1745,10 @@ tail_recurse:
                if (*datalength > 0)
                        return;
                
-               s->state = CAMEL_MIME_PARSER_STATE_BODY_END;
+               s->state = HSCAN_BODY_END;
                break;
                
-       case CAMEL_MIME_PARSER_STATE_MULTIPART:
+       case HSCAN_MULTIPART:
                h = s->parts;
                do {
                        do {
@@ -1791,9 +1774,9 @@ tail_recurse:
                                d(printf("got boundary: %s\n", hb->boundary));
                                folder_scan_skip_line(s, NULL);
                                if (!state) {
-                                       s->state = CAMEL_MIME_PARSER_STATE_FROM;
+                                       s->state = HSCAN_FROM;
                                        folder_scan_step(s, databuffer, datalength);
-                                       s->parts->savestate = CAMEL_MIME_PARSER_STATE_MULTIPART; /* set return state for the new head part */
+                                       s->parts->savestate = HSCAN_MULTIPART; /* set return state for the new head part */
                                        return;
                                }
                        } else {
@@ -1801,26 +1784,26 @@ tail_recurse:
                        }
                } while (1);
 
-               s->state = CAMEL_MIME_PARSER_STATE_MULTIPART_END;
+               s->state = HSCAN_MULTIPART_END;
                break;
 
-       case CAMEL_MIME_PARSER_STATE_MESSAGE:
-               s->state = CAMEL_MIME_PARSER_STATE_FROM;
+       case HSCAN_MESSAGE:
+               s->state = HSCAN_FROM;
                folder_scan_step(s, databuffer, datalength);
-               s->parts->savestate = CAMEL_MIME_PARSER_STATE_MESSAGE_END;
+               s->parts->savestate = HSCAN_MESSAGE_END;
                break;
 
-       case CAMEL_MIME_PARSER_STATE_FROM_END:
-       case CAMEL_MIME_PARSER_STATE_BODY_END:
-       case CAMEL_MIME_PARSER_STATE_MULTIPART_END:
-       case CAMEL_MIME_PARSER_STATE_MESSAGE_END:
+       case HSCAN_FROM_END:
+       case HSCAN_BODY_END:
+       case HSCAN_MULTIPART_END:
+       case HSCAN_MESSAGE_END:
                s->state = s->parts->savestate;
                folder_pull_part(s);
-               if (s->state & CAMEL_MIME_PARSER_STATE_END)
+               if (s->state & HSCAN_END)
                        return;
                goto tail_recurse;
 
-       case CAMEL_MIME_PARSER_STATE_EOF:
+       case HSCAN_EOF:
                return;
 
        default:
@@ -1836,30 +1819,30 @@ static void
 folder_scan_drop_step(struct _header_scan_state *s)
 {
        switch (s->state) {
-       case CAMEL_MIME_PARSER_STATE_EOF:
-               s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
-       case CAMEL_MIME_PARSER_STATE_INITIAL:
+       case HSCAN_EOF:
+               s->state = HSCAN_INITIAL;
+       case HSCAN_INITIAL:
                return;
 
-       case CAMEL_MIME_PARSER_STATE_FROM:
-       case CAMEL_MIME_PARSER_STATE_PRE_FROM:
-               s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
+       case HSCAN_FROM:
+       case HSCAN_PRE_FROM:
+               s->state = HSCAN_INITIAL;
                folder_pull_part(s);
                return;
 
-       case CAMEL_MIME_PARSER_STATE_MESSAGE:
-       case CAMEL_MIME_PARSER_STATE_HEADER:
-       case CAMEL_MIME_PARSER_STATE_MULTIPART:
+       case HSCAN_MESSAGE:
+       case HSCAN_HEADER:
+       case HSCAN_MULTIPART:
 
-       case CAMEL_MIME_PARSER_STATE_FROM_END:
-       case CAMEL_MIME_PARSER_STATE_BODY_END:
-       case CAMEL_MIME_PARSER_STATE_MULTIPART_END:
-       case CAMEL_MIME_PARSER_STATE_MESSAGE_END:
+       case HSCAN_FROM_END:
+       case HSCAN_BODY_END:
+       case HSCAN_MULTIPART_END:
+       case HSCAN_MESSAGE_END:
 
                s->state = s->parts->savestate;
                folder_pull_part(s);
-               if (s->state & CAMEL_MIME_PARSER_STATE_END) {
-                       s->state &= ~CAMEL_MIME_PARSER_STATE_END;
+               if (s->state & HSCAN_END) {
+                       s->state &= ~HSCAN_END;
                }
                return;
        default:
@@ -1903,16 +1886,16 @@ int main(int argc, char **argv)
                s->scan_from = FALSE;
 #if 0
                h = g_malloc0(sizeof(*h));
-               h->savestate = CAMEL_MIME_PARSER_STATE_EOF;
+               h->savestate = HSCAN_EOF;
                folder_push_part(s, h);
 #endif 
-               while (s->state != CAMEL_MIME_PARSER_STATE_EOF) {
+               while (s->state != HSCAN_EOF) {
                        folder_scan_step(s, &data, &len);
                        printf("\n -- PARSER STEP RETURN -- %d '%s'\n\n", s->state, states[s->state]);
                        switch (s->state) {
-                       case CAMEL_MIME_PARSER_STATE_HEADER:
+                       case HSCAN_HEADER:
                                if (s->parts->content_type
-                                   && (charset = camel_content_type_param(s->parts->content_type, "charset"))) {
+                                   && (charset = header_content_type_param(s->parts->content_type, "charset"))) {
                                        if (strcasecmp(charset, "us-ascii")) {
 #if 0
                                                folder_push_filter_charset(s, "UTF-8", charset);
@@ -1924,7 +1907,7 @@ int main(int argc, char **argv)
                                        charset = NULL;
                                }
 
-                               encoding = camel_header_raw_find(&s->parts->headers, "Content-transfer-encoding", 0);
+                               encoding = header_raw_find(&s->parts->headers, "Content-transfer-encoding", 0);
                                printf("encoding = '%s'\n", encoding);
                                if (encoding && !strncasecmp(encoding, " base64", 7)) {
                                        printf("adding base64 filter\n");
@@ -1950,10 +1933,10 @@ int main(int argc, char **argv)
                                }
 
                                break;
-                       case CAMEL_MIME_PARSER_STATE_BODY:
+                       case HSCAN_BODY:
                                printf("got body %d '%.*s'\n",  len, len, data);
                                break;
-                       case CAMEL_MIME_PARSER_STATE_BODY_END:
+                       case HSCAN_BODY_END:
                                printf("end body %d '%.*s'\n",  len, len, data);
                                if (encoding && !strncasecmp(encoding, " base64", 7)) {
                                        printf("removing filters\n");
index db85133..25571bf 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- *  Copyright (C) 2000-2003 Ximian Inc.
+ *  Copyright (C) 2000 Ximian Inc.
  *
  *  Authors: Michael Zucchi <notzed@ximian.com>
  *
@@ -43,26 +43,27 @@ typedef struct _CamelMimeParserClass CamelMimeParserClass;
 /* NOTE: if you add more states, you may need to bump the
    start of the END tags to 16 or 32, etc - so they are
    the same as the matching start tag, with a bit difference */
-enum _camel_mime_parser_state {
-       CAMEL_MIME_PARSER_STATE_INITIAL,
-       CAMEL_MIME_PARSER_STATE_PRE_FROM,       /* data before a 'From' line */
-       CAMEL_MIME_PARSER_STATE_FROM,           /* got 'From' line */
-       CAMEL_MIME_PARSER_STATE_HEADER,         /* toplevel header */
-       CAMEL_MIME_PARSER_STATE_BODY,           /* scanning body of message */
-       CAMEL_MIME_PARSER_STATE_MULTIPART,      /* got multipart header */
-       CAMEL_MIME_PARSER_STATE_MESSAGE,        /* rfc822 message */
-       
-       CAMEL_MIME_PARSER_STATE_PART,           /* part of a multipart */
-       
-       CAMEL_MIME_PARSER_STATE_END = 8,        /* bit mask for 'end' flags */
-       
-       CAMEL_MIME_PARSER_STATE_EOF = 8,        /* end of file */
-       CAMEL_MIME_PARSER_STATE_PRE_FROM_END,   /* pre from end */
-       CAMEL_MIME_PARSER_STATE_FROM_END,       /* end of whole from bracket */
-       CAMEL_MIME_PARSER_STATE_HEADER_END,     /* dummy value */
-       CAMEL_MIME_PARSER_STATE_BODY_END,       /* end of message */
-       CAMEL_MIME_PARSER_STATE_MULTIPART_END,  /* end of multipart  */
-       CAMEL_MIME_PARSER_STATE_MESSAGE_END,    /* end of message */
+enum _header_state {
+       HSCAN_INITIAL,
+       HSCAN_PRE_FROM,         /* data before a 'From' line */
+       HSCAN_FROM,             /* got 'From' line */
+       HSCAN_HEADER,           /* toplevel header */
+       HSCAN_BODY,             /* scanning body of message */
+       HSCAN_MULTIPART,        /* got multipart header */
+       HSCAN_MESSAGE,          /* rfc822 message */
+
+       HSCAN_PART,             /* part of a multipart */
+
+       HSCAN_END = 8,          /* bit mask for 'end' flags */
+
+       HSCAN_EOF = 8,          /* end of file */
+       HSCAN_PRE_FROM_END,     /* pre from end */
+       HSCAN_FROM_END,         /* end of whole from bracket */
+       HSCAN_HEADER_END,       /* dummy value */
+       HSCAN_BODY_END,         /* end of message */
+       HSCAN_MULTIPART_END,    /* end of multipart  */
+       HSCAN_MESSAGE_END,      /* end of message */
+
 };
 
 struct _CamelMimeParser {
@@ -74,70 +75,70 @@ struct _CamelMimeParser {
 struct _CamelMimeParserClass {
        CamelObjectClass parent_class;
 
-       void (*message) (CamelMimeParser *parser, void *headers);
-       void (*part) (CamelMimeParser *parser);
-       void (*content) (CamelMimeParser *parser);
+       void (*message)(CamelMimeParser *, void *headers);
+       void (*part)(CamelMimeParser *);
+       void (*content)(CamelMimeParser *);
 };
 
-CamelType camel_mime_parser_get_type (void);
-CamelMimeParser *camel_mime_parser_new (void);
+CamelType              camel_mime_parser_get_type      (void);
+CamelMimeParser      *camel_mime_parser_new    (void);
 
 /* quick-fix for parser not erroring, we can find out if it had an error afterwards */
-int            camel_mime_parser_errno (CamelMimeParser *parser);
+int            camel_mime_parser_errno         (CamelMimeParser *);
 
 /* using an fd will be a little faster, but not much (over a simple stream) */
-int            camel_mime_parser_init_with_fd (CamelMimeParser *parser, int fd);
-int            camel_mime_parser_init_with_stream (CamelMimeParser *parser, CamelStream *stream);
+int            camel_mime_parser_init_with_fd(CamelMimeParser *, int fd);
+int            camel_mime_parser_init_with_stream(CamelMimeParser *m, CamelStream *stream);
 
 /* get the stream or fd back of the parser */
-CamelStream    *camel_mime_parser_stream (CamelMimeParser *parser);
-int            camel_mime_parser_fd (CamelMimeParser *parser);
+CamelStream    *camel_mime_parser_stream(CamelMimeParser *m);
+int            camel_mime_parser_fd(CamelMimeParser *m);
 
 /* scan 'From' separators? */
-void camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from);
+void camel_mime_parser_scan_from(CamelMimeParser *, int);
 /* Do we want to know about the pre-from data? */
-void camel_mime_parser_scan_pre_from (CamelMimeParser *parser, gboolean scan_pre_from);
+void camel_mime_parser_scan_pre_from(CamelMimeParser *, int);
 
 /* what headers to save, MUST include ^Content-Type: */
-int camel_mime_parser_set_header_regex (CamelMimeParser *parser, char *matchstr);
+int camel_mime_parser_set_header_regex(CamelMimeParser *m, char *matchstr);
 
 /* normal interface */
-enum _camel_mime_parser_state camel_mime_parser_step (CamelMimeParser *parser, char **buf, size_t *buflen);
-void camel_mime_parser_unstep (CamelMimeParser *parser);
-void camel_mime_parser_drop_step (CamelMimeParser *parser);
-enum _camel_mime_parser_state camel_mime_parser_state (CamelMimeParser *parser);
+enum _header_state camel_mime_parser_step(CamelMimeParser *, char **, size_t *);
+void camel_mime_parser_unstep(CamelMimeParser *);
+void camel_mime_parser_drop_step(CamelMimeParser *m);
+enum _header_state camel_mime_parser_state(CamelMimeParser *);
 
 /* read through the parser */
-int camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int len);
+int camel_mime_parser_read(CamelMimeParser *m, const char **databuffer, int len);
 
 /* get content type for the current part/header */
-CamelContentType *camel_mime_parser_content_type (CamelMimeParser *parser);
+struct _header_content_type *camel_mime_parser_content_type(CamelMimeParser *);
 
 /* get/change raw header by name */
-const char *camel_mime_parser_header (CamelMimeParser *parser, const char *name, int *offset);
+const char *camel_mime_parser_header(CamelMimeParser *, const char *, int *offset);
 
 /* get all raw headers. READ ONLY! */
-struct _camel_header_raw *camel_mime_parser_headers_raw (CamelMimeParser *parser);
+struct _header_raw *camel_mime_parser_headers_raw(CamelMimeParser *);
 
 /* get multipart pre/postface */
-const char *camel_mime_parser_preface (CamelMimeParser *parser);
-const char *camel_mime_parser_postface (CamelMimeParser *parser);
+const char *camel_mime_parser_preface(CamelMimeParser *m);
+const char *camel_mime_parser_postface(CamelMimeParser *m);
 
 /* return the from line content */
-const char *camel_mime_parser_from_line (CamelMimeParser *parser);
+const char *camel_mime_parser_from_line(CamelMimeParser *m);
 
 /* add a processing filter for body contents */
-int camel_mime_parser_filter_add (CamelMimeParser *parser, CamelMimeFilter *filter);
-void camel_mime_parser_filter_remove (CamelMimeParser *parser, int id);
+int camel_mime_parser_filter_add(CamelMimeParser *, CamelMimeFilter *);
+void camel_mime_parser_filter_remove(CamelMimeParser *, int);
 
 /* these should be used with caution, because the state will not
    track the seeked position */
 /* FIXME: something to bootstrap the state? */
-off_t camel_mime_parser_tell (CamelMimeParser *parser);
-off_t camel_mime_parser_seek (CamelMimeParser *parser, off_t offset, int whence);
+off_t camel_mime_parser_tell(CamelMimeParser *);
+off_t camel_mime_parser_seek(CamelMimeParser *, off_t, int);
 
-off_t camel_mime_parser_tell_start_headers (CamelMimeParser *parser);
-off_t camel_mime_parser_tell_start_from (CamelMimeParser *parser);
+off_t camel_mime_parser_tell_start_headers(CamelMimeParser *);
+off_t camel_mime_parser_tell_start_from(CamelMimeParser *);
 
 #ifdef __cplusplus
 }
index e2df274..0f80507 100644 (file)
@@ -66,7 +66,7 @@ simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw, CamelMimeParser
        
        /* read in the entire content */
        buffer = g_byte_array_new ();
-       while (camel_mime_parser_step (mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_BODY_END) {
+       while (camel_mime_parser_step (mp, &buf, &len) != HSCAN_BODY_END) {
                d(printf("appending o/p data: %d: %.*s\n", len, len, buf));
                g_byte_array_append (buffer, buf, len);
        }
@@ -88,13 +88,13 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParse
 
        ct = camel_mime_parser_content_type (mp);
 
-       encoding = camel_header_content_encoding_decode (camel_mime_parser_header (mp, "Content-Transfer-Encoding", NULL));
+       encoding = header_content_encoding_decode (camel_mime_parser_header (mp, "Content-Transfer-Encoding", NULL));
        
        switch (camel_mime_parser_state (mp)) {
-       case CAMEL_MIME_PARSER_STATE_HEADER:
+       case HSCAN_HEADER:
                d(printf("Creating body part\n"));
                /* multipart/signed is some fucked up type that we must treat as binary data, fun huh, idiots. */
-               if (camel_content_type_is (ct, "multipart", "signed")) {
+               if (header_content_type_is (ct, "multipart", "signed")) {
                        content = (CamelDataWrapper *) camel_multipart_signed_new ();
                        camel_multipart_construct_from_parser ((CamelMultipart *) content, mp);
                } else {
@@ -102,16 +102,16 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParse
                        simple_data_wrapper_construct_from_parser (content, mp);
                }
                break;
-       case CAMEL_MIME_PARSER_STATE_MESSAGE:
+       case HSCAN_MESSAGE:
                d(printf("Creating message part\n"));
                content = (CamelDataWrapper *) camel_mime_message_new ();
                camel_mime_part_construct_from_parser ((CamelMimePart *)content, mp);
                break;
-       case CAMEL_MIME_PARSER_STATE_MULTIPART:
+       case HSCAN_MULTIPART:
                d(printf("Creating multi-part\n"));
-               if (camel_content_type_is (ct, "multipart", "encrypted"))
+               if (header_content_type_is (ct, "multipart", "encrypted"))
                        content = (CamelDataWrapper *) camel_multipart_encrypted_new ();
-               else if (camel_content_type_is (ct, "multipart", "signed"))
+               else if (header_content_type_is (ct, "multipart", "signed"))
                        content = (CamelDataWrapper *) camel_multipart_signed_new ();
                else
                        content = (CamelDataWrapper *) camel_multipart_new ();
index 88ec42c..ac6e357 100644 (file)
@@ -4,9 +4,8 @@
 /* 
  * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
  *         Michael Zucchi <notzed@ximian.com>
- *          Jeffrey Stedfast <fejj@ximian.com>
  *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
+ * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
  * This program is free software; you can redistribute it and/or 
  * modify it under the terms of version 2 of the GNU General Public 
@@ -23,7 +22,6 @@
  * USA
  */
 
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -78,10 +76,10 @@ static ssize_t         write_to_stream                 (CamelDataWrapper *dw, Ca
 static int            construct_from_stream           (CamelDataWrapper *dw, CamelStream *stream);
 
 /* from CamelMedium */ 
-static void            add_header                      (CamelMedium *medium, const char *name, const void *value);
-static void            set_header                      (CamelMedium *medium, const char *name, const void *value);
-static void            remove_header                   (CamelMedium *medium, const char *name);
-static const void     *get_header                      (CamelMedium *medium, const char *name);
+static void            add_header                      (CamelMedium *medium, const char *header_name, const void *header_value);
+static void            set_header                      (CamelMedium *medium, const char *header_name, const void *header_value);
+static void            remove_header                   (CamelMedium *medium, const char *header_name);
+static const void     *get_header                      (CamelMedium *medium, const char *header_name);
 static GArray         *get_headers                     (CamelMedium *medium);
 static void            free_headers                    (CamelMedium *medium, GArray *headers);
 
@@ -94,9 +92,9 @@ static int             construct_from_parser           (CamelMimePart *mime_part
 static void set_disposition (CamelMimePart *mime_part, const char *disposition);
 
 /* format output of headers */
-static int write_references(CamelStream *stream, struct _camel_header_raw *h);
-/*static int write_fold(CamelStream *stream, struct _camel_header_raw *h);*/
-static int write_raw(CamelStream *stream, struct _camel_header_raw *h);
+static int write_references(CamelStream *stream, struct _header_raw *h);
+/*static int write_fold(CamelStream *stream, struct _header_raw *h);*/
+static int write_raw(CamelStream *stream, struct _header_raw *h);
 
 
 /* loads in a hash table the set of header names we */
@@ -157,8 +155,8 @@ camel_mime_part_init (gpointer object, gpointer klass)
        CamelMimePart *mime_part = CAMEL_MIME_PART (object);
        
        if (((CamelDataWrapper *) mime_part)->mime_type)
-               camel_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
-       ((CamelDataWrapper *) mime_part)->mime_type = camel_content_type_new ("text", "plain");
+               header_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
+       ((CamelDataWrapper *) mime_part)->mime_type = header_content_type_new ("text", "plain");
        
        mime_part->description          = NULL;
        mime_part->disposition          = NULL;
@@ -180,9 +178,9 @@ camel_mime_part_finalize (CamelObject *object)
        g_free (mime_part->content_MD5);
        g_free (mime_part->content_location);
        camel_string_list_free (mime_part->content_languages);
-       camel_content_disposition_unref(mime_part->disposition);
+       header_disposition_unref(mime_part->disposition);
        
-       camel_header_raw_clear(&mime_part->headers);
+       header_raw_clear(&mime_part->headers);
 }
 
 
@@ -210,7 +208,7 @@ camel_mime_part_get_type (void)
 /* **** */
 
 static gboolean
-process_header(CamelMedium *medium, const char *name, const char *value)
+process_header(CamelMedium *medium, const char *header_name, const char *header_value)
 {
        CamelMimePart *mime_part = CAMEL_MIME_PART (medium);
        CamelHeaderType header_type;
@@ -221,41 +219,41 @@ process_header(CamelMedium *medium, const char *name, const char *value)
        /* known, the job is done in the parsing routine. If not,         */
        /* we simply add the header in a raw fashion                      */
 
-       header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, name);
+       header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, header_name);
        switch (header_type) {
        case HEADER_DESCRIPTION: /* raw header->utf8 conversion */
                g_free (mime_part->description);
                if (((CamelDataWrapper *) mime_part)->mime_type) {
-                       charset = camel_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "charset");
+                       charset = header_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "charset");
                        charset = e_iconv_charset_name (charset);
                } else
                        charset = NULL;
-               mime_part->description = g_strstrip (camel_header_decode_string (value, charset));
+               mime_part->description = g_strstrip (header_decode_string (header_value, charset));
                break;
        case HEADER_DISPOSITION:
-               set_disposition (mime_part, value);
+               set_disposition (mime_part, header_value);
                break;
        case HEADER_CONTENT_ID:
                g_free (mime_part->content_id);
-               mime_part->content_id = camel_header_contentid_decode (value);
+               mime_part->content_id = header_contentid_decode (header_value);
                break;
        case HEADER_ENCODING:
-               text = camel_header_token_decode (value);
+               text = header_token_decode (header_value);
                mime_part->encoding = camel_mime_part_encoding_from_string (text);
                g_free (text);
                break;
        case HEADER_CONTENT_MD5:
                g_free (mime_part->content_MD5);
-               mime_part->content_MD5 = g_strdup (value);
+               mime_part->content_MD5 = g_strdup (header_value);
                break;
        case HEADER_CONTENT_LOCATION:
                g_free (mime_part->content_location);
-               mime_part->content_location = camel_header_location_decode (value);
+               mime_part->content_location = header_location_decode (header_value);
                break;
        case HEADER_CONTENT_TYPE:
                if (((CamelDataWrapper *) mime_part)->mime_type)
-                       camel_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
-               ((CamelDataWrapper *) mime_part)->mime_type = camel_content_type_decode (value);
+                       header_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
+               ((CamelDataWrapper *) mime_part)->mime_type = header_content_type_decode (header_value);
                break;
        default:
                return FALSE;
@@ -264,16 +262,16 @@ process_header(CamelMedium *medium, const char *name, const char *value)
 }
 
 static void
-set_header (CamelMedium *medium, const char *name, const void *value)
+set_header (CamelMedium *medium, const char *header_name, const void *header_value)
 {
        CamelMimePart *part = CAMEL_MIME_PART (medium);
        
-       process_header(medium, name, value);
-       camel_header_raw_replace(&part->headers, name, value, -1);
+       process_header(medium, header_name, header_value);
+       header_raw_replace(&part->headers, header_name, header_value, -1);
 }
 
 static void
-add_header (CamelMedium *medium, const char *name, const void *value)
+add_header (CamelMedium *medium, const char *header_name, const void *header_value)
 {
        CamelMimePart *part = CAMEL_MIME_PART (medium);
        
@@ -282,27 +280,27 @@ add_header (CamelMedium *medium, const char *name, const void *value)
        /* we simply add the header in a raw fashion                      */
 
        /* If it was one of the headers we handled, it must be unique, set it instead of add */
-       if (process_header(medium, name, value))
-               camel_header_raw_replace(&part->headers, name, value, -1);
+       if (process_header(medium, header_name, header_value))
+               header_raw_replace(&part->headers, header_name, header_value, -1);
        else
-               camel_header_raw_append(&part->headers, name, value, -1);
+               header_raw_append(&part->headers, header_name, header_value, -1);
 }
 
 static void
-remove_header (CamelMedium *medium, const char *name)
+remove_header (CamelMedium *medium, const char *header_name)
 {
        CamelMimePart *part = (CamelMimePart *)medium;
        
-       process_header(medium, name, NULL);
-       camel_header_raw_remove(&part->headers, name);
+       process_header(medium, header_name, NULL);
+       header_raw_remove(&part->headers, header_name);
 }
 
 static const void *
-get_header (CamelMedium *medium, const char *name)
+get_header (CamelMedium *medium, const char *header_name)
 {
        CamelMimePart *part = (CamelMimePart *)medium;
 
-       return camel_header_raw_find(&part->headers, name, NULL);
+       return header_raw_find(&part->headers, header_name, NULL);
 }
 
 static GArray *
@@ -311,7 +309,7 @@ get_headers (CamelMedium *medium)
        CamelMimePart *part = (CamelMimePart *)medium;
        GArray *headers;
        CamelMediumHeader header;
-       struct _camel_header_raw *h;
+       struct _header_raw *h;
 
        headers = g_array_new (FALSE, FALSE, sizeof (CamelMediumHeader));
        for (h = part->headers; h; h = h->next) {
@@ -333,7 +331,7 @@ free_headers (CamelMedium *medium, GArray *gheaders)
 void
 camel_mime_part_set_description (CamelMimePart *mime_part, const char *description)
 {
-       char *text = camel_header_encode_string (description);
+       char *text = header_encode_string (description);
        
        camel_medium_set_header (CAMEL_MEDIUM (mime_part),
                                 "Content-Description", text);
@@ -351,9 +349,9 @@ camel_mime_part_get_description (CamelMimePart *mime_part)
 static void
 set_disposition (CamelMimePart *mime_part, const char *disposition)
 {
-       camel_content_disposition_unref(mime_part->disposition);
+       header_disposition_unref(mime_part->disposition);
        if (disposition)
-               mime_part->disposition = camel_content_disposition_decode(disposition);
+               mime_part->disposition = header_disposition_decode(disposition);
        else
                mime_part->disposition = NULL;
 }
@@ -372,7 +370,7 @@ camel_mime_part_set_disposition (CamelMimePart *mime_part, const char *dispositi
                g_free(mime_part->disposition->disposition);
                mime_part->disposition->disposition = g_strdup(disposition);
        }
-       text = camel_content_disposition_format(mime_part->disposition);
+       text = header_disposition_format(mime_part->disposition);
 
        camel_medium_set_header (CAMEL_MEDIUM (mime_part),
                                 "Content-Disposition", text);
@@ -398,17 +396,17 @@ camel_mime_part_set_filename (CamelMimePart *mime_part, const char *filename)
        char *str;
        
        if (mime_part->disposition == NULL)
-               mime_part->disposition = camel_content_disposition_decode("attachment");
+               mime_part->disposition = header_disposition_decode("attachment");
 
-       camel_header_set_param(&mime_part->disposition->params, "filename", filename);
-       str = camel_content_disposition_format(mime_part->disposition);
+       header_set_param(&mime_part->disposition->params, "filename", filename);
+       str = header_disposition_format(mime_part->disposition);
 
        camel_medium_set_header (CAMEL_MEDIUM (mime_part),
                                 "Content-Disposition", str);
        g_free(str);
        
-       camel_content_type_set_param (((CamelDataWrapper *) mime_part)->mime_type, "name", filename);
-       str = camel_content_type_format (((CamelDataWrapper *) mime_part)->mime_type);
+       header_content_type_set_param (((CamelDataWrapper *) mime_part)->mime_type, "name", filename);
+       str = header_content_type_format (((CamelDataWrapper *) mime_part)->mime_type);
        camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", str);
        g_free (str);
 }
@@ -417,12 +415,12 @@ const char *
 camel_mime_part_get_filename (CamelMimePart *mime_part)
 {
        if (mime_part->disposition) {
-               const char *name = camel_header_param (mime_part->disposition->params, "filename");
+               const char *name = header_param (mime_part->disposition->params, "filename");
                if (name)
                        return name;
        }
        
-       return camel_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "name");
+       return header_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "name");
 }
 
 
@@ -436,7 +434,7 @@ camel_mime_part_set_content_id (CamelMimePart *mime_part, const char *contentid)
        if (contentid)
                id = g_strstrip (g_strdup (contentid));
        else
-               id = camel_header_msgid_generate ();
+               id = header_msgid_generate ();
        
        cid = g_strdup_printf ("<%s>", id);
        g_free (id);
@@ -547,7 +545,7 @@ set_content_object (CamelMedium *medium, CamelDataWrapper *content)
        if (mime_part->mime_type != content_type) {
                char *txt;
                
-               txt = camel_content_type_format (content_type);
+               txt = header_content_type_format (content_type);
                camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", txt);
                g_free (txt);
        }
@@ -556,7 +554,7 @@ set_content_object (CamelMedium *medium, CamelDataWrapper *content)
 /**********************************************************************/
 
 static ssize_t
-write_references(CamelStream *stream, struct _camel_header_raw *h)
+write_references(CamelStream *stream, struct _header_raw *h)
 {
        ssize_t len, out, total;
        char *v, *ids, *ide;
@@ -600,12 +598,12 @@ write_references(CamelStream *stream, struct _camel_header_raw *h)
 #if 0
 /* not needed - yet - handled by default case */
 static ssize_t
-write_fold(CamelStream *stream, struct _camel_header_raw *h)
+write_fold(CamelStream *stream, struct _header_raw *h)
 {
        char *val;
        int count;
 
-       val = camel_header_fold(h->value, strlen(h->name));
+       val = header_fold(h->value, strlen(h->name));
        count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val);
        g_free(val);
 
@@ -614,7 +612,7 @@ write_fold(CamelStream *stream, struct _camel_header_raw *h)
 #endif
 
 static ssize_t
-write_raw(CamelStream *stream, struct _camel_header_raw *h)
+write_raw(CamelStream *stream, struct _header_raw *h)
 {
        char *val = h->value;
 
@@ -638,9 +636,9 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
        /* TODO: content-languages header? */
        
        if (mp->headers) {
-               struct _camel_header_raw *h = mp->headers;
+               struct _header_raw *h = mp->headers;
                char *val;
-               ssize_t (*writefn)(CamelStream *stream, struct _camel_header_raw *);
+               ssize_t (*writefn)(CamelStream *stream, struct _header_raw *);
                
                /* fold/write the headers.   But dont fold headers that are already formatted
                   (e.g. ones with parameter-lists, that we know about, and have created) */
@@ -650,7 +648,7 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
                                g_warning("h->value is NULL here for %s", h->name);
                                count = 0;
                        } else if ((writefn = g_hash_table_lookup(header_formatted_table, h->name)) == NULL) {
-                               val = camel_header_fold(val, strlen(h->name));
+                               val = header_fold(val, strlen(h->name));
                                count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val);
                                g_free(val);
                        } else {
@@ -678,9 +676,9 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
                gboolean reencode = FALSE;
                const char *filename;
                
-               if (camel_content_type_is (dw->mime_type, "text", "*")) {
-                       content_charset = camel_content_type_param (content->mime_type, "charset");
-                       part_charset = camel_content_type_param (dw->mime_type, "charset");
+               if (header_content_type_is (dw->mime_type, "text", "*")) {
+                       content_charset = header_content_type_param (content->mime_type, "charset");
+                       part_charset = header_content_type_param (dw->mime_type, "charset");
                        
                        if (content_charset && part_charset) {
                                content_charset = e_iconv_charset_name (content_charset);
@@ -724,7 +722,7 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
                        }
                        
                        /* we only re-do crlf on encoded blocks */
-                       if (filter && camel_content_type_is (dw->mime_type, "text", "*")) {
+                       if (filter && header_content_type_is (dw->mime_type, "text", "*")) {
                                CamelMimeFilter *crlf = camel_mime_filter_crlf_new(CAMEL_MIME_FILTER_CRLF_ENCODE,
                                                                                   CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
                                
@@ -777,7 +775,7 @@ static int
 construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp)
 {
        CamelDataWrapper *dw = (CamelDataWrapper *) mime_part;
-       struct _camel_header_raw *headers;
+       struct _header_raw *headers;
        const char *content;
        char *buf;
        size_t len;
@@ -786,18 +784,18 @@ construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp)
        d(printf("mime_part::construct_from_parser()\n"));
        
        switch (camel_mime_parser_step(mp, &buf, &len)) {
-       case CAMEL_MIME_PARSER_STATE_MESSAGE:
+       case HSCAN_MESSAGE:
                /* set the default type of a message always */
                if (dw->mime_type)
-                       camel_content_type_unref (dw->mime_type);
-               dw->mime_type = camel_content_type_decode ("message/rfc822");
-       case CAMEL_MIME_PARSER_STATE_HEADER:
-       case CAMEL_MIME_PARSER_STATE_MULTIPART:
+                       header_content_type_unref (dw->mime_type);
+               dw->mime_type = header_content_type_decode ("message/rfc822");
+       case HSCAN_HEADER:
+       case HSCAN_MULTIPART:
                /* we have the headers, build them into 'us' */
                headers = camel_mime_parser_headers_raw(mp);
 
                /* if content-type exists, process it first, set for fallback charset in headers */
-               content = camel_header_raw_find(&headers, "content-type", NULL);
+               content = header_raw_find(&headers, "content-type", NULL);
                if (content)
                        process_header((CamelMedium *)dw, "content-type", content);
 
index 5c3d7d9..ff2a311 100644 (file)
@@ -46,12 +46,12 @@ extern "C" {
 struct _CamelMimePart {
        CamelMedium parent_object;
        
-       struct _camel_header_raw *headers; /* mime headers */
+       struct _header_raw *headers; /* mime headers */
        
        /* All fields here are -** PRIVATE **- */
        /* TODO: these should be in a camelcontentinfo */
        char *description;
-       CamelContentDisposition *disposition;
+       CamelMimeDisposition *disposition;
        char *content_id;
        char *content_MD5;
        char *content_location;
index 6f719a8..5ed7cf6 100644 (file)
@@ -1193,7 +1193,7 @@ header_decode_text (const char *in, size_t inlen, const char *default_charset)
 }
 
 char *
-camel_header_decode_string (const char *in, const char *default_charset)
+header_decode_string (const char *in, const char *default_charset)
 {
        if (in == NULL)
                return NULL;
@@ -1310,7 +1310,7 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
 
 /* TODO: Should this worry about quotes?? */
 char *
-camel_header_encode_string (const unsigned char *in)
+header_encode_string (const unsigned char *in)
 {
        const unsigned char *inptr = in, *start, *word;
        gboolean last_was_encoded = FALSE;
@@ -1608,7 +1608,7 @@ header_encode_phrase_merge_words (GList **wordsp)
 
 /* encodes a phrase sequence (different quoting/encoding rules to strings) */
 char *
-camel_header_encode_phrase (const unsigned char *in)
+header_encode_phrase (const unsigned char *in)
 {
        struct _phrase_word *word = NULL, *last_word = NULL;
        GList *words, *wordl;
@@ -1622,8 +1622,7 @@ camel_header_encode_phrase (const unsigned char *in)
        if (!words)
                return NULL;
        
-       while (header_encode_phrase_merge_words (&words))
-               ;
+       while (header_encode_phrase_merge_words (&words));
        
        out = g_string_new ("");
        
@@ -1709,7 +1708,7 @@ decode_token (const char **in)
 }
 
 char *
-camel_header_token_decode(const char *in)
+header_token_decode(const char *in)
 {
        if (in == NULL)
                return NULL;
@@ -1806,7 +1805,7 @@ header_decode_value(const char **in)
 
 /* should this return -1 for no int? */
 int
-camel_header_decode_int(const char **in)
+header_decode_int(const char **in)
 {
        const char *inptr = *in;
        int c, v=0;
@@ -1951,7 +1950,7 @@ header_decode_rfc2184_param (const char **in, char **paramp, gboolean *value_is_
                                *value_is_encoded = TRUE;
                } else {
                        /* form := param*#=value or param*#*=value */
-                       *part = camel_header_decode_int (&inptr);
+                       *part = header_decode_int (&inptr);
                        header_decode_lwsp (&inptr);
                        if (*inptr == '*') {
                                /* form := param*#*=value */
@@ -2077,7 +2076,7 @@ header_decode_param (const char **in, char **paramp, char **valuep, int *is_rfc2
 }
 
 char *
-camel_header_param (struct _camel_header_param *p, const char *name)
+header_param (struct _header_param *p, const char *name)
 {
        while (p && strcasecmp (p->name, name) != 0)
                p = p->next;
@@ -2086,10 +2085,10 @@ camel_header_param (struct _camel_header_param *p, const char *name)
        return NULL;
 }
 
-struct _camel_header_param *
-camel_header_set_param (struct _camel_header_param **l, const char *name, const char *value)
+struct _header_param *
+header_set_param (struct _header_param **l, const char *name, const char *value)
 {
-       struct _camel_header_param *p = (struct _camel_header_param *)l, *pn;
+       struct _header_param *p = (struct _header_param *)l, *pn;
        
        if (name == NULL)
                return NULL;
@@ -2124,21 +2123,21 @@ camel_header_set_param (struct _camel_header_param **l, const char *name, const
 }
 
 const char *
-camel_content_type_param (CamelContentType *t, const char *name)
+header_content_type_param (struct _header_content_type *t, const char *name)
 {
        if (t==NULL)
                return NULL;
-       return camel_header_param (t->params, name);
+       return header_param (t->params, name);
 }
 
 void
-camel_content_type_set_param (CamelContentType *t, const char *name, const char *value)
+header_content_type_set_param (struct _header_content_type *t, const char *name, const char *value)
 {
-       camel_header_set_param (&t->params, name, value);
+       header_set_param (&t->params, name, value);
 }
 
 /**
- * camel_content_type_is:
+ * header_content_type_is:
  * @ct: A content type specifier, or #NULL.
  * @type: A type to check against.
  * @subtype: A subtype to check against, or "*" to match any subtype.
@@ -2150,7 +2149,7 @@ camel_content_type_set_param (CamelContentType *t, const char *name, const char
  * Return value: #TRUE or #FALSE depending on the matching of the type.
  **/
 int
-camel_content_type_is(CamelContentType *ct, const char *type, const char *subtype)
+header_content_type_is(struct _header_content_type *ct, const char *type, const char *subtype)
 {
        /* no type == text/plain or text/"*" */
        if (ct==NULL || (ct->type == NULL && ct->subtype == NULL)) {
@@ -2167,9 +2166,9 @@ camel_content_type_is(CamelContentType *ct, const char *type, const char *subtyp
 }
 
 void
-camel_header_param_list_free(struct _camel_header_param *p)
+header_param_list_free(struct _header_param *p)
 {
-       struct _camel_header_param *n;
+       struct _header_param *n;
 
        while (p) {
                n = p->next;
@@ -2180,10 +2179,10 @@ camel_header_param_list_free(struct _camel_header_param *p)
        }
 }
 
-CamelContentType *
-camel_content_type_new(const char *type, const char *subtype)
+struct _header_content_type *
+header_content_type_new(const char *type, const char *subtype)
 {
-       CamelContentType *t = g_malloc(sizeof(*t));
+       struct _header_content_type *t = g_malloc(sizeof(*t));
 
        t->type = g_strdup(type);
        t->subtype = g_strdup(subtype);
@@ -2193,7 +2192,7 @@ camel_content_type_new(const char *type, const char *subtype)
 }
 
 void
-camel_content_type_ref(CamelContentType *ct)
+header_content_type_ref(struct _header_content_type *ct)
 {
        if (ct)
                ct->refcount++;
@@ -2201,11 +2200,11 @@ camel_content_type_ref(CamelContentType *ct)
 
 
 void
-camel_content_type_unref(CamelContentType *ct)
+header_content_type_unref(struct _header_content_type *ct)
 {
        if (ct) {
                if (ct->refcount <= 1) {
-                       camel_header_param_list_free(ct->params);
+                       header_param_list_free(ct->params);
                        g_free(ct->type);
                        g_free(ct->subtype);
                        g_free(ct);
@@ -2333,7 +2332,7 @@ header_decode_addrspec(const char **in)
    *(word) '<' [ *('@' domain ) ':' ] word *( '.' word) @ domain
    */
 
-static struct _camel_header_address *
+static struct _header_address *
 header_decode_mailbox(const char **in, const char *charset)
 {
        const char *inptr = *in;
@@ -2341,7 +2340,7 @@ header_decode_mailbox(const char **in, const char *charset)
        int closeme = FALSE;
        GString *addr;
        GString *name = NULL;
-       struct _camel_header_address *address = NULL;
+       struct _header_address *address = NULL;
        const char *comment = NULL;
 
        addr = g_string_new("");
@@ -2356,7 +2355,7 @@ header_decode_mailbox(const char **in, const char *charset)
                        char *text, *last;
 
                        /* perform internationalised decoding, and append */
-                       text = camel_header_decode_string (pre, charset);
+                       text = header_decode_string (pre, charset);
                        g_string_append (name, text);
                        last = pre;
                        g_free(text);
@@ -2458,7 +2457,7 @@ header_decode_mailbox(const char **in, const char *charset)
                                g_string_append_c(addr, *inptr);
 
                        /* check for address is encoded word ... */
-                       text = camel_header_decode_string(addr->str, charset);
+                       text = header_decode_string(addr->str, charset);
                        if (name == NULL) {
                                name = addr;
                                addr = g_string_new("");
@@ -2514,7 +2513,7 @@ header_decode_mailbox(const char **in, const char *charset)
                        if (comend > comstart) {
                                d(printf("  looking at subset '%.*s'\n", comend-comstart, comstart));
                                tmp = g_strndup (comstart, comend-comstart);
-                               text = camel_header_decode_string (tmp, charset);
+                               text = header_decode_string (tmp, charset);
                                name = g_string_new (text);
                                g_free (tmp);
                                g_free (text);
@@ -2542,7 +2541,7 @@ header_decode_mailbox(const char **in, const char *charset)
                        addr = out;
                }
                
-               address = camel_header_address_new_name(name ? name->str : "", addr->str);
+               address = header_address_new_name(name ? name->str : "", addr->str);
        }
        
        d(printf("got mailbox: %s\n", addr->str));
@@ -2554,13 +2553,13 @@ header_decode_mailbox(const char **in, const char *charset)
        return address;
 }
 
-static struct _camel_header_address *
+static struct _header_address *
 header_decode_address(const char **in, const char *charset)
 {
        const char *inptr = *in;
        char *pre;
        GString *group = g_string_new("");
-       struct _camel_header_address *addr = NULL, *member;
+       struct _header_address *addr = NULL, *member;
 
        /* pre-scan, trying to work out format, discard results */
        header_decode_lwsp(&inptr);
@@ -2572,7 +2571,7 @@ header_decode_address(const char **in, const char *charset)
        header_decode_lwsp(&inptr);
        if (*inptr == ':') {
                d(printf("group detected: %s\n", group->str));
-               addr = camel_header_address_new_group(group->str);
+               addr = header_address_new_group(group->str);
                /* that was a group spec, scan mailbox's */
                inptr++;
                /* FIXME: check rfc 2047 encodings of words, here or above in the loop */
@@ -2582,7 +2581,7 @@ header_decode_address(const char **in, const char *charset)
                        do {
                                member = header_decode_mailbox(&inptr, charset);
                                if (member)
-                                       camel_header_address_add_member(addr, member);
+                                       header_address_add_member(addr, member);
                                header_decode_lwsp(&inptr);
                                if (*inptr == ',')
                                        inptr++;
@@ -2639,7 +2638,7 @@ header_msgid_decode_internal(const char **in)
 }
 
 char *
-camel_header_msgid_decode(const char *in)
+header_msgid_decode(const char *in)
 {
        if (in == NULL)
                return NULL;
@@ -2648,7 +2647,7 @@ camel_header_msgid_decode(const char *in)
 }
 
 char *
-camel_header_contentid_decode (const char *in)
+header_contentid_decode (const char *in)
 {
        const char *inptr = in;
        gboolean at = FALSE;
@@ -2665,7 +2664,7 @@ camel_header_contentid_decode (const char *in)
        
        /* make sure the content-id is not "" which can happen if we get a
         * content-id such as <.@> (which Eudora likes to use...) */
-       if ((buf = camel_header_msgid_decode (inptr)) != NULL && *buf)
+       if ((buf = header_msgid_decode (inptr)) != NULL && *buf)
                return buf;
        
        g_free (buf);
@@ -2715,9 +2714,9 @@ camel_header_contentid_decode (const char *in)
 }
 
 void
-camel_header_references_list_append_asis(struct _camel_header_references **list, char *ref)
+header_references_list_append_asis(struct _header_references **list, char *ref)
 {
-       struct _camel_header_references *w = (struct _camel_header_references *)list, *n;
+       struct _header_references *w = (struct _header_references *)list, *n;
        while (w->next)
                w = w->next;
        n = g_malloc(sizeof(*n));
@@ -2727,10 +2726,10 @@ camel_header_references_list_append_asis(struct _camel_header_references **list,
 }
 
 int
-camel_header_references_list_size(struct _camel_header_references **list)
+header_references_list_size(struct _header_references **list)
 {
        int count = 0;
-       struct _camel_header_references *w = *list;
+       struct _header_references *w = *list;
        while (w) {
                count++;
                w = w->next;
@@ -2739,9 +2738,9 @@ camel_header_references_list_size(struct _camel_header_references **list)
 }
 
 void
-camel_header_references_list_clear(struct _camel_header_references **list)
+header_references_list_clear(struct _header_references **list)
 {
-       struct _camel_header_references *w = *list, *n;
+       struct _header_references *w = *list, *n;
        while (w) {
                n = w->next;
                g_free(w->id);
@@ -2752,9 +2751,9 @@ camel_header_references_list_clear(struct _camel_header_references **list)
 }
 
 static void
-header_references_decode_single (const char **in, struct _camel_header_references **head)
+header_references_decode_single (const char **in, struct _header_references **head)
 {
-       struct _camel_header_references *ref;
+       struct _header_references *ref;
        const char *inptr = *in;
        char *id, *word;
        
@@ -2763,7 +2762,7 @@ header_references_decode_single (const char **in, struct _camel_header_reference
                if (*inptr == '<') {
                        id = header_msgid_decode_internal (&inptr);
                        if (id) {
-                               ref = g_malloc (sizeof (struct _camel_header_references));
+                               ref = g_malloc (sizeof (struct _header_references));
                                ref->next = *head;
                                ref->id = id;
                                *head = ref;
@@ -2781,10 +2780,10 @@ header_references_decode_single (const char **in, struct _camel_header_reference
        *in = inptr;
 }
 
-struct _camel_header_references *
-camel_header_references_inreplyto_decode (const char *in)
+struct _header_references *
+header_references_inreplyto_decode (const char *in)
 {
-       struct _camel_header_references *ref = NULL;
+       struct _header_references *ref = NULL;
        
        if (in == NULL || in[0] == '\0')
                return NULL;
@@ -2795,10 +2794,10 @@ camel_header_references_inreplyto_decode (const char *in)
 }
 
 /* generate a list of references, from most recent up */
-struct _camel_header_references *
-camel_header_references_decode (const char *in)
+struct _header_references *
+header_references_decode (const char *in)
 {
-       struct _camel_header_references *refs = NULL;
+       struct _header_references *refs = NULL;
        
        if (in == NULL || in[0] == '\0')
                return NULL;
@@ -2809,13 +2808,13 @@ camel_header_references_decode (const char *in)
        return refs;
 }
 
-struct _camel_header_references *
-camel_header_references_dup(const struct _camel_header_references *list)
+struct _header_references *
+header_references_dup(const struct _header_references *list)
 {
-       struct _camel_header_references *new = NULL, *tmp;
+       struct _header_references *new = NULL, *tmp;
 
        while (list) {
-               tmp = g_new(struct _camel_header_references, 1);
+               tmp = g_new(struct _header_references, 1);
                tmp->next = new;
                tmp->id = g_strdup(list->id);
                new = tmp;
@@ -2824,8 +2823,8 @@ camel_header_references_dup(const struct _camel_header_references *list)
        return new;
 }
 
-struct _camel_header_address *
-camel_header_mailbox_decode(const char *in, const char *charset)
+struct _header_address *
+header_mailbox_decode(const char *in, const char *charset)
 {
        if (in == NULL)
                return NULL;
@@ -2833,11 +2832,11 @@ camel_header_mailbox_decode(const char *in, const char *charset)
        return header_decode_mailbox(&in, charset);
 }
 
-struct _camel_header_address *
-camel_header_address_decode(const char *in, const char *charset)
+struct _header_address *
+header_address_decode(const char *in, const char *charset)
 {
        const char *inptr = in, *last;
-       struct _camel_header_address *list = NULL, *addr;
+       struct _header_address *list = NULL, *addr;
 
        d(printf("decoding To: '%s'\n", in));
 
@@ -2852,7 +2851,7 @@ camel_header_address_decode(const char *in, const char *charset)
                last = inptr;
                addr = header_decode_address(&inptr, charset);
                if (addr)
-                       camel_header_address_list_append(&list, addr);
+                       header_address_list_append(&list, addr);
                header_decode_lwsp(&inptr);
                if (*inptr == ',')
                        inptr++;
@@ -2872,7 +2871,7 @@ camel_header_address_decode(const char *in, const char *charset)
 }
 
 void
-camel_header_mime_decode(const char *in, int *maj, int *min)
+header_mime_decode(const char *in, int *maj, int *min)
 {
        const char *inptr = in;
        int major=-1, minor=-1;
@@ -2882,13 +2881,13 @@ camel_header_mime_decode(const char *in, int *maj, int *min)
        if (in != NULL) {
                header_decode_lwsp(&inptr);
                if (isdigit(*inptr)) {
-                       major = camel_header_decode_int(&inptr);
+                       major = header_decode_int(&inptr);
                        header_decode_lwsp(&inptr);
                        if (*inptr == '.') {
                                inptr++;
                                header_decode_lwsp(&inptr);
                                if (isdigit(*inptr))
-                                       minor = camel_header_decode_int(&inptr);
+                                       minor = header_decode_int(&inptr);
                        }
                }
        }
@@ -2901,18 +2900,18 @@ camel_header_mime_decode(const char *in, int *maj, int *min)
        d(printf("major = %d, minor = %d\n", major, minor));
 }
 
-static struct _camel_header_param *
+static struct _header_param *
 header_decode_param_list (const char **in)
 {
        const char *inptr = *in;
-       struct _camel_header_param *head = NULL, *tail = NULL;
+       struct _header_param *head = NULL, *tail = NULL;
        gboolean last_was_rfc2184 = FALSE;
        gboolean is_rfc2184 = FALSE;
        
        header_decode_lwsp (&inptr);
        
        while (*inptr == ';') {
-               struct _camel_header_param *param;
+               struct _header_param *param;
                char *name, *value;
                int rfc2184_part;
                
@@ -2951,7 +2950,7 @@ header_decode_param_list (const char **in)
                                }
                        }
                        
-                       param = g_malloc (sizeof (struct _camel_header_param));
+                       param = g_malloc (sizeof (struct _header_param));
                        param->name = name;
                        param->value = value;
                        param->next = NULL;
@@ -2985,8 +2984,8 @@ header_decode_param_list (const char **in)
        return head;
 }
 
-struct _camel_header_param *
-camel_header_param_list_decode(const char *in)
+struct _header_param *
+header_param_list_decode(const char *in)
 {
        if (in == NULL)
                return NULL;
@@ -3108,7 +3107,7 @@ header_encode_param (const unsigned char *in, gboolean *encoded)
 }
 
 void
-camel_header_param_list_format_append (GString *out, struct _camel_header_param *p)
+header_param_list_format_append (GString *out, struct _header_param *p)
 {
        int used = out->len;
        
@@ -3209,23 +3208,23 @@ camel_header_param_list_format_append (GString *out, struct _camel_header_param
 }
 
 char *
-camel_header_param_list_format(struct _camel_header_param *p)
+header_param_list_format(struct _header_param *p)
 {
        GString *out = g_string_new("");
        char *ret;
 
-       camel_header_param_list_format_append(out, p);
+       header_param_list_format_append(out, p);
        ret = out->str;
        g_string_free(out, FALSE);
        return ret;
 }
 
-CamelContentType *
-camel_content_type_decode(const char *in)
+struct _header_content_type *
+header_content_type_decode(const char *in)
 {
        const char *inptr = in;
        char *type, *subtype = NULL;
-       CamelContentType *t = NULL;
+       struct _header_content_type *t = NULL;
 
        if (in==NULL)
                return NULL;
@@ -3245,7 +3244,7 @@ camel_content_type_decode(const char *in)
                        w(g_warning("MIME type with no subtype: %s", in));
                }
 
-               t = camel_content_type_new(type, subtype);
+               t = header_content_type_new(type, subtype);
                t->params = header_decode_param_list(&inptr);
                g_free(type);
                g_free(subtype);
@@ -3257,9 +3256,9 @@ camel_content_type_decode(const char *in)
 }
 
 void
-camel_content_type_dump(CamelContentType *ct)
+header_content_type_dump(struct _header_content_type *ct)
 {
-       struct _camel_header_param *p;
+       struct _header_param *p;
 
        printf("Content-Type: ");
        if (ct==NULL) {
@@ -3278,7 +3277,7 @@ camel_content_type_dump(CamelContentType *ct)
 }
 
 char *
-camel_content_type_format (CamelContentType *ct)
+header_content_type_format (struct _header_content_type *ct)
 {
        GString *out;
        char *ret;
@@ -3299,7 +3298,7 @@ camel_content_type_format (CamelContentType *ct)
        } else {
                g_string_append_printf (out, "%s/%s", ct->type, ct->subtype);
        }
-       camel_header_param_list_format_append (out, ct->params);
+       header_param_list_format_append (out, ct->params);
        
        ret = out->str;
        g_string_free (out, FALSE);
@@ -3308,7 +3307,7 @@ camel_content_type_format (CamelContentType *ct)
 }
 
 char *
-camel_content_type_simple (CamelContentType *ct)
+header_content_type_simple (struct _header_content_type *ct)
 {
        if (ct->type == NULL) {
                w(g_warning ("Content-Type with no main type"));
@@ -3324,17 +3323,17 @@ camel_content_type_simple (CamelContentType *ct)
 }
 
 char *
-camel_header_content_encoding_decode(const char *in)
+header_content_encoding_decode(const char *in)
 {
        if (in)
                return decode_token(&in);
        return NULL;
 }
 
-CamelContentDisposition *
-camel_content_disposition_decode(const char *in)
+CamelMimeDisposition *
+header_disposition_decode(const char *in)
 {
-       CamelContentDisposition *d = NULL;
+       CamelMimeDisposition *d = NULL;
        const char *inptr = in;
 
        if (in == NULL)
@@ -3350,18 +3349,18 @@ camel_content_disposition_decode(const char *in)
 }
 
 void
-camel_content_disposition_ref(CamelContentDisposition *d)
+header_disposition_ref(CamelMimeDisposition *d)
 {
        if (d)
                d->refcount++;
 }
 
 void
-camel_content_disposition_unref(CamelContentDisposition *d)
+header_disposition_unref(CamelMimeDisposition *d)
 {
        if (d) {
                if (d->refcount<=1) {
-                       camel_header_param_list_free(d->params);
+                       header_param_list_free(d->params);
                        g_free(d->disposition);
                        g_free(d);
                } else {
@@ -3371,7 +3370,7 @@ camel_content_disposition_unref(CamelContentDisposition *d)
 }
 
 char *
-camel_content_disposition_format(CamelContentDisposition *d)
+header_disposition_format(CamelMimeDisposition *d)
 {
        GString *out;
        char *ret;
@@ -3384,7 +3383,7 @@ camel_content_disposition_format(CamelContentDisposition *d)
                out = g_string_append(out, d->disposition);
        else
                out = g_string_append(out, "attachment");
-       camel_header_param_list_format_append(out, d->params);
+       header_param_list_format_append(out, d->params);
 
        ret = out->str;
        g_string_free(out, FALSE);
@@ -3423,7 +3422,7 @@ static char *tz_days [] = {
 };
 
 char *
-camel_header_format_date(time_t time, int offset)
+header_format_date(time_t time, int offset)
 {
        struct tm tm;
 
@@ -3448,7 +3447,7 @@ camel_header_format_date(time_t time, int offset)
 /* convert a date to time_t representation */
 /* this is an awful mess oh well */
 time_t
-camel_header_decode_date(const char *in, int *saveoffset)
+header_decode_date(const char *in, int *saveoffset)
 {
        const char *inptr = in;
        char *monthname;
@@ -3488,7 +3487,7 @@ camel_header_decode_date(const char *in, int *saveoffset)
                        }
                }
        }
-       tm.tm_mday = camel_header_decode_int(&inptr);
+       tm.tm_mday = header_decode_int(&inptr);
        monthname = decode_token(&inptr);
        if (monthname) {
                for (i=0;i<sizeof(tz_months)/sizeof(tz_months[0]);i++) {
@@ -3499,7 +3498,7 @@ camel_header_decode_date(const char *in, int *saveoffset)
                }
                g_free(monthname);
        }
-       year = camel_header_decode_int(&inptr);
+       year = header_decode_int(&inptr);
        if (year < 69) {
                tm.tm_year = 100 + year;
        } else if (year < 100) {
@@ -3510,25 +3509,25 @@ camel_header_decode_date(const char *in, int *saveoffset)
                tm.tm_year = year - 1900;
        }
        /* get the time ... yurck */
-       tm.tm_hour = camel_header_decode_int(&inptr);
+       tm.tm_hour = header_decode_int(&inptr);
        header_decode_lwsp(&inptr);
        if (*inptr == ':')
                inptr++;
-       tm.tm_min = camel_header_decode_int(&inptr);
+       tm.tm_min = header_decode_int(&inptr);
        header_decode_lwsp(&inptr);
        if (*inptr == ':')
                inptr++;
-       tm.tm_sec = camel_header_decode_int(&inptr);
+       tm.tm_sec = header_decode_int(&inptr);
        header_decode_lwsp(&inptr);
        if (*inptr == '+'
            || *inptr == '-') {
                offset = (*inptr++)=='-'?-1:1;
-               offset = offset * camel_header_decode_int(&inptr);
+               offset = offset * header_decode_int(&inptr);
                d(printf("abs signed offset = %d\n", offset));
                if (offset < -1200 || offset > 1200)
                        offset = 0;
        } else if (isdigit(*inptr)) {
-               offset = camel_header_decode_int(&inptr);
+               offset = header_decode_int(&inptr);
                d(printf("abs offset = %d\n", offset));
                if (offset < -1200 || offset > 1200)
                        offset = 0;
@@ -3548,7 +3547,7 @@ camel_header_decode_date(const char *in, int *saveoffset)
                header_decode_lwsp(&inptr);
                if (*inptr == '+' || *inptr == '-') {
                        int sign = (*inptr++)=='-'?-1:1;
-                       offset = offset + (camel_header_decode_int(&inptr)*sign);
+                       offset = offset + (header_decode_int(&inptr)*sign);
                }
                d(printf("named offset = %d\n", offset));
        }
@@ -3566,7 +3565,7 @@ camel_header_decode_date(const char *in, int *saveoffset)
 
        d({
                char *tmp;
-               tmp = camel_header_format_date(t, offset);
+               tmp = header_format_date(t, offset);
                printf(" encoded again: %s\n", tmp);
                g_free(tmp);
        });
@@ -3578,7 +3577,7 @@ camel_header_decode_date(const char *in, int *saveoffset)
 }
 
 char *
-camel_header_location_decode(const char *in)
+header_location_decode(const char *in)
 {
        const char *p;
 
@@ -3608,7 +3607,7 @@ camel_header_location_decode(const char *in)
 
 #ifdef CHECKS
 static void
-check_header(struct _camel_header_raw *h)
+check_header(struct _header_raw *h)
 {
        unsigned char *p;
 
@@ -3624,7 +3623,7 @@ check_header(struct _camel_header_raw *h)
 #endif
 
 void
-camel_header_raw_append_parse(struct _camel_header_raw **list, const char *header, int offset)
+header_raw_append_parse(struct _header_raw **list, const char *header, int offset)
 {
        register const char *in;
        size_t fieldlen;
@@ -3644,13 +3643,13 @@ camel_header_raw_append_parse(struct _camel_header_raw **list, const char *heade
        memcpy(name, header, fieldlen);
        name[fieldlen] = 0;
 
-       camel_header_raw_append(list, name, in, offset);
+       header_raw_append(list, name, in, offset);
 }
 
 void
-camel_header_raw_append(struct _camel_header_raw **list, const char *name, const char *value, int offset)
+header_raw_append(struct _header_raw **list, const char *name, const char *value, int offset)
 {
-       struct _camel_header_raw *l, *n;
+       struct _header_raw *l, *n;
 
        d(printf("Header: %s: %s\n", name, value));
 
@@ -3662,7 +3661,7 @@ camel_header_raw_append(struct _camel_header_raw **list, const char *name, const
 #ifdef CHECKS
        check_header(n);
 #endif
-       l = (struct _camel_header_raw *)list;
+       l = (struct _header_raw *)list;
        while (l->next) {
                l = l->next;
        }
@@ -3672,21 +3671,21 @@ camel_header_raw_append(struct _camel_header_raw **list, const char *name, const
 #if 0
        if (!strcasecmp(name, "To")) {
                printf("- Decoding To\n");
-               camel_header_to_decode(value);
+               header_to_decode(value);
        } else if (!strcasecmp(name, "Content-type")) {
                printf("- Decoding content-type\n");
-               camel_content_type_dump(camel_content_type_decode(value));              
+               header_content_type_dump(header_content_type_decode(value));            
        } else if (!strcasecmp(name, "MIME-Version")) {
                printf("- Decoding mime version\n");
-               camel_header_mime_decode(value);
+               header_mime_decode(value);
        }
 #endif
 }
 
-static struct _camel_header_raw *
-header_raw_find_node(struct _camel_header_raw **list, const char *name)
+static struct _header_raw *
+header_raw_find_node(struct _header_raw **list, const char *name)
 {
-       struct _camel_header_raw *l;
+       struct _header_raw *l;
 
        l = *list;
        while (l) {
@@ -3698,9 +3697,9 @@ header_raw_find_node(struct _camel_header_raw **list, const char *name)
 }
 
 const char *
-camel_header_raw_find(struct _camel_header_raw **list, const char *name, int *offset)
+header_raw_find(struct _header_raw **list, const char *name, int *offset)
 {
-       struct _camel_header_raw *l;
+       struct _header_raw *l;
 
        l = header_raw_find_node(list, name);
        if (l) {
@@ -3712,9 +3711,9 @@ camel_header_raw_find(struct _camel_header_raw **list, const char *name, int *of
 }
 
 const char *
-camel_header_raw_find_next(struct _camel_header_raw **list, const char *name, int *offset, const char *last)
+header_raw_find_next(struct _header_raw **list, const char *name, int *offset, const char *last)
 {
-       struct _camel_header_raw *l;
+       struct _header_raw *l;
 
        if (last == NULL || name == NULL)
                return NULL;
@@ -3722,11 +3721,11 @@ camel_header_raw_find_next(struct _camel_header_raw **list, const char *name, in
        l = *list;
        while (l && l->value != last)
                l = l->next;
-       return camel_header_raw_find(&l, name, offset);
+       return header_raw_find(&l, name, offset);
 }
 
 static void
-header_raw_free(struct _camel_header_raw *l)
+header_raw_free(struct _header_raw *l)
 {
        g_free(l->name);
        g_free(l->value);
@@ -3734,12 +3733,12 @@ header_raw_free(struct _camel_header_raw *l)
 }
 
 void
-camel_header_raw_remove(struct _camel_header_raw **list, const char *name)
+header_raw_remove(struct _header_raw **list, const char *name)
 {
-       struct _camel_header_raw *l, *p;
+       struct _header_raw *l, *p;
 
        /* the next pointer is at the head of the structure, so this is safe */
-       p = (struct _camel_header_raw *)list;
+       p = (struct _header_raw *)list;
        l = *list;
        while (l) {
                if (!strcasecmp(l->name, name)) {
@@ -3754,16 +3753,16 @@ camel_header_raw_remove(struct _camel_header_raw **list, const char *name)
 }
 
 void
-camel_header_raw_replace(struct _camel_header_raw **list, const char *name, const char *value, int offset)
+header_raw_replace(struct _header_raw **list, const char *name, const char *value, int offset)
 {
-       camel_header_raw_remove(list, name);
-       camel_header_raw_append(list, name, value, offset);
+       header_raw_remove(list, name);
+       header_raw_append(list, name, value, offset);
 }
 
 void
-camel_header_raw_clear(struct _camel_header_raw **list)
+header_raw_clear(struct _header_raw **list)
 {
-       struct _camel_header_raw *l, *n;
+       struct _header_raw *l, *n;
        l = *list;
        while (l) {
                n = l->next;
@@ -3774,7 +3773,7 @@ camel_header_raw_clear(struct _camel_header_raw **list)
 }
 
 char *
-camel_header_msgid_generate (void)
+header_msgid_generate (void)
 {
        static pthread_mutex_t count_lock = PTHREAD_MUTEX_INITIALIZER;
 #define COUNT_LOCK() pthread_mutex_lock (&count_lock)
@@ -3851,14 +3850,14 @@ static struct {
 };
 
 char *
-camel_header_raw_check_mailing_list(struct _camel_header_raw **list)
+header_raw_check_mailing_list(struct _header_raw **list)
 {
        const char *v;
        regmatch_t match[3];
        int i;
        
        for (i = 0; i < sizeof (mail_list_magic) / sizeof (mail_list_magic[0]); i++) {
-               v = camel_header_raw_find (list, mail_list_magic[i].name, NULL);
+               v = header_raw_find (list, mail_list_magic[i].name, NULL);
                if (v != NULL && regexec (&mail_list_magic[i].regex, v, 3, match, 0) == 0 && match[1].rm_so != -1) {
                        char *list;
                        int len1, len2;
@@ -3884,52 +3883,48 @@ camel_header_raw_check_mailing_list(struct _camel_header_raw **list)
 }
 
 /* ok, here's the address stuff, what a mess ... */
-struct _camel_header_address *
-camel_header_address_new (void)
+struct _header_address *header_address_new(void)
 {
-       struct _camel_header_address *h;
+       struct _header_address *h;
        h = g_malloc0(sizeof(*h));
        h->type = HEADER_ADDRESS_NONE;
        h->refcount = 1;
        return h;
 }
 
-struct _camel_header_address *
-camel_header_address_new_name(const char *name, const char *addr)
+struct _header_address *header_address_new_name(const char *name, const char *addr)
 {
-       struct _camel_header_address *h;
-       h = camel_header_address_new();
+       struct _header_address *h;
+
+       h = header_address_new();
        h->type = HEADER_ADDRESS_NAME;
        h->name = g_strdup(name);
        h->v.addr = g_strdup(addr);
        return h;
 }
 
-struct _camel_header_address *
-camel_header_address_new_group (const char *name)
+struct _header_address *header_address_new_group(const char *name)
 {
-       struct _camel_header_address *h;
+       struct _header_address *h;
 
-       h = camel_header_address_new();
+       h = header_address_new();
        h->type = HEADER_ADDRESS_GROUP;
        h->name = g_strdup(name);
        return h;
 }
 
-void
-camel_header_address_ref(struct _camel_header_address *h)
+void header_address_ref(struct _header_address *h)
 {
        if (h)
                h->refcount++;
 }
 
-void
-camel_header_address_unref(struct _camel_header_address *h)
+void header_address_unref(struct _header_address *h)
 {
        if (h) {
                if (h->refcount <= 1) {
                        if (h->type == HEADER_ADDRESS_GROUP) {
-                               camel_header_address_list_clear(&h->v.members);
+                               header_address_list_clear(&h->v.members);
                        } else if (h->type == HEADER_ADDRESS_NAME) {
                                g_free(h->v.addr);
                        }
@@ -3941,8 +3936,7 @@ camel_header_address_unref(struct _camel_header_address *h)
        }
 }
 
-void
-camel_header_address_set_name(struct _camel_header_address *h, const char *name)
+void header_address_set_name(struct _header_address *h, const char *name)
 {
        if (h) {
                g_free(h->name);
@@ -3950,8 +3944,7 @@ camel_header_address_set_name(struct _camel_header_address *h, const char *name)
        }
 }
 
-void
-camel_header_address_set_addr(struct _camel_header_address *h, const char *addr)
+void header_address_set_addr(struct _header_address *h, const char *addr)
 {
        if (h) {
                if (h->type == HEADER_ADDRESS_NAME
@@ -3965,14 +3958,13 @@ camel_header_address_set_addr(struct _camel_header_address *h, const char *addr)
        }
 }
 
-void
-camel_header_address_set_members(struct _camel_header_address *h, struct _camel_header_address *group)
+void header_address_set_members(struct _header_address *h, struct _header_address *group)
 {
        if (h) {
                if (h->type == HEADER_ADDRESS_GROUP
                    || h->type == HEADER_ADDRESS_NONE) {
                        h->type = HEADER_ADDRESS_GROUP;
-                       camel_header_address_list_clear(&h->v.members);
+                       header_address_list_clear(&h->v.members);
                        /* should this ref them? */
                        h->v.members = group;
                } else {
@@ -3981,23 +3973,21 @@ camel_header_address_set_members(struct _camel_header_address *h, struct _camel_
        }
 }
 
-void
-camel_header_address_add_member(struct _camel_header_address *h, struct _camel_header_address *member)
+void header_address_add_member(struct _header_address *h, struct _header_address *member)
 {
        if (h) {
                if (h->type == HEADER_ADDRESS_GROUP
                    || h->type == HEADER_ADDRESS_NONE) {
                        h->type = HEADER_ADDRESS_GROUP;
-                       camel_header_address_list_append(&h->v.members, member);
+                       header_address_list_append(&h->v.members, member);
                }                   
        }
 }
 
-void
-camel_header_address_list_append_list(struct _camel_header_address **l, struct _camel_header_address **h)
+void header_address_list_append_list(struct _header_address **l, struct _header_address **h)
 {
        if (l) {
-               struct _camel_header_address *n = (struct _camel_header_address *)l;
+               struct _header_address *n = (struct _header_address *)l;
 
                while (n->next)
                        n = n->next;
@@ -4006,23 +3996,21 @@ camel_header_address_list_append_list(struct _camel_header_address **l, struct _
 }
 
 
-void
-camel_header_address_list_append(struct _camel_header_address **l, struct _camel_header_address *h)
+void header_address_list_append(struct _header_address **l, struct _header_address *h)
 {
        if (h) {
-               camel_header_address_list_append_list(l, &h);
+               header_address_list_append_list(l, &h);
                h->next = NULL;
        }
 }
 
-void
-camel_header_address_list_clear(struct _camel_header_address **l)
+void header_address_list_clear(struct _header_address **l)
 {
-       struct _camel_header_address *a, *n;
+       struct _header_address *a, *n;
        a = *l;
        while (a) {
                n = a->next;
-               camel_header_address_unref(a);
+               header_address_unref(a);
                a = n;
        }
        *l = NULL;
@@ -4031,7 +4019,7 @@ camel_header_address_list_clear(struct _camel_header_address **l)
 /* if encode is true, then the result is suitable for mailing, otherwise
    the result is suitable for display only (and may not even be re-parsable) */
 static void
-header_address_list_encode_append (GString *out, int encode, struct _camel_header_address *a)
+header_address_list_encode_append (GString *out, int encode, struct _header_address *a)
 {
        char *text;
        
@@ -4039,7 +4027,7 @@ header_address_list_encode_append (GString *out, int encode, struct _camel_heade
                switch (a->type) {
                case HEADER_ADDRESS_NAME:
                        if (encode)
-                               text = camel_header_encode_phrase (a->name);
+                               text = header_encode_phrase (a->name);
                        else
                                text = a->name;
                        if (text && *text)
@@ -4051,7 +4039,7 @@ header_address_list_encode_append (GString *out, int encode, struct _camel_heade
                        break;
                case HEADER_ADDRESS_GROUP:
                        if (encode)
-                               text = camel_header_encode_phrase (a->name);
+                               text = header_encode_phrase (a->name);
                        else
                                text = a->name;
                        g_string_append_printf (out, "%s: ", text);
@@ -4071,7 +4059,7 @@ header_address_list_encode_append (GString *out, int encode, struct _camel_heade
 }
 
 char *
-camel_header_address_list_encode (struct _camel_header_address *a)
+header_address_list_encode (struct _header_address *a)
 {
        GString *out;
        char *ret;
@@ -4088,7 +4076,7 @@ camel_header_address_list_encode (struct _camel_header_address *a)
 }
 
 char *
-camel_header_address_list_format (struct _camel_header_address *a)
+header_address_list_format (struct _header_address *a)
 {
        GString *out;
        char *ret;
@@ -4106,7 +4094,7 @@ camel_header_address_list_format (struct _camel_header_address *a)
 }
 
 char *
-camel_header_address_fold (const char *in, size_t headerlen)
+header_address_fold (const char *in, size_t headerlen)
 {
        size_t len, outlen;
        const char *inptr = in, *space, *p, *n;
@@ -4140,7 +4128,7 @@ camel_header_address_fold (const char *in, size_t headerlen)
        
        /* we need to fold, so first unfold (if we need to), then process */
        if (needunfold)
-               inptr = in = camel_header_unfold (in);
+               inptr = in = header_unfold (in);
        
        out = g_string_new ("");
        outlen = headerlen + 2;
@@ -4182,7 +4170,7 @@ camel_header_address_fold (const char *in, size_t headerlen)
 /* simple header folding */
 /* will work even if the header is already folded */
 char *
-camel_header_fold(const char *in, size_t headerlen)
+header_fold(const char *in, size_t headerlen)
 {
        size_t len, outlen, i;
        const char *inptr = in, *space, *p, *n;
@@ -4216,7 +4204,7 @@ camel_header_fold(const char *in, size_t headerlen)
 
        /* we need to fold, so first unfold (if we need to), then process */
        if (needunfold)
-               inptr = in = camel_header_unfold(in);
+               inptr = in = header_unfold(in);
 
        out = g_string_new("");
        outlen = headerlen+2;
@@ -4261,7 +4249,7 @@ camel_header_fold(const char *in, size_t headerlen)
 }
 
 char *
-camel_header_unfold(const char *in)
+header_unfold(const char *in)
 {
        char *out = g_malloc(strlen(in)+1);
        const char *inptr = in;
index 7035b76..b58bcbe 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- *  Copyright (C) 2000-2003 Ximian Inc.
+ *  Copyright (C) 2000 Ximian Inc.
  *
  *  Authors: Michael Zucchi <notzed@ximian.com>
  *           Jeffrey Stedfast <fejj@ximian.com>
@@ -32,9 +32,9 @@ extern "C" {
 #include <time.h>
 #include <glib.h>
 
-/* maximum recommended size of a line from camel_header_fold() */
+/* maximum recommended size of a line from header_fold() */
 #define CAMEL_FOLD_SIZE (77)
-/* maximum hard size of a line from camel_header_fold() */
+/* maximum hard size of a line from header_fold() */
 #define CAMEL_FOLD_MAX_SIZE (998)
 
 #define CAMEL_UUDECODE_STATE_INIT   (0)
@@ -55,53 +55,53 @@ typedef enum _CamelMimePartEncodingType {
 } CamelMimePartEncodingType;
 
 /* a list of references for this message */
-struct _camel_header_references {
-       struct _camel_header_references *next;
+struct _header_references {
+       struct _header_references *next;
        char *id;
 };
 
-struct _camel_header_param {
-       struct _camel_header_param *next;
+struct _header_param {
+       struct _header_param *next;
        char *name;
        char *value;
 };
 
 /* describes a content-type */
-typedef struct {
+struct _header_content_type {
        char *type;
        char *subtype;
-       struct _camel_header_param *params;
+       struct _header_param *params;
        unsigned int refcount;
-} CamelContentType;
+};
 
 /* a raw rfc822 header */
 /* the value MUST be US-ASCII */
-struct _camel_header_raw {
-       struct _camel_header_raw *next;
+struct _header_raw {
+       struct _header_raw *next;
        char *name;
        char *value;
        int offset;             /* in file, if known */
 };
 
-typedef struct {
+typedef struct _CamelMimeDisposition {
        char *disposition;
-       struct _camel_header_param *params;
+       struct _header_param *params;
        unsigned int refcount;
-} CamelContentDisposition;
+} CamelMimeDisposition;
 
-enum _camel_header_address_t {
+enum _header_address_type {
        HEADER_ADDRESS_NONE,    /* uninitialised */
        HEADER_ADDRESS_NAME,
        HEADER_ADDRESS_GROUP
 };
 
-struct _camel_header_address {
-       struct _camel_header_address *next;
-       enum _camel_header_address_t type;
+struct _header_address {
+       struct _header_address *next;
+       enum _header_address_type type;
        char *name;
        union {
                char *addr;
-               struct _camel_header_address *members;
+               struct _header_address *members;
        } v;
        unsigned int refcount;
 };
@@ -110,116 +110,116 @@ struct _camel_header_address {
 void camel_mime_utils_init(void);
 
 /* Address lists */
-struct _camel_header_address *camel_header_address_new (void);
-struct _camel_header_address *camel_header_address_new_name (const char *name, const char *addr);
-struct _camel_header_address *camel_header_address_new_group (const char *name);
-void camel_header_address_ref (struct _camel_header_address *);
-void camel_header_address_unref (struct _camel_header_address *);
-void camel_header_address_set_name (struct _camel_header_address *, const char *name);
-void camel_header_address_set_addr (struct _camel_header_address *, const char *addr);
-void camel_header_address_set_members (struct _camel_header_address *, struct _camel_header_address *group);
-void camel_header_address_add_member (struct _camel_header_address *, struct _camel_header_address *member);
-void camel_header_address_list_append_list (struct _camel_header_address **l, struct _camel_header_address **h);
-void camel_header_address_list_append (struct _camel_header_address **, struct _camel_header_address *);
-void camel_header_address_list_clear (struct _camel_header_address **);
-
-struct _camel_header_address *camel_header_address_decode (const char *in, const char *charset);
-struct _camel_header_address *camel_header_mailbox_decode (const char *in, const char *charset);
+struct _header_address *header_address_new(void);
+struct _header_address *header_address_new_name(const char *name, const char *addr);
+struct _header_address *header_address_new_group(const char *name);
+void header_address_ref(struct _header_address *);
+void header_address_unref(struct _header_address *);
+void header_address_set_name(struct _header_address *, const char *name);
+void header_address_set_addr(struct _header_address *, const char *addr);
+void header_address_set_members(struct _header_address *, struct _header_address *group);
+void header_address_add_member(struct _header_address *, struct _header_address *member);
+void header_address_list_append_list(struct _header_address **l, struct _header_address **h);
+void header_address_list_append(struct _header_address **, struct _header_address *);
+void header_address_list_clear(struct _header_address **);
+
+struct _header_address *header_address_decode(const char *in, const char *charset);
+struct _header_address *header_mailbox_decode(const char *in, const char *charset);
 /* for mailing */
-char *camel_header_address_list_encode (struct _camel_header_address *a);
+char *header_address_list_encode(struct _header_address *a);
 /* for display */
-char *camel_header_address_list_format (struct _camel_header_address *a);
+char *header_address_list_format(struct _header_address *a);
 
 /* structured header prameters */
-struct _camel_header_param *camel_header_param_list_decode (const char *in);
-char *camel_header_param (struct _camel_header_param *p, const char *name);
-struct _camel_header_param *camel_header_set_param (struct _camel_header_param **l, const char *name, const char *value);
-void camel_header_param_list_format_append (GString *out, struct _camel_header_param *p);
-char *camel_header_param_list_format (struct _camel_header_param *p);
-void camel_header_param_list_free (struct _camel_header_param *p);
+struct _header_param *header_param_list_decode(const char *in);
+char *header_param(struct _header_param *p, const char *name);
+struct _header_param *header_set_param(struct _header_param **l, const char *name, const char *value);
+void header_param_list_format_append(GString *out, struct _header_param *p);
+char *header_param_list_format(struct _header_param *p);
+void header_param_list_free(struct _header_param *p);
 
 /* Content-Type header */
-CamelContentType *camel_content_type_new (const char *type, const char *subtype);
-CamelContentType *camel_content_type_decode (const char *in);
-void camel_content_type_unref (CamelContentType *ct);
-void camel_content_type_ref (CamelContentType *ct);
-const char *camel_content_type_param (CamelContentType *t, const char *name);
-void camel_content_type_set_param (CamelContentType *t, const char *name, const char *value);
-int camel_content_type_is (CamelContentType *ct, const char *type, const char *subtype);
-char *camel_content_type_format (CamelContentType *ct);
-char *camel_content_type_simple (CamelContentType *ct);
+struct _header_content_type *header_content_type_new(const char *type, const char *subtype);
+struct _header_content_type *header_content_type_decode(const char *in);
+void header_content_type_unref(struct _header_content_type *ct);
+void header_content_type_ref(struct _header_content_type *ct);
+const char *header_content_type_param(struct _header_content_type *t, const char *name);
+void header_content_type_set_param(struct _header_content_type *t, const char *name, const char *value);
+int header_content_type_is(struct _header_content_type *ct, const char *type, const char *subtype);
+char *header_content_type_format(struct _header_content_type *ct);
+char *header_content_type_simple(struct _header_content_type *ct);
 
 /* DEBUGGING function */
-void camel_content_type_dump (CamelContentType *ct);
+void header_content_type_dump(struct _header_content_type *ct);
 
 /* Content-Disposition header */
-CamelContentDisposition *camel_content_disposition_decode (const char *in);
-void camel_content_disposition_ref (CamelContentDisposition *);
-void camel_content_disposition_unref (CamelContentDisposition *);
-char *camel_content_disposition_format (CamelContentDisposition *d);
+CamelMimeDisposition *header_disposition_decode(const char *in);
+void header_disposition_ref(CamelMimeDisposition *);
+void header_disposition_unref(CamelMimeDisposition *);
+char *header_disposition_format(CamelMimeDisposition *d);
 
 /* decode the contents of a content-encoding header */
-char *camel_header_content_encoding_decode (const char *in);
+char *header_content_encoding_decode(const char *in);
 
 /* raw headers */
-void camel_header_raw_append (struct _camel_header_raw **list, const char *name, const char *value, int offset);
-void camel_header_raw_append_parse (struct _camel_header_raw **list, const char *header, int offset);
-const char *camel_header_raw_find (struct _camel_header_raw **list, const char *name, int *offset);
-const char *camel_header_raw_find_next (struct _camel_header_raw **list, const char *name, int *offset, const char *last);
-void camel_header_raw_replace (struct _camel_header_raw **list, const char *name, const char *value, int offset);
-void camel_header_raw_remove (struct _camel_header_raw **list, const char *name);
-void camel_header_raw_fold (struct _camel_header_raw **list);
-void camel_header_raw_clear (struct _camel_header_raw **list);
+void header_raw_append(struct _header_raw **list, const char *name, const char *value, int offset);
+void header_raw_append_parse(struct _header_raw **list, const char *header, int offset);
+const char *header_raw_find(struct _header_raw **list, const char *name, int *offset);
+const char *header_raw_find_next(struct _header_raw **list, const char *name, int *offset, const char *last);
+void header_raw_replace(struct _header_raw **list, const char *name, const char *value, int offset);
+void header_raw_remove(struct _header_raw **list, const char *name);
+void header_raw_fold(struct _header_raw **list);
+void header_raw_clear(struct _header_raw **list);
 
-char *camel_header_raw_check_mailing_list (struct _camel_header_raw **list);
+char *header_raw_check_mailing_list(struct _header_raw **list);
 
 /* fold a header */
-char *camel_header_address_fold (const char *in, size_t headerlen);
-char *camel_header_fold (const char *in, size_t headerlen);
-char *camel_header_unfold (const char *in);
+char *header_address_fold (const char *in, size_t headerlen);
+char *header_fold (const char *in, size_t headerlen);
+char *header_unfold (const char *in);
 
 /* decode a header which is a simple token */
-char *camel_header_token_decode (const char *in);
+char *header_token_decode (const char *in);
 
-int camel_header_decode_int (const char **in);
+int header_decode_int (const char **in);
 
 /* decode/encode a string type, like a subject line */
-char *camel_header_decode_string (const char *in, const char *default_charset);
-char *camel_header_encode_string (const unsigned char *in);
+char *header_decode_string (const char *in, const char *default_charset);
+char *header_encode_string (const unsigned char *in);
 
 /* encode a phrase, like the real name of an address */
-char *camel_header_encode_phrase (const unsigned char *in);
+char *header_encode_phrase (const unsigned char *in);
 
 /* decode an email date field into a GMT time, + optional offset */
-time_t camel_header_decode_date (const char *in, int *saveoffset);
-char *camel_header_format_date (time_t time, int offset);
+time_t header_decode_date (const char *in, int *saveoffset);
+char *header_format_date (time_t time, int offset);
 
 /* decode a message id */
-char *camel_header_msgid_decode (const char *in);
-char *camel_header_contentid_decode (const char *in);
+char *header_msgid_decode (const char *in);
+char *header_contentid_decode (const char *in);
 
 /* generate msg id */
-char *camel_header_msgid_generate (void);
+char *header_msgid_generate (void);
 
 /* decode a References or In-Reply-To header */
-struct _camel_header_references *camel_header_references_inreplyto_decode (const char *in);
-struct _camel_header_references *camel_header_references_decode (const char *in);
-void camel_header_references_list_clear (struct _camel_header_references **list);
-void camel_header_references_list_append_asis (struct _camel_header_references **list, char *ref);
-int camel_header_references_list_size (struct _camel_header_references **list);
-struct _camel_header_references *camel_header_references_dup (const struct _camel_header_references *list);
+struct _header_references *header_references_inreplyto_decode (const char *in);
+struct _header_references *header_references_decode(const char *in);
+void header_references_list_clear(struct _header_references **list);
+void header_references_list_append_asis(struct _header_references **list, char *ref);
+int header_references_list_size(struct _header_references **list);
+struct _header_references *header_references_dup(const struct _header_references *list);
 
 /* decode content-location */
-char *camel_header_location_decode (const char *in);
+char *header_location_decode(const char *in);
 
 /* decode the mime-type header */
-void camel_header_mime_decode (const char *in, int *maj, int *min);
+void header_mime_decode(const char *in, int *maj, int *min);
 
 /* do incremental base64/quoted-printable (de/en)coding */
-size_t base64_decode_step (unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save);
+size_t base64_decode_step(unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save);
 
-size_t base64_encode_step (unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save);
-size_t base64_encode_close (unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save);
+size_t base64_encode_step(unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save);
+size_t base64_encode_close(unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save);
 
 size_t uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *state, guint32 *save);
 
@@ -228,10 +228,10 @@ size_t uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigne
 size_t uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state,
                       guint32 *save);
 
-size_t quoted_decode_step (unsigned char *in, size_t len, unsigned char *out, int *savestate, int *saveme);
+size_t quoted_decode_step(unsigned char *in, size_t len, unsigned char *out, int *savestate, int *saveme);
 
-size_t quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int *state, int *save);
-size_t quoted_encode_close (unsigned char *in, size_t len, unsigned char *out, int *state, int *save);
+size_t quoted_encode_step(unsigned char *in, size_t len, unsigned char *out, int *state, int *save);
+size_t quoted_encode_close(unsigned char *in, size_t len, unsigned char *out, int *state, int *save);
 
 char *base64_encode_simple (const char *data, size_t len);
 size_t base64_decode_simple (char *data, size_t len);
index 7080719..b5a287c 100644 (file)
@@ -402,7 +402,7 @@ camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, Came
 /* write the headers back out again, but not he Content-Length header, because we dont
    want        to maintain it! */
 static int
-solaris_header_write(int fd, struct _camel_header_raw *header)
+solaris_header_write(int fd, struct _header_raw *header)
 {
         struct iovec iv[4];
         int outlen = 0, len;
@@ -473,10 +473,10 @@ camel_movemail_solaris (int oldsfd, int dfd, CamelException *ex)
 
        ffrom = camel_mime_filter_from_new();
 
-       while (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_FROM) {
+       while (camel_mime_parser_step(mp, &buffer, &len) == HSCAN_FROM) {
                g_assert(camel_mime_parser_from_line(mp));
                from = g_strdup(camel_mime_parser_from_line(mp));
-               if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_FROM_END) {
+               if (camel_mime_parser_step(mp, &buffer, &len) != HSCAN_FROM_END) {
                        const char *cl;
                        int length;
                        int start, body;
index 90866a9..d44d712 100644 (file)
@@ -107,7 +107,7 @@ set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type
        if (mime_type) {
                const char *protocol;
                
-               protocol = camel_content_type_param (mime_type, "protocol");
+               protocol = header_content_type_param (mime_type, "protocol");
                g_free (mpe->protocol);
                mpe->protocol = g_strdup (protocol);
        }
@@ -215,10 +215,10 @@ camel_multipart_encrypted_encrypt (CamelMultipartEncrypted *mpe, CamelMimePart *
        mpe->decrypted = content;
        
        /* set the content-type params for this multipart/encrypted part */
-       mime_type = camel_content_type_new ("multipart", "encrypted");
-       camel_content_type_set_param (mime_type, "protocol", cipher->encrypt_protocol);
+       mime_type = header_content_type_new ("multipart", "encrypted");
+       header_content_type_set_param (mime_type, "protocol", cipher->encrypt_protocol);
        camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (mpe), mime_type);
-       camel_content_type_unref (mime_type);
+       header_content_type_unref (mime_type);
        camel_multipart_set_boundary ((CamelMultipart *) mpe, NULL);
        
        return 0;
@@ -282,7 +282,7 @@ camel_multipart_encrypted_decrypt (CamelMultipartEncrypted *mpe,
        /* get the encrypted part (second part) */
        encrypted_part = camel_multipart_get_part (CAMEL_MULTIPART (mpe), CAMEL_MULTIPART_ENCRYPTED_CONTENT);
        mime_type = camel_mime_part_get_content_type (encrypted_part);
-       if (!camel_content_type_is (mime_type, "application", "octet-stream")) {
+       if (!header_content_type_is (mime_type, "application", "octet-stream")) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Failed to decrypt MIME part: invalid structure"));
                return NULL;
index 63c48a5..5b776d7 100644 (file)
@@ -159,7 +159,7 @@ camel_multipart_signed_get_type (void)
  * set the mime_type appropriately to match the data uses, so
  * that the multiple parts my be extracted.
  *
- * Use construct_from_parser.  The parser MUST be in the CAMEL_MIME_PARSER_STATE_HEADER
+ * Use construct_from_parser.  The parser MUST be in the HSCAN_HEADER
  * state, and the current content_type MUST be "multipart/signed" with
  * the appropriate boundary and it SHOULD include the appropriate protocol
  * and hash specifiers.
@@ -279,11 +279,11 @@ set_mime_type_field(CamelDataWrapper *data_wrapper, CamelContentType *mime_type)
        if (mime_type) {
                const char *micalg, *protocol;
 
-               protocol = camel_content_type_param(mime_type, "protocol");
+               protocol = header_content_type_param(mime_type, "protocol");
                g_free(mps->protocol);
                mps->protocol = g_strdup(protocol);
 
-               micalg = camel_content_type_param(mime_type, "micalg");
+               micalg = header_content_type_param(mime_type, "micalg");
                g_free(mps->micalg);
                mps->micalg = g_strdup(micalg);
        }
@@ -432,7 +432,7 @@ static int
 signed_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
 {
        int err;
-       CamelContentType *content_type;
+       struct _header_content_type *content_type;
        CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
        char *buf;
        size_t len;
@@ -440,14 +440,14 @@ signed_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser
 
        /* we *must not* be in multipart state, otherwise the mime parser will
           parse the headers which is a no no @#$@# stupid multipart/signed spec */
-       g_assert(camel_mime_parser_state(mp) == CAMEL_MIME_PARSER_STATE_HEADER);
+       g_assert(camel_mime_parser_state(mp) == HSCAN_HEADER);
 
        /* All we do is copy it to a memstream */
        content_type = camel_mime_parser_content_type(mp);
-       camel_multipart_set_boundary(multipart, camel_content_type_param(content_type, "boundary"));
+       camel_multipart_set_boundary(multipart, header_content_type_param(content_type, "boundary"));
 
        mem = camel_stream_mem_new();
-       while (camel_mime_parser_step(mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_BODY_END)
+       while (camel_mime_parser_step(mp, &buf, &len) != HSCAN_BODY_END)
                camel_stream_write(mem, buf, len);
 
        set_stream(mps, mem);
@@ -646,11 +646,11 @@ camel_multipart_signed_sign(CamelMultipartSigned *mps, CamelCipherContext *conte
        camel_mime_part_set_description(signature, _("This is a digitally signed message part"));
 
        /* setup our mime type and boundary */
-       mime_type = camel_content_type_new("multipart", "signed");
-       camel_content_type_set_param(mime_type, "micalg", camel_cipher_hash_to_id(context, hash));
-       camel_content_type_set_param(mime_type, "protocol", context->sign_protocol);
+       mime_type = header_content_type_new("multipart", "signed");
+       header_content_type_set_param(mime_type, "micalg", camel_cipher_hash_to_id(context, hash));
+       header_content_type_set_param(mime_type, "protocol", context->sign_protocol);
        camel_data_wrapper_set_mime_type_field(CAMEL_DATA_WRAPPER (mps), mime_type);
-       camel_content_type_unref(mime_type);
+       header_content_type_unref(mime_type);
        camel_multipart_set_boundary((CamelMultipart *)mps, NULL);
 
        /* just keep the whole raw content.  We dont *really* need to do this because
index 1ec7711..0d5148e 100644 (file)
@@ -374,7 +374,7 @@ set_boundary (CamelMultipart *multipart, const char *boundary)
                boundary = bbuf;
        }
 
-       camel_content_type_set_param (cdw->mime_type, "boundary", boundary);
+       header_content_type_set_param (cdw->mime_type, "boundary", boundary);
 }
 
 /**
@@ -402,7 +402,7 @@ get_boundary (CamelMultipart *multipart)
        CamelDataWrapper *cdw = CAMEL_DATA_WRAPPER (multipart);
 
        g_return_val_if_fail (cdw->mime_type != NULL, NULL);
-       return camel_content_type_param (cdw->mime_type, "boundary");
+       return header_content_type_param (cdw->mime_type, "boundary");
 }
 
 /**
@@ -546,21 +546,21 @@ static int
 construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
 {
        int err;
-       CamelContentType *content_type;
+       struct _header_content_type *content_type;
        CamelMimePart *bodypart;
        char *buf;
        size_t len;
        
-       g_assert(camel_mime_parser_state(mp) == CAMEL_MIME_PARSER_STATE_MULTIPART);
+       g_assert(camel_mime_parser_state(mp) == HSCAN_MULTIPART);
        
        /* FIXME: we should use a came-mime-mutlipart, not jsut a camel-multipart, but who cares */
        d(printf("Creating multi-part\n"));
                
        content_type = camel_mime_parser_content_type(mp);
        camel_multipart_set_boundary(multipart,
-                                    camel_content_type_param(content_type, "boundary"));
+                                    header_content_type_param(content_type, "boundary"));
        
-       while (camel_mime_parser_step(mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
+       while (camel_mime_parser_step(mp, &buf, &len) != HSCAN_MULTIPART_END) {
                camel_mime_parser_unstep(mp);
                bodypart = camel_mime_part_new();
                camel_mime_part_construct_from_parser(bodypart, mp);
index 2ba908b..7cadbd5 100644 (file)
@@ -408,7 +408,7 @@ camel_search_header_match (const char *value, const char *match, camel_search_ma
        
        switch(type) {
        case CAMEL_SEARCH_TYPE_ENCODED:
-               v = camel_header_decode_string(value, default_charset); /* FIXME: Find header charset */
+               v = header_decode_string(value, default_charset); /* FIXME: Find header charset */
                truth = header_match(v, match, how);
                g_free(v);
                break;
@@ -449,8 +449,8 @@ camel_search_header_match (const char *value, const char *match, camel_search_ma
 
                for (i=0; !truth && camel_internet_address_get(cia, i, &name, &addr);i++)
                        truth = (name && header_match(name, match, how)) || (addr && header_match(addr, match, how));
-               
-               camel_object_unref (cia);
+
+               camel_object_unref((CamelObject *)cia);
                break;
        }
 
@@ -482,14 +482,14 @@ camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern)
        } else if (CAMEL_IS_MIME_MESSAGE (containee)) {
                /* for messages we only look at its contents */
                truth = camel_search_message_body_contains ((CamelDataWrapper *)containee, pattern);
-       } else if (camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
+       } else if (header_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
                /* for all other text parts, we look inside, otherwise we dont care */
                CamelStreamMem *mem = (CamelStreamMem *)camel_stream_mem_new ();
                
                camel_data_wrapper_write_to_stream (containee, CAMEL_STREAM (mem));
                camel_stream_write (CAMEL_STREAM (mem), "", 1);
                truth = regexec (pattern, mem->buffer->data, 0, NULL, 0) == 0;
-               camel_object_unref (mem);
+               camel_object_unref (CAMEL_OBJECT (mem));
        }
        
        return truth;
index 8e83f7a..7cc30b6 100644 (file)
@@ -52,7 +52,7 @@ int camel_search_build_match_regex(regex_t *pattern, camel_search_flags_t type,
 gboolean camel_search_message_body_contains(CamelDataWrapper *object, regex_t *pattern);
 
 gboolean camel_search_header_match(const char *value, const char *match, camel_search_match_t how, camel_search_t type, const char *default_charset);
-gboolean camel_search_camel_header_soundex(const char *header, const char *match);
+gboolean camel_search_header_soundex(const char *header, const char *match);
 
 /* TODO: replace with a real search function */
 const char *camel_ustrstrcase(const char *haystack, const char *needle);
index 8345bbf..20790cd 100644 (file)
 #ifdef __cplusplus
 extern "C" {
 #pragma }
-#endif /* __cplusplus */
+#endif /* __cplusplus }*/
 
 typedef struct _CamelAddress CamelAddress;
+typedef struct _header_content_type CamelContentType;
 typedef struct _CamelDigestFolder CamelDigestFolder;
 typedef struct _CamelDigestStore CamelDigestStore;
 typedef struct _CamelDiscoDiary CamelDiscoDiary;
index 4db0c7a..be3e29f 100644 (file)
@@ -1673,7 +1673,7 @@ content_info_get_part_spec (CamelMessageContentInfo *ci)
                CamelMessageContentInfo *child;
                
                /* FIXME: is this only supposed to apply if 'node' is a multipart? */
-               if (node->parent->parent && camel_content_type_is (node->parent->type, "message", "*")) {
+               if (node->parent->parent && header_content_type_is (node->parent->type, "message", "*")) {
                        node = node->parent;
                        continue;
                }
@@ -1721,7 +1721,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
        part_spec = content_info_get_part_spec (ci);
        
        /* There are three cases: multipart/signed, multipart, message/rfc822, and "other" */
-       if (camel_content_type_is (ci->type, "multipart", "signed")) {
+       if (header_content_type_is (ci->type, "multipart", "signed")) {
                CamelMultipartSigned *body_mp;
                char *spec;
                int ret;
@@ -1749,12 +1749,12 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
                }
                
                return (CamelDataWrapper *) body_mp;
-       } else if (camel_content_type_is (ci->type, "multipart", "*")) {
+       } else if (header_content_type_is (ci->type, "multipart", "*")) {
                CamelMultipart *body_mp;
                char *child_spec;
                int speclen, num;
                
-               if (camel_content_type_is (ci->type, "multipart", "encrypted"))
+               if (header_content_type_is (ci->type, "multipart", "encrypted"))
                        body_mp = (CamelMultipart *) camel_multipart_encrypted_new ();
                else
                        body_mp = camel_multipart_new ();
@@ -1808,7 +1808,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
                g_free (child_spec);
                
                return (CamelDataWrapper *) body_mp;
-       } else if (camel_content_type_is (ci->type, "message", "rfc822")) {
+       } else if (header_content_type_is (ci->type, "message", "rfc822")) {
                content = (CamelDataWrapper *) get_message (imap_folder, uid, part_spec, ci->childs, ex);
                g_free (part_spec);
                return content;
index 32530d3..d08fd9b 100644 (file)
@@ -1,4 +1,3 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2002 Ximian Inc.
  *
index 0011520..26a0857 100644 (file)
@@ -751,7 +751,7 @@ parse_params (const char **parms_p, CamelContentType *type)
                value = imap_parse_nstring (&parms, &len);
                
                if (name && value)
-                       camel_content_type_set_param (type, name, value);
+                       header_content_type_set_param (type, name, value);
                g_free (name);
                g_free (value);
                
@@ -814,11 +814,11 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                        inptr += 3;
                }
                
-               ctype = camel_content_type_new ("multipart", subtype ? subtype : "mixed");
+               ctype = header_content_type_new ("multipart", subtype ? subtype : "mixed");
                g_free (subtype);
                
                if (*inptr++ != ')') {
-                       camel_content_type_unref (ctype);
+                       header_content_type_unref (ctype);
                        return NULL;
                }
                
@@ -855,7 +855,7 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                
                camel_strdown (type);
                camel_strdown (subtype);
-               ctype = camel_content_type_new (type, subtype);
+               ctype = header_content_type_new (type, subtype);
                g_free (subtype);
                g_free (type);
                
@@ -906,7 +906,7 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                size = strtoul ((const char *) inptr, &p, 10);
                inptr = (const unsigned char *) p;
                
-               if (camel_content_type_is (ctype, "message", "rfc822")) {
+               if (header_content_type_is (ctype, "message", "rfc822")) {
                        /* body_type_msg */
                        if (*inptr++ != ' ')
                                goto exception;
@@ -928,7 +928,7 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                        /* lines */
                        strtoul ((const char *) inptr, &p, 10);
                        inptr = (const unsigned char *) p;
-               } else if (camel_content_type_is (ctype, "text", "*")) {
+               } else if (header_content_type_is (ctype, "text", "*")) {
                        if (*inptr++ != ' ')
                                goto exception;
                        
@@ -956,7 +956,7 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
        
  exception:
        
-       camel_content_type_unref (ctype);
+       header_content_type_unref (ctype);
        g_free (id);
        g_free (description);
        g_free (encoding);
index dcbc362..57935a8 100644 (file)
@@ -318,7 +318,7 @@ media_text      ::= <"> "TEXT" <"> SPACE media_subtype
 
 /*
 struct _body_fields {
-       CamelContentType *ct;
+       struct _header_content_type *ct;
        char *msgid, *desc;
        CamelMimePartEncodingType encoding;
        guint32 size;
@@ -337,7 +337,7 @@ imap_free_body(struct _CamelMessageContentInfo *cinfo)
        }
        
        if (cinfo->type)
-               camel_content_type_unref(cinfo->type);
+               header_content_type_unref(cinfo->type);
        g_free(cinfo->id);
        g_free(cinfo->description);
        g_free(cinfo->encoding);
@@ -345,7 +345,7 @@ imap_free_body(struct _CamelMessageContentInfo *cinfo)
 }
 
 void
-imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist)
+imap_parse_param_list(CamelIMAPPStream *is, struct _header_param **plist)
 {
        int tok, len;
        unsigned char *token, *param;
@@ -365,17 +365,17 @@ imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist)
                        param = alloca(strlen(token)+1);
                        strcpy(param, token);
                        camel_imapp_stream_astring(is, &token);
-                       camel_header_set_param(plist, param, token);
+                       header_set_param(plist, param, token);
                }
        } /* else check nil?  no need */
 }
 
-struct _CamelContentDisposition *
+struct _CamelMimeDisposition *
 imap_parse_ext_optional(CamelIMAPPStream *is)
 {
        int tok, len;
        unsigned char *token;
-       struct _CamelContentDisposition * volatile dinfo = NULL;
+       struct _CamelMimeDisposition * volatile dinfo = NULL;
 
        /* this parses both extension types, from the body_fld_dsp onwards */
        /* although the grammars are different, they can be parsed the same way */
@@ -448,7 +448,7 @@ imap_parse_ext_optional(CamelIMAPPStream *is)
                }
        } CAMEL_CATCH(ex) {
                if (dinfo)
-                       camel_content_disposition_unref(dinfo);
+                       header_disposition_unref(dinfo);
                camel_exception_throw_ex(ex);
        } CAMEL_DONE;
 
@@ -475,7 +475,7 @@ imap_parse_body_fields(CamelIMAPPStream *is)
                type = alloca(strlen(token)+1);
                strcpy(type, token);
                camel_imapp_stream_astring(is, &token);
-               cinfo->type = camel_content_type_new(type, token);
+               cinfo->type = header_content_type_new(type, token);
                imap_parse_param_list(is, &cinfo->type->params);
        
                /* body_fld_id     ::= nstring */
@@ -501,13 +501,13 @@ imap_parse_body_fields(CamelIMAPPStream *is)
        return cinfo;
 }
 
-struct _camel_header_address *
+struct _header_address *
 imap_parse_address_list(CamelIMAPPStream *is)
 /* throws PARSE,IO exception */
 {
        int tok, len;
        unsigned char *token, *host, *mbox;
-       struct _camel_header_address *list = NULL;
+       struct _header_address *list = NULL;
 
        /* "(" 1*address ")" / nil */
 
@@ -515,7 +515,7 @@ imap_parse_address_list(CamelIMAPPStream *is)
                tok = camel_imapp_stream_token(is, &token, &len);
                if (tok == '(') {
                        while (1) {
-                               struct _camel_header_address *addr, *group = NULL;
+                               struct _header_address *addr, *group = NULL;
 
                                /* address         ::= "(" addr_name SPACE addr_adl SPACE addr_mailbox
                                   SPACE addr_host ")" */
@@ -525,7 +525,7 @@ imap_parse_address_list(CamelIMAPPStream *is)
                                if (tok != '(')
                                        camel_exception_throw(1, "missing '(' for address");
 
-                               addr = camel_header_address_new();
+                               addr = header_address_new();
                                addr->type = HEADER_ADDRESS_NAME;
                                tok = camel_imapp_stream_nstring(is, &token);
                                addr->name = g_strdup(token);
@@ -551,7 +551,7 @@ imap_parse_address_list(CamelIMAPPStream *is)
                                                g_free(addr->name);
                                                addr->name = mbox;
                                                addr->type = HEADER_ADDRESS_GROUP;
-                                               camel_header_address_list_append(&list, addr);
+                                               header_address_list_append(&list, addr);
                                                group = addr;
                                        }
                                } else {
@@ -559,9 +559,9 @@ imap_parse_address_list(CamelIMAPPStream *is)
                                        g_free(mbox);
                                        d(printf("adding address '%s'\n", addr->v.addr));
                                        if (group != NULL)
-                                               camel_header_address_add_member(group, addr);
+                                               header_address_add_member(group, addr);
                                        else
-                                               camel_header_address_list_append(&list, addr);
+                                               header_address_list_append(&list, addr);
                                }
                                do {
                                        tok = camel_imapp_stream_token(is, &token, &len);
@@ -571,7 +571,7 @@ imap_parse_address_list(CamelIMAPPStream *is)
                        d(printf("empty, nil '%s'\n", token));
                }
        } CAMEL_CATCH(ex) {
-               camel_header_address_list_clear(&list);
+               header_address_list_clear(&list);
                camel_exception_throw_ex(ex);
        } CAMEL_DONE;
 
@@ -583,7 +583,7 @@ imap_parse_envelope(CamelIMAPPStream *is)
 {
        int tok, len;
        unsigned char *token;
-       struct _camel_header_address *addr, *addr_from;
+       struct _header_address *addr, *addr_from;
        char *addrstr;
        struct _CamelMessageInfo *minfo;
 
@@ -603,7 +603,7 @@ imap_parse_envelope(CamelIMAPPStream *is)
 
                /* env_date        ::= nstring */
                camel_imapp_stream_nstring(is, &token);
-               minfo->date_sent = camel_header_decode_date(token, NULL);
+               minfo->date_sent = header_decode_date(token, NULL);
 
                /* env_subject     ::= nstring */
                tok = camel_imapp_stream_nstring(is, &token);
@@ -618,10 +618,10 @@ imap_parse_envelope(CamelIMAPPStream *is)
                /* env_sender      ::= "(" 1*address ")" / nil */
                addr = imap_parse_address_list(is);
                if (addr_from) {
-                       camel_header_address_list_clear(&addr);
+                       header_address_list_clear(&addr);
 #if 0
                        if (addr)
-                               camel_header_address_list_append_list(&addr_from, &addr);
+                               header_address_list_append_list(&addr_from, &addr);
 #endif
                } else {
                        if (addr)
@@ -629,38 +629,38 @@ imap_parse_envelope(CamelIMAPPStream *is)
                }
 
                if (addr_from) {
-                       addrstr = camel_header_address_list_format(addr_from);
+                       addrstr = header_address_list_format(addr_from);
                        camel_message_info_set_from(minfo, addrstr);
-                       camel_header_address_list_clear(&addr_from);
+                       header_address_list_clear(&addr_from);
                }
 
                /* we dont keep reply_to */
 
                /* env_reply_to    ::= "(" 1*address ")" / nil */
                addr = imap_parse_address_list(is);
-               camel_header_address_list_clear(&addr);
+               header_address_list_clear(&addr);
 
                /* env_to          ::= "(" 1*address ")" / nil */
                addr = imap_parse_address_list(is);
                if (addr) {
-                       addrstr = camel_header_address_list_format(addr);
+                       addrstr = header_address_list_format(addr);
                        camel_message_info_set_to(minfo, addrstr);
-                       camel_header_address_list_clear(&addr);
+                       header_address_list_clear(&addr);
                }
 
                /* env_cc          ::= "(" 1*address ")" / nil */
                addr = imap_parse_address_list(is);
                if (addr) {
-                       addrstr = camel_header_address_list_format(addr);
+                       addrstr = header_address_list_format(addr);
                        camel_message_info_set_cc(minfo, addrstr);
-                       camel_header_address_list_clear(&addr);
+                       header_address_list_clear(&addr);
                }
 
                /* we dont keep bcc either */
 
                /* env_bcc         ::= "(" 1*address ")" / nil */
                addr = imap_parse_address_list(is);
-               camel_header_address_list_clear(&addr);
+               header_address_list_clear(&addr);
 
                /* FIXME: need to put in-reply-to into references hash list */
 
@@ -690,7 +690,7 @@ imap_parse_body(CamelIMAPPStream *is)
        unsigned char *token;
        struct _CamelMessageContentInfo * volatile cinfo = NULL;
        struct _CamelMessageContentInfo *subinfo, *last;
-       struct _CamelContentDisposition * volatile dinfo = NULL;
+       struct _CamelMimeDisposition * volatile dinfo = NULL;
        struct _CamelMessageInfo * volatile minfo = NULL;
 
        /* body            ::= "(" body_type_1part / body_type_mpart ")" */
@@ -723,7 +723,7 @@ imap_parse_body(CamelIMAPPStream *is)
                        d(printf("media_subtype\n"));
 
                        camel_imapp_stream_astring(is, &token);
-                       cinfo->type = camel_content_type_new("multipart", token);
+                       cinfo->type = header_content_type_new("multipart", token);
 
                        /* body_ext_mpart  ::= body_fld_param
                           [SPACE body_fld_dsp SPACE body_fld_lang
@@ -822,7 +822,7 @@ imap_parse_body(CamelIMAPPStream *is)
                if (cinfo)
                        imap_free_body(cinfo);
                if (dinfo)
-                       camel_content_disposition_unref(dinfo);
+                       header_disposition_unref(dinfo);
                if (minfo)
                        camel_message_info_free(minfo);
                camel_exception_throw_ex(ex);
@@ -830,7 +830,7 @@ imap_parse_body(CamelIMAPPStream *is)
 
        /* FIXME: do something with the disposition, currently we have no way to pass it out? */
        if (dinfo)
-               camel_content_disposition_unref(dinfo);
+               header_disposition_unref(dinfo);
 
        return cinfo;
 }
index e0974bd..76ec178 100644 (file)
@@ -48,10 +48,10 @@ void imap_parse_flags(CamelIMAPPStream *stream, guint32 *flagsp) /* IO,PARSE */;
 void imap_write_flags(CamelStream *stream, guint32 flags) /* IO */;
 
 /* ********************************************************************** */
-void imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist) /* IO,PARSE */;
-struct _CamelContentDisposition *imap_parse_ext_optional(CamelIMAPPStream *is) /* IO,PARSE */;
+void imap_parse_param_list(CamelIMAPPStream *is, struct _header_param **plist) /* IO,PARSE */;
+struct _CamelMimeDisposition *imap_parse_ext_optional(CamelIMAPPStream *is) /* IO,PARSE */;
 struct _CamelMessageContentInfo *imap_parse_body_fields(CamelIMAPPStream *is) /* IO,PARSE */;
-struct _camel_header_address *imap_parse_address_list(CamelIMAPPStream *is) /* IO,PARSE */;
+struct _header_address *imap_parse_address_list(CamelIMAPPStream *is) /* IO,PARSE */;
 struct _CamelMessageInfo *imap_parse_envelope(CamelIMAPPStream *is) /* IO, PARSE */;
 struct _CamelMessageContentInfo *imap_parse_body(CamelIMAPPStream *is) /* IO,PARSE */;
 char *imap_parse_section(CamelIMAPPStream *is) /* IO,PARSE */;
index 42534b3..807b04e 100644 (file)
@@ -41,7 +41,7 @@
 
 #define CAMEL_LOCAL_SUMMARY_VERSION (0x200)
 
-static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_header_raw *);
+static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _header_raw *);
 
 static int local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *mi);
 static char *local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo *mi);
@@ -192,8 +192,8 @@ do_stat_ci(CamelLocalSummary *cls, struct _stat_info *info, CamelMessageContentI
        if (ci->encoding)
                info->citotal += strlen(ci->encoding) + 4;
        if (ci->type) {
-               CamelContentType *ct = ci->type;
-               struct _camel_header_param *param;
+               struct _header_content_type *ct = ci->type;
+               struct _header_param *param;
 
                info->citotal += sizeof(*ct) + 4;
                if (ct->type)
@@ -308,7 +308,7 @@ camel_local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const Cam
  * Return value: -1 on error, otherwise the number of bytes written.
  **/
 int
-camel_local_summary_write_headers(int fd, struct _camel_header_raw *header, const char *xevline, const char *status, const char *xstatus)
+camel_local_summary_write_headers(int fd, struct _header_raw *header, const char *xevline, const char *status, const char *xstatus)
 {
        int outlen = 0, len;
        int newfd;
@@ -463,7 +463,7 @@ static char *
 local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo *mi)
 {
        GString *out = g_string_new("");
-       struct _camel_header_param *params = NULL;
+       struct _header_param *params = NULL;
        GString *val = g_string_new("");
        CamelFlag *flag = mi->user_flags;
        CamelTag *tag = mi->user_tags;
@@ -492,7 +492,7 @@ local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo
                                        g_string_append_c (val, ',');
                                flag = flag->next;
                        }
-                       camel_header_set_param (&params, "flags", val->str);
+                       header_set_param (&params, "flags", val->str);
                        g_string_truncate (val, 0);
                }
                if (tag) {
@@ -504,11 +504,11 @@ local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo
                                        g_string_append_c (val, ',');
                                tag = tag->next;
                        }
-                       camel_header_set_param (&params, "tags", val->str);
+                       header_set_param (&params, "tags", val->str);
                }
                g_string_free (val, TRUE);
-               camel_header_param_list_format_append (out, params);
-               camel_header_param_list_free (params);
+               header_param_list_format_append (out, params);
+               header_param_list_free (params);
        }
        ret = out->str;
        g_string_free (out, FALSE);
@@ -519,13 +519,13 @@ local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo
 static int
 local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *mi)
 {
-       struct _camel_header_param *params, *scan;
+       struct _header_param *params, *scan;
        guint32 uid, flags;
        char *header;
        int i;
 
        /* check for uid/flags */
-       header = camel_header_token_decode(xev);
+       header = header_token_decode(xev);
        if (header && strlen(header) == strlen("00000000-0000")
            && sscanf(header, "%08x-%04x", &uid, &flags) == 2) {
                char uidstr[20];
@@ -546,7 +546,7 @@ local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelM
        /* check for additional data */ 
        header = strchr(xev, ';');
        if (header) {
-               params = camel_header_param_list_decode(header+1);
+               params = header_param_list_decode(header+1);
                scan = params;
                while (scan) {
                        if (!strcasecmp(scan->name, "flags")) {
@@ -572,13 +572,13 @@ local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelM
                        }
                        scan = scan->next;
                }
-               camel_header_param_list_free(params);
+               header_param_list_free(params);
        }
        return 0;
 }
 
 static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
+message_info_new(CamelFolderSummary *s, struct _header_raw *h)
 {
        CamelMessageInfo *mi;
        CamelLocalSummary *cls = (CamelLocalSummary *)s;
@@ -588,7 +588,7 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
                const char *xev;
                int doindex = FALSE;
 
-               xev = camel_header_raw_find(&h, "X-Evolution", NULL);
+               xev = header_raw_find(&h, "X-Evolution", NULL);
                if (xev==NULL || camel_local_summary_decode_x_evolution(cls, xev, mi) == -1) {
                        /* to indicate it has no xev header */
                        mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED | CAMEL_MESSAGE_FOLDER_NOXEV;
index 25d77e6..0995331 100644 (file)
@@ -82,7 +82,7 @@ char *camel_local_summary_encode_x_evolution(CamelLocalSummary *cls, const Camel
 int camel_local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *info);
 
 /* utility functions - write headers to a file with optional X-Evolution header and/or status header */
-int camel_local_summary_write_headers(int fd, struct _camel_header_raw *header, const char *xevline, const char *status, const char *xstatus);
+int camel_local_summary_write_headers(int fd, struct _header_raw *header, const char *xevline, const char *status, const char *xstatus);
 
 #endif /* ! _CAMEL_LOCAL_SUMMARY_H */
 
index 37e1ac2..2075694 100644 (file)
@@ -48,7 +48,7 @@
 #define CAMEL_MAILDIR_SUMMARY_VERSION (0x2000)
 
 static CamelMessageInfo *message_info_load(CamelFolderSummary *s, FILE *in);
-static CamelMessageInfo *message_info_new(CamelFolderSummary *, struct _camel_header_raw *);
+static CamelMessageInfo *message_info_new(CamelFolderSummary *, struct _header_raw *);
 static void message_info_free(CamelFolderSummary *, CamelMessageInfo *mi);
 
 static int maildir_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex);
@@ -256,7 +256,7 @@ static CamelMessageInfo *maildir_summary_add(CamelLocalSummary *cls, CamelMimeMe
        return mi;
 }
 
-static CamelMessageInfo *message_info_new(CamelFolderSummary * s, struct _camel_header_raw *h)
+static CamelMessageInfo *message_info_new(CamelFolderSummary * s, struct _header_raw *h)
 {
        CamelMessageInfo *mi, *info;
        CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
index 01c3d78..942610d 100644 (file)
@@ -376,7 +376,7 @@ retry:
        camel_mime_parser_scan_from(parser, TRUE);
 
        camel_mime_parser_seek(parser, frompos, SEEK_SET);
-       if (camel_mime_parser_step(parser, NULL, NULL) != CAMEL_MIME_PARSER_STATE_FROM
+       if (camel_mime_parser_step(parser, NULL, NULL) != HSCAN_FROM
            || camel_mime_parser_tell_start_from(parser) != frompos) {
 
                g_warning("Summary doesn't match the folder contents!  eek!\n"
index 4018fc9..88d2a3e 100644 (file)
@@ -49,7 +49,7 @@
 static int summary_header_load (CamelFolderSummary *, FILE *);
 static int summary_header_save (CamelFolderSummary *, FILE *);
 
-static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_header_raw *);
+static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _header_raw *);
 static CamelMessageInfo * message_info_new_from_parser (CamelFolderSummary *, CamelMimeParser *);
 static CamelMessageInfo * message_info_load (CamelFolderSummary *, FILE *);
 static int               message_info_save (CamelFolderSummary *, FILE *, CamelMessageInfo *);
@@ -187,7 +187,7 @@ summary_header_save(CamelFolderSummary *s, FILE *out)
 }
 
 static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
+message_info_new(CamelFolderSummary *s, struct _header_raw *h)
 {
        CamelMessageInfo *mi;
        CamelMboxSummary *mbs = (CamelMboxSummary *)s;
@@ -204,16 +204,16 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
 
                if (mbs->xstatus) {
                        /* check for existance of status & x-status headers */
-                       status = camel_header_raw_find(&h, "Status", NULL);
+                       status = header_raw_find(&h, "Status", NULL);
                        if (status)
                                flags = decode_status(status);
-                       xstatus = camel_header_raw_find(&h, "X-Status", NULL);
+                       xstatus = header_raw_find(&h, "X-Status", NULL);
                        if (xstatus)
                                flags |= decode_status(xstatus);
                }
 #endif
                /* if we have an xev header, use it, else assign a new one */
-               xev = camel_header_raw_find(&h, "X-Evolution", NULL);
+               xev = header_raw_find(&h, "X-Evolution", NULL);
                if (xev != NULL
                    && camel_local_summary_decode_x_evolution((CamelLocalSummary *)s, xev, mi) == 0) {
                        uid = camel_message_info_uid(mi);
@@ -355,7 +355,7 @@ summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *chan
        camel_mime_parser_seek(mp, offset, SEEK_SET);
 
        if (offset > 0) {
-               if (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM
+               if (camel_mime_parser_step(mp, NULL, NULL) == HSCAN_FROM
                    && camel_mime_parser_tell_start_from(mp) == offset) {
                        camel_mime_parser_unstep(mp);
                } else {
@@ -380,7 +380,7 @@ summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *chan
        }
        mbs->changes = changeinfo;
 
-       while (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) {
+       while (camel_mime_parser_step(mp, NULL, NULL) == HSCAN_FROM) {
                CamelMessageInfo *info;
                off_t pc = camel_mime_parser_tell_start_from (mp) + 1;
                
@@ -394,7 +394,7 @@ summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *chan
                        break;
                }
 
-               g_assert(camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM_END);
+               g_assert(camel_mime_parser_step(mp, NULL, NULL) == HSCAN_FROM_END);
        }
 
        camel_object_unref(CAMEL_OBJECT (mp));
@@ -638,7 +638,7 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
 
                camel_mime_parser_seek(mp, info->frompos, SEEK_SET);
 
-               if (camel_mime_parser_step(mp, 0, 0) != CAMEL_MIME_PARSER_STATE_FROM) {
+               if (camel_mime_parser_step(mp, 0, 0) != HSCAN_FROM) {
                        g_warning("Expected a From line here, didn't get it");
                        camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                             _("Summary and folder mismatch, even after a sync"));
@@ -653,7 +653,7 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
                        goto error;
                }
 
-               if (camel_mime_parser_step(mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM_END) {
+               if (camel_mime_parser_step(mp, 0, 0) == HSCAN_FROM_END) {
                        g_warning("camel_mime_parser_step failed (2)");
                        goto error;
                }
@@ -667,7 +667,7 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
                /* SIGH: encode_param_list is about the only function which folds headers by itself.
                   This should be fixed somehow differently (either parser doesn't fold headers,
                   or param_list doesn't, or something */
-               xevtmp = camel_header_unfold(xevnew);
+               xevtmp = header_unfold(xevnew);
                /* the raw header contains a leading ' ', so (dis)count that too */
                if (strlen(xev)-1 != strlen(xevtmp)) {
                        printf ("strlen(xev)-1 = %d; strlen(xevtmp) = %d\n", strlen(xev)-1, strlen(xevtmp));
@@ -839,7 +839,7 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
                        camel_mime_parser_seek(mp, info->frompos, SEEK_SET);
                }
 
-               if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_FROM) {
+               if (camel_mime_parser_step(mp, &buffer, &len) != HSCAN_FROM) {
                        g_warning("Expected a From line here, didn't get it");
                        camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                             _("Summary and folder mismatch, even after a sync"));
@@ -885,7 +885,7 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
                if (info && info->info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV | CAMEL_MESSAGE_FOLDER_FLAGGED)) {
                        d(printf("Updating header for %s flags = %08x\n", camel_message_info_uid(info), info->info.flags));
 
-                       if (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_FROM_END) {
+                       if (camel_mime_parser_step(mp, &buffer, &len) == HSCAN_FROM_END) {
                                g_warning("camel_mime_parser_step failed (2)");
                                goto error;
                        }
@@ -918,7 +918,7 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
                camel_mime_parser_drop_step(mp);
                if (info) {
                        d(printf("looking for message content to copy across from %d\n", (int)camel_mime_parser_tell(mp)));
-                       while (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_PRE_FROM) {
+                       while (camel_mime_parser_step(mp, &buffer, &len) == HSCAN_PRE_FROM) {
                                /*d(printf("copying mbox contents to tmp: '%.*s'\n", len, buffer));*/
                                if (write(fdout, buffer, len) != len) {
                                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
index 5dd26ac..25794fa 100644 (file)
@@ -314,7 +314,7 @@ mh_summary_sync_message(CamelLocalSummary *cls, CamelMessageInfo *info, CamelExc
 
        mp = camel_mime_parser_new();
        camel_mime_parser_init_with_fd(mp, fd);
-       if (camel_mime_parser_step(mp, 0, 0) != CAMEL_MIME_PARSER_STATE_EOF) {
+       if (camel_mime_parser_step(mp, 0, 0) != HSCAN_EOF) {
                xev = camel_mime_parser_header(mp, "X-Evolution", &xevoffset);
                d(printf("xev = '%s'\n", xev));
                xevnew = camel_local_summary_encode_x_evolution(cls, info);
index b72aeda..7813243 100644 (file)
@@ -63,7 +63,7 @@ char *camel_spool_summary_encode_x_evolution(CamelSpoolSummary *cls, const Camel
 int camel_spool_summary_decode_x_evolution(CamelSpoolSummary *cls, const char *xev, CamelMessageInfo *info);
 
 /* utility functions - write headers to a file with optional X-Evolution header */
-int camel_spool_summary_write_headers(int fd, struct _camel_header_raw *header, char *xevline);
+int camel_spool_summary_write_headers(int fd, struct _header_raw *header, char *xevline);
 
 #endif /* ! _CAMEL_SPOOL_SUMMARY_H */
 
index 2a9669d..9f6ff5f 100644 (file)
@@ -77,7 +77,7 @@ struct _CamelNNTPSummaryPrivate {
 
 #define _PRIVATE(o) (((CamelNNTPSummary *)(o))->priv)
 
-static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_header_raw *);
+static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _header_raw *);
 static int summary_header_load(CamelFolderSummary *, FILE *);
 static int summary_header_save(CamelFolderSummary *, FILE *);
 
@@ -165,7 +165,7 @@ camel_nntp_summary_new(CamelNNTPFolder *folder)
 }
 
 static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
+message_info_new(CamelFolderSummary *s, struct _header_raw *h)
 {
        CamelMessageInfo *mi;
        CamelNNTPSummary *cns = (CamelNNTPSummary *)s;
@@ -186,8 +186,7 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
        return mi;
 }
 
-static int
-summary_header_load(CamelFolderSummary *s, FILE *in)
+static int summary_header_load(CamelFolderSummary *s, FILE *in)
 {
        CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(s);
 
@@ -199,8 +198,7 @@ summary_header_load(CamelFolderSummary *s, FILE *in)
        return 0;
 }
 
-static int
-summary_header_save(CamelFolderSummary *s, FILE *out)
+static int summary_header_save(CamelFolderSummary *s, FILE *out)
 {
        CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(s);
 
@@ -213,8 +211,7 @@ summary_header_save(CamelFolderSummary *s, FILE *out)
 }
 
 /* Assumes we have the stream */
-int
-camel_nntp_summary_check(CamelNNTPSummary *cns, CamelFolderChangeInfo *changes, CamelException *ex)
+int camel_nntp_summary_check(CamelNNTPSummary *cns, CamelFolderChangeInfo *changes, CamelException *ex)
 {
        CamelNNTPStore *store;
        CamelFolder *folder;
@@ -393,7 +390,7 @@ add_range_xover(CamelNNTPSummary *cns, unsigned int high, unsigned int low, Came
        CamelFolder *folder;
        CamelFolderSummary *s;
        CamelMessageInfo *mi;
-       struct _camel_header_raw *headers = NULL;
+       struct _header_raw *headers = NULL;
        char *line, *tab;
        int len, ret;
        unsigned int n, count, total, size;
@@ -436,7 +433,7 @@ add_range_xover(CamelNNTPSummary *cns, unsigned int high, unsigned int low, Came
                        if (xover->name) {
                                line += xover->skip;
                                if (line < tab) {
-                                       camel_header_raw_append(&headers, xover->name, line, -1);
+                                       header_raw_append(&headers, xover->name, line, -1);
                                        switch(xover->type) {
                                        case XOVER_STRING:
                                                break;
@@ -471,7 +468,7 @@ add_range_xover(CamelNNTPSummary *cns, unsigned int high, unsigned int low, Came
                        cns->priv->uid = NULL;
                }
 
-               camel_header_raw_clear(&headers);
+               header_raw_clear(&headers);
 
                now = time(0);
                if (last + 2 < now) {
@@ -536,7 +533,7 @@ add_range_head(CamelNNTPSummary *cns, unsigned int high, unsigned int low, Camel
                                if (camel_mime_parser_init_with_stream(mp, (CamelStream *)store->stream) == -1)
                                        goto error;
                                mi = camel_folder_summary_add_from_parser(s, mp);
-                               while (camel_mime_parser_step(mp, NULL, NULL) != CAMEL_MIME_PARSER_STATE_EOF)
+                               while (camel_mime_parser_step(mp, NULL, NULL) != HSCAN_EOF)
                                        ;
                                if (mi == NULL) {
                                        goto error;
index d8000a8..5f26d71 100644 (file)
@@ -94,7 +94,7 @@ get_XOVER_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
                                camel_message_info_set_to(new_info, g_strdup(folder->name));
                                camel_message_info_set_uid(new_info, uid);
 
-                               new_info->date_sent = camel_header_decode_date(date, NULL);
+                               new_info->date_sent = header_decode_date(date, NULL);
 #if 0
                                /* XXX do we need to fill in both dates? */
                                new_info->headers.date_received = g_strdup(date);
@@ -176,8 +176,9 @@ get_HEAD_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
                        }
 
                        /* create a stream from which to parse the headers */
-                       header_stream = camel_stream_mem_new_with_buffer (buf, buf_len,
-                                                                         CAMEL_STREAM_MEM_READ);
+                       header_stream = camel_stream_mem_new_with_buffer(buf,
+                                                                buf_len,
+                                                                CAMEL_STREAM_MEM_READ);
 
                        header_array = get_header_array_from_stream (header_stream);
 
@@ -196,7 +197,7 @@ get_HEAD_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
                                        new_info->message_id = g_strdup(header->value);
                                }
                                else if (!g_strcasecmp(header->name, "Date")) {
-                                       new_info->date_sent = camel_header_decode_date (header->value);
+                                       new_info->date_sent = header_decode_date (header->value);
 #if 0
                                        new_info->date_sent = g_strdup(header->value);
                                        new_info->date_received = g_strdup(header->value);
index 0df4fcf..a0d4ea6 100644 (file)
@@ -145,7 +145,7 @@ cmd_builduid(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
        CamelPOP3FolderInfo *fi = data;
        MD5Context md5;
        unsigned char digest[16];
-       struct _camel_header_raw *h;
+       struct _header_raw *h;
        CamelMimeParser *mp;
 
        /* TODO; somehow work out the limit and use that for proper progress reporting
@@ -156,9 +156,9 @@ cmd_builduid(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
        mp = camel_mime_parser_new();
        camel_mime_parser_init_with_stream(mp, (CamelStream *)stream);
        switch (camel_mime_parser_step(mp, NULL, NULL)) {
-       case CAMEL_MIME_PARSER_STATE_HEADER:
-       case CAMEL_MIME_PARSER_STATE_MESSAGE:
-       case CAMEL_MIME_PARSER_STATE_MULTIPART:
+       case HSCAN_HEADER:
+       case HSCAN_MESSAGE:
+       case HSCAN_MULTIPART:
                h = camel_mime_parser_headers_raw(mp);
                while (h) {
                        if (strcasecmp(h->name, "status") != 0
index fbf6f08..863daf1 100644 (file)
@@ -87,7 +87,7 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
                  CamelAddress *from, CamelAddress *recipients,
                  CamelException *ex)
 {
-       struct _camel_header_raw *header, *savedbcc, *n, *tail;
+       struct _header_raw *header, *savedbcc, *n, *tail;
        const char *from_addr, *addr, **argv;
        int i, len, fd[2], nullfd, wstat;
        CamelStreamFilter *filter;
@@ -122,9 +122,9 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
        
        /* unlink the bcc headers */
        savedbcc = NULL;
-       tail = (struct _camel_header_raw *) &savedbcc;
+       tail = (struct _header_raw *) &savedbcc;
        
-       header = (struct _camel_header_raw *) &CAMEL_MIME_PART (message)->headers;
+       header = (struct _header_raw *) &CAMEL_MIME_PART (message)->headers;
        n = header->next;
        while (n != NULL) {
                if (!strcasecmp (n->name, "Bcc")) {
index 107698c..504cbfa 100644 (file)
@@ -1223,7 +1223,7 @@ static gboolean
 smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelException *ex)
 {
        CamelBestencEncoding enctype = CAMEL_BESTENC_8BIT;
-       struct _camel_header_raw *header, *savedbcc, *n, *tail;
+       struct _header_raw *header, *savedbcc, *n, *tail;
        char *cmdbuf, *respbuf = NULL;
        CamelStreamFilter *filtered_stream;
        CamelMimeFilter *crlffilter;
@@ -1282,9 +1282,9 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
        
        /* unlink the bcc headers */
        savedbcc = NULL;
-       tail = (struct _camel_header_raw *) &savedbcc;
+       tail = (struct _header_raw *) &savedbcc;
        
-       header = (struct _camel_header_raw *) &CAMEL_MIME_PART (message)->headers;
+       header = (struct _header_raw *) &CAMEL_MIME_PART (message)->headers;
        n = header->next;
        while (n != NULL) {
                if (!strcasecmp (n->name, "Bcc")) {