[evolution-patches] Re: [Evolution-hackers] camel namespacing



namespace patches

On Tue, 2003-08-26 at 13:28 -0400, Jeffrey Stedfast wrote:
> here's the sed script used to namespace camel...
> 
> on top of these changes, I also moved 
> "typedef _CamelContentType CamelContentType;" 
> into camel-mime-utils.h
> 
> I have also saved the diffs in case anyone wants to take a look
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com
? ChangeLog.nonximian
? body
? body.c
? body.txt
? camel-namespace.patch
? charset-map.c
? charset-map.diff
? cmsutil.c
? date.patch
? imap
? invalid-content-id.patch
? iso
? iso.c
? namespace.patch
? namespace.sh
? pop3-uidl.patch
? smime
? uid-cache.patch
? providers/imapp/Makefile
? providers/imapp/Makefile.in
? tests/data/camel-mime-tests.tar.gz
? tests/data/messages/+0cqBCNW0M2YtQhngB3.msg
? tests/data/messages/+0dDCa:K0M2YtI:e1E7.msg
? tests/data/messages/+0dYMHpa0M2YtABA8E7.msg
? tests/data/messages/+0eCBvVy0M2YtAoUABO.msg
? tests/data/messages/+0ecpeqa0M2YtR5ylop.msg
? tests/data/messages/+4eAAuwi0M2Yt8fF:1=.msg
? tests/data/messages/+4eCJmyS0M2Yt0JG084.msg
? tests/data/messages/+8c7PkUC0M2YtQRlAJf.msg
? tests/data/messages/+8cw6MMi0M2YtIdMY14.msg
? tests/data/messages/+8d1jNti0M2Yt1JIU4e.msg
? tests/data/messages/+8dKYHKW0M2Yt4m4mEX.msg
? tests/data/messages/+8dOmHgy0M2Yt8GzfAi.msg
? tests/data/messages/+8dYdPha0M2YtEY6mBX.msg
? tests/data/messages/+8eDOTru0M2YtM=C08O.msg
? tests/data/messages/+Adt502i0M2Yt4xGcMe.msg
? tests/data/messages/+AeDT39K0M2YtQC:2o3.msg
? tests/data/messages/+EcAMjLS0M2YtMHxasa.msg
? tests/data/messages/+Ee18UKG0M26BBXBbVv.msg
? tests/data/messages/+Ee=E0Me0M2R081Buli.msg
? tests/data/messages/+EfQNeoK0M2YtM3tK4E.msg
? tests/data/messages/+Id1jTjy0M2YtNKCk8G.msg
? tests/data/messages/+Id2FSYW0M2R0JJONVH.msg
? tests/data/messages/+IdP9Ghi0M2YtQbPm8k.msg
? tests/data/messages/+IegBWQW0M2YtQ1Y7JS.msg
? tests/data/messages/+Iem7V2W0M2Yt1==uYp.msg
? tests/data/messages/+IevgHoS0M2YtNRnGJy.msg
? tests/data/messages/+MdXHoi:0M2YtFYuldt.msg
? tests/data/messages/+MdXeexu0M2YtRfGUor.msg
? tests/data/messages/+MegBIby0M2YtM1Y59M.msg
? tests/data/messages/+Mf1eAY:0M2UDEAqrYb.msg
? tests/data/messages/+MfWA2=:0M2R01N5k8H.msg
? tests/data/messages/+MfasKRC0M2YtQwhLMX.msg
? tests/data/messages/+QdMpAAq0M2YtBp=EMM.msg
? tests/data/messages/+QdjbiC60M2Yt0L5vAe.msg
? tests/data/messages/+QdlYevu0M2YtMpdolq.msg
? tests/data/messages/+QeBYziC0M2YtI3CLkB.msg
? tests/data/messages/+QeteZn:0M2YtN3sZ8w.msg
? tests/data/messages/+QfQbqFm0M2YtA7NBlo.msg
? tests/data/messages/+QfQc7Fu0M2YtA7ND1H.msg
? tests/data/messages/+QfXX:mi0M2YtBi3KYx.msg
? tests/data/messages/+Ucw6MUK0M2YtMdMYZQ.msg
? tests/data/messages/+Ud4Lq720M2YtE7NGsL.msg
? tests/data/messages/+UdMpA860M2Yt9p=EIF.msg
? tests/data/messages/+Ue1ICcG0M2Yt01U0s:.msg
? tests/data/messages/+YcDGsK20M2Yt49I4UX.msg
? tests/data/messages/+Yd1jVRm0M2Yt54CX5E.msg
? tests/data/messages/+Yd1kPFu0M2YtF4Ce9K.msg
? tests/data/messages/+YdLZXty0M2R09L7zwf.msg
? tests/data/messages/+YdMpABO0M2YtJp=EQC.msg
? tests/data/messages/+YdV2eZy0M2Yt9gpZpk.msg
? tests/data/messages/+cdShwmG0M2YtRV4Ep:.msg
? tests/data/messages/+ceAribO0M2Yt1A339h.msg
? tests/data/messages/+ceAuyi:0M2YtRA3Ada.msg
? tests/data/messages/+ceAvkqG0M2YtNA35Yf.msg
? tests/data/messages/+gcHsZ0S0M2YtA1:lZb.msg
? tests/data/messages/+ge=xjkK0M2YtAXVU9g.msg
? tests/data/messages/+gevgHyW0M2YtBRnGNK.msg
? tests/data/messages/+kcC2C560M2YtQa9std.msg
? tests/data/messages/+keDcXpq0M2Yt0AZ088.msg
? tests/data/messages/+kem5iCq0M2Yt1==oc0.msg
? tests/data/messages/+kfQgm6e0M2YtI7N8AU.msg
? tests/data/messages/+odjq1a:0M2YtMP5VlJ.msg
? tests/data/messages/+oem5hCq0M2YtR==zBi.msg
? tests/data/messages/+sdFt28e0M2YtELTudB.msg
? tests/data/messages/+sdR:Owe0M2YtJ9QYUh.msg
? tests/data/messages/+seE6sT20M2YtEVGE8p.msg
? tests/data/messages/+wdEs1GS0M2YtEBM2gD.msg
? tests/data/messages/+weAvjOm0M2Yt5A34N=.msg
? tests/data/messages/+weCHaLK0M2Yt8I=U8r.msg
? tests/data/messages/appledouble.msg
? tests/data/messages/appledouble2.msg
? tests/data/messages/bad-elm-rfc822.msg
? tests/data/messages/bad-ps-attach.msg
? tests/data/messages/bounce.msg
? tests/data/messages/broken-params.msg
? tests/data/messages/broken-winvn.msg
? tests/data/messages/busted.msg
? tests/data/messages/busted2.msg
? tests/data/messages/deeply-nested.msg
? tests/data/messages/encoding-uue.msg
? tests/data/messages/ext-bodies.msg
? tests/data/messages/ext-bodies2.msg
? tests/data/messages/external-images.msg
? tests/data/messages/external-images2.msg
? tests/data/messages/foo.msg
? tests/data/messages/gif-caps.msg
? tests/data/messages/hal-ishmail.msg
? tests/data/messages/infomac.msg
? tests/data/messages/iso-header.msg
? tests/data/messages/latin2.msg
? tests/data/messages/links.msg
? tests/data/messages/maybe-broken-gif.msg
? tests/data/messages/md5-test.msg
? tests/data/messages/mime-uu.msg
? tests/data/messages/ms-jpg.msg
? tests/data/messages/mult-alt.msg
? tests/data/messages/mult-alt2.msg
? tests/data/messages/mult-rel-10.msg
? tests/data/messages/mult-rel-11.msg
? tests/data/messages/mult-rel-2.msg
? tests/data/messages/mult-rel-3.msg
? tests/data/messages/mult-rel-4.msg
? tests/data/messages/mult-rel-5.msg
? tests/data/messages/mult-rel-6.msg
? tests/data/messages/mult-rel-7.msg
? tests/data/messages/mult-rel-8.msg
? tests/data/messages/mult-rel-9.msg
? tests/data/messages/mult-rel-loser.msg
? tests/data/messages/mult-rel.msg
? tests/data/messages/multipart-rfc822-caps.msg
? tests/data/messages/pgp-plain.msg
? tests/data/messages/pgp.msg
? tests/data/messages/pgp2.msg
? tests/data/messages/rfc822-case.msg
? tests/data/messages/smime0-msigned.msg
? tests/data/messages/smime1-osigned.msg
? tests/data/messages/smime10-certs.msg
? tests/data/messages/smime11-certs.msg
? tests/data/messages/smime12-osigned.msg
? tests/data/messages/smime13-msigned.msg
? tests/data/messages/smime14-osigned.msg
? tests/data/messages/smime15-osigned.msg
? tests/data/messages/smime16-osigned.msg
? tests/data/messages/smime17-osigned.msg
? tests/data/messages/smime18-encrypted.msg
? tests/data/messages/smime19-msigned.msg
? tests/data/messages/smime2-osigned.msg
? tests/data/messages/smime20-encrypted.msg
? tests/data/messages/smime21-enc-msigned.msg
? tests/data/messages/smime22-fwd-encrypted.msg
? tests/data/messages/smime23-fwd-encrypted.msg
? tests/data/messages/smime24-msigned.msg
? tests/data/messages/smime25-enc-signed.msg
? tests/data/messages/smime26-msigned.msg
? tests/data/messages/smime27-encrypted.msg
? tests/data/messages/smime28-msigned-junk.msg
? tests/data/messages/smime29-bogus.msg
? tests/data/messages/smime3-osigned.msg
? tests/data/messages/smime4-msigned.msg
? tests/data/messages/smime5-junk.msg
? tests/data/messages/smime6-msigned.msg
? tests/data/messages/smime7-msigned.msg
? tests/data/messages/smime8-certs.msg
? tests/data/messages/smime9-msigned.msg
? tests/data/messages/sprynet-bounce.msg
? tests/data/messages/sun-attach.msg
? tests/data/messages/sun-attach2.msg
? tests/data/messages/sun-attach3.msg
? tests/data/messages/urls.msg
? tests/data/messages/uu-images.msg
? tests/data/messages/vcard.msg
? tests/data/messages/x-ms-attachment.msg
? tests/folder/test10
? tests/message/test4
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.1870
retrieving revision 1.1872
diff -u -r1.1870 -r1.1872
--- ChangeLog	25 Aug 2003 15:09:33 -0000	1.1870
+++ ChangeLog	26 Aug 2003 16:05:58 -0000	1.1872
@@ -1,3 +1,139 @@
+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: camel-data-wrapper.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-data-wrapper.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- camel-data-wrapper.c	21 Aug 2003 16:20:12 -0000	1.61
+++ camel-data-wrapper.c	25 Aug 2003 21:01:35 -0000	1.62
@@ -75,7 +75,7 @@
 	camel_data_wrapper->priv = g_malloc (sizeof (struct _CamelDataWrapperPrivate));
 	pthread_mutex_init (&camel_data_wrapper->priv->stream_lock, NULL);
 	
-	camel_data_wrapper->mime_type = header_content_type_new ("application", "octet-stream");
+	camel_data_wrapper->mime_type = camel_content_type_new ("application", "octet-stream");
 	camel_data_wrapper->encoding = CAMEL_MIME_PART_ENCODING_DEFAULT;
 	camel_data_wrapper->offline = FALSE;
 }
@@ -90,7 +90,7 @@
 	g_free (camel_data_wrapper->priv);
 	
 	if (camel_data_wrapper->mime_type)
-		header_content_type_unref (camel_data_wrapper->mime_type);
+		camel_content_type_unref (camel_data_wrapper->mime_type);
 	
 	if (camel_data_wrapper->stream)
 		camel_object_unref (camel_data_wrapper->stream);
@@ -198,7 +198,7 @@
 		break;
 	}
 	
-	if (header_content_type_is (data_wrapper->mime_type, "text", "*")) {
+	if (camel_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 @@
 set_mime_type (CamelDataWrapper *data_wrapper, const char *mime_type)
 {
 	if (data_wrapper->mime_type)
-		header_content_type_unref (data_wrapper->mime_type);
-	data_wrapper->mime_type = header_content_type_decode (mime_type);
+		camel_content_type_unref (data_wrapper->mime_type);
+	data_wrapper->mime_type = camel_content_type_decode (mime_type);
 }
 
 /**
@@ -299,7 +299,7 @@
 static char *
 get_mime_type (CamelDataWrapper *data_wrapper)
 {
-	return header_content_type_simple (data_wrapper->mime_type);
+	return camel_content_type_simple (data_wrapper->mime_type);
 }
 
 /**
@@ -354,10 +354,10 @@
 	g_return_if_fail (mime_type != NULL);
 
 	if (data_wrapper->mime_type)
-		header_content_type_unref (data_wrapper->mime_type);
+		camel_content_type_unref (data_wrapper->mime_type);
 	data_wrapper->mime_type = mime_type;
 	if (mime_type)
-		header_content_type_ref (data_wrapper->mime_type);
+		camel_content_type_ref (data_wrapper->mime_type);
 }
 
 void
Index: camel-digest-folder.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-digest-folder.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- camel-digest-folder.c	11 Aug 2003 17:57:31 -0000	1.13
+++ camel-digest-folder.c	25 Aug 2003 21:01:35 -0000	1.14
@@ -221,7 +221,7 @@
 		return NULL;
 	
 	/* Make sure we have a multipart/digest subpart or at least some message/rfc822 attachments... */
-	if (!header_content_type_is (CAMEL_DATA_WRAPPER (message)->mime_type, "multipart", "digest")) {
+	if (!camel_content_type_is (CAMEL_DATA_WRAPPER (message)->mime_type, "multipart", "digest")) {
 		if (!multipart_contains_message_parts (CAMEL_MULTIPART (wrapper)))
 			return NULL;
 	}
Index: camel-filter-driver.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-filter-driver.c,v
retrieving revision 1.74
retrieving revision 1.76
diff -u -r1.74 -r1.76
--- camel-filter-driver.c	25 Aug 2003 15:09:34 -0000	1.74
+++ camel-filter-driver.c	26 Aug 2003 16:05:59 -0000	1.76
@@ -1127,7 +1127,7 @@
 	
 	source_url = g_strdup_printf ("file://%s", mbox);
 	
-	while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) {
+	while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) {
 		CamelMessageInfo *info;
 		CamelMimeMessage *msg;
 		int pc = 0;
@@ -1349,7 +1349,7 @@
 	}
 	
 	if (info == NULL) {
-		struct _header_raw *h;
+		struct _camel_header_raw *h;
 		
 		if (message) {
 			camel_object_ref (CAMEL_OBJECT (message));
Index: camel-filter-search.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-filter-search.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- camel-filter-search.c	11 Aug 2003 20:41:32 -0000	1.32
+++ camel-filter-search.c	25 Aug 2003 21:01:36 -0000	1.33
@@ -163,7 +163,7 @@
 			else {
 				ct = camel_mime_part_get_content_type (CAMEL_MIME_PART (message));
 				if (ct) {
-					charset = header_content_type_param (ct, "charset");
+					charset = camel_content_type_param (ct, "charset");
 					charset = e_iconv_charset_name (charset);
 				}
 			}
@@ -262,7 +262,7 @@
 	CamelMimePart *mp = CAMEL_MIME_PART (message);
 	GString *str = g_string_new ("");
 	char   *ret;
-	struct _header_raw *h;
+	struct _camel_header_raw *h;
 	
 	for (h = mp->headers; h; h = h->next) {
 		if (h->value != NULL) {
Index: camel-folder-search.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-folder-search.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- camel-folder-search.c	11 Aug 2003 20:41:32 -0000	1.58
+++ camel-folder-search.c	25 Aug 2003 21:01:36 -0000	1.59
@@ -1,5 +1,6 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- *  Copyright (C) 2000,2001 Ximian Inc.
+ *  Copyright (C) 2000-2003 Ximian Inc.
  *
  *  Authors: Michael Zucchi <notzed ximian com>
  *
@@ -855,7 +856,7 @@
 	} 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 (header_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
+	} else if (camel_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: camel-folder-summary.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-folder-summary.c,v
retrieving revision 1.125
retrieving revision 1.127
diff -u -r1.125 -r1.127
--- camel-folder-summary.c	13 Aug 2003 16:40:11 -0000	1.125
+++ camel-folder-summary.c	26 Aug 2003 16:05:59 -0000	1.127
@@ -90,14 +90,14 @@
 static int summary_header_load(CamelFolderSummary *, FILE *);
 static int summary_header_save(CamelFolderSummary *, FILE *);
 
-static CamelMessageInfo * message_info_new(CamelFolderSummary *, struct _header_raw *);
+static CamelMessageInfo * message_info_new(CamelFolderSummary *, struct _camel_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 _header_raw *);
+static CamelMessageContentInfo * content_info_new(CamelFolderSummary *, struct _camel_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 @@
  * 
  * Return value: The newly added record.
  **/
-CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *s, struct _header_raw *h)
+CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
 {
 	CamelMessageInfo *info = camel_folder_summary_info_new_from_header(s, h);
 
@@ -869,7 +869,7 @@
  * 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 _header_raw *h)
+CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
 {
 	return ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s))) -> message_info_new(s, h);
 }
@@ -907,7 +907,7 @@
 	/* 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) != HSCAN_EOF) {
+	if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_EOF) {
 		info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new_from_parser(s, mp);
 
 		camel_mime_parser_unstep(mp);
@@ -1452,9 +1452,9 @@
 
 	state = camel_mime_parser_state(mp);
 	switch (state) {
-	case HSCAN_HEADER:
-	case HSCAN_MESSAGE:
-	case HSCAN_MULTIPART:
+	case CAMEL_MIME_PARSER_STATE_HEADER:
+	case CAMEL_MIME_PARSER_STATE_MESSAGE:
+	case CAMEL_MIME_PARSER_STATE_MULTIPART:
 		mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new(s, camel_mime_parser_headers_raw(mp));
 		break;
 	default:
@@ -1469,13 +1469,13 @@
 	CamelMessageContentInfo *ci = NULL;
 
 	switch (camel_mime_parser_state(mp)) {
-	case HSCAN_HEADER:
-	case HSCAN_MESSAGE:
-	case HSCAN_MULTIPART:
+	case CAMEL_MIME_PARSER_STATE_HEADER:
+	case CAMEL_MIME_PARSER_STATE_MESSAGE:
+	case CAMEL_MIME_PARSER_STATE_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);
-			header_content_type_ref(ci->type);
+			camel_content_type_ref(ci->type);
 		}
 		break;
 	default:
@@ -1504,17 +1504,17 @@
 }
 
 static char *
-summary_format_address(struct _header_raw *h, const char *name, const char *charset)
+summary_format_address(struct _camel_header_raw *h, const char *name, const char *charset)
 {
-	struct _header_address *addr;
+	struct _camel_header_address *addr;
 	const char *text;
 	char *ret;
 
-	text = header_raw_find (&h, name, NULL);
-	addr = header_address_decode (text, charset);
+	text = camel_header_raw_find (&h, name, NULL);
+	addr = camel_header_address_decode (text, charset);
 	if (addr) {
-		ret = header_address_list_format (addr);
-		header_address_list_clear (&addr);
+		ret = camel_header_address_list_format (addr);
+		camel_header_address_list_clear (&addr);
 	} else {
 		ret = g_strdup (text);
 	}
@@ -1523,15 +1523,15 @@
 }
 
 static char *
-summary_format_string (struct _header_raw *h, const char *name, const char *charset)
+summary_format_string (struct _camel_header_raw *h, const char *name, const char *charset)
 {
 	const char *text;
 	
-	text = header_raw_find (&h, name, NULL);
+	text = camel_header_raw_find (&h, name, NULL);
 	if (text) {
 		while (isspace ((unsigned) *text))
 			text++;
-		return header_decode_string (text, charset);
+		return camel_header_decode_string (text, charset);
 	} else {
 		return NULL;
 	}
@@ -1593,23 +1593,23 @@
 }
 
 static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _header_raw *h)
+message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
 {
 	CamelMessageInfo *mi;
 	const char *received;
 	guchar digest[16];
-	struct _header_references *refs, *irt, *scan;
+	struct _camel_header_references *refs, *irt, *scan;
 	char *msgid;
 	int count;
 	char *subject, *from, *to, *cc, *mlist;
-	struct _header_content_type *ct = NULL;
+	CamelContentType *ct = NULL;
 	const char *content, *charset = NULL;
 
 	mi = camel_folder_summary_info_new(s);
 
-	if ((content = header_raw_find(&h, "Content-Type", NULL))
-	     && (ct = header_content_type_decode(content))
-	     && (charset = header_content_type_param(ct, "charset"))
+	if ((content = camel_header_raw_find(&h, "Content-Type", NULL))
+	     && (ct = camel_content_type_decode(content))
+	     && (charset = camel_content_type_param(ct, "charset"))
 	     && (strcasecmp(charset, "us-ascii") == 0))
 		charset = NULL;
 	
@@ -1619,10 +1619,10 @@
 	from = summary_format_address(h, "from", charset);
 	to = summary_format_address(h, "to", charset);
 	cc = summary_format_address(h, "cc", charset);
-	mlist = header_raw_check_mailing_list(&h);
+	mlist = camel_header_raw_check_mailing_list(&h);
 
 	if (ct)
-		header_content_type_unref(ct);
+		camel_content_type_unref(ct);
 
 #ifdef DOEPOOLV
 	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject, TRUE);
@@ -1646,16 +1646,16 @@
 
 	mi->user_flags = NULL;
 	mi->user_tags = NULL;
-	mi->date_sent = header_decode_date(header_raw_find(&h, "date", NULL), NULL);
-	received = header_raw_find(&h, "received", NULL);
+	mi->date_sent = camel_header_decode_date(camel_header_raw_find(&h, "date", NULL), NULL);
+	received = camel_header_raw_find(&h, "received", NULL);
 	if (received)
 		received = strrchr(received, ';');
 	if (received)
-		mi->date_received = header_decode_date(received + 1, NULL);
+		mi->date_received = camel_header_decode_date(received + 1, NULL);
 	else
 		mi->date_received = 0;
 
-	msgid = header_msgid_decode(header_raw_find(&h, "message-id", NULL));
+	msgid = camel_header_msgid_decode(camel_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 @@
 	}
 	
 	/* decode our references and in-reply-to headers */
-	refs = header_references_decode (header_raw_find (&h, "references", NULL));
-	irt = header_references_inreplyto_decode (header_raw_find (&h, "in-reply-to", NULL));
+	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));
 	if (refs || irt) {
 		if (irt) {
 			/* The References field is populated from the ``References'' and/or ``In-Reply-To''
@@ -1677,7 +1677,7 @@
 			refs = irt;
 		}
 		
-		count = header_references_list_size(&refs);
+		count = camel_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 @@
 			scan = scan->next;
 		}
 		mi->references->size = count;
-		header_references_list_clear(&refs);
+		camel_header_references_list_clear(&refs);
 	}
 
 	return mi;
@@ -1867,7 +1867,7 @@
 }
 
 static CamelMessageContentInfo *
-content_info_new (CamelFolderSummary *s, struct _header_raw *h)
+content_info_new (CamelFolderSummary *s, struct _camel_header_raw *h)
 {
 	CamelMessageContentInfo *ci;
 	const char *charset;
@@ -1875,9 +1875,9 @@
 	ci = camel_folder_summary_content_info_new (s);
 	
 	charset = e_iconv_locale_charset ();
-	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));
+	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));
 	
 	return ci;
 }
@@ -1888,7 +1888,7 @@
 	CamelMessageContentInfo *ci;
 	char *type, *subtype;
 	guint32 count, i;
-	struct _header_content_type *ct;
+	CamelContentType *ct;
 
 	io(printf("Loading content info\n"));
 
@@ -1896,7 +1896,7 @@
 	
 	camel_folder_summary_decode_token(in, &type);
 	camel_folder_summary_decode_token(in, &subtype);
-	ct = header_content_type_new(type, subtype);
+	ct = camel_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 @@
 		if (!(name && value))
 			goto error;
 		
-		header_content_type_set_param(ct, name, value);
+		camel_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 @@
 static int
 content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
 {
-	struct _header_content_type *ct;
-	struct _header_param *hp;
+	CamelContentType *ct;
+	struct _camel_header_param *hp;
 
 	io(printf("Saving content info\n"));
 
@@ -1965,7 +1965,7 @@
 static void
 content_info_free(CamelFolderSummary *s, CamelMessageContentInfo *ci)
 {
-	header_content_type_unref(ci->type);
+	camel_content_type_unref(ci->type);
 	g_free(ci->id);
 	g_free(ci->description);
 	g_free(ci->encoding);
@@ -1992,7 +1992,7 @@
 	size_t len;
 	char *buffer;
 	CamelMessageContentInfo *info = NULL;
-	struct _header_content_type *ct;
+	CamelContentType *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 @@
 		info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_parser(s, mp);
 
 	switch(state) {
-	case HSCAN_HEADER:
+	case CAMEL_MIME_PARSER_STATE_HEADER:
 		/* check content type for indexing, then read body */
 		ct = camel_mime_parser_content_type(mp);
 		/* update attachments flag as we go */
-		if (!header_content_type_is(ct, "text", "*"))
+		if (!camel_content_type_is(ct, "text", "*"))
 			msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
 
-		if (p->index && header_content_type_is(ct, "text", "*")) {
+		if (p->index && camel_content_type_is(ct, "text", "*")) {
 			char *encoding;
 			const char *charset;
 
 			d(printf("generating index:\n"));
 			
-			encoding = header_content_encoding_decode(camel_mime_parser_header(mp, "content-transfer-encoding", NULL));
+			encoding = camel_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 @@
 				g_free(encoding);
 			}
 
-			charset = header_content_type_param(ct, "charset");
+			charset = camel_content_type_param(ct, "charset");
 			if (charset!=NULL
 			    && !(strcasecmp(charset, "us-ascii")==0
 				 || strcasecmp(charset, "utf-8")==0)) {
@@ -2073,7 +2073,7 @@
 
 			/* we do charset conversions before this filter, which isn't strictly correct,
 			   but works in most cases */
-			if (header_content_type_is(ct, "text", "html")) {
+			if (camel_content_type_is(ct, "text", "html")) {
 				if (p->filter_html == NULL)
 					p->filter_html = camel_mime_filter_html_new();
 				else
@@ -2085,7 +2085,7 @@
 			idx_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_index);
 		}
 		/* and scan/index everything */
-		while (camel_mime_parser_step(mp, &buffer, &len) != HSCAN_BODY_END)
+		while (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_BODY_END)
 			;
 		/* and remove the filters */
 		camel_mime_parser_filter_remove(mp, enc_id);
@@ -2093,14 +2093,14 @@
 		camel_mime_parser_filter_remove(mp, html_id);
 		camel_mime_parser_filter_remove(mp, idx_id);
 		break;
-	case HSCAN_MULTIPART:
+	case CAMEL_MIME_PARSER_STATE_MULTIPART:
 		d(printf("Summarising multipart\n"));
 		/* update attachments flag as we go */
 		ct = camel_mime_parser_content_type(mp);
-		if (header_content_type_is(ct, "multipart", "mixed"))
+		if (camel_content_type_is(ct, "multipart", "mixed"))
 			msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
 
-		while (camel_mime_parser_step(mp, &buffer, &len) != HSCAN_MULTIPART_END) {
+		while (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
 			camel_mime_parser_unstep(mp);
 			part = summary_build_content_info(s, msginfo, mp);
 			if (part) {
@@ -2109,7 +2109,7 @@
 			}
 		}
 		break;
-	case HSCAN_MESSAGE:
+	case CAMEL_MIME_PARSER_STATE_MESSAGE:
 		d(printf("Summarising message\n"));
 		/* update attachments flag as we go */
 		msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
@@ -2120,7 +2120,7 @@
 			my_list_append((struct _node **)&info->childs, (struct _node *)part);
 		}
 		state = camel_mime_parser_step(mp, &buffer, &len);
-		if (state != HSCAN_MESSAGE_END) {
+		if (state != CAMEL_MIME_PARSER_STATE_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 @@
 	   add a reference, probably need fixing for multithreading */
 
 	/* check for attachments */
-	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"))
+	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"))
 			msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
-	} else if (!header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*"))
+	} else if (!camel_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 @@
 			my_list_append((struct _node **)&info->childs, (struct _node *)child);
 		}
 	} else if (p->filter_stream
-		   && header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*")) {
+		   && camel_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 (header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "html")) {
+		if (camel_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 @@
  * Returns a new CamelMessageInfo structure populated by the header.
  **/
 CamelMessageInfo *
-camel_message_info_new_from_header (struct _header_raw *header)
+camel_message_info_new_from_header (struct _camel_header_raw *header)
 {
 	CamelMessageInfo *info;
 	char *subject, *from, *to, *cc, *mlist;
-	struct _header_content_type *ct = NULL;
+	CamelContentType *ct = NULL;
 	const char *content, *date, *charset = NULL;
 	
-	if ((content = header_raw_find(&header, "Content-Type", NULL))
-	    && (ct = header_content_type_decode(content))
-	    && (charset = header_content_type_param(ct, "charset"))
+	if ((content = camel_header_raw_find(&header, "Content-Type", NULL))
+	    && (ct = camel_content_type_decode(content))
+	    && (charset = camel_content_type_param(ct, "charset"))
 	    && (strcasecmp(charset, "us-ascii") == 0))
 		charset = NULL;
 	
@@ -2607,11 +2607,11 @@
 	from = summary_format_address(header, "from", charset);
 	to = summary_format_address(header, "to", charset);
 	cc = summary_format_address(header, "cc", charset);
-	date = header_raw_find(&header, "date", NULL);
-	mlist = header_raw_check_mailing_list(&header);
+	date = camel_header_raw_find(&header, "date", NULL);
+	mlist = camel_header_raw_check_mailing_list(&header);
 
 	if (ct)
-		header_content_type_unref(ct);
+		camel_content_type_unref(ct);
 
 	info = camel_message_info_new();
 
@@ -2622,16 +2622,16 @@
 	camel_message_info_set_mlist(info, mlist);
 	
 	if (date)
-		info->date_sent = header_decode_date (date, NULL);
+		info->date_sent = camel_header_decode_date (date, NULL);
 	else
 		info->date_sent = time (NULL);
 	
-	date = header_raw_find (&header, "received", NULL);
+	date = camel_header_raw_find (&header, "received", NULL);
 	if (date && (date = strrchr (date, ';')))
 		date++;
 	
 	if (date)
-		info->date_received = header_decode_date (date, NULL);
+		info->date_received = camel_header_decode_date (date, NULL);
 	else
 		info->date_received = time (NULL);
 	
Index: camel-folder-summary.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-folder-summary.h,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- camel-folder-summary.h	25 Jun 2003 15:43:46 -0000	1.66
+++ camel-folder-summary.h	25 Aug 2003 21:01:36 -0000	1.67
@@ -48,7 +48,7 @@
 	struct _CamelMessageContentInfo *childs;
 	struct _CamelMessageContentInfo *parent;
 	
-	struct _header_content_type *type;
+	CamelContentType *type;
 	char *id;
 	char *description;
 	char *encoding;		/* this should be an enum?? */
@@ -191,7 +191,7 @@
 	int (*summary_header_save)(CamelFolderSummary *, FILE *);
 
 	/* create/save/load an individual message info */
-	CamelMessageInfo * (*message_info_new)(CamelFolderSummary *, struct _header_raw *);
+	CamelMessageInfo * (*message_info_new)(CamelFolderSummary *, struct _camel_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 @@
 	void		   (*message_info_free)(CamelFolderSummary *, CamelMessageInfo *);
 
 	/* save/load individual content info's */
-	CamelMessageContentInfo * (*content_info_new)(CamelFolderSummary *, struct _header_raw *);
+	CamelMessageContentInfo * (*content_info_new)(CamelFolderSummary *, struct _camel_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_add(CamelFolderSummary *, CamelMessageInfo *info);
 
 /* build/add raw summary items */
-CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *, struct _header_raw *);
+CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *, struct _camel_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 _header_raw *);
+CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *, struct _camel_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 @@
 void camel_folder_summary_array_free(CamelFolderSummary *s, GPtrArray *array);
 
 /* summary formatting utils */
-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);
+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);
 
 /* 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 @@
    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 _header_raw *header);
+CamelMessageInfo *camel_message_info_new_from_header(struct _camel_header_raw *header);
 void camel_message_info_dup_to(const CamelMessageInfo *from, CamelMessageInfo *to);
 void camel_message_info_free(CamelMessageInfo *mi);
 
Index: camel-http-stream.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-http-stream.c,v
retrieving revision 1.10
retrieving revision 1.12
diff -u -r1.10 -r1.12
--- camel-http-stream.c	19 Aug 2003 02:36:19 -0000	1.10
+++ camel-http-stream.c	26 Aug 2003 16:05:59 -0000	1.12
@@ -96,10 +96,10 @@
 		camel_object_unref(http->parser);
 	
 	if (http->content_type)
-		header_content_type_unref (http->content_type);
+		camel_content_type_unref (http->content_type);
 	
 	if (http->headers)
-		header_raw_clear (&http->headers);
+		camel_header_raw_clear (&http->headers);
 	
 	if (http->session)
 		camel_object_unref(http->session);
@@ -261,7 +261,7 @@
 	/* parse the HTTP status code */
 	if (!strncasecmp (buffer, "HTTP/", 5)) {
 		token = http_next_token (buffer);
-		http->statuscode = header_decode_int (&token);
+		http->statuscode = camel_header_decode_int (&token);
 		return http->statuscode;
 	}
 
@@ -273,7 +273,7 @@
 static int
 http_get_headers (CamelHttpStream *http)
 {
-	struct _header_raw *headers, *node, *tail;
+	struct _camel_header_raw *headers, *node, *tail;
 	const char *type;
 	char *buf;
 	size_t len;
@@ -286,27 +286,27 @@
 	camel_mime_parser_init_with_stream (http->parser, http->read);
 	
 	switch (camel_mime_parser_step (http->parser, &buf, &len)) {
-	case HSCAN_MESSAGE:
-	case HSCAN_HEADER:
+	case CAMEL_MIME_PARSER_STATE_MESSAGE:
+	case CAMEL_MIME_PARSER_STATE_HEADER:
 		headers = camel_mime_parser_headers_raw (http->parser);
 		if (http->content_type)
-			header_content_type_unref (http->content_type);
-		type = header_raw_find (&headers, "Content-Type", NULL);
+			camel_content_type_unref (http->content_type);
+		type = camel_header_raw_find (&headers, "Content-Type", NULL);
 		if (type)
-			http->content_type = header_content_type_decode (type);
+			http->content_type = camel_content_type_decode (type);
 		else
 			http->content_type = NULL;
 		
 		if (http->headers)
-			header_raw_clear (&http->headers);
+			camel_header_raw_clear (&http->headers);
 		
 		http->headers = NULL;
-		tail = (struct _header_raw *) &http->headers;
+		tail = (struct _camel_header_raw *) &http->headers;
 		
 		d(printf("HTTP Headers:\n"));
 		while (headers) {
 			d(printf(" %s:%s\n", headers->name, headers->value));
-			node = g_new (struct _header_raw, 1);
+			node = g_new (struct _camel_header_raw, 1);
 			node->next = NULL;
 			node->name = g_strdup (headers->name);
 			node->value = g_strdup (headers->value);
@@ -432,13 +432,13 @@
 		case 302: {
 			char *loc;
 
-			header_content_type_unref (http->content_type);
+			camel_content_type_unref (http->content_type);
 			http->content_type = NULL;
 			http_disconnect(http);
 
-			loc = g_strdup(header_raw_find(&http->headers, "Location", NULL));
+			loc = g_strdup(camel_header_raw_find(&http->headers, "Location", NULL));
 			if (loc == NULL) {
-				header_raw_clear(&http->headers);
+				camel_header_raw_clear(&http->headers);
 				return -1;
 			}
 
@@ -449,11 +449,11 @@
 			http->url = camel_url_new(loc, NULL);
 			if (http->url == NULL) {
 				printf("redirect url '%s' cannot be parsed\n", loc);
-				header_raw_clear (&http->headers);
+				camel_header_raw_clear (&http->headers);
 				return -1;
 			}
 			d(printf(" redirect url = %p\n", http->url));
-			header_raw_clear (&http->headers);
+			camel_header_raw_clear (&http->headers);
 
 			goto redirect;
 			break; }
@@ -536,7 +536,7 @@
 	}
 	
 	if (http_stream->content_type)
-		header_content_type_ref (http_stream->content_type);
+		camel_content_type_ref (http_stream->content_type);
 	
 	return http_stream->content_type;
 }
Index: camel-http-stream.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-http-stream.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- camel-http-stream.h	19 Aug 2003 02:36:19 -0000	1.5
+++ camel-http-stream.h	25 Aug 2003 21:01:36 -0000	1.6
@@ -59,7 +59,7 @@
 	CamelMimeParser *parser;
 	
 	CamelContentType *content_type;
-	struct _header_raw *headers;
+	struct _camel_header_raw *headers;
 	
 	CamelHttpMethod method;
 	struct _CamelSession *session;
Index: camel-internet-address.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-internet-address.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- camel-internet-address.c	20 Mar 2003 16:43:26 -0000	1.27
+++ camel-internet-address.c	25 Aug 2003 21:01:36 -0000	1.28
@@ -84,18 +84,18 @@
 static int
 internet_decode	(CamelAddress *a, const char *raw)
 {
-	struct _header_address *ha, *n;
+	struct _camel_header_address *ha, *n;
 	int count = a->addresses->len;
 
 	/* Should probably use its own decoder or something */
-	ha = header_address_decode(raw, NULL);
+	ha = camel_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 _header_address *g = n->v.members;
+				struct _camel_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 @@
 			}
 			n = n->next;
 		}
-		header_address_list_clear(&ha);
+		camel_header_address_list_clear(&ha);
 	}
 	
 	return a->addresses->len - count;
@@ -413,7 +413,7 @@
 char *
 camel_internet_address_encode_address(int *inlen, const char *real, const char *addr)
 {
-	char *name = header_encode_phrase(real);
+	char *name = camel_header_encode_phrase(real);
 	char *ret = NULL, *addra = NULL;
 	int len = *inlen;
 	GString *out = g_string_new("");
@@ -422,7 +422,7 @@
 
 	if (name && name[0]) {
 		if (strlen(name) + len > CAMEL_FOLD_SIZE) {
-			char *folded = header_address_fold(name, len);
+			char *folded = camel_header_address_fold(name, len);
 			char *last;
 			g_string_append(out, folded);
 			g_free(folded);
Index: camel-medium.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-medium.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- camel-medium.c	7 Jul 2003 19:18:53 -0000	1.37
+++ camel-medium.c	25 Aug 2003 21:01:36 -0000	1.38
@@ -40,11 +40,11 @@
 #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 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 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 GArray *get_headers (CamelMedium *medium);
 static void free_headers (CamelMedium *medium, GArray *headers);
@@ -121,17 +121,16 @@
 }
 
 static void
-add_header (CamelMedium *medium, const gchar *header_name,
-	    const void *header_value)
+add_header (CamelMedium *medium, const char *name, const void *value)
 {
-	g_warning("No %s::add_header implemented, adding %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), header_name);
+	g_warning("No %s::add_header implemented, adding %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
 }
 
 /**
  * camel_medium_add_header:
  * @medium: a CamelMedium
- * @header_name: name of the header
- * @header_value: value of the header
+ * @name: name of the header
+ * @value: value of the header
  *
  * Adds a header to a medium.
  *
@@ -140,78 +139,78 @@
  * headers.   No we dont, order isn't important! Z
  **/
 void
-camel_medium_add_header (CamelMedium *medium, const gchar *header_name, const void *header_value)
+camel_medium_add_header (CamelMedium *medium, const char *name, const void *value)
 {
 	g_return_if_fail (CAMEL_IS_MEDIUM (medium));
-	g_return_if_fail (header_name != NULL);
-	g_return_if_fail (header_value != NULL);
+	g_return_if_fail (name != NULL);
+	g_return_if_fail (value != NULL);
 
-	CM_CLASS (medium)->add_header(medium, header_name, header_value);
+	CM_CLASS (medium)->add_header(medium, name, value);
 }
 
 static void
-set_header (CamelMedium *medium, const char *header_name, const void *header_value)
+set_header (CamelMedium *medium, const char *name, const void *value)
 {
-	g_warning("No %s::set_header implemented, setting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), header_name);
+	g_warning("No %s::set_header implemented, setting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
 }
 
 /**
  * camel_medium_set_header:
  * @medium: a CamelMedium
- * @header_name: name of the header
- * @header_value: value of the header
+ * @name: name of the 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 *header_name, const void *header_value)
+camel_medium_set_header (CamelMedium *medium, const char *name, const void *value)
 {
 	g_return_if_fail (CAMEL_IS_MEDIUM (medium));
-	g_return_if_fail (header_name != NULL);
+	g_return_if_fail (name != NULL);
 
-	if (header_value == NULL)
-		CM_CLASS(medium)->remove_header(medium, header_name);
+	if (value == NULL)
+		CM_CLASS(medium)->remove_header(medium, name);
 	else
-		CM_CLASS(medium)->set_header(medium, header_name, header_value);
+		CM_CLASS(medium)->set_header(medium, name, value);
 }
 
 static void
-remove_header(CamelMedium *medium, const char *header_name)
+remove_header(CamelMedium *medium, const char *name)
 {
-	g_warning("No %s::remove_header implemented, removing %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), header_name);
+	g_warning("No %s::remove_header implemented, removing %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
 }
 
 /**
  * camel_medium_remove_header:
  * @medium: a medium
- * @header_name: the name of the 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 *header_name)
+camel_medium_remove_header(CamelMedium *medium, const char *name)
 {
 	g_return_if_fail (CAMEL_IS_MEDIUM (medium));
-	g_return_if_fail (header_name != NULL);
+	g_return_if_fail (name != NULL);
 
-	CM_CLASS(medium)->remove_header(medium, header_name);
+	CM_CLASS(medium)->remove_header(medium, name);
 }
 
 
 static const void *
-get_header(CamelMedium *medium, const char *header_name)
+get_header(CamelMedium *medium, const char *name)
 {
-	g_warning("No %s::get_header implemented, getting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), header_name);
+	g_warning("No %s::get_header implemented, getting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
 	return NULL;
 }
 
 /**
  * camel_medium_get_header:
  * @medium: a medium
- * @header_name: the name of the 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.
@@ -223,12 +222,12 @@
  * Return value: the value of the named header, or %NULL
  **/
 const void *
-camel_medium_get_header(CamelMedium *medium, const char *header_name)
+camel_medium_get_header(CamelMedium *medium, const char *name)
 {
 	g_return_val_if_fail (CAMEL_IS_MEDIUM (medium), NULL);
-	g_return_val_if_fail (header_name != NULL, NULL);
+	g_return_val_if_fail (name != NULL, NULL);
 
-	return CM_CLASS (medium)->get_header (medium, header_name);
+	return CM_CLASS (medium)->get_header (medium, name);
 }
 
 
Index: camel-medium.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-medium.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- camel-medium.h	27 Oct 2001 16:59:27 -0000	1.19
+++ camel-medium.h	25 Aug 2003 21:01:36 -0000	1.20
@@ -31,7 +31,7 @@
 #ifdef __cplusplus
 extern "C" {
 #pragma }
-#endif /* __cplusplus }*/
+#endif /* __cplusplus */
 
 #include <camel/camel-data-wrapper.h>
 
@@ -46,8 +46,7 @@
 	const char *value;
 } CamelMediumHeader;
 
-struct _CamelMedium
-{
+struct _CamelMedium {
 	CamelDataWrapper parent_object;
 
 	/* The content of the medium, as opposed to our parent
@@ -55,34 +54,32 @@
 	 * content.
 	 */
 	CamelDataWrapper *content;
-
 };
 
 typedef struct {
 	CamelDataWrapperClass parent_class;
 
 	/* Virtual methods */
-	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);
+	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);
 
 	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 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);
+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);
 
 GArray *camel_medium_get_headers (CamelMedium *medium);
 void camel_medium_free_headers (CamelMedium *medium, GArray *headers);
Index: camel-mime-message.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-message.c,v
retrieving revision 1.121
retrieving revision 1.123
diff -u -r1.121 -r1.123
--- camel-mime-message.c	15 Aug 2003 20:57:29 -0000	1.121
+++ camel-mime-message.c	26 Aug 2003 16:05:59 -0000	1.123
@@ -80,9 +80,9 @@
 };
 
 static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-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 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 int construct_from_parser (CamelMimePart *, CamelMimeParser *);
 static void unref_recipient (gpointer key, gpointer value, gpointer user_data);
 
@@ -99,10 +99,10 @@
 	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 @@
 	message->date = date;
 	message->date_offset = offset;
 	
-	datestr = header_format_date (date, offset);
+	datestr = camel_header_format_date (date, offset);
 	CAMEL_MEDIUM_CLASS (parent_class)->set_header ((CamelMedium *)message, "Date", datestr);
 	g_free (datestr);
 }
@@ -235,7 +235,7 @@
 		if (received)
 			received = strrchr (received, ';');
 		if (received)
-			msg->date_received = header_decode_date (received + 1, &msg->date_received_offset);
+			msg->date_received = camel_header_decode_date (received + 1, &msg->date_received_offset);
 	}
 	
 	if (offset)
@@ -258,7 +258,7 @@
 	if (message_id) {
 		id = g_strstrip (g_strdup (message_id));
 	} else {
-		id = header_msgid_generate ();
+		id = camel_header_msgid_generate ();
 	}
 	
 	mime_message->message_id = id;
@@ -321,7 +321,7 @@
 	
 	g_free (mime_message->subject);
 	mime_message->subject = g_strstrip (g_strdup (subject));
-	text = header_encode_string((unsigned char *)mime_message->subject);
+	text = camel_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 @@
 	/* ... then clean up the follow-on state */
 	state = camel_mime_parser_step (mp, &buf, &len);
 	switch (state) {
-	case HSCAN_EOF: case HSCAN_FROM_END: /* these doesn't belong to us */
+	case CAMEL_MIME_PARSER_STATE_EOF: case CAMEL_MIME_PARSER_STATE_FROM_END: /* these doesn't belong to us */
 		camel_mime_parser_unstep (mp);
-	case HSCAN_MESSAGE_END:
+	case CAMEL_MIME_PARSER_STATE_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 @@
 
 /* FIXME: check format of fields. */
 static gboolean
-process_header (CamelMedium *medium, const char *header_name, const char *header_value)
+process_header (CamelMedium *medium, const char *name, const char *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, header_name);
+	header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, 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), header_value);
+		camel_address_decode (CAMEL_ADDRESS (message->from), 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), header_value);
+		camel_address_decode (CAMEL_ADDRESS (message->reply_to), value);
 		break;
 	case HEADER_SUBJECT:
 		g_free (message->subject);
 		if (((CamelDataWrapper *) message)->mime_type) {
-			charset = header_content_type_param (((CamelDataWrapper *) message)->mime_type, "charset");
+			charset = camel_content_type_param (((CamelDataWrapper *) message)->mime_type, "charset");
 			charset = e_iconv_charset_name (charset);
 		} else
 			charset = NULL;
-		message->subject = g_strstrip (header_decode_string (header_value, charset));
+		message->subject = g_strstrip (camel_header_decode_string (value, charset));
 		break;
 	case HEADER_TO:
 	case HEADER_CC:
@@ -552,15 +552,15 @@
 	case HEADER_RESENT_TO:
 	case HEADER_RESENT_CC:
 	case HEADER_RESENT_BCC:
-		addr = g_hash_table_lookup (message->recipients, header_name);
-		if (header_value)
-			camel_address_decode (CAMEL_ADDRESS (addr), header_value);
+		addr = g_hash_table_lookup (message->recipients, name);
+		if (value)
+			camel_address_decode (CAMEL_ADDRESS (addr), value);
 		else
 			camel_address_remove (CAMEL_ADDRESS (addr), -1);
 		break;
 	case HEADER_DATE:
-		if (header_value) {
-			message->date = header_decode_date (header_value, &message->date_offset);
+		if (value) {
+			message->date = camel_header_decode_date (value, &message->date_offset);
 		} else {
 			message->date = CAMEL_MESSAGE_DATE_CURRENT;
 			message->date_offset = 0;
@@ -568,8 +568,8 @@
 		break;
 	case HEADER_MESSAGE_ID:
 		g_free (message->message_id);
-		if (header_value)
-			message->message_id = header_msgid_decode (header_value);
+		if (value)
+			message->message_id = camel_header_msgid_decode (value);
 		else
 			message->message_id = NULL;
 		break;
@@ -581,27 +581,27 @@
 }
 
 static void
-set_header (CamelMedium *medium, const char *header_name, const void *header_value)
+set_header (CamelMedium *medium, const char *name, const void *value)
 {
-	process_header (medium, header_name, header_value);
-	parent_class->parent_class.set_header (medium, header_name, header_value);
+	process_header (medium, name, value);
+	parent_class->parent_class.set_header (medium, name, value);
 }
 
 static void
-add_header (CamelMedium *medium, const char *header_name, const void *header_value)
+add_header (CamelMedium *medium, const char *name, const void *value)
 {
 	/* if we process it, then it must be forced unique as well ... */
-	if (process_header (medium, header_name, header_value))
-		parent_class->parent_class.set_header (medium, header_name, header_value);
+	if (process_header (medium, name, value))
+		parent_class->parent_class.set_header (medium, name, value);
 	else
-		parent_class->parent_class.add_header (medium, header_name, header_value);
+		parent_class->parent_class.add_header (medium, name, value);
 }
 
 static void
-remove_header (CamelMedium *medium, const char *header_name)
+remove_header (CamelMedium *medium, const char *name)
 {
-	process_header (medium, header_name, NULL);
-	parent_class->parent_class.remove_header (medium, header_name);
+	process_header (medium, name, NULL);
+	parent_class->parent_class.remove_header (medium, name);
 }
 
 typedef gboolean (*CamelPartFunc)(CamelMimeMessage *, CamelMimePart *, void *data);
@@ -698,7 +698,7 @@
 		return CAMEL_MIME_PART_ENCODING_DEFAULT;
 	}
 	
-	istext = header_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*");
+	istext = camel_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 @@
 	
 	/* 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 = header_content_type_param (content->mime_type, "charset"))) {
+	    && (charsetin = camel_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 @@
 		d(printf("best charset = %s\n", charsetin ? charsetin : "(null)"));
 		charset = g_strdup (charsetin);
 		
-		charsetin = header_content_type_param (content->mime_type, "charset");
+		charsetin = camel_content_type_param (content->mime_type, "charset");
 	} else {
 		charset = NULL;
 	}
@@ -813,13 +813,13 @@
 		camel_mime_part_set_encoding (part, encoding);
 		
 		if ((data->required & CAMEL_BESTENC_GET_CHARSET) != 0) {
-			if (header_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*")) {
+			if (camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*")) {
 				char *newct;
 				
 				/* FIXME: ick, the part content_type interface needs fixing bigtime */
-				header_content_type_set_param (((CamelDataWrapper *) part)->mime_type, "charset",
+				camel_content_type_set_param (((CamelDataWrapper *) part)->mime_type, "charset",
 							       charset ? charset : "us-ascii");
-				newct = header_content_type_format (((CamelDataWrapper *) part)->mime_type);
+				newct = camel_content_type_format (((CamelDataWrapper *) part)->mime_type);
 				if (newct) {
 					d(printf("Setting content-type to %s\n", newct));
 					
@@ -909,7 +909,7 @@
 char *
 camel_mime_message_build_mbox_from (CamelMimeMessage *message)
 {
-	struct _header_raw *header = ((CamelMimePart *)message)->headers;
+	struct _camel_header_raw *header = ((CamelMimePart *)message)->headers;
 	GString *out = g_string_new("From ");
 	char *ret;
 	const char *tmp;
@@ -917,11 +917,11 @@
 	int offset;
 	struct tm tm;
 	
-	tmp = header_raw_find (&header, "Sender", NULL);
+	tmp = camel_header_raw_find (&header, "Sender", NULL);
 	if (tmp == NULL)
-		tmp = header_raw_find (&header, "From", NULL);
+		tmp = camel_header_raw_find (&header, "From", NULL);
 	if (tmp != NULL) {
-		struct _header_address *addr = header_address_decode (tmp, NULL);
+		struct _camel_header_address *addr = camel_header_address_decode (tmp, NULL);
 		
 		tmp = NULL;
 		if (addr) {
@@ -929,7 +929,7 @@
 				g_string_append (out, addr->v.addr);
 				tmp = "";
 			}
-			header_address_unref (addr);
+			camel_header_address_unref (addr);
 		}
 	}
 	
@@ -937,7 +937,7 @@
 		g_string_append (out, "unknown nodomain now au");
 	
 	/* try use the received header to get the date */
-	tmp = header_raw_find (&header, "Received", NULL);
+	tmp = camel_header_raw_find (&header, "Received", NULL);
 	if (tmp) {
 		tmp = strrchr(tmp, ';');
 		if (tmp)
@@ -946,9 +946,9 @@
 	
 	/* if there isn't one, try the Date field */
 	if (tmp == NULL)
-		tmp = header_raw_find (&header, "Date", NULL);
+		tmp = camel_header_raw_find (&header, "Date", NULL);
 	
-	thetime = header_decode_date (tmp, &offset);
+	thetime = camel_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: camel-mime-parser.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-parser.c,v
retrieving revision 1.53
retrieving revision 1.55
diff -u -r1.53 -r1.55
--- camel-mime-parser.c	11 Aug 2003 17:57:31 -0000	1.53
+++ camel-mime-parser.c	26 Aug 2003 16:05:59 -0000	1.55
@@ -203,7 +203,7 @@
 
     /* global state */
 
-	enum _header_state state;
+	enum _camel_mime_parser_state state;
 
 	/* for building headers during scanning */
 	char *outbuf;
@@ -248,14 +248,14 @@
 struct _header_scan_stack {
 	struct _header_scan_stack *parent;
 
-	enum _header_state savestate; /* state at invocation of this part */
+	enum _camel_mime_parser_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 _header_raw *headers;	/* headers for this part */
+	struct _camel_header_raw *headers;	/* headers for this part */
 
-	struct _header_content_type *content_type;
+	CamelContentType *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 @@
 
 #if d(!)0
 static char *states[] = {
-	"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",
+	"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",
 };
 #endif
 
@@ -388,7 +388,7 @@
  *
  * 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 HSCAN_BODY will have passed through the filter.
+ * of CAMEL_MIME_PARSER_STATE_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 @@
 
 	if (s->parts &&
 	    s->parts->headers) {
-		return header_raw_find(&s->parts->headers, name, offset);
+		return camel_header_raw_find(&s->parts->headers, name, offset);
 	}
 	return NULL;
 }
@@ -478,7 +478,7 @@
  * Return value: The raw headers, or NULL if there are no headers
  * defined for the current part or state.  These are READ ONLY.
  **/
-struct _header_raw *
+struct _camel_header_raw *
 camel_mime_parser_headers_raw(CamelMimeParser *m)
 {
 	struct _header_scan_state *s = _PRIVATE(m);
@@ -505,7 +505,7 @@
  * @m: 
  * 
  * Retrieve the preface text for the current multipart.
- * Can only be used when the state is HSCAN_MULTIPART_END.
+ * Can only be used when the state is CAMEL_MIME_PARSER_STATE_MULTIPART_END.
  * 
  * Return value: The preface text, or NULL if there wasn't any.
  **/
@@ -526,7 +526,7 @@
  * 
  * Retrieve the postface text for the current multipart.
  * Only returns valid data when the current state if
- * HSCAN_MULTIPART_END.
+ * CAMEL_MIME_PARSER_STATE_MULTIPART_END.
  * 
  * Return value: The postface text, or NULL if there wasn't any.
  **/
@@ -546,10 +546,10 @@
  * @m: 
  * 
  * Get the last scanned "From " line, from a recently scanned from.
- * This should only be called in the HSCAN_FROM state.  The
+ * This should only be called in the CAMEL_MIME_PARSER_STATE_FROM state.  The
  * from line will include the closing \n found (if there was one).
  *
- * The return value will remain valid while in the HSCAN_FROM
+ * The return value will remain valid while in the CAMEL_MIME_PARSER_STATE_FROM
  * state, or any deeper state.
  * 
  * Return value: The From line, or NULL if called out of context.
@@ -607,46 +607,48 @@
 
 /**
  * camel_mime_parser_scan_from:
- * @m: 
+ * @parser: MIME parser object
  * @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 HSCAN_FROM and HSCAN_FROM_END will be returned
+ * states CAMEL_MIME_PARSER_STATE_FROM and CAMEL_MIME_PARSER_STATE_FROM_END will be returned
  * to the caller during parsing.
  *
  * This may also be preceeded by an optional
- * HSCAN_PRE_FROM state which contains the scanned data
+ * CAMEL_MIME_PARSER_STATE_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 *m, int scan_from)
+camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
 	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 HSCAN_PRE_FROM which returns the specified data.
+ * state CAMEL_MIME_PARSER_STATE_PRE_FROM which returns the specified data.
  **/
 void
-camel_mime_parser_scan_pre_from(CamelMimeParser *m, int scan_pre_from)
+camel_mime_parser_scan_pre_from (CamelMimeParser *parser, gboolean scan_pre_from)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
 	s->scan_pre_from = scan_pre_from;
 }
 
 /**
  * camel_mime_parser_content_type:
- * @m: 
+ * @parser: MIME parser object
  * 
  * Get the content type defined in the current part.
  * 
@@ -654,21 +656,22 @@
  * is no content-type defined for this part of state of the
  * parser.
  **/
-struct _header_content_type *
-camel_mime_parser_content_type(CamelMimeParser *m)
+CamelContentType *
+camel_mime_parser_content_type (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
-
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
 	/* 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:
- * @m: 
+ * @parser: MIME parser object
  * 
  * Cause the last step operation to repeat itself.  If this is 
  * called repeated times, then the same step will be repeated
@@ -677,16 +680,17 @@
  * 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 *m)
+void
+camel_mime_parser_unstep (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
-
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
 	s->unstep++;
 }
 
 /**
  * camel_mime_parser_drop_step:
- * @m: 
+ * @parser: MIME parser object
  * 
  * Drop the last step call.  This should only be used
  * in conjunction with seeking of the stream as the
@@ -695,17 +699,18 @@
  *
  * Use this call with care.
  **/
-void camel_mime_parser_drop_step(CamelMimeParser *m)
+void
+camel_mime_parser_drop_step (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
-
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
 	s->unstep = 0;
 	folder_scan_drop_step(s);
 }
 
 /**
  * camel_mime_parser_step:
- * @m: 
+ * @parser: MIME parser object 
  * @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.
@@ -716,7 +721,7 @@
  * has been called, then continue to return the same state
  * for that many calls.
  *
- * If the step is HSCAN_BODY then the databuffer and datalength
+ * If the step is CAMEL_MIME_PARSER_STATE_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.
@@ -728,10 +733,10 @@
  * Return value: The current new state of the parser
  * is returned.
  **/
-enum _header_state
-camel_mime_parser_step(CamelMimeParser *m, char **databuffer, size_t *datalength)
+enum _camel_mime_parser_state
+camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *datalength)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
 
 	d(printf("OLD STATE:  '%s' :\n", states[s->state]));
 
@@ -755,7 +760,7 @@
 
 /**
  * camel_mime_parser_read:
- * @m: 
+ * @parser: MIME parser object
  * @databuffer: 
  * @len: 
  * 
@@ -774,9 +779,9 @@
  * Return value: The number of bytes available, or -1 on error.
  **/
 int
-camel_mime_parser_read(CamelMimeParser *m, const char **databuffer, int len)
+camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int len)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
 	int there;
 
 	if (len == 0)
@@ -806,34 +811,35 @@
 
 /**
  * camel_mime_parser_tell:
- * @m: 
+ * @parser: MIME parser object
  * 
  * 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:
  *
- * HSCAN_INITIAL, The start of the current message.
- * HSCAN_HEADER, HSCAN_MESSAGE, HSCAN_MULTIPART, the character
+ * 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
  * position immediately after the end of the header.
- * HSCAN_BODY, Position within the message of the start
+ * CAMEL_MIME_PARSER_STATE_BODY, Position within the message of the start
  * of the current data block.
- * HSCAN_*_END, The position of the character starting
+ * CAMEL_MIME_PARSER_STATE_*_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 *m)
+off_t
+camel_mime_parser_tell (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
 
 	return folder_tell(s);
 }
 
 /**
  * camel_mime_parser_tell_start_headers:
- * @m: 
+ * @parser: MIME parser object
  * 
  * Find out the position within the file of where the
  * headers started, this is cached by the parser
@@ -842,16 +848,17 @@
  * 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 *m)
+off_t
+camel_mime_parser_tell_start_headers (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
 
 	return s->start_of_headers;
 }
 
 /**
  * camel_mime_parser_tell_start_from:
- * @m: 
+ * @parser: MIME parser object
  * 
  * If the parser is scanning From lines, then this returns
  * the position of the start of the From line.
@@ -859,17 +866,18 @@
  * 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 *m)
+off_t
+camel_mime_parser_tell_start_from (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
 
 	return s->start_of_from;
 }
 
 /**
  * camel_mime_parser_seek:
- * @m: 
- * @off: Number of bytes to offset the seek by.
+ * @parser: MIME parser object
+ * @offset: Number of bytes to offset the seek by.
  * @whence: SEEK_SET, SEEK_CUR, SEEK_END
  * 
  * Reset the source position to a known value.
@@ -883,29 +891,33 @@
  * an error (for example, trying to seek on a non-seekable
  * stream or file descriptor).
  **/
-off_t camel_mime_parser_seek(CamelMimeParser *m, off_t off, int whence)
+off_t
+camel_mime_parser_seek(CamelMimeParser *parser, off_t offset, int whence)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
-	return folder_seek(s, off, whence);
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
+	return folder_seek(s, offset, whence);
 }
 
 /**
  * camel_mime_parser_state:
- * @m: 
+ * @parser: MIME parser object
  * 
  * Get the current parser state.
  * 
  * Return value: The current parser state.
  **/
-enum _header_state camel_mime_parser_state(CamelMimeParser *m)
+enum _camel_mime_parser_state
+camel_mime_parser_state (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
 	return s->state;
 }
 
 /**
  * camel_mime_parser_stream:
- * @m: 
+ * @parser: MIME parser object
  * 
  * Get the stream, if any, the parser has been initialised
  * with.  May be used to setup sub-streams, but should not
@@ -916,15 +928,17 @@
  * if the parser is reading from a file descriptor or is
  * uninitialised.
  **/
-CamelStream *camel_mime_parser_stream(CamelMimeParser *m)
+CamelStream *
+camel_mime_parser_stream (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
 	return s->stream;
 }
 
 /**
  * camel_mime_parser_fd:
- * @m: 
+ * @parser: MIME parser object
  * 
  * Return the file descriptor, if any, the parser has been
  * initialised with.
@@ -936,17 +950,20 @@
  * 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 *m)
+int
+camel_mime_parser_fd (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
 	return s->fd;
 }
 
 /* Return errno of the parser, incase any error occured during processing */
-int camel_mime_parser_errno(CamelMimeParser *m)
+int
+camel_mime_parser_errno (CamelMimeParser *parser)
 {
-	struct _header_scan_state *s = _PRIVATE(m);
-
+	struct _header_scan_state *s = _PRIVATE (parser);
+	
 	return s->ioerrno;
 }
 
@@ -1071,9 +1088,9 @@
 #ifdef MEMPOOL
 		mempool_free(h->pool);
 #else
-		header_raw_clear(&h->headers);
+		camel_header_raw_clear(&h->headers);
 #endif
-		header_content_type_unref(h->content_type);
+		camel_content_type_unref(h->content_type);
 		if (h->pretext)
 			g_byte_array_free(h->pretext, TRUE);
 		if (h->posttext)
@@ -1169,7 +1186,7 @@
 static void
 header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h, char *header, int offset)
 {
-	struct _header_raw *l, *n;
+	struct _camel_header_raw *l, *n;
 	char *content;
 	
 	content = strchr(header, ':');
@@ -1192,7 +1209,7 @@
 		
 		n->offset = offset;
 		
-		l = (struct _header_raw *)&h->headers;
+		l = (struct _camel_header_raw *)&h->headers;
 		while (l->next) {
 			l = l->next;
 		}
@@ -1519,7 +1536,7 @@
 
 	s->parts = NULL;
 
-	s->state = HSCAN_INITIAL;
+	s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
 	return s;
 }
 
@@ -1530,7 +1547,7 @@
 		folder_scan_drop_step(s);
 	}
 	s->unstep = 0;
-	s->state = HSCAN_INITIAL;
+	s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
 }
 
 static void
@@ -1581,7 +1598,7 @@
 	const char *bound;
 	int type;
 	int state;
-	struct _header_content_type *ct = NULL;
+	CamelContentType *ct = NULL;
 	struct _header_scan_filter *f;
 	size_t presize;
 
@@ -1608,7 +1625,7 @@
 	switch (s->state) {
 
 #ifdef USE_FROM
-	case HSCAN_INITIAL:
+	case CAMEL_MIME_PARSER_STATE_INITIAL:
 		if (s->scan_from) {
 			h = g_malloc0(sizeof(*h));
 			h->boundary = g_strdup("From ");
@@ -1616,13 +1633,13 @@
 			h->boundarylenfinal = h->boundarylen;
 			h->from_line = g_byte_array_new();
 			folder_push_part(s, h);
-			s->state = HSCAN_PRE_FROM;
+			s->state = CAMEL_MIME_PARSER_STATE_PRE_FROM;
 		} else {
 			s->start_of_from = -1;
 			goto scan_header;
 		}
 
-	case HSCAN_PRE_FROM:
+	case CAMEL_MIME_PARSER_STATE_PRE_FROM:
 
 		h = s->parts;
 		do {
@@ -1637,68 +1654,68 @@
 			d(printf("found 'From '\n"));
 			s->start_of_from = folder_tell(s);
 			folder_scan_skip_line(s, h->from_line);
-			h->savestate = HSCAN_INITIAL;
-			s->state = HSCAN_FROM;
+			h->savestate = CAMEL_MIME_PARSER_STATE_INITIAL;
+			s->state = CAMEL_MIME_PARSER_STATE_FROM;
 		} else {
 			folder_pull_part(s);
-			s->state = HSCAN_EOF;
+			s->state = CAMEL_MIME_PARSER_STATE_EOF;
 		}
 		return;
 #else
-	case HSCAN_INITIAL:
-	case HSCAN_PRE_FROM:
+	case CAMEL_MIME_PARSER_STATE_INITIAL:
+	case CAMEL_MIME_PARSER_STATE_PRE_FROM:
 #endif /* !USE_FROM */
 
 	scan_header:
-	case HSCAN_FROM:
+	case CAMEL_MIME_PARSER_STATE_FROM:
 		s->start_of_headers = folder_tell(s);
 		h = folder_scan_header(s, &state);
 #ifdef USE_FROM
 		if (s->scan_from)
-			h->savestate = HSCAN_FROM_END;
+			h->savestate = CAMEL_MIME_PARSER_STATE_FROM_END;
 		else
 #endif
-			h->savestate = HSCAN_EOF;
+			h->savestate = CAMEL_MIME_PARSER_STATE_EOF;
 
 		/* FIXME: should this check for MIME-Version: 1.0 as well? */
 
-		type = HSCAN_HEADER;
-		if ( (content = header_raw_find(&h->headers, "Content-Type", NULL))
-		     && (ct = header_content_type_decode(content))) {
+		type = CAMEL_MIME_PARSER_STATE_HEADER;
+		if ( (content = camel_header_raw_find(&h->headers, "Content-Type", NULL))
+		     && (ct = camel_content_type_decode(content))) {
 			if (!strcasecmp(ct->type, "multipart")) {
-				if (!header_content_type_is(ct, "multipart", "signed")
-				    && (bound = header_content_type_param(ct, "boundary"))) {
+				if (!camel_content_type_is(ct, "multipart", "signed")
+				    && (bound = camel_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 = HSCAN_MULTIPART;
+					type = CAMEL_MIME_PARSER_STATE_MULTIPART;
 				} else {
-					/*header_content_type_unref(ct);
-					  ct = header_content_type_decode("text/plain");*/
+					/*camel_content_type_unref(ct);
+					  ct = camel_content_type_decode("text/plain");*/
 /* We can't quite do this, as it will mess up all the offsets ... */
-/*					header_raw_replace(&h->headers, "Content-Type", "text/plain", offset);*/
+/*					camel_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 = HSCAN_MESSAGE;
+					type = CAMEL_MIME_PARSER_STATE_MESSAGE;
 				}
 			}
 		} else {
 			/* make the default type for multipart/digest be message/rfc822 */
 			if ((s->parts
-			     && header_content_type_is(s->parts->content_type, "multipart", "digest"))) {
-				ct = header_content_type_decode("message/rfc822");
-				type = HSCAN_MESSAGE;
+			     && camel_content_type_is(s->parts->content_type, "multipart", "digest"))) {
+				ct = camel_content_type_decode("message/rfc822");
+				type = CAMEL_MIME_PARSER_STATE_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 = header_content_type_decode("text/plain");
+				ct = camel_content_type_decode("text/plain");
 			}
 		}
 		h->content_type = ct;
@@ -1706,10 +1723,10 @@
 		s->state = type;
 		return;
 		
-	case HSCAN_HEADER:
-		s->state = HSCAN_BODY;
+	case CAMEL_MIME_PARSER_STATE_HEADER:
+		s->state = CAMEL_MIME_PARSER_STATE_BODY;
 		
-	case HSCAN_BODY:
+	case CAMEL_MIME_PARSER_STATE_BODY:
 		h = s->parts;
 		*datalength = 0;
 		presize = SCAN_HEAD;
@@ -1745,10 +1762,10 @@
 		if (*datalength > 0)
 			return;
 		
-		s->state = HSCAN_BODY_END;
+		s->state = CAMEL_MIME_PARSER_STATE_BODY_END;
 		break;
 		
-	case HSCAN_MULTIPART:
+	case CAMEL_MIME_PARSER_STATE_MULTIPART:
 		h = s->parts;
 		do {
 			do {
@@ -1774,9 +1791,9 @@
 				d(printf("got boundary: %s\n", hb->boundary));
 				folder_scan_skip_line(s, NULL);
 				if (!state) {
-					s->state = HSCAN_FROM;
+					s->state = CAMEL_MIME_PARSER_STATE_FROM;
 					folder_scan_step(s, databuffer, datalength);
-					s->parts->savestate = HSCAN_MULTIPART; /* set return state for the new head part */
+					s->parts->savestate = CAMEL_MIME_PARSER_STATE_MULTIPART; /* set return state for the new head part */
 					return;
 				}
 			} else {
@@ -1784,26 +1801,26 @@
 			}
 		} while (1);
 
-		s->state = HSCAN_MULTIPART_END;
+		s->state = CAMEL_MIME_PARSER_STATE_MULTIPART_END;
 		break;
 
-	case HSCAN_MESSAGE:
-		s->state = HSCAN_FROM;
+	case CAMEL_MIME_PARSER_STATE_MESSAGE:
+		s->state = CAMEL_MIME_PARSER_STATE_FROM;
 		folder_scan_step(s, databuffer, datalength);
-		s->parts->savestate = HSCAN_MESSAGE_END;
+		s->parts->savestate = CAMEL_MIME_PARSER_STATE_MESSAGE_END;
 		break;
 
-	case HSCAN_FROM_END:
-	case HSCAN_BODY_END:
-	case HSCAN_MULTIPART_END:
-	case HSCAN_MESSAGE_END:
+	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:
 		s->state = s->parts->savestate;
 		folder_pull_part(s);
-		if (s->state & HSCAN_END)
+		if (s->state & CAMEL_MIME_PARSER_STATE_END)
 			return;
 		goto tail_recurse;
 
-	case HSCAN_EOF:
+	case CAMEL_MIME_PARSER_STATE_EOF:
 		return;
 
 	default:
@@ -1819,30 +1836,30 @@
 folder_scan_drop_step(struct _header_scan_state *s)
 {
 	switch (s->state) {
-	case HSCAN_EOF:
-		s->state = HSCAN_INITIAL;
-	case HSCAN_INITIAL:
+	case CAMEL_MIME_PARSER_STATE_EOF:
+		s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
+	case CAMEL_MIME_PARSER_STATE_INITIAL:
 		return;
 
-	case HSCAN_FROM:
-	case HSCAN_PRE_FROM:
-		s->state = HSCAN_INITIAL;
+	case CAMEL_MIME_PARSER_STATE_FROM:
+	case CAMEL_MIME_PARSER_STATE_PRE_FROM:
+		s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
 		folder_pull_part(s);
 		return;
 
-	case HSCAN_MESSAGE:
-	case HSCAN_HEADER:
-	case HSCAN_MULTIPART:
-
-	case HSCAN_FROM_END:
-	case HSCAN_BODY_END:
-	case HSCAN_MULTIPART_END:
-	case HSCAN_MESSAGE_END:
+	case CAMEL_MIME_PARSER_STATE_MESSAGE:
+	case CAMEL_MIME_PARSER_STATE_HEADER:
+	case CAMEL_MIME_PARSER_STATE_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:
 
 		s->state = s->parts->savestate;
 		folder_pull_part(s);
-		if (s->state & HSCAN_END) {
-			s->state &= ~HSCAN_END;
+		if (s->state & CAMEL_MIME_PARSER_STATE_END) {
+			s->state &= ~CAMEL_MIME_PARSER_STATE_END;
 		}
 		return;
 	default:
@@ -1886,16 +1903,16 @@
 		s->scan_from = FALSE;
 #if 0
 		h = g_malloc0(sizeof(*h));
-		h->savestate = HSCAN_EOF;
+		h->savestate = CAMEL_MIME_PARSER_STATE_EOF;
 		folder_push_part(s, h);
 #endif	
-		while (s->state != HSCAN_EOF) {
+		while (s->state != CAMEL_MIME_PARSER_STATE_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 HSCAN_HEADER:
+			case CAMEL_MIME_PARSER_STATE_HEADER:
 				if (s->parts->content_type
-				    && (charset = header_content_type_param(s->parts->content_type, "charset"))) {
+				    && (charset = camel_content_type_param(s->parts->content_type, "charset"))) {
 					if (strcasecmp(charset, "us-ascii")) {
 #if 0
 						folder_push_filter_charset(s, "UTF-8", charset);
@@ -1907,7 +1924,7 @@
 					charset = NULL;
 				}
 
-				encoding = header_raw_find(&s->parts->headers, "Content-transfer-encoding", 0);
+				encoding = camel_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");
@@ -1933,10 +1950,10 @@
 				}
 
 				break;
-			case HSCAN_BODY:
+			case CAMEL_MIME_PARSER_STATE_BODY:
 				printf("got body %d '%.*s'\n",  len, len, data);
 				break;
-			case HSCAN_BODY_END:
+			case CAMEL_MIME_PARSER_STATE_BODY_END:
 				printf("end body %d '%.*s'\n",  len, len, data);
 				if (encoding && !strncasecmp(encoding, " base64", 7)) {
 					printf("removing filters\n");
Index: camel-mime-parser.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-parser.h,v
retrieving revision 1.17
retrieving revision 1.19
diff -u -r1.17 -r1.19
--- camel-mime-parser.h	16 May 2003 18:47:49 -0000	1.17
+++ camel-mime-parser.h	26 Aug 2003 16:05:59 -0000	1.19
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- *  Copyright (C) 2000 Ximian Inc.
+ *  Copyright (C) 2000-2003 Ximian Inc.
  *
  *  Authors: Michael Zucchi <notzed ximian com>
  *
@@ -43,27 +43,26 @@
 /* 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 _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 */
-
+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 */
 };
 
 struct _CamelMimeParser {
@@ -75,70 +74,70 @@
 struct _CamelMimeParserClass {
 	CamelObjectClass parent_class;
 
-	void (*message)(CamelMimeParser *, void *headers);
-	void (*part)(CamelMimeParser *);
-	void (*content)(CamelMimeParser *);
+	void (*message) (CamelMimeParser *parser, void *headers);
+	void (*part) (CamelMimeParser *parser);
+	void (*content) (CamelMimeParser *parser);
 };
 
-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 *);
+int		camel_mime_parser_errno (CamelMimeParser *parser);
 
 /* using an fd will be a little faster, but not much (over a simple stream) */
-int		camel_mime_parser_init_with_fd(CamelMimeParser *, int fd);
-int		camel_mime_parser_init_with_stream(CamelMimeParser *m, CamelStream *stream);
+int		camel_mime_parser_init_with_fd (CamelMimeParser *parser, int fd);
+int		camel_mime_parser_init_with_stream (CamelMimeParser *parser, CamelStream *stream);
 
 /* get the stream or fd back of the parser */
-CamelStream    *camel_mime_parser_stream(CamelMimeParser *m);
-int		camel_mime_parser_fd(CamelMimeParser *m);
+CamelStream    *camel_mime_parser_stream (CamelMimeParser *parser);
+int		camel_mime_parser_fd (CamelMimeParser *parser);
 
 /* scan 'From' separators? */
-void camel_mime_parser_scan_from(CamelMimeParser *, int);
+void camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from);
 /* Do we want to know about the pre-from data? */
-void camel_mime_parser_scan_pre_from(CamelMimeParser *, int);
+void camel_mime_parser_scan_pre_from (CamelMimeParser *parser, gboolean scan_pre_from);
 
 /* what headers to save, MUST include ^Content-Type: */
-int camel_mime_parser_set_header_regex(CamelMimeParser *m, char *matchstr);
+int camel_mime_parser_set_header_regex (CamelMimeParser *parser, char *matchstr);
 
 /* normal interface */
-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 *);
+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);
 
 /* read through the parser */
-int camel_mime_parser_read(CamelMimeParser *m, const char **databuffer, int len);
+int camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int len);
 
 /* get content type for the current part/header */
-struct _header_content_type *camel_mime_parser_content_type(CamelMimeParser *);
+CamelContentType *camel_mime_parser_content_type (CamelMimeParser *parser);
 
 /* get/change raw header by name */
-const char *camel_mime_parser_header(CamelMimeParser *, const char *, int *offset);
+const char *camel_mime_parser_header (CamelMimeParser *parser, const char *name, int *offset);
 
 /* get all raw headers. READ ONLY! */
-struct _header_raw *camel_mime_parser_headers_raw(CamelMimeParser *);
+struct _camel_header_raw *camel_mime_parser_headers_raw (CamelMimeParser *parser);
 
 /* get multipart pre/postface */
-const char *camel_mime_parser_preface(CamelMimeParser *m);
-const char *camel_mime_parser_postface(CamelMimeParser *m);
+const char *camel_mime_parser_preface (CamelMimeParser *parser);
+const char *camel_mime_parser_postface (CamelMimeParser *parser);
 
 /* return the from line content */
-const char *camel_mime_parser_from_line(CamelMimeParser *m);
+const char *camel_mime_parser_from_line (CamelMimeParser *parser);
 
 /* add a processing filter for body contents */
-int camel_mime_parser_filter_add(CamelMimeParser *, CamelMimeFilter *);
-void camel_mime_parser_filter_remove(CamelMimeParser *, int);
+int camel_mime_parser_filter_add (CamelMimeParser *parser, CamelMimeFilter *filter);
+void camel_mime_parser_filter_remove (CamelMimeParser *parser, int id);
 
 /* 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 *);
-off_t camel_mime_parser_seek(CamelMimeParser *, off_t, int);
+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_start_headers(CamelMimeParser *);
-off_t camel_mime_parser_tell_start_from(CamelMimeParser *);
+off_t camel_mime_parser_tell_start_headers (CamelMimeParser *parser);
+off_t camel_mime_parser_tell_start_from (CamelMimeParser *parser);
 
 #ifdef __cplusplus
 }
Index: camel-mime-part-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-part-utils.c,v
retrieving revision 1.95
retrieving revision 1.97
diff -u -r1.95 -r1.97
--- camel-mime-part-utils.c	15 Aug 2003 20:57:29 -0000	1.95
+++ camel-mime-part-utils.c	26 Aug 2003 16:05:59 -0000	1.97
@@ -66,7 +66,7 @@
 	
 	/* read in the entire content */
 	buffer = g_byte_array_new ();
-	while (camel_mime_parser_step (mp, &buf, &len) != HSCAN_BODY_END) {
+	while (camel_mime_parser_step (mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_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 @@
 
 	ct = camel_mime_parser_content_type (mp);
 
-	encoding = header_content_encoding_decode (camel_mime_parser_header (mp, "Content-Transfer-Encoding", NULL));
+	encoding = camel_header_content_encoding_decode (camel_mime_parser_header (mp, "Content-Transfer-Encoding", NULL));
 	
 	switch (camel_mime_parser_state (mp)) {
-	case HSCAN_HEADER:
+	case CAMEL_MIME_PARSER_STATE_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 (header_content_type_is (ct, "multipart", "signed")) {
+		if (camel_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 @@
 			simple_data_wrapper_construct_from_parser (content, mp);
 		}
 		break;
-	case HSCAN_MESSAGE:
+	case CAMEL_MIME_PARSER_STATE_MESSAGE:
 		d(printf("Creating message part\n"));
 		content = (CamelDataWrapper *) camel_mime_message_new ();
 		camel_mime_part_construct_from_parser ((CamelMimePart *)content, mp);
 		break;
-	case HSCAN_MULTIPART:
+	case CAMEL_MIME_PARSER_STATE_MULTIPART:
 		d(printf("Creating multi-part\n"));
-		if (header_content_type_is (ct, "multipart", "encrypted"))
+		if (camel_content_type_is (ct, "multipart", "encrypted"))
 			content = (CamelDataWrapper *) camel_multipart_encrypted_new ();
-		else if (header_content_type_is (ct, "multipart", "signed"))
+		else if (camel_content_type_is (ct, "multipart", "signed"))
 			content = (CamelDataWrapper *) camel_multipart_signed_new ();
 		else
 			content = (CamelDataWrapper *) camel_multipart_new ();
Index: camel-mime-part.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-part.c,v
retrieving revision 1.157
retrieving revision 1.159
diff -u -r1.157 -r1.159
--- camel-mime-part.c	15 Aug 2003 20:57:29 -0000	1.157
+++ camel-mime-part.c	26 Aug 2003 16:05:59 -0000	1.159
@@ -4,8 +4,9 @@
 /* 
  * Authors: Bertrand Guiheneuf <bertrand helixcode com>
  *	    Michael Zucchi <notzed ximian com>
+ *          Jeffrey Stedfast <fejj ximian com>
  *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
+ * Copyright 1999-2003 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 
@@ -22,6 +23,7 @@
  * USA
  */
 
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -76,10 +78,10 @@
 static int	       construct_from_stream	       (CamelDataWrapper *dw, CamelStream *stream);
 
 /* from CamelMedium */ 
-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 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 GArray         *get_headers                     (CamelMedium *medium);
 static void            free_headers                    (CamelMedium *medium, GArray *headers);
 
@@ -92,9 +94,9 @@
 static void set_disposition (CamelMimePart *mime_part, const char *disposition);
 
 /* format output of headers */
-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);
+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);
 
 
 /* loads in a hash table the set of header names we */
@@ -155,8 +157,8 @@
 	CamelMimePart *mime_part = CAMEL_MIME_PART (object);
 	
 	if (((CamelDataWrapper *) mime_part)->mime_type)
-		header_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
-	((CamelDataWrapper *) mime_part)->mime_type = header_content_type_new ("text", "plain");
+		camel_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
+	((CamelDataWrapper *) mime_part)->mime_type = camel_content_type_new ("text", "plain");
 	
 	mime_part->description          = NULL;
 	mime_part->disposition          = NULL;
@@ -178,9 +180,9 @@
 	g_free (mime_part->content_MD5);
 	g_free (mime_part->content_location);
 	camel_string_list_free (mime_part->content_languages);
-	header_disposition_unref(mime_part->disposition);
+	camel_content_disposition_unref(mime_part->disposition);
 	
-	header_raw_clear(&mime_part->headers);
+	camel_header_raw_clear(&mime_part->headers);
 }
 
 
@@ -208,7 +210,7 @@
 /* **** */
 
 static gboolean
-process_header(CamelMedium *medium, const char *header_name, const char *header_value)
+process_header(CamelMedium *medium, const char *name, const char *value)
 {
 	CamelMimePart *mime_part = CAMEL_MIME_PART (medium);
 	CamelHeaderType header_type;
@@ -219,41 +221,41 @@
 	/* 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, header_name);
+	header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, name);
 	switch (header_type) {
 	case HEADER_DESCRIPTION: /* raw header->utf8 conversion */
 		g_free (mime_part->description);
 		if (((CamelDataWrapper *) mime_part)->mime_type) {
-			charset = header_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "charset");
+			charset = camel_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "charset");
 			charset = e_iconv_charset_name (charset);
 		} else
 			charset = NULL;
-		mime_part->description = g_strstrip (header_decode_string (header_value, charset));
+		mime_part->description = g_strstrip (camel_header_decode_string (value, charset));
 		break;
 	case HEADER_DISPOSITION:
-		set_disposition (mime_part, header_value);
+		set_disposition (mime_part, value);
 		break;
 	case HEADER_CONTENT_ID:
 		g_free (mime_part->content_id);
-		mime_part->content_id = header_contentid_decode (header_value);
+		mime_part->content_id = camel_header_contentid_decode (value);
 		break;
 	case HEADER_ENCODING:
-		text = header_token_decode (header_value);
+		text = camel_header_token_decode (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 (header_value);
+		mime_part->content_MD5 = g_strdup (value);
 		break;
 	case HEADER_CONTENT_LOCATION:
 		g_free (mime_part->content_location);
-		mime_part->content_location = header_location_decode (header_value);
+		mime_part->content_location = camel_header_location_decode (value);
 		break;
 	case HEADER_CONTENT_TYPE:
 		if (((CamelDataWrapper *) mime_part)->mime_type)
-			header_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
-		((CamelDataWrapper *) mime_part)->mime_type = header_content_type_decode (header_value);
+			camel_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
+		((CamelDataWrapper *) mime_part)->mime_type = camel_content_type_decode (value);
 		break;
 	default:
 		return FALSE;
@@ -262,16 +264,16 @@
 }
 
 static void
-set_header (CamelMedium *medium, const char *header_name, const void *header_value)
+set_header (CamelMedium *medium, const char *name, const void *value)
 {
 	CamelMimePart *part = CAMEL_MIME_PART (medium);
 	
-	process_header(medium, header_name, header_value);
-	header_raw_replace(&part->headers, header_name, header_value, -1);
+	process_header(medium, name, value);
+	camel_header_raw_replace(&part->headers, name, value, -1);
 }
 
 static void
-add_header (CamelMedium *medium, const char *header_name, const void *header_value)
+add_header (CamelMedium *medium, const char *name, const void *value)
 {
 	CamelMimePart *part = CAMEL_MIME_PART (medium);
 	
@@ -280,27 +282,27 @@
 	/* 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, header_name, header_value))
-		header_raw_replace(&part->headers, header_name, header_value, -1);
+	if (process_header(medium, name, value))
+		camel_header_raw_replace(&part->headers, name, value, -1);
 	else
-		header_raw_append(&part->headers, header_name, header_value, -1);
+		camel_header_raw_append(&part->headers, name, value, -1);
 }
 
 static void
-remove_header (CamelMedium *medium, const char *header_name)
+remove_header (CamelMedium *medium, const char *name)
 {
 	CamelMimePart *part = (CamelMimePart *)medium;
 	
-	process_header(medium, header_name, NULL);
-	header_raw_remove(&part->headers, header_name);
+	process_header(medium, name, NULL);
+	camel_header_raw_remove(&part->headers, name);
 }
 
 static const void *
-get_header (CamelMedium *medium, const char *header_name)
+get_header (CamelMedium *medium, const char *name)
 {
 	CamelMimePart *part = (CamelMimePart *)medium;
 
-	return header_raw_find(&part->headers, header_name, NULL);
+	return camel_header_raw_find(&part->headers, name, NULL);
 }
 
 static GArray *
@@ -309,7 +311,7 @@
 	CamelMimePart *part = (CamelMimePart *)medium;
 	GArray *headers;
 	CamelMediumHeader header;
-	struct _header_raw *h;
+	struct _camel_header_raw *h;
 
 	headers = g_array_new (FALSE, FALSE, sizeof (CamelMediumHeader));
 	for (h = part->headers; h; h = h->next) {
@@ -331,7 +333,7 @@
 void
 camel_mime_part_set_description (CamelMimePart *mime_part, const char *description)
 {
-	char *text = header_encode_string (description);
+	char *text = camel_header_encode_string (description);
 	
 	camel_medium_set_header (CAMEL_MEDIUM (mime_part),
 				 "Content-Description", text);
@@ -349,9 +351,9 @@
 static void
 set_disposition (CamelMimePart *mime_part, const char *disposition)
 {
-	header_disposition_unref(mime_part->disposition);
+	camel_content_disposition_unref(mime_part->disposition);
 	if (disposition)
-		mime_part->disposition = header_disposition_decode(disposition);
+		mime_part->disposition = camel_content_disposition_decode(disposition);
 	else
 		mime_part->disposition = NULL;
 }
@@ -370,7 +372,7 @@
 		g_free(mime_part->disposition->disposition);
 		mime_part->disposition->disposition = g_strdup(disposition);
 	}
-	text = header_disposition_format(mime_part->disposition);
+	text = camel_content_disposition_format(mime_part->disposition);
 
 	camel_medium_set_header (CAMEL_MEDIUM (mime_part),
 				 "Content-Disposition", text);
@@ -396,17 +398,17 @@
 	char *str;
 	
 	if (mime_part->disposition == NULL)
-		mime_part->disposition = header_disposition_decode("attachment");
+		mime_part->disposition = camel_content_disposition_decode("attachment");
 
-	header_set_param(&mime_part->disposition->params, "filename", filename);
-	str = header_disposition_format(mime_part->disposition);
+	camel_header_set_param(&mime_part->disposition->params, "filename", filename);
+	str = camel_content_disposition_format(mime_part->disposition);
 
 	camel_medium_set_header (CAMEL_MEDIUM (mime_part),
 				 "Content-Disposition", str);
 	g_free(str);
 	
-	header_content_type_set_param (((CamelDataWrapper *) mime_part)->mime_type, "name", filename);
-	str = header_content_type_format (((CamelDataWrapper *) mime_part)->mime_type);
+	camel_content_type_set_param (((CamelDataWrapper *) mime_part)->mime_type, "name", filename);
+	str = camel_content_type_format (((CamelDataWrapper *) mime_part)->mime_type);
 	camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", str);
 	g_free (str);
 }
@@ -415,12 +417,12 @@
 camel_mime_part_get_filename (CamelMimePart *mime_part)
 {
 	if (mime_part->disposition) {
-		const char *name = header_param (mime_part->disposition->params, "filename");
+		const char *name = camel_header_param (mime_part->disposition->params, "filename");
 		if (name)
 			return name;
 	}
 	
-	return header_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "name");
+	return camel_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "name");
 }
 
 
@@ -434,7 +436,7 @@
 	if (contentid)
 		id = g_strstrip (g_strdup (contentid));
 	else
-		id = header_msgid_generate ();
+		id = camel_header_msgid_generate ();
 	
 	cid = g_strdup_printf ("<%s>", id);
 	g_free (id);
@@ -545,7 +547,7 @@
 	if (mime_part->mime_type != content_type) {
 		char *txt;
 		
-		txt = header_content_type_format (content_type);
+		txt = camel_content_type_format (content_type);
 		camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", txt);
 		g_free (txt);
 	}
@@ -554,7 +556,7 @@
 /**********************************************************************/
 
 static ssize_t
-write_references(CamelStream *stream, struct _header_raw *h)
+write_references(CamelStream *stream, struct _camel_header_raw *h)
 {
 	ssize_t len, out, total;
 	char *v, *ids, *ide;
@@ -598,12 +600,12 @@
 #if 0
 /* not needed - yet - handled by default case */
 static ssize_t
-write_fold(CamelStream *stream, struct _header_raw *h)
+write_fold(CamelStream *stream, struct _camel_header_raw *h)
 {
 	char *val;
 	int count;
 
-	val = header_fold(h->value, strlen(h->name));
+	val = camel_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);
 
@@ -612,7 +614,7 @@
 #endif
 
 static ssize_t
-write_raw(CamelStream *stream, struct _header_raw *h)
+write_raw(CamelStream *stream, struct _camel_header_raw *h)
 {
 	char *val = h->value;
 
@@ -636,9 +638,9 @@
 	/* TODO: content-languages header? */
 	
 	if (mp->headers) {
-		struct _header_raw *h = mp->headers;
+		struct _camel_header_raw *h = mp->headers;
 		char *val;
-		ssize_t (*writefn)(CamelStream *stream, struct _header_raw *);
+		ssize_t (*writefn)(CamelStream *stream, struct _camel_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) */
@@ -648,7 +650,7 @@
 				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 = header_fold(val, strlen(h->name));
+				val = camel_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 {
@@ -676,9 +678,9 @@
 		gboolean reencode = FALSE;
 		const char *filename;
 		
-		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 (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 (content_charset && part_charset) {
 				content_charset = e_iconv_charset_name (content_charset);
@@ -722,7 +724,7 @@
 			}
 			
 			/* we only re-do crlf on encoded blocks */
-			if (filter && header_content_type_is (dw->mime_type, "text", "*")) {
+			if (filter && camel_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);
 				
@@ -775,7 +777,7 @@
 construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp)
 {
 	CamelDataWrapper *dw = (CamelDataWrapper *) mime_part;
-	struct _header_raw *headers;
+	struct _camel_header_raw *headers;
 	const char *content;
 	char *buf;
 	size_t len;
@@ -784,18 +786,18 @@
 	d(printf("mime_part::construct_from_parser()\n"));
 	
 	switch (camel_mime_parser_step(mp, &buf, &len)) {
-	case HSCAN_MESSAGE:
+	case CAMEL_MIME_PARSER_STATE_MESSAGE:
 		/* set the default type of a message always */
 		if (dw->mime_type)
-			header_content_type_unref (dw->mime_type);
-		dw->mime_type = header_content_type_decode ("message/rfc822");
-	case HSCAN_HEADER:
-	case HSCAN_MULTIPART:
+			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:
 		/* 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 = header_raw_find(&headers, "content-type", NULL);
+		content = camel_header_raw_find(&headers, "content-type", NULL);
 		if (content)
 			process_header((CamelMedium *)dw, "content-type", content);
 
Index: camel-mime-part.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-part.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- camel-mime-part.h	15 Aug 2003 20:57:29 -0000	1.59
+++ camel-mime-part.h	25 Aug 2003 21:01:36 -0000	1.60
@@ -46,12 +46,12 @@
 struct _CamelMimePart {
 	CamelMedium parent_object;
 	
-	struct _header_raw *headers; /* mime headers */
+	struct _camel_header_raw *headers; /* mime headers */
 	
 	/* All fields here are -** PRIVATE **- */
 	/* TODO: these should be in a camelcontentinfo */
 	char *description;
-	CamelMimeDisposition *disposition;
+	CamelContentDisposition *disposition;
 	char *content_id;
 	char *content_MD5;
 	char *content_location;
Index: camel-mime-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-utils.c,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -r1.187 -r1.188
--- camel-mime-utils.c	29 Jul 2003 13:52:43 -0000	1.187
+++ camel-mime-utils.c	25 Aug 2003 21:01:36 -0000	1.188
@@ -1193,7 +1193,7 @@
 }
 
 char *
-header_decode_string (const char *in, const char *default_charset)
+camel_header_decode_string (const char *in, const char *default_charset)
 {
 	if (in == NULL)
 		return NULL;
@@ -1310,7 +1310,7 @@
 
 /* TODO: Should this worry about quotes?? */
 char *
-header_encode_string (const unsigned char *in)
+camel_header_encode_string (const unsigned char *in)
 {
 	const unsigned char *inptr = in, *start, *word;
 	gboolean last_was_encoded = FALSE;
@@ -1608,7 +1608,7 @@
 
 /* encodes a phrase sequence (different quoting/encoding rules to strings) */
 char *
-header_encode_phrase (const unsigned char *in)
+camel_header_encode_phrase (const unsigned char *in)
 {
 	struct _phrase_word *word = NULL, *last_word = NULL;
 	GList *words, *wordl;
@@ -1622,7 +1622,8 @@
 	if (!words)
 		return NULL;
 	
-	while (header_encode_phrase_merge_words (&words));
+	while (header_encode_phrase_merge_words (&words))
+		;
 	
 	out = g_string_new ("");
 	
@@ -1708,7 +1709,7 @@
 }
 
 char *
-header_token_decode(const char *in)
+camel_header_token_decode(const char *in)
 {
 	if (in == NULL)
 		return NULL;
@@ -1805,7 +1806,7 @@
 
 /* should this return -1 for no int? */
 int
-header_decode_int(const char **in)
+camel_header_decode_int(const char **in)
 {
 	const char *inptr = *in;
 	int c, v=0;
@@ -1950,7 +1951,7 @@
 				*value_is_encoded = TRUE;
 		} else {
 			/* form := param*#=value or param*#*=value */
-			*part = header_decode_int (&inptr);
+			*part = camel_header_decode_int (&inptr);
 			header_decode_lwsp (&inptr);
 			if (*inptr == '*') {
 				/* form := param*#*=value */
@@ -2076,7 +2077,7 @@
 }
 
 char *
-header_param (struct _header_param *p, const char *name)
+camel_header_param (struct _camel_header_param *p, const char *name)
 {
 	while (p && strcasecmp (p->name, name) != 0)
 		p = p->next;
@@ -2085,10 +2086,10 @@
 	return NULL;
 }
 
-struct _header_param *
-header_set_param (struct _header_param **l, const char *name, const char *value)
+struct _camel_header_param *
+camel_header_set_param (struct _camel_header_param **l, const char *name, const char *value)
 {
-	struct _header_param *p = (struct _header_param *)l, *pn;
+	struct _camel_header_param *p = (struct _camel_header_param *)l, *pn;
 	
 	if (name == NULL)
 		return NULL;
@@ -2123,21 +2124,21 @@
 }
 
 const char *
-header_content_type_param (struct _header_content_type *t, const char *name)
+camel_content_type_param (CamelContentType *t, const char *name)
 {
 	if (t==NULL)
 		return NULL;
-	return header_param (t->params, name);
+	return camel_header_param (t->params, name);
 }
 
 void
-header_content_type_set_param (struct _header_content_type *t, const char *name, const char *value)
+camel_content_type_set_param (CamelContentType *t, const char *name, const char *value)
 {
-	header_set_param (&t->params, name, value);
+	camel_header_set_param (&t->params, name, value);
 }
 
 /**
- * header_content_type_is:
+ * camel_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.
@@ -2149,7 +2150,7 @@
  * Return value: #TRUE or #FALSE depending on the matching of the type.
  **/
 int
-header_content_type_is(struct _header_content_type *ct, const char *type, const char *subtype)
+camel_content_type_is(CamelContentType *ct, const char *type, const char *subtype)
 {
 	/* no type == text/plain or text/"*" */
 	if (ct==NULL || (ct->type == NULL && ct->subtype == NULL)) {
@@ -2166,9 +2167,9 @@
 }
 
 void
-header_param_list_free(struct _header_param *p)
+camel_header_param_list_free(struct _camel_header_param *p)
 {
-	struct _header_param *n;
+	struct _camel_header_param *n;
 
 	while (p) {
 		n = p->next;
@@ -2179,10 +2180,10 @@
 	}
 }
 
-struct _header_content_type *
-header_content_type_new(const char *type, const char *subtype)
+CamelContentType *
+camel_content_type_new(const char *type, const char *subtype)
 {
-	struct _header_content_type *t = g_malloc(sizeof(*t));
+	CamelContentType *t = g_malloc(sizeof(*t));
 
 	t->type = g_strdup(type);
 	t->subtype = g_strdup(subtype);
@@ -2192,7 +2193,7 @@
 }
 
 void
-header_content_type_ref(struct _header_content_type *ct)
+camel_content_type_ref(CamelContentType *ct)
 {
 	if (ct)
 		ct->refcount++;
@@ -2200,11 +2201,11 @@
 
 
 void
-header_content_type_unref(struct _header_content_type *ct)
+camel_content_type_unref(CamelContentType *ct)
 {
 	if (ct) {
 		if (ct->refcount <= 1) {
-			header_param_list_free(ct->params);
+			camel_header_param_list_free(ct->params);
 			g_free(ct->type);
 			g_free(ct->subtype);
 			g_free(ct);
@@ -2332,7 +2333,7 @@
    *(word) '<' [ *('@' domain ) ':' ] word *( '.' word) @ domain
    */
 
-static struct _header_address *
+static struct _camel_header_address *
 header_decode_mailbox(const char **in, const char *charset)
 {
 	const char *inptr = *in;
@@ -2340,7 +2341,7 @@
 	int closeme = FALSE;
 	GString *addr;
 	GString *name = NULL;
-	struct _header_address *address = NULL;
+	struct _camel_header_address *address = NULL;
 	const char *comment = NULL;
 
 	addr = g_string_new("");
@@ -2355,7 +2356,7 @@
 			char *text, *last;
 
 			/* perform internationalised decoding, and append */
-			text = header_decode_string (pre, charset);
+			text = camel_header_decode_string (pre, charset);
 			g_string_append (name, text);
 			last = pre;
 			g_free(text);
@@ -2457,7 +2458,7 @@
 				g_string_append_c(addr, *inptr);
 
 			/* check for address is encoded word ... */
-			text = header_decode_string(addr->str, charset);
+			text = camel_header_decode_string(addr->str, charset);
 			if (name == NULL) {
 				name = addr;
 				addr = g_string_new("");
@@ -2513,7 +2514,7 @@
 			if (comend > comstart) {
 				d(printf("  looking at subset '%.*s'\n", comend-comstart, comstart));
 				tmp = g_strndup (comstart, comend-comstart);
-				text = header_decode_string (tmp, charset);
+				text = camel_header_decode_string (tmp, charset);
 				name = g_string_new (text);
 				g_free (tmp);
 				g_free (text);
@@ -2541,7 +2542,7 @@
 			addr = out;
 		}
 		
-		address = header_address_new_name(name ? name->str : "", addr->str);
+		address = camel_header_address_new_name(name ? name->str : "", addr->str);
 	}
 	
 	d(printf("got mailbox: %s\n", addr->str));
@@ -2553,13 +2554,13 @@
 	return address;
 }
 
-static struct _header_address *
+static struct _camel_header_address *
 header_decode_address(const char **in, const char *charset)
 {
 	const char *inptr = *in;
 	char *pre;
 	GString *group = g_string_new("");
-	struct _header_address *addr = NULL, *member;
+	struct _camel_header_address *addr = NULL, *member;
 
 	/* pre-scan, trying to work out format, discard results */
 	header_decode_lwsp(&inptr);
@@ -2571,7 +2572,7 @@
 	header_decode_lwsp(&inptr);
 	if (*inptr == ':') {
 		d(printf("group detected: %s\n", group->str));
-		addr = header_address_new_group(group->str);
+		addr = camel_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 */
@@ -2581,7 +2582,7 @@
 			do {
 				member = header_decode_mailbox(&inptr, charset);
 				if (member)
-					header_address_add_member(addr, member);
+					camel_header_address_add_member(addr, member);
 				header_decode_lwsp(&inptr);
 				if (*inptr == ',')
 					inptr++;
@@ -2607,7 +2608,7 @@
 }
 
 static char *
-header_msgid_decode_internal(const char **in)
+camel_header_msgid_decode_internal(const char **in)
 {
 	const char *inptr = *in;
 	char *msgid = NULL;
@@ -2638,16 +2639,16 @@
 }
 
 char *
-header_msgid_decode(const char *in)
+camel_header_msgid_decode(const char *in)
 {
 	if (in == NULL)
 		return NULL;
 
-	return header_msgid_decode_internal(&in);
+	return camel_header_msgid_decode_internal(&in);
 }
 
 char *
-header_contentid_decode (const char *in)
+camel_header_contentid_decode (const char *in)
 {
 	const char *inptr = in;
 	gboolean at = FALSE;
@@ -2664,7 +2665,7 @@
 	
 	/* 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 = header_msgid_decode (inptr)) != NULL && *buf)
+	if ((buf = camel_header_msgid_decode (inptr)) != NULL && *buf)
 		return buf;
 	
 	g_free (buf);
@@ -2714,9 +2715,9 @@
 }
 
 void
-header_references_list_append_asis(struct _header_references **list, char *ref)
+camel_header_references_list_append_asis(struct _camel_header_references **list, char *ref)
 {
-	struct _header_references *w = (struct _header_references *)list, *n;
+	struct _camel_header_references *w = (struct _camel_header_references *)list, *n;
 	while (w->next)
 		w = w->next;
 	n = g_malloc(sizeof(*n));
@@ -2726,10 +2727,10 @@
 }
 
 int
-header_references_list_size(struct _header_references **list)
+camel_header_references_list_size(struct _camel_header_references **list)
 {
 	int count = 0;
-	struct _header_references *w = *list;
+	struct _camel_header_references *w = *list;
 	while (w) {
 		count++;
 		w = w->next;
@@ -2738,9 +2739,9 @@
 }
 
 void
-header_references_list_clear(struct _header_references **list)
+camel_header_references_list_clear(struct _camel_header_references **list)
 {
-	struct _header_references *w = *list, *n;
+	struct _camel_header_references *w = *list, *n;
 	while (w) {
 		n = w->next;
 		g_free(w->id);
@@ -2751,18 +2752,18 @@
 }
 
 static void
-header_references_decode_single (const char **in, struct _header_references **head)
+camel_header_references_decode_single (const char **in, struct _camel_header_references **head)
 {
-	struct _header_references *ref;
+	struct _camel_header_references *ref;
 	const char *inptr = *in;
 	char *id, *word;
 	
 	while (*inptr) {
 		header_decode_lwsp (&inptr);
 		if (*inptr == '<') {
-			id = header_msgid_decode_internal (&inptr);
+			id = camel_header_msgid_decode_internal (&inptr);
 			if (id) {
-				ref = g_malloc (sizeof (struct _header_references));
+				ref = g_malloc (sizeof (struct _camel_header_references));
 				ref->next = *head;
 				ref->id = id;
 				*head = ref;
@@ -2780,41 +2781,41 @@
 	*in = inptr;
 }
 
-struct _header_references *
-header_references_inreplyto_decode (const char *in)
+struct _camel_header_references *
+camel_header_references_inreplyto_decode (const char *in)
 {
-	struct _header_references *ref = NULL;
+	struct _camel_header_references *ref = NULL;
 	
 	if (in == NULL || in[0] == '\0')
 		return NULL;
 	
-	header_references_decode_single (&in, &ref);
+	camel_header_references_decode_single (&in, &ref);
 	
 	return ref;
 }
 
 /* generate a list of references, from most recent up */
-struct _header_references *
-header_references_decode (const char *in)
+struct _camel_header_references *
+camel_header_references_decode (const char *in)
 {
-	struct _header_references *refs = NULL;
+	struct _camel_header_references *refs = NULL;
 	
 	if (in == NULL || in[0] == '\0')
 		return NULL;
 	
 	while (*in)
-		header_references_decode_single (&in, &refs);
+		camel_header_references_decode_single (&in, &refs);
 	
 	return refs;
 }
 
-struct _header_references *
-header_references_dup(const struct _header_references *list)
+struct _camel_header_references *
+camel_header_references_dup(const struct _camel_header_references *list)
 {
-	struct _header_references *new = NULL, *tmp;
+	struct _camel_header_references *new = NULL, *tmp;
 
 	while (list) {
-		tmp = g_new(struct _header_references, 1);
+		tmp = g_new(struct _camel_header_references, 1);
 		tmp->next = new;
 		tmp->id = g_strdup(list->id);
 		new = tmp;
@@ -2823,8 +2824,8 @@
 	return new;
 }
 
-struct _header_address *
-header_mailbox_decode(const char *in, const char *charset)
+struct _camel_header_address *
+camel_header_mailbox_decode(const char *in, const char *charset)
 {
 	if (in == NULL)
 		return NULL;
@@ -2832,11 +2833,11 @@
 	return header_decode_mailbox(&in, charset);
 }
 
-struct _header_address *
-header_address_decode(const char *in, const char *charset)
+struct _camel_header_address *
+camel_header_address_decode(const char *in, const char *charset)
 {
 	const char *inptr = in, *last;
-	struct _header_address *list = NULL, *addr;
+	struct _camel_header_address *list = NULL, *addr;
 
 	d(printf("decoding To: '%s'\n", in));
 
@@ -2851,7 +2852,7 @@
 		last = inptr;
 		addr = header_decode_address(&inptr, charset);
 		if (addr)
-			header_address_list_append(&list, addr);
+			camel_header_address_list_append(&list, addr);
 		header_decode_lwsp(&inptr);
 		if (*inptr == ',')
 			inptr++;
@@ -2871,7 +2872,7 @@
 }
 
 void
-header_mime_decode(const char *in, int *maj, int *min)
+camel_header_mime_decode(const char *in, int *maj, int *min)
 {
 	const char *inptr = in;
 	int major=-1, minor=-1;
@@ -2881,13 +2882,13 @@
 	if (in != NULL) {
 		header_decode_lwsp(&inptr);
 		if (isdigit(*inptr)) {
-			major = header_decode_int(&inptr);
+			major = camel_header_decode_int(&inptr);
 			header_decode_lwsp(&inptr);
 			if (*inptr == '.') {
 				inptr++;
 				header_decode_lwsp(&inptr);
 				if (isdigit(*inptr))
-					minor = header_decode_int(&inptr);
+					minor = camel_header_decode_int(&inptr);
 			}
 		}
 	}
@@ -2900,18 +2901,18 @@
 	d(printf("major = %d, minor = %d\n", major, minor));
 }
 
-static struct _header_param *
+static struct _camel_header_param *
 header_decode_param_list (const char **in)
 {
 	const char *inptr = *in;
-	struct _header_param *head = NULL, *tail = NULL;
+	struct _camel_header_param *head = NULL, *tail = NULL;
 	gboolean last_was_rfc2184 = FALSE;
 	gboolean is_rfc2184 = FALSE;
 	
 	header_decode_lwsp (&inptr);
 	
 	while (*inptr == ';') {
-		struct _header_param *param;
+		struct _camel_header_param *param;
 		char *name, *value;
 		int rfc2184_part;
 		
@@ -2950,7 +2951,7 @@
 				}
 			}
 			
-			param = g_malloc (sizeof (struct _header_param));
+			param = g_malloc (sizeof (struct _camel_header_param));
 			param->name = name;
 			param->value = value;
 			param->next = NULL;
@@ -2984,8 +2985,8 @@
 	return head;
 }
 
-struct _header_param *
-header_param_list_decode(const char *in)
+struct _camel_header_param *
+camel_header_param_list_decode(const char *in)
 {
 	if (in == NULL)
 		return NULL;
@@ -2995,7 +2996,7 @@
 
 
 static char *
-header_encode_param (const unsigned char *in, gboolean *encoded)
+camel_header_encode_param (const unsigned char *in, gboolean *encoded)
 {
 	register const unsigned char *inptr = in;
 	unsigned char *outbuf = NULL;
@@ -3107,7 +3108,7 @@
 }
 
 void
-header_param_list_format_append (GString *out, struct _header_param *p)
+camel_header_param_list_format_append (GString *out, struct _camel_header_param *p)
 {
 	int used = out->len;
 	
@@ -3123,7 +3124,7 @@
 			continue;
 		}
 		
-		value = header_encode_param (p->value, &encoded);
+		value = camel_header_encode_param (p->value, &encoded);
 		if (!value) {
 			w(g_warning ("appending parameter %s=%s violates rfc2184", p->name, p->value));
 			value = g_strdup (p->value);
@@ -3208,23 +3209,23 @@
 }
 
 char *
-header_param_list_format(struct _header_param *p)
+camel_header_param_list_format(struct _camel_header_param *p)
 {
 	GString *out = g_string_new("");
 	char *ret;
 
-	header_param_list_format_append(out, p);
+	camel_header_param_list_format_append(out, p);
 	ret = out->str;
 	g_string_free(out, FALSE);
 	return ret;
 }
 
-struct _header_content_type *
-header_content_type_decode(const char *in)
+CamelContentType *
+camel_content_type_decode(const char *in)
 {
 	const char *inptr = in;
 	char *type, *subtype = NULL;
-	struct _header_content_type *t = NULL;
+	CamelContentType *t = NULL;
 
 	if (in==NULL)
 		return NULL;
@@ -3244,7 +3245,7 @@
 			w(g_warning("MIME type with no subtype: %s", in));
 		}
 
-		t = header_content_type_new(type, subtype);
+		t = camel_content_type_new(type, subtype);
 		t->params = header_decode_param_list(&inptr);
 		g_free(type);
 		g_free(subtype);
@@ -3256,9 +3257,9 @@
 }
 
 void
-header_content_type_dump(struct _header_content_type *ct)
+camel_content_type_dump(CamelContentType *ct)
 {
-	struct _header_param *p;
+	struct _camel_header_param *p;
 
 	printf("Content-Type: ");
 	if (ct==NULL) {
@@ -3277,7 +3278,7 @@
 }
 
 char *
-header_content_type_format (struct _header_content_type *ct)
+camel_content_type_format (CamelContentType *ct)
 {
 	GString *out;
 	char *ret;
@@ -3298,7 +3299,7 @@
 	} else {
 		g_string_append_printf (out, "%s/%s", ct->type, ct->subtype);
 	}
-	header_param_list_format_append (out, ct->params);
+	camel_header_param_list_format_append (out, ct->params);
 	
 	ret = out->str;
 	g_string_free (out, FALSE);
@@ -3307,7 +3308,7 @@
 }
 
 char *
-header_content_type_simple (struct _header_content_type *ct)
+camel_content_type_simple (CamelContentType *ct)
 {
 	if (ct->type == NULL) {
 		w(g_warning ("Content-Type with no main type"));
@@ -3323,17 +3324,17 @@
 }
 
 char *
-header_content_encoding_decode(const char *in)
+camel_header_content_encoding_decode(const char *in)
 {
 	if (in)
 		return decode_token(&in);
 	return NULL;
 }
 
-CamelMimeDisposition *
-header_disposition_decode(const char *in)
+CamelContentDisposition *
+camel_content_disposition_decode(const char *in)
 {
-	CamelMimeDisposition *d = NULL;
+	CamelContentDisposition *d = NULL;
 	const char *inptr = in;
 
 	if (in == NULL)
@@ -3349,18 +3350,18 @@
 }
 
 void
-header_disposition_ref(CamelMimeDisposition *d)
+camel_content_disposition_ref(CamelContentDisposition *d)
 {
 	if (d)
 		d->refcount++;
 }
 
 void
-header_disposition_unref(CamelMimeDisposition *d)
+camel_content_disposition_unref(CamelContentDisposition *d)
 {
 	if (d) {
 		if (d->refcount<=1) {
-			header_param_list_free(d->params);
+			camel_header_param_list_free(d->params);
 			g_free(d->disposition);
 			g_free(d);
 		} else {
@@ -3370,7 +3371,7 @@
 }
 
 char *
-header_disposition_format(CamelMimeDisposition *d)
+camel_content_disposition_format(CamelContentDisposition *d)
 {
 	GString *out;
 	char *ret;
@@ -3383,7 +3384,7 @@
 		out = g_string_append(out, d->disposition);
 	else
 		out = g_string_append(out, "attachment");
-	header_param_list_format_append(out, d->params);
+	camel_header_param_list_format_append(out, d->params);
 
 	ret = out->str;
 	g_string_free(out, FALSE);
@@ -3422,7 +3423,7 @@
 };
 
 char *
-header_format_date(time_t time, int offset)
+camel_header_format_date(time_t time, int offset)
 {
 	struct tm tm;
 
@@ -3447,7 +3448,7 @@
 /* convert a date to time_t representation */
 /* this is an awful mess oh well */
 time_t
-header_decode_date(const char *in, int *saveoffset)
+camel_header_decode_date(const char *in, int *saveoffset)
 {
 	const char *inptr = in;
 	char *monthname;
@@ -3487,7 +3488,7 @@
 			}
 		}
 	}
-	tm.tm_mday = header_decode_int(&inptr);
+	tm.tm_mday = camel_header_decode_int(&inptr);
 	monthname = decode_token(&inptr);
 	if (monthname) {
 		for (i=0;i<sizeof(tz_months)/sizeof(tz_months[0]);i++) {
@@ -3498,7 +3499,7 @@
 		}
 		g_free(monthname);
 	}
-	year = header_decode_int(&inptr);
+	year = camel_header_decode_int(&inptr);
 	if (year < 69) {
 		tm.tm_year = 100 + year;
 	} else if (year < 100) {
@@ -3509,25 +3510,25 @@
 		tm.tm_year = year - 1900;
 	}
 	/* get the time ... yurck */
-	tm.tm_hour = header_decode_int(&inptr);
+	tm.tm_hour = camel_header_decode_int(&inptr);
 	header_decode_lwsp(&inptr);
 	if (*inptr == ':')
 		inptr++;
-	tm.tm_min = header_decode_int(&inptr);
+	tm.tm_min = camel_header_decode_int(&inptr);
 	header_decode_lwsp(&inptr);
 	if (*inptr == ':')
 		inptr++;
-	tm.tm_sec = header_decode_int(&inptr);
+	tm.tm_sec = camel_header_decode_int(&inptr);
 	header_decode_lwsp(&inptr);
 	if (*inptr == '+'
 	    || *inptr == '-') {
 		offset = (*inptr++)=='-'?-1:1;
-		offset = offset * header_decode_int(&inptr);
+		offset = offset * camel_header_decode_int(&inptr);
 		d(printf("abs signed offset = %d\n", offset));
 		if (offset < -1200 || offset > 1200)
 			offset = 0;
 	} else if (isdigit(*inptr)) {
-		offset = header_decode_int(&inptr);
+		offset = camel_header_decode_int(&inptr);
 		d(printf("abs offset = %d\n", offset));
 		if (offset < -1200 || offset > 1200)
 			offset = 0;
@@ -3547,7 +3548,7 @@
 		header_decode_lwsp(&inptr);
 		if (*inptr == '+' || *inptr == '-') {
 			int sign = (*inptr++)=='-'?-1:1;
-			offset = offset + (header_decode_int(&inptr)*sign);
+			offset = offset + (camel_header_decode_int(&inptr)*sign);
 		}
 		d(printf("named offset = %d\n", offset));
 	}
@@ -3565,7 +3566,7 @@
 
 	d({
 		char *tmp;
-		tmp = header_format_date(t, offset);
+		tmp = camel_header_format_date(t, offset);
 		printf(" encoded again: %s\n", tmp);
 		g_free(tmp);
 	});
@@ -3577,7 +3578,7 @@
 }
 
 char *
-header_location_decode(const char *in)
+camel_header_location_decode(const char *in)
 {
 	const char *p;
 
@@ -3607,7 +3608,7 @@
 
 #ifdef CHECKS
 static void
-check_header(struct _header_raw *h)
+check_header(struct _camel_header_raw *h)
 {
 	unsigned char *p;
 
@@ -3623,7 +3624,7 @@
 #endif
 
 void
-header_raw_append_parse(struct _header_raw **list, const char *header, int offset)
+camel_header_raw_append_parse(struct _camel_header_raw **list, const char *header, int offset)
 {
 	register const char *in;
 	size_t fieldlen;
@@ -3643,13 +3644,13 @@
 	memcpy(name, header, fieldlen);
 	name[fieldlen] = 0;
 
-	header_raw_append(list, name, in, offset);
+	camel_header_raw_append(list, name, in, offset);
 }
 
 void
-header_raw_append(struct _header_raw **list, const char *name, const char *value, int offset)
+camel_header_raw_append(struct _camel_header_raw **list, const char *name, const char *value, int offset)
 {
-	struct _header_raw *l, *n;
+	struct _camel_header_raw *l, *n;
 
 	d(printf("Header: %s: %s\n", name, value));
 
@@ -3661,7 +3662,7 @@
 #ifdef CHECKS
 	check_header(n);
 #endif
-	l = (struct _header_raw *)list;
+	l = (struct _camel_header_raw *)list;
 	while (l->next) {
 		l = l->next;
 	}
@@ -3671,21 +3672,21 @@
 #if 0
 	if (!strcasecmp(name, "To")) {
 		printf("- Decoding To\n");
-		header_to_decode(value);
+		camel_header_to_decode(value);
 	} else if (!strcasecmp(name, "Content-type")) {
 		printf("- Decoding content-type\n");
-		header_content_type_dump(header_content_type_decode(value));		
+		camel_content_type_dump(camel_content_type_decode(value));		
 	} else if (!strcasecmp(name, "MIME-Version")) {
 		printf("- Decoding mime version\n");
-		header_mime_decode(value);
+		camel_header_mime_decode(value);
 	}
 #endif
 }
 
-static struct _header_raw *
-header_raw_find_node(struct _header_raw **list, const char *name)
+static struct _camel_header_raw *
+camel_header_raw_find_node(struct _camel_header_raw **list, const char *name)
 {
-	struct _header_raw *l;
+	struct _camel_header_raw *l;
 
 	l = *list;
 	while (l) {
@@ -3697,11 +3698,11 @@
 }
 
 const char *
-header_raw_find(struct _header_raw **list, const char *name, int *offset)
+camel_header_raw_find(struct _camel_header_raw **list, const char *name, int *offset)
 {
-	struct _header_raw *l;
+	struct _camel_header_raw *l;
 
-	l = header_raw_find_node(list, name);
+	l = camel_header_raw_find_node(list, name);
 	if (l) {
 		if (offset)
 			*offset = l->offset;
@@ -3711,9 +3712,9 @@
 }
 
 const char *
-header_raw_find_next(struct _header_raw **list, const char *name, int *offset, const char *last)
+camel_header_raw_find_next(struct _camel_header_raw **list, const char *name, int *offset, const char *last)
 {
-	struct _header_raw *l;
+	struct _camel_header_raw *l;
 
 	if (last == NULL || name == NULL)
 		return NULL;
@@ -3721,11 +3722,11 @@
 	l = *list;
 	while (l && l->value != last)
 		l = l->next;
-	return header_raw_find(&l, name, offset);
+	return camel_header_raw_find(&l, name, offset);
 }
 
 static void
-header_raw_free(struct _header_raw *l)
+camel_header_raw_free(struct _camel_header_raw *l)
 {
 	g_free(l->name);
 	g_free(l->value);
@@ -3733,17 +3734,17 @@
 }
 
 void
-header_raw_remove(struct _header_raw **list, const char *name)
+camel_header_raw_remove(struct _camel_header_raw **list, const char *name)
 {
-	struct _header_raw *l, *p;
+	struct _camel_header_raw *l, *p;
 
 	/* the next pointer is at the head of the structure, so this is safe */
-	p = (struct _header_raw *)list;
+	p = (struct _camel_header_raw *)list;
 	l = *list;
 	while (l) {
 		if (!strcasecmp(l->name, name)) {
 			p->next = l->next;
-			header_raw_free(l);
+			camel_header_raw_free(l);
 			l = p->next;
 		} else {
 			p = l;
@@ -3753,27 +3754,27 @@
 }
 
 void
-header_raw_replace(struct _header_raw **list, const char *name, const char *value, int offset)
+camel_header_raw_replace(struct _camel_header_raw **list, const char *name, const char *value, int offset)
 {
-	header_raw_remove(list, name);
-	header_raw_append(list, name, value, offset);
+	camel_header_raw_remove(list, name);
+	camel_header_raw_append(list, name, value, offset);
 }
 
 void
-header_raw_clear(struct _header_raw **list)
+camel_header_raw_clear(struct _camel_header_raw **list)
 {
-	struct _header_raw *l, *n;
+	struct _camel_header_raw *l, *n;
 	l = *list;
 	while (l) {
 		n = l->next;
-		header_raw_free(l);
+		camel_header_raw_free(l);
 		l = n;
 	}
 	*list = NULL;
 }
 
 char *
-header_msgid_generate (void)
+camel_header_msgid_generate (void)
 {
 	static pthread_mutex_t count_lock = PTHREAD_MUTEX_INITIALIZER;
 #define COUNT_LOCK() pthread_mutex_lock (&count_lock)
@@ -3850,14 +3851,14 @@
 };
 
 char *
-header_raw_check_mailing_list(struct _header_raw **list)
+camel_header_raw_check_mailing_list(struct _camel_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 = header_raw_find (list, mail_list_magic[i].name, NULL);
+		v = camel_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;
@@ -3883,48 +3884,52 @@
 }
 
 /* ok, here's the address stuff, what a mess ... */
-struct _header_address *header_address_new(void)
+struct _camel_header_address *
+camel_header_address_new (void)
 {
-	struct _header_address *h;
+	struct _camel_header_address *h;
 	h = g_malloc0(sizeof(*h));
 	h->type = HEADER_ADDRESS_NONE;
 	h->refcount = 1;
 	return h;
 }
 
-struct _header_address *header_address_new_name(const char *name, const char *addr)
+struct _camel_header_address *
+camel_header_address_new_name(const char *name, const char *addr)
 {
-	struct _header_address *h;
-
-	h = header_address_new();
+	struct _camel_header_address *h;
+	h = camel_header_address_new();
 	h->type = HEADER_ADDRESS_NAME;
 	h->name = g_strdup(name);
 	h->v.addr = g_strdup(addr);
 	return h;
 }
 
-struct _header_address *header_address_new_group(const char *name)
+struct _camel_header_address *
+camel_header_address_new_group (const char *name)
 {
-	struct _header_address *h;
+	struct _camel_header_address *h;
 
-	h = header_address_new();
+	h = camel_header_address_new();
 	h->type = HEADER_ADDRESS_GROUP;
 	h->name = g_strdup(name);
 	return h;
 }
 
-void header_address_ref(struct _header_address *h)
+void
+camel_header_address_ref(struct _camel_header_address *h)
 {
 	if (h)
 		h->refcount++;
 }
 
-void header_address_unref(struct _header_address *h)
+void
+camel_header_address_unref(struct _camel_header_address *h)
 {
 	if (h) {
 		if (h->refcount <= 1) {
 			if (h->type == HEADER_ADDRESS_GROUP) {
-				header_address_list_clear(&h->v.members);
+				camel_header_address_list_clear(&h->v.members);
 			} else if (h->type == HEADER_ADDRESS_NAME) {
 				g_free(h->v.addr);
 			}
@@ -3936,7 +3941,8 @@
 	}
 }
 
-void header_address_set_name(struct _header_address *h, const char *name)
+void
+camel_header_address_set_name(struct _camel_header_address *h, const char *name)
 {
 	if (h) {
 		g_free(h->name);
@@ -3944,7 +3950,8 @@
 	}
 }
 
-void header_address_set_addr(struct _header_address *h, const char *addr)
+void
+camel_header_address_set_addr(struct _camel_header_address *h, const char *addr)
 {
 	if (h) {
 		if (h->type == HEADER_ADDRESS_NAME
@@ -3958,13 +3965,14 @@
 	}
 }
 
-void header_address_set_members(struct _header_address *h, struct _header_address *group)
+void
+camel_header_address_set_members(struct _camel_header_address *h, struct _camel_header_address *group)
 {
 	if (h) {
 		if (h->type == HEADER_ADDRESS_GROUP
 		    || h->type == HEADER_ADDRESS_NONE) {
 			h->type = HEADER_ADDRESS_GROUP;
-			header_address_list_clear(&h->v.members);
+			camel_header_address_list_clear(&h->v.members);
 			/* should this ref them? */
 			h->v.members = group;
 		} else {
@@ -3973,21 +3981,23 @@
 	}
 }
 
-void header_address_add_member(struct _header_address *h, struct _header_address *member)
+void
+camel_header_address_add_member(struct _camel_header_address *h, struct _camel_header_address *member)
 {
 	if (h) {
 		if (h->type == HEADER_ADDRESS_GROUP
 		    || h->type == HEADER_ADDRESS_NONE) {
 			h->type = HEADER_ADDRESS_GROUP;
-			header_address_list_append(&h->v.members, member);
+			camel_header_address_list_append(&h->v.members, member);
 		}		    
 	}
 }
 
-void header_address_list_append_list(struct _header_address **l, struct _header_address **h)
+void
+camel_header_address_list_append_list(struct _camel_header_address **l, struct _camel_header_address **h)
 {
 	if (l) {
-		struct _header_address *n = (struct _header_address *)l;
+		struct _camel_header_address *n = (struct _camel_header_address *)l;
 
 		while (n->next)
 			n = n->next;
@@ -3996,21 +4006,23 @@
 }
 
 
-void header_address_list_append(struct _header_address **l, struct _header_address *h)
+void
+camel_header_address_list_append(struct _camel_header_address **l, struct _camel_header_address *h)
 {
 	if (h) {
-		header_address_list_append_list(l, &h);
+		camel_header_address_list_append_list(l, &h);
 		h->next = NULL;
 	}
 }
 
-void header_address_list_clear(struct _header_address **l)
+void
+camel_header_address_list_clear(struct _camel_header_address **l)
 {
-	struct _header_address *a, *n;
+	struct _camel_header_address *a, *n;
 	a = *l;
 	while (a) {
 		n = a->next;
-		header_address_unref(a);
+		camel_header_address_unref(a);
 		a = n;
 	}
 	*l = NULL;
@@ -4019,7 +4031,7 @@
 /* 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 _header_address *a)
+camel_header_address_list_encode_append (GString *out, int encode, struct _camel_header_address *a)
 {
 	char *text;
 	
@@ -4027,7 +4039,7 @@
 		switch (a->type) {
 		case HEADER_ADDRESS_NAME:
 			if (encode)
-				text = header_encode_phrase (a->name);
+				text = camel_header_encode_phrase (a->name);
 			else
 				text = a->name;
 			if (text && *text)
@@ -4039,11 +4051,11 @@
 			break;
 		case HEADER_ADDRESS_GROUP:
 			if (encode)
-				text = header_encode_phrase (a->name);
+				text = camel_header_encode_phrase (a->name);
 			else
 				text = a->name;
 			g_string_append_printf (out, "%s: ", text);
-			header_address_list_encode_append (out, encode, a->v.members);
+			camel_header_address_list_encode_append (out, encode, a->v.members);
 			g_string_append_printf (out, ";");
 			if (encode)
 				g_free (text);
@@ -4059,7 +4071,7 @@
 }
 
 char *
-header_address_list_encode (struct _header_address *a)
+camel_header_address_list_encode (struct _camel_header_address *a)
 {
 	GString *out;
 	char *ret;
@@ -4068,7 +4080,7 @@
 		return NULL;
 	
 	out = g_string_new ("");
-	header_address_list_encode_append (out, TRUE, a);
+	camel_header_address_list_encode_append (out, TRUE, a);
 	ret = out->str;
 	g_string_free (out, FALSE);
 	
@@ -4076,7 +4088,7 @@
 }
 
 char *
-header_address_list_format (struct _header_address *a)
+camel_header_address_list_format (struct _camel_header_address *a)
 {
 	GString *out;
 	char *ret;
@@ -4086,7 +4098,7 @@
 	
 	out = g_string_new ("");
 	
-	header_address_list_encode_append (out, FALSE, a);
+	camel_header_address_list_encode_append (out, FALSE, a);
 	ret = out->str;
 	g_string_free (out, FALSE);
 	
@@ -4094,7 +4106,7 @@
 }
 
 char *
-header_address_fold (const char *in, size_t headerlen)
+camel_header_address_fold (const char *in, size_t headerlen)
 {
 	size_t len, outlen;
 	const char *inptr = in, *space, *p, *n;
@@ -4128,7 +4140,7 @@
 	
 	/* we need to fold, so first unfold (if we need to), then process */
 	if (needunfold)
-		inptr = in = header_unfold (in);
+		inptr = in = camel_header_unfold (in);
 	
 	out = g_string_new ("");
 	outlen = headerlen + 2;
@@ -4170,7 +4182,7 @@
 /* simple header folding */
 /* will work even if the header is already folded */
 char *
-header_fold(const char *in, size_t headerlen)
+camel_header_fold(const char *in, size_t headerlen)
 {
 	size_t len, outlen, i;
 	const char *inptr = in, *space, *p, *n;
@@ -4204,7 +4216,7 @@
 
 	/* we need to fold, so first unfold (if we need to), then process */
 	if (needunfold)
-		inptr = in = header_unfold(in);
+		inptr = in = camel_header_unfold(in);
 
 	out = g_string_new("");
 	outlen = headerlen+2;
@@ -4249,7 +4261,7 @@
 }
 
 char *
-header_unfold(const char *in)
+camel_header_unfold(const char *in)
 {
 	char *out = g_malloc(strlen(in)+1);
 	const char *inptr = in;
Index: camel-mime-utils.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-utils.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- camel-mime-utils.h	11 Aug 2003 17:57:31 -0000	1.45
+++ camel-mime-utils.h	25 Aug 2003 21:01:37 -0000	1.46
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- *  Copyright (C) 2000 Ximian Inc.
+ *  Copyright (C) 2000-2003 Ximian Inc.
  *
  *  Authors: Michael Zucchi <notzed ximian com>
  *           Jeffrey Stedfast <fejj ximian com>
@@ -32,9 +32,9 @@
 #include <time.h>
 #include <glib.h>
 
-/* maximum recommended size of a line from header_fold() */
+/* maximum recommended size of a line from camel_header_fold() */
 #define CAMEL_FOLD_SIZE (77)
-/* maximum hard size of a line from header_fold() */
+/* maximum hard size of a line from camel_header_fold() */
 #define CAMEL_FOLD_MAX_SIZE (998)
 
 #define CAMEL_UUDECODE_STATE_INIT   (0)
@@ -55,53 +55,53 @@
 } CamelMimePartEncodingType;
 
 /* a list of references for this message */
-struct _header_references {
-	struct _header_references *next;
+struct _camel_header_references {
+	struct _camel_header_references *next;
 	char *id;
 };
 
-struct _header_param {
-	struct _header_param *next;
+struct _camel_header_param {
+	struct _camel_header_param *next;
 	char *name;
 	char *value;
 };
 
 /* describes a content-type */
-struct _header_content_type {
+typedef struct {
 	char *type;
 	char *subtype;
-	struct _header_param *params;
+	struct _camel_header_param *params;
 	unsigned int refcount;
-};
+} CamelContentType;
 
 /* a raw rfc822 header */
 /* the value MUST be US-ASCII */
-struct _header_raw {
-	struct _header_raw *next;
+struct _camel_header_raw {
+	struct _camel_header_raw *next;
 	char *name;
 	char *value;
 	int offset;		/* in file, if known */
 };
 
-typedef struct _CamelMimeDisposition {
+typedef struct {
 	char *disposition;
-	struct _header_param *params;
+	struct _camel_header_param *params;
 	unsigned int refcount;
-} CamelMimeDisposition;
+} CamelContentDisposition;
 
-enum _header_address_type {
+enum _camel_header_address_t {
 	HEADER_ADDRESS_NONE,	/* uninitialised */
 	HEADER_ADDRESS_NAME,
 	HEADER_ADDRESS_GROUP
 };
 
-struct _header_address {
-	struct _header_address *next;
-	enum _header_address_type type;
+struct _camel_header_address {
+	struct _camel_header_address *next;
+	enum _camel_header_address_t type;
 	char *name;
 	union {
 		char *addr;
-		struct _header_address *members;
+		struct _camel_header_address *members;
 	} v;
 	unsigned int refcount;
 };
@@ -110,116 +110,116 @@
 void camel_mime_utils_init(void);
 
 /* Address lists */
-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 _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 _header_address *header_address_decode(const char *in, const char *charset);
-struct _header_address *header_mailbox_decode(const char *in, const char *charset);
+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);
 /* for mailing */
-char *header_address_list_encode(struct _header_address *a);
+char *camel_header_address_list_encode (struct _camel_header_address *a);
 /* for display */
-char *header_address_list_format(struct _header_address *a);
+char *camel_header_address_list_format (struct _camel_header_address *a);
 
 /* structured header prameters */
-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);
+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);
 
 /* Content-Type header */
-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);
+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);
 
 /* DEBUGGING function */
-void header_content_type_dump(struct _header_content_type *ct);
+void camel_content_type_dump (CamelContentType *ct);
 
 /* Content-Disposition header */
-CamelMimeDisposition *header_disposition_decode(const char *in);
-void header_disposition_ref(CamelMimeDisposition *);
-void header_disposition_unref(CamelMimeDisposition *);
-char *header_disposition_format(CamelMimeDisposition *d);
+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);
 
 /* decode the contents of a content-encoding header */
-char *header_content_encoding_decode(const char *in);
+char *camel_header_content_encoding_decode (const char *in);
 
 /* raw headers */
-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);
+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);
 
-char *header_raw_check_mailing_list(struct _header_raw **list);
+char *camel_header_raw_check_mailing_list (struct _camel_header_raw **list);
 
 /* fold a header */
-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);
+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);
 
 /* decode a header which is a simple token */
-char *header_token_decode (const char *in);
+char *camel_header_token_decode (const char *in);
 
-int header_decode_int (const char **in);
+int camel_header_decode_int (const char **in);
 
 /* decode/encode a string type, like a subject line */
-char *header_decode_string (const char *in, const char *default_charset);
-char *header_encode_string (const unsigned char *in);
+char *camel_header_decode_string (const char *in, const char *default_charset);
+char *camel_header_encode_string (const unsigned char *in);
 
 /* encode a phrase, like the real name of an address */
-char *header_encode_phrase (const unsigned char *in);
+char *camel_header_encode_phrase (const unsigned char *in);
 
 /* decode an email date field into a GMT time, + optional offset */
-time_t header_decode_date (const char *in, int *saveoffset);
-char *header_format_date (time_t time, int offset);
+time_t camel_header_decode_date (const char *in, int *saveoffset);
+char *camel_header_format_date (time_t time, int offset);
 
 /* decode a message id */
-char *header_msgid_decode (const char *in);
-char *header_contentid_decode (const char *in);
+char *camel_header_msgid_decode (const char *in);
+char *camel_header_contentid_decode (const char *in);
 
 /* generate msg id */
-char *header_msgid_generate (void);
+char *camel_header_msgid_generate (void);
 
 /* decode a References or In-Reply-To header */
-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);
+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);
 
 /* decode content-location */
-char *header_location_decode(const char *in);
+char *camel_header_location_decode (const char *in);
 
 /* decode the mime-type header */
-void header_mime_decode(const char *in, int *maj, int *min);
+void camel_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_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: camel-movemail.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-movemail.c,v
retrieving revision 1.16
retrieving revision 1.18
diff -u -r1.16 -r1.18
--- camel-movemail.c	11 Nov 2002 06:24:54 -0000	1.16
+++ camel-movemail.c	26 Aug 2003 16:05:59 -0000	1.18
@@ -402,7 +402,7 @@
 /* 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 _header_raw *header)
+solaris_header_write(int fd, struct _camel_header_raw *header)
 {
         struct iovec iv[4];
         int outlen = 0, len;
@@ -473,10 +473,10 @@
 
 	ffrom = camel_mime_filter_from_new();
 
-	while (camel_mime_parser_step(mp, &buffer, &len) == HSCAN_FROM) {
+	while (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_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) != HSCAN_FROM_END) {
+		if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_FROM_END) {
 			const char *cl;
 			int length;
 			int start, body;
Index: camel-multipart-encrypted.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-multipart-encrypted.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- camel-multipart-encrypted.c	12 Jul 2002 23:14:16 -0000	1.4
+++ camel-multipart-encrypted.c	25 Aug 2003 21:01:37 -0000	1.5
@@ -107,7 +107,7 @@
 	if (mime_type) {
 		const char *protocol;
 		
-		protocol = header_content_type_param (mime_type, "protocol");
+		protocol = camel_content_type_param (mime_type, "protocol");
 		g_free (mpe->protocol);
 		mpe->protocol = g_strdup (protocol);
 	}
@@ -215,10 +215,10 @@
 	mpe->decrypted = content;
 	
 	/* set the content-type params for this multipart/encrypted part */
-	mime_type = header_content_type_new ("multipart", "encrypted");
-	header_content_type_set_param (mime_type, "protocol", cipher->encrypt_protocol);
+	mime_type = camel_content_type_new ("multipart", "encrypted");
+	camel_content_type_set_param (mime_type, "protocol", cipher->encrypt_protocol);
 	camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (mpe), mime_type);
-	header_content_type_unref (mime_type);
+	camel_content_type_unref (mime_type);
 	camel_multipart_set_boundary ((CamelMultipart *) mpe, NULL);
 	
 	return 0;
@@ -282,7 +282,7 @@
 	/* 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 (!header_content_type_is (mime_type, "application", "octet-stream")) {
+	if (!camel_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: camel-multipart-signed.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-multipart-signed.c,v
retrieving revision 1.13
retrieving revision 1.15
diff -u -r1.13 -r1.15
--- camel-multipart-signed.c	15 Aug 2003 20:57:29 -0000	1.13
+++ camel-multipart-signed.c	26 Aug 2003 16:05:59 -0000	1.15
@@ -159,7 +159,7 @@
  * 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 HSCAN_HEADER
+ * Use construct_from_parser.  The parser MUST be in the CAMEL_MIME_PARSER_STATE_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 @@
 	if (mime_type) {
 		const char *micalg, *protocol;
 
-		protocol = header_content_type_param(mime_type, "protocol");
+		protocol = camel_content_type_param(mime_type, "protocol");
 		g_free(mps->protocol);
 		mps->protocol = g_strdup(protocol);
 
-		micalg = header_content_type_param(mime_type, "micalg");
+		micalg = camel_content_type_param(mime_type, "micalg");
 		g_free(mps->micalg);
 		mps->micalg = g_strdup(micalg);
 	}
@@ -432,7 +432,7 @@
 signed_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
 {
 	int err;
-	struct _header_content_type *content_type;
+	CamelContentType *content_type;
 	CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
 	char *buf;
 	size_t len;
@@ -440,14 +440,14 @@
 
 	/* 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) == HSCAN_HEADER);
+	g_assert(camel_mime_parser_state(mp) == CAMEL_MIME_PARSER_STATE_HEADER);
 
 	/* All we do is copy it to a memstream */
 	content_type = camel_mime_parser_content_type(mp);
-	camel_multipart_set_boundary(multipart, header_content_type_param(content_type, "boundary"));
+	camel_multipart_set_boundary(multipart, camel_content_type_param(content_type, "boundary"));
 
 	mem = camel_stream_mem_new();
-	while (camel_mime_parser_step(mp, &buf, &len) != HSCAN_BODY_END)
+	while (camel_mime_parser_step(mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_BODY_END)
 		camel_stream_write(mem, buf, len);
 
 	set_stream(mps, mem);
@@ -646,11 +646,11 @@
 	camel_mime_part_set_description(signature, _("This is a digitally signed message part"));
 
 	/* setup our mime type and boundary */
-	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);
+	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);
 	camel_data_wrapper_set_mime_type_field(CAMEL_DATA_WRAPPER (mps), mime_type);
-	header_content_type_unref(mime_type);
+	camel_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: camel-multipart.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-multipart.c,v
retrieving revision 1.53
retrieving revision 1.55
diff -u -r1.53 -r1.55
--- camel-multipart.c	15 Aug 2003 20:57:29 -0000	1.53
+++ camel-multipart.c	26 Aug 2003 16:05:59 -0000	1.55
@@ -374,7 +374,7 @@
 		boundary = bbuf;
 	}
 
-	header_content_type_set_param (cdw->mime_type, "boundary", boundary);
+	camel_content_type_set_param (cdw->mime_type, "boundary", boundary);
 }
 
 /**
@@ -402,7 +402,7 @@
 	CamelDataWrapper *cdw = CAMEL_DATA_WRAPPER (multipart);
 
 	g_return_val_if_fail (cdw->mime_type != NULL, NULL);
-	return header_content_type_param (cdw->mime_type, "boundary");
+	return camel_content_type_param (cdw->mime_type, "boundary");
 }
 
 /**
@@ -546,21 +546,21 @@
 construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
 {
 	int err;
-	struct _header_content_type *content_type;
+	CamelContentType *content_type;
 	CamelMimePart *bodypart;
 	char *buf;
 	size_t len;
 	
-	g_assert(camel_mime_parser_state(mp) == HSCAN_MULTIPART);
+	g_assert(camel_mime_parser_state(mp) == CAMEL_MIME_PARSER_STATE_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,
-				     header_content_type_param(content_type, "boundary"));
+				     camel_content_type_param(content_type, "boundary"));
 	
-	while (camel_mime_parser_step(mp, &buf, &len) != HSCAN_MULTIPART_END) {
+	while (camel_mime_parser_step(mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
 		camel_mime_parser_unstep(mp);
 		bodypart = camel_mime_part_new();
 		camel_mime_part_construct_from_parser(bodypart, mp);
Index: camel-search-private.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-search-private.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- camel-search-private.c	6 Mar 2003 15:22:56 -0000	1.29
+++ camel-search-private.c	25 Aug 2003 21:01:39 -0000	1.30
@@ -408,7 +408,7 @@
 	
 	switch(type) {
 	case CAMEL_SEARCH_TYPE_ENCODED:
-		v = header_decode_string(value, default_charset); /* FIXME: Find header charset */
+		v = camel_header_decode_string(value, default_charset); /* FIXME: Find header charset */
 		truth = header_match(v, match, how);
 		g_free(v);
 		break;
@@ -449,8 +449,8 @@
 
 		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((CamelObject *)cia);
+		
+		camel_object_unref (cia);
 		break;
 	}
 
@@ -482,14 +482,14 @@
 	} 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 (header_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
+	} else if (camel_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 (CAMEL_OBJECT (mem));
+		camel_object_unref (mem);
 	}
 	
 	return truth;
Index: camel-search-private.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-search-private.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- camel-search-private.h	18 Apr 2002 02:18:54 -0000	1.8
+++ camel-search-private.h	25 Aug 2003 21:01:39 -0000	1.9
@@ -52,7 +52,7 @@
 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_header_soundex(const char *header, const char *match);
+gboolean camel_search_camel_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: camel-types.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-types.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- camel-types.h	12 Mar 2002 00:55:53 -0000	1.26
+++ camel-types.h	25 Aug 2003 21:01:39 -0000	1.27
@@ -24,10 +24,9 @@
 #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: providers/imap/camel-imap-folder.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imap/camel-imap-folder.c,v
retrieving revision 1.306
retrieving revision 1.307
diff -u -r1.306 -r1.307
--- providers/imap/camel-imap-folder.c	11 Aug 2003 17:57:44 -0000	1.306
+++ providers/imap/camel-imap-folder.c	25 Aug 2003 21:01:40 -0000	1.307
@@ -1673,7 +1673,7 @@
 		CamelMessageContentInfo *child;
 		
 		/* FIXME: is this only supposed to apply if 'node' is a multipart? */
-		if (node->parent->parent && header_content_type_is (node->parent->type, "message", "*")) {
+		if (node->parent->parent && camel_content_type_is (node->parent->type, "message", "*")) {
 			node = node->parent;
 			continue;
 		}
@@ -1721,7 +1721,7 @@
 	part_spec = content_info_get_part_spec (ci);
 	
 	/* There are three cases: multipart/signed, multipart, message/rfc822, and "other" */
-	if (header_content_type_is (ci->type, "multipart", "signed")) {
+	if (camel_content_type_is (ci->type, "multipart", "signed")) {
 		CamelMultipartSigned *body_mp;
 		char *spec;
 		int ret;
@@ -1749,12 +1749,12 @@
 		}
 		
 		return (CamelDataWrapper *) body_mp;
-	} else if (header_content_type_is (ci->type, "multipart", "*")) {
+	} else if (camel_content_type_is (ci->type, "multipart", "*")) {
 		CamelMultipart *body_mp;
 		char *child_spec;
 		int speclen, num;
 		
-		if (header_content_type_is (ci->type, "multipart", "encrypted"))
+		if (camel_content_type_is (ci->type, "multipart", "encrypted"))
 			body_mp = (CamelMultipart *) camel_multipart_encrypted_new ();
 		else
 			body_mp = camel_multipart_new ();
@@ -1808,7 +1808,7 @@
 		g_free (child_spec);
 		
 		return (CamelDataWrapper *) body_mp;
-	} else if (header_content_type_is (ci->type, "message", "rfc822")) {
+	} else if (camel_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: providers/imap/camel-imap-store-summary.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imap/camel-imap-store-summary.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- providers/imap/camel-imap-store-summary.c	7 Jul 2003 19:18:55 -0000	1.8
+++ providers/imap/camel-imap-store-summary.c	25 Aug 2003 21:01:40 -0000	1.9
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2002 Ximian Inc.
  *
Index: providers/imap/camel-imap-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imap/camel-imap-utils.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- providers/imap/camel-imap-utils.c	7 Jul 2003 19:18:55 -0000	1.66
+++ providers/imap/camel-imap-utils.c	25 Aug 2003 21:01:40 -0000	1.67
@@ -751,7 +751,7 @@
 		value = imap_parse_nstring (&parms, &len);
 		
 		if (name && value)
-			header_content_type_set_param (type, name, value);
+			camel_content_type_set_param (type, name, value);
 		g_free (name);
 		g_free (value);
 		
@@ -814,11 +814,11 @@
 			inptr += 3;
 		}
 		
-		ctype = header_content_type_new ("multipart", subtype ? subtype : "mixed");
+		ctype = camel_content_type_new ("multipart", subtype ? subtype : "mixed");
 		g_free (subtype);
 		
 		if (*inptr++ != ')') {
-			header_content_type_unref (ctype);
+			camel_content_type_unref (ctype);
 			return NULL;
 		}
 		
@@ -855,7 +855,7 @@
 		
 		camel_strdown (type);
 		camel_strdown (subtype);
-		ctype = header_content_type_new (type, subtype);
+		ctype = camel_content_type_new (type, subtype);
 		g_free (subtype);
 		g_free (type);
 		
@@ -906,7 +906,7 @@
 		size = strtoul ((const char *) inptr, &p, 10);
 		inptr = (const unsigned char *) p;
 		
-		if (header_content_type_is (ctype, "message", "rfc822")) {
+		if (camel_content_type_is (ctype, "message", "rfc822")) {
 			/* body_type_msg */
 			if (*inptr++ != ' ')
 				goto exception;
@@ -928,7 +928,7 @@
 			/* lines */
 			strtoul ((const char *) inptr, &p, 10);
 			inptr = (const unsigned char *) p;
-		} else if (header_content_type_is (ctype, "text", "*")) {
+		} else if (camel_content_type_is (ctype, "text", "*")) {
 			if (*inptr++ != ' ')
 				goto exception;
 			
@@ -956,7 +956,7 @@
 	
  exception:
 	
-	header_content_type_unref (ctype);
+	camel_content_type_unref (ctype);
 	g_free (id);
 	g_free (description);
 	g_free (encoding);
Index: providers/imapp/camel-imapp-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imapp/camel-imapp-utils.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- providers/imapp/camel-imapp-utils.c	1 Aug 2003 21:07:43 -0000	1.1
+++ providers/imapp/camel-imapp-utils.c	25 Aug 2003 21:01:41 -0000	1.2
@@ -318,7 +318,7 @@
 
 /*
 struct _body_fields {
-	struct _header_content_type *ct;
+	CamelContentType *ct;
 	char *msgid, *desc;
 	CamelMimePartEncodingType encoding;
 	guint32 size;
@@ -337,7 +337,7 @@
 	}
 	
 	if (cinfo->type)
-		header_content_type_unref(cinfo->type);
+		camel_content_type_unref(cinfo->type);
 	g_free(cinfo->id);
 	g_free(cinfo->description);
 	g_free(cinfo->encoding);
@@ -345,7 +345,7 @@
 }
 
 void
-imap_parse_param_list(CamelIMAPPStream *is, struct _header_param **plist)
+imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist)
 {
 	int tok, len;
 	unsigned char *token, *param;
@@ -365,17 +365,17 @@
 			param = alloca(strlen(token)+1);
 			strcpy(param, token);
 			camel_imapp_stream_astring(is, &token);
-			header_set_param(plist, param, token);
+			camel_header_set_param(plist, param, token);
 		}
 	} /* else check nil?  no need */
 }
 
-struct _CamelMimeDisposition *
+struct _CamelContentDisposition *
 imap_parse_ext_optional(CamelIMAPPStream *is)
 {
 	int tok, len;
 	unsigned char *token;
-	struct _CamelMimeDisposition * volatile dinfo = NULL;
+	struct _CamelContentDisposition * 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 @@
 		}
 	} CAMEL_CATCH(ex) {
 		if (dinfo)
-			header_disposition_unref(dinfo);
+			camel_content_disposition_unref(dinfo);
 		camel_exception_throw_ex(ex);
 	} CAMEL_DONE;
 
@@ -475,7 +475,7 @@
 		type = alloca(strlen(token)+1);
 		strcpy(type, token);
 		camel_imapp_stream_astring(is, &token);
-		cinfo->type = header_content_type_new(type, token);
+		cinfo->type = camel_content_type_new(type, token);
 		imap_parse_param_list(is, &cinfo->type->params);
 	
 		/* body_fld_id     ::= nstring */
@@ -501,13 +501,13 @@
 	return cinfo;
 }
 
-struct _header_address *
+struct _camel_header_address *
 imap_parse_address_list(CamelIMAPPStream *is)
 /* throws PARSE,IO exception */
 {
 	int tok, len;
 	unsigned char *token, *host, *mbox;
-	struct _header_address *list = NULL;
+	struct _camel_header_address *list = NULL;
 
 	/* "(" 1*address ")" / nil */
 
@@ -515,7 +515,7 @@
 		tok = camel_imapp_stream_token(is, &token, &len);
 		if (tok == '(') {
 			while (1) {
-				struct _header_address *addr, *group = NULL;
+				struct _camel_header_address *addr, *group = NULL;
 
 				/* address         ::= "(" addr_name SPACE addr_adl SPACE addr_mailbox
 				   SPACE addr_host ")" */
@@ -525,7 +525,7 @@
 				if (tok != '(')
 					camel_exception_throw(1, "missing '(' for address");
 
-				addr = header_address_new();
+				addr = camel_header_address_new();
 				addr->type = HEADER_ADDRESS_NAME;
 				tok = camel_imapp_stream_nstring(is, &token);
 				addr->name = g_strdup(token);
@@ -551,7 +551,7 @@
 						g_free(addr->name);
 						addr->name = mbox;
 						addr->type = HEADER_ADDRESS_GROUP;
-						header_address_list_append(&list, addr);
+						camel_header_address_list_append(&list, addr);
 						group = addr;
 					}
 				} else {
@@ -559,9 +559,9 @@
 					g_free(mbox);
 					d(printf("adding address '%s'\n", addr->v.addr));
 					if (group != NULL)
-						header_address_add_member(group, addr);
+						camel_header_address_add_member(group, addr);
 					else
-						header_address_list_append(&list, addr);
+						camel_header_address_list_append(&list, addr);
 				}
 				do {
 					tok = camel_imapp_stream_token(is, &token, &len);
@@ -571,7 +571,7 @@
 			d(printf("empty, nil '%s'\n", token));
 		}
 	} CAMEL_CATCH(ex) {
-		header_address_list_clear(&list);
+		camel_header_address_list_clear(&list);
 		camel_exception_throw_ex(ex);
 	} CAMEL_DONE;
 
@@ -583,7 +583,7 @@
 {
 	int tok, len;
 	unsigned char *token;
-	struct _header_address *addr, *addr_from;
+	struct _camel_header_address *addr, *addr_from;
 	char *addrstr;
 	struct _CamelMessageInfo *minfo;
 
@@ -603,7 +603,7 @@
 
 		/* env_date        ::= nstring */
 		camel_imapp_stream_nstring(is, &token);
-		minfo->date_sent = header_decode_date(token, NULL);
+		minfo->date_sent = camel_header_decode_date(token, NULL);
 
 		/* env_subject     ::= nstring */
 		tok = camel_imapp_stream_nstring(is, &token);
@@ -618,10 +618,10 @@
 		/* env_sender      ::= "(" 1*address ")" / nil */
 		addr = imap_parse_address_list(is);
 		if (addr_from) {
-			header_address_list_clear(&addr);
+			camel_header_address_list_clear(&addr);
 #if 0
 			if (addr)
-				header_address_list_append_list(&addr_from, &addr);
+				camel_header_address_list_append_list(&addr_from, &addr);
 #endif
 		} else {
 			if (addr)
@@ -629,38 +629,38 @@
 		}
 
 		if (addr_from) {
-			addrstr = header_address_list_format(addr_from);
+			addrstr = camel_header_address_list_format(addr_from);
 			camel_message_info_set_from(minfo, addrstr);
-			header_address_list_clear(&addr_from);
+			camel_header_address_list_clear(&addr_from);
 		}
 
 		/* we dont keep reply_to */
 
 		/* env_reply_to    ::= "(" 1*address ")" / nil */
 		addr = imap_parse_address_list(is);
-		header_address_list_clear(&addr);
+		camel_header_address_list_clear(&addr);
 
 		/* env_to          ::= "(" 1*address ")" / nil */
 		addr = imap_parse_address_list(is);
 		if (addr) {
-			addrstr = header_address_list_format(addr);
+			addrstr = camel_header_address_list_format(addr);
 			camel_message_info_set_to(minfo, addrstr);
-			header_address_list_clear(&addr);
+			camel_header_address_list_clear(&addr);
 		}
 
 		/* env_cc          ::= "(" 1*address ")" / nil */
 		addr = imap_parse_address_list(is);
 		if (addr) {
-			addrstr = header_address_list_format(addr);
+			addrstr = camel_header_address_list_format(addr);
 			camel_message_info_set_cc(minfo, addrstr);
-			header_address_list_clear(&addr);
+			camel_header_address_list_clear(&addr);
 		}
 
 		/* we dont keep bcc either */
 
 		/* env_bcc         ::= "(" 1*address ")" / nil */
 		addr = imap_parse_address_list(is);
-		header_address_list_clear(&addr);
+		camel_header_address_list_clear(&addr);
 
 		/* FIXME: need to put in-reply-to into references hash list */
 
@@ -690,7 +690,7 @@
 	unsigned char *token;
 	struct _CamelMessageContentInfo * volatile cinfo = NULL;
 	struct _CamelMessageContentInfo *subinfo, *last;
-	struct _CamelMimeDisposition * volatile dinfo = NULL;
+	struct _CamelContentDisposition * volatile dinfo = NULL;
 	struct _CamelMessageInfo * volatile minfo = NULL;
 
 	/* body            ::= "(" body_type_1part / body_type_mpart ")" */
@@ -723,7 +723,7 @@
 			d(printf("media_subtype\n"));
 
 			camel_imapp_stream_astring(is, &token);
-			cinfo->type = header_content_type_new("multipart", token);
+			cinfo->type = camel_content_type_new("multipart", token);
 
 			/* body_ext_mpart  ::= body_fld_param
 			   [SPACE body_fld_dsp SPACE body_fld_lang
@@ -822,7 +822,7 @@
 		if (cinfo)
 			imap_free_body(cinfo);
 		if (dinfo)
-			header_disposition_unref(dinfo);
+			camel_content_disposition_unref(dinfo);
 		if (minfo)
 			camel_message_info_free(minfo);
 		camel_exception_throw_ex(ex);
@@ -830,7 +830,7 @@
 
 	/* FIXME: do something with the disposition, currently we have no way to pass it out? */
 	if (dinfo)
-		header_disposition_unref(dinfo);
+		camel_content_disposition_unref(dinfo);
 
 	return cinfo;
 }
Index: providers/imapp/camel-imapp-utils.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imapp/camel-imapp-utils.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- providers/imapp/camel-imapp-utils.h	1 Aug 2003 21:07:43 -0000	1.1
+++ providers/imapp/camel-imapp-utils.h	25 Aug 2003 21:01:41 -0000	1.2
@@ -48,10 +48,10 @@
 void imap_write_flags(CamelStream *stream, guint32 flags) /* IO */;
 
 /* ********************************************************************** */
-void imap_parse_param_list(CamelIMAPPStream *is, struct _header_param **plist) /* IO,PARSE */;
-struct _CamelMimeDisposition *imap_parse_ext_optional(CamelIMAPPStream *is) /* IO,PARSE */;
+void imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist) /* IO,PARSE */;
+struct _CamelContentDisposition *imap_parse_ext_optional(CamelIMAPPStream *is) /* IO,PARSE */;
 struct _CamelMessageContentInfo *imap_parse_body_fields(CamelIMAPPStream *is) /* IO,PARSE */;
-struct _header_address *imap_parse_address_list(CamelIMAPPStream *is) /* IO,PARSE */;
+struct _camel_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: providers/local/camel-local-summary.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/local/camel-local-summary.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- providers/local/camel-local-summary.c	17 Dec 2002 21:46:41 -0000	1.23
+++ providers/local/camel-local-summary.c	25 Aug 2003 21:01:42 -0000	1.24
@@ -41,7 +41,7 @@
 
 #define CAMEL_LOCAL_SUMMARY_VERSION (0x200)
 
-static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _header_raw *);
+static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_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 @@
 	if (ci->encoding)
 		info->citotal += strlen(ci->encoding) + 4;
 	if (ci->type) {
-		struct _header_content_type *ct = ci->type;
-		struct _header_param *param;
+		CamelContentType *ct = ci->type;
+		struct _camel_header_param *param;
 
 		info->citotal += sizeof(*ct) + 4;
 		if (ct->type)
@@ -308,7 +308,7 @@
  * Return value: -1 on error, otherwise the number of bytes written.
  **/
 int
-camel_local_summary_write_headers(int fd, struct _header_raw *header, const char *xevline, const char *status, const char *xstatus)
+camel_local_summary_write_headers(int fd, struct _camel_header_raw *header, const char *xevline, const char *status, const char *xstatus)
 {
 	int outlen = 0, len;
 	int newfd;
@@ -463,7 +463,7 @@
 local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo *mi)
 {
 	GString *out = g_string_new("");
-	struct _header_param *params = NULL;
+	struct _camel_header_param *params = NULL;
 	GString *val = g_string_new("");
 	CamelFlag *flag = mi->user_flags;
 	CamelTag *tag = mi->user_tags;
@@ -492,7 +492,7 @@
 					g_string_append_c (val, ',');
 				flag = flag->next;
 			}
-			header_set_param (&params, "flags", val->str);
+			camel_header_set_param (&params, "flags", val->str);
 			g_string_truncate (val, 0);
 		}
 		if (tag) {
@@ -504,11 +504,11 @@
 					g_string_append_c (val, ',');
 				tag = tag->next;
 			}
-			header_set_param (&params, "tags", val->str);
+			camel_header_set_param (&params, "tags", val->str);
 		}
 		g_string_free (val, TRUE);
-		header_param_list_format_append (out, params);
-		header_param_list_free (params);
+		camel_header_param_list_format_append (out, params);
+		camel_header_param_list_free (params);
 	}
 	ret = out->str;
 	g_string_free (out, FALSE);
@@ -519,13 +519,13 @@
 static int
 local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *mi)
 {
-	struct _header_param *params, *scan;
+	struct _camel_header_param *params, *scan;
 	guint32 uid, flags;
 	char *header;
 	int i;
 
 	/* check for uid/flags */
-	header = header_token_decode(xev);
+	header = camel_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 @@
 	/* check for additional data */	
 	header = strchr(xev, ';');
 	if (header) {
-		params = header_param_list_decode(header+1);
+		params = camel_header_param_list_decode(header+1);
 		scan = params;
 		while (scan) {
 			if (!strcasecmp(scan->name, "flags")) {
@@ -572,13 +572,13 @@
 			}
 			scan = scan->next;
 		}
-		header_param_list_free(params);
+		camel_header_param_list_free(params);
 	}
 	return 0;
 }
 
 static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _header_raw *h)
+message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
 {
 	CamelMessageInfo *mi;
 	CamelLocalSummary *cls = (CamelLocalSummary *)s;
@@ -588,7 +588,7 @@
 		const char *xev;
 		int doindex = FALSE;
 
-		xev = header_raw_find(&h, "X-Evolution", NULL);
+		xev = camel_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: providers/local/camel-local-summary.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/local/camel-local-summary.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- providers/local/camel-local-summary.h	10 Sep 2002 21:10:49 -0000	1.10
+++ providers/local/camel-local-summary.h	25 Aug 2003 21:01:42 -0000	1.11
@@ -82,7 +82,7 @@
 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 _header_raw *header, const char *xevline, const char *status, const char *xstatus);
+int camel_local_summary_write_headers(int fd, struct _camel_header_raw *header, const char *xevline, const char *status, const char *xstatus);
 
 #endif /* ! _CAMEL_LOCAL_SUMMARY_H */
 
Index: providers/local/camel-maildir-summary.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/local/camel-maildir-summary.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- providers/local/camel-maildir-summary.c	17 Dec 2002 21:46:41 -0000	1.20
+++ providers/local/camel-maildir-summary.c	25 Aug 2003 21:01:42 -0000	1.21
@@ -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 _header_raw *);
+static CamelMessageInfo *message_info_new(CamelFolderSummary *, struct _camel_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 @@
 	return mi;
 }
 
-static CamelMessageInfo *message_info_new(CamelFolderSummary * s, struct _header_raw *h)
+static CamelMessageInfo *message_info_new(CamelFolderSummary * s, struct _camel_header_raw *h)
 {
 	CamelMessageInfo *mi, *info;
 	CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
Index: providers/local/camel-mbox-folder.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/local/camel-mbox-folder.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- providers/local/camel-mbox-folder.c	7 Jul 2003 19:18:56 -0000	1.25
+++ providers/local/camel-mbox-folder.c	26 Aug 2003 16:06:01 -0000	1.26
@@ -376,7 +376,7 @@
 	camel_mime_parser_scan_from(parser, TRUE);
 
 	camel_mime_parser_seek(parser, frompos, SEEK_SET);
-	if (camel_mime_parser_step(parser, NULL, NULL) != HSCAN_FROM
+	if (camel_mime_parser_step(parser, NULL, NULL) != CAMEL_MIME_PARSER_STATE_FROM
 	    || camel_mime_parser_tell_start_from(parser) != frompos) {
 
 		g_warning("Summary doesn't match the folder contents!  eek!\n"
Index: providers/local/camel-mbox-summary.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/local/camel-mbox-summary.c,v
retrieving revision 1.42
retrieving revision 1.44
diff -u -r1.42 -r1.44
--- providers/local/camel-mbox-summary.c	7 Jul 2003 19:18:56 -0000	1.42
+++ providers/local/camel-mbox-summary.c	26 Aug 2003 16:06:01 -0000	1.44
@@ -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 _header_raw *);
+static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_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 @@
 }
 
 static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _header_raw *h)
+message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
 {
 	CamelMessageInfo *mi;
 	CamelMboxSummary *mbs = (CamelMboxSummary *)s;
@@ -204,16 +204,16 @@
 
 		if (mbs->xstatus) {
 			/* check for existance of status & x-status headers */
-			status = header_raw_find(&h, "Status", NULL);
+			status = camel_header_raw_find(&h, "Status", NULL);
 			if (status)
 				flags = decode_status(status);
-			xstatus = header_raw_find(&h, "X-Status", NULL);
+			xstatus = camel_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 = header_raw_find(&h, "X-Evolution", NULL);
+		xev = camel_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 @@
 	camel_mime_parser_seek(mp, offset, SEEK_SET);
 
 	if (offset > 0) {
-		if (camel_mime_parser_step(mp, NULL, NULL) == HSCAN_FROM
+		if (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM
 		    && camel_mime_parser_tell_start_from(mp) == offset) {
 			camel_mime_parser_unstep(mp);
 		} else {
@@ -380,7 +380,7 @@
 	}
 	mbs->changes = changeinfo;
 
-	while (camel_mime_parser_step(mp, NULL, NULL) == HSCAN_FROM) {
+	while (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) {
 		CamelMessageInfo *info;
 		off_t pc = camel_mime_parser_tell_start_from (mp) + 1;
 		
@@ -394,7 +394,7 @@
 			break;
 		}
 
-		g_assert(camel_mime_parser_step(mp, NULL, NULL) == HSCAN_FROM_END);
+		g_assert(camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM_END);
 	}
 
 	camel_object_unref(CAMEL_OBJECT (mp));
@@ -638,7 +638,7 @@
 
 		camel_mime_parser_seek(mp, info->frompos, SEEK_SET);
 
-		if (camel_mime_parser_step(mp, 0, 0) != HSCAN_FROM) {
+		if (camel_mime_parser_step(mp, 0, 0) != CAMEL_MIME_PARSER_STATE_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 @@
 			goto error;
 		}
 
-		if (camel_mime_parser_step(mp, 0, 0) == HSCAN_FROM_END) {
+		if (camel_mime_parser_step(mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM_END) {
 			g_warning("camel_mime_parser_step failed (2)");
 			goto error;
 		}
@@ -667,7 +667,7 @@
 		/* 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 = header_unfold(xevnew);
+		xevtmp = camel_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_mime_parser_seek(mp, info->frompos, SEEK_SET);
 		}
 
-		if (camel_mime_parser_step(mp, &buffer, &len) != HSCAN_FROM) {
+		if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_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 @@
 		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) == HSCAN_FROM_END) {
+			if (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_FROM_END) {
 				g_warning("camel_mime_parser_step failed (2)");
 				goto error;
 			}
@@ -918,7 +918,7 @@
 		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) == HSCAN_PRE_FROM) {
+			while (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_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: providers/local/camel-mh-summary.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/local/camel-mh-summary.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- providers/local/camel-mh-summary.c	11 Nov 2002 06:24:56 -0000	1.14
+++ providers/local/camel-mh-summary.c	26 Aug 2003 16:06:01 -0000	1.15
@@ -314,7 +314,7 @@
 
 	mp = camel_mime_parser_new();
 	camel_mime_parser_init_with_fd(mp, fd);
-	if (camel_mime_parser_step(mp, 0, 0) != HSCAN_EOF) {
+	if (camel_mime_parser_step(mp, 0, 0) != CAMEL_MIME_PARSER_STATE_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: providers/local/camel-spool-summary.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/local/camel-spool-summary.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- providers/local/camel-spool-summary.h	20 Mar 2003 16:43:29 -0000	1.8
+++ providers/local/camel-spool-summary.h	25 Aug 2003 21:01:42 -0000	1.9
@@ -63,7 +63,7 @@
 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 _header_raw *header, char *xevline);
+int camel_spool_summary_write_headers(int fd, struct _camel_header_raw *header, char *xevline);
 
 #endif /* ! _CAMEL_SPOOL_SUMMARY_H */
 
Index: providers/nntp/camel-nntp-summary.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/nntp/camel-nntp-summary.c,v
retrieving revision 1.5
retrieving revision 1.7
diff -u -r1.5 -r1.7
--- providers/nntp/camel-nntp-summary.c	30 Nov 2001 03:09:38 -0000	1.5
+++ providers/nntp/camel-nntp-summary.c	26 Aug 2003 16:06:02 -0000	1.7
@@ -77,7 +77,7 @@
 
 #define _PRIVATE(o) (((CamelNNTPSummary *)(o))->priv)
 
-static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _header_raw *);
+static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_header_raw *);
 static int summary_header_load(CamelFolderSummary *, FILE *);
 static int summary_header_save(CamelFolderSummary *, FILE *);
 
@@ -165,7 +165,7 @@
 }
 
 static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _header_raw *h)
+message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
 {
 	CamelMessageInfo *mi;
 	CamelNNTPSummary *cns = (CamelNNTPSummary *)s;
@@ -186,7 +186,8 @@
 	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);
 
@@ -198,7 +199,8 @@
 	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);
 
@@ -211,7 +213,8 @@
 }
 
 /* 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;
@@ -390,7 +393,7 @@
 	CamelFolder *folder;
 	CamelFolderSummary *s;
 	CamelMessageInfo *mi;
-	struct _header_raw *headers = NULL;
+	struct _camel_header_raw *headers = NULL;
 	char *line, *tab;
 	int len, ret;
 	unsigned int n, count, total, size;
@@ -433,7 +436,7 @@
 			if (xover->name) {
 				line += xover->skip;
 				if (line < tab) {
-					header_raw_append(&headers, xover->name, line, -1);
+					camel_header_raw_append(&headers, xover->name, line, -1);
 					switch(xover->type) {
 					case XOVER_STRING:
 						break;
@@ -468,7 +471,7 @@
 			cns->priv->uid = NULL;
 		}
 
-		header_raw_clear(&headers);
+		camel_header_raw_clear(&headers);
 
 		now = time(0);
 		if (last + 2 < now) {
@@ -533,7 +536,7 @@
 				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) != HSCAN_EOF)
+				while (camel_mime_parser_step(mp, NULL, NULL) != CAMEL_MIME_PARSER_STATE_EOF)
 					;
 				if (mi == NULL) {
 					goto error;
Index: providers/nntp/camel-nntp-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/nntp/camel-nntp-utils.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- providers/nntp/camel-nntp-utils.c	27 Oct 2001 16:59:31 -0000	1.20
+++ providers/nntp/camel-nntp-utils.c	25 Aug 2003 21:01:43 -0000	1.21
@@ -94,7 +94,7 @@
 				camel_message_info_set_to(new_info, g_strdup(folder->name));
 				camel_message_info_set_uid(new_info, uid);
 
-				new_info->date_sent = header_decode_date(date, NULL);
+				new_info->date_sent = camel_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,9 +176,8 @@
 			}
 
 			/* 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);
 
@@ -197,7 +196,7 @@
 					new_info->message_id = g_strdup(header->value);
 				}
 				else if (!g_strcasecmp(header->name, "Date")) {
-					new_info->date_sent = header_decode_date (header->value);
+					new_info->date_sent = camel_header_decode_date (header->value);
 #if 0
 					new_info->date_sent = g_strdup(header->value);
 					new_info->date_received = g_strdup(header->value);
Index: providers/pop3/camel-pop3-folder.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/pop3/camel-pop3-folder.c,v
retrieving revision 1.59
retrieving revision 1.61
diff -u -r1.59 -r1.61
--- providers/pop3/camel-pop3-folder.c	18 Jun 2003 17:55:40 -0000	1.59
+++ providers/pop3/camel-pop3-folder.c	26 Aug 2003 16:06:03 -0000	1.61
@@ -145,7 +145,7 @@
 	CamelPOP3FolderInfo *fi = data;
 	MD5Context md5;
 	unsigned char digest[16];
-	struct _header_raw *h;
+	struct _camel_header_raw *h;
 	CamelMimeParser *mp;
 
 	/* TODO; somehow work out the limit and use that for proper progress reporting
@@ -156,9 +156,9 @@
 	mp = camel_mime_parser_new();
 	camel_mime_parser_init_with_stream(mp, (CamelStream *)stream);
 	switch (camel_mime_parser_step(mp, NULL, NULL)) {
-	case HSCAN_HEADER:
-	case HSCAN_MESSAGE:
-	case HSCAN_MULTIPART:
+	case CAMEL_MIME_PARSER_STATE_HEADER:
+	case CAMEL_MIME_PARSER_STATE_MESSAGE:
+	case CAMEL_MIME_PARSER_STATE_MULTIPART:
 		h = camel_mime_parser_headers_raw(mp);
 		while (h) {
 			if (strcasecmp(h->name, "status") != 0
Index: providers/sendmail/camel-sendmail-transport.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/sendmail/camel-sendmail-transport.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- providers/sendmail/camel-sendmail-transport.c	10 Mar 2003 16:48:47 -0000	1.29
+++ providers/sendmail/camel-sendmail-transport.c	25 Aug 2003 21:01:51 -0000	1.30
@@ -87,7 +87,7 @@
 		  CamelAddress *from, CamelAddress *recipients,
 		  CamelException *ex)
 {
-	struct _header_raw *header, *savedbcc, *n, *tail;
+	struct _camel_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 @@
 	
 	/* unlink the bcc headers */
 	savedbcc = NULL;
-	tail = (struct _header_raw *) &savedbcc;
+	tail = (struct _camel_header_raw *) &savedbcc;
 	
-	header = (struct _header_raw *) &CAMEL_MIME_PART (message)->headers;
+	header = (struct _camel_header_raw *) &CAMEL_MIME_PART (message)->headers;
 	n = header->next;
 	while (n != NULL) {
 		if (!strcasecmp (n->name, "Bcc")) {
Index: providers/smtp/camel-smtp-transport.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/smtp/camel-smtp-transport.c,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -r1.140 -r1.141
--- providers/smtp/camel-smtp-transport.c	19 Aug 2003 02:36:30 -0000	1.140
+++ providers/smtp/camel-smtp-transport.c	25 Aug 2003 21:01:55 -0000	1.141
@@ -1223,7 +1223,7 @@
 smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelException *ex)
 {
 	CamelBestencEncoding enctype = CAMEL_BESTENC_8BIT;
-	struct _header_raw *header, *savedbcc, *n, *tail;
+	struct _camel_header_raw *header, *savedbcc, *n, *tail;
 	char *cmdbuf, *respbuf = NULL;
 	CamelStreamFilter *filtered_stream;
 	CamelMimeFilter *crlffilter;
@@ -1282,9 +1282,9 @@
 	
 	/* unlink the bcc headers */
 	savedbcc = NULL;
-	tail = (struct _header_raw *) &savedbcc;
+	tail = (struct _camel_header_raw *) &savedbcc;
 	
-	header = (struct _header_raw *) &CAMEL_MIME_PART (message)->headers;
+	header = (struct _camel_header_raw *) &CAMEL_MIME_PART (message)->headers;
 	n = header->next;
 	while (n != NULL) {
 		if (!strcasecmp (n->name, "Bcc")) {
? 43241.patch
? composer-namespace.patch
? namespace.patch
? namespace.sh
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.565
retrieving revision 1.567
diff -u -r1.565 -r1.567
--- ChangeLog	19 Aug 2003 15:22:50 -0000	1.565
+++ ChangeLog	26 Aug 2003 16:07:04 -0000	1.567
@@ -1,3 +1,19 @@
+2003-08-26  Jeffrey Stedfast  <fejj ximian com>
+
+	* e-msg-composer.c (message_rfc822_dnd):
+	s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g
+
+2003-08-25  Jeffrey Stedfast  <fejj ximian com>
+
+	* e-msg-composer-attachment-bar.c: updated for namespace changed
+	made to camel-mime-utils.[c,h]
+
+	* e-msg-composer-attachment.c: updated for namespace changed made
+	to camel-mime-utils.[c,h]
+
+	* e-msg-composer.c: updated for namespace changed made to
+	camel-mime-utils.[c,h]
+
 2003-08-19  Jeffrey Stedfast  <fejj ximian com>
 
 	* Original patch from David Woodhouse, but modified a bit by me.
Index: e-msg-composer-attachment-bar.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-attachment-bar.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- e-msg-composer-attachment-bar.c	13 Aug 2003 16:30:35 -0000	1.74
+++ e-msg-composer-attachment-bar.c	25 Aug 2003 21:03:47 -0000	1.75
@@ -231,7 +231,7 @@
 		content_type = camel_mime_part_get_content_type (attachment->body);
 		/* Get the image out of the attachment 
 		   and create a thumbnail for it */
-		image = header_content_type_is (content_type, "image", "*");
+		image = camel_content_type_is (content_type, "image", "*");
 		
 		if (image && attachment->pixbuf_cache == NULL) {
 			CamelDataWrapper *wrapper;
@@ -304,7 +304,7 @@
 		} else {
 			char *mime_type;
 			
-			mime_type = header_content_type_simple (content_type);
+			mime_type = camel_content_type_simple (content_type);
 			pixbuf = e_icon_for_mime_type (mime_type, 48);
 			g_free (mime_type);
 			gnome_icon_list_append_pixbuf (icon_list, pixbuf, NULL, label);
@@ -725,7 +725,7 @@
 	content = camel_medium_get_content_object (CAMEL_MEDIUM (attachment->body));
 	
 	if (!CAMEL_IS_MULTIPART (content)) {
-		if (header_content_type_is (content_type, "text", "*")) {
+		if (camel_content_type_is (content_type, "text", "*")) {
 			CamelMimePartEncodingType encoding;
 			CamelStreamFilter *filter_stream;
 			CamelMimeFilterBestenc *bestenc;
@@ -733,7 +733,7 @@
 			const char *charset;
 			char *type;
 			
-			charset = header_content_type_param (content_type, "charset");
+			charset = camel_content_type_param (content_type, "charset");
 			
 			stream = camel_stream_null_new ();
 			filter_stream = camel_stream_filter_new_with_stream (stream);
@@ -762,8 +762,8 @@
 			
 			if (!charset) {
 				/* looks kinda nasty, but this is how ya have to do it */
-				header_content_type_set_param (content_type, "charset", default_charset);
-				type = header_content_type_format (content_type);
+				camel_content_type_set_param (content_type, "charset", default_charset);
+				type = camel_content_type_format (content_type);
 				camel_mime_part_set_content_type (attachment->body, type);
 				g_free (type);
 			}
Index: e-msg-composer-attachment.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-attachment.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- e-msg-composer-attachment.c	13 Aug 2003 16:30:35 -0000	1.47
+++ e-msg-composer-attachment.c	25 Aug 2003 21:03:47 -0000	1.48
@@ -220,7 +220,7 @@
            workaround, don't set a Content-Id on these parts. Fixes
            bug #10032 */
 	/* set the Content-Id */
-	content_id = header_msgid_generate ();
+	content_id = camel_header_msgid_generate ();
 	camel_mime_part_set_content_id (part, content_id);
 	g_free (content_id);
 #endif
@@ -430,7 +430,7 @@
 	set_entry (editor_gui, "description_entry",
 		   camel_mime_part_get_description (attachment->body));
 	content_type = camel_mime_part_get_content_type (attachment->body);
-	type = header_content_type_simple (content_type);
+	type = camel_content_type_simple (content_type);
 	set_entry (editor_gui, "mime_type_entry", type);
 	g_free (type);
 	
Index: e-msg-composer.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
retrieving revision 1.408
retrieving revision 1.410
diff -u -r1.408 -r1.410
--- e-msg-composer.c	19 Aug 2003 15:22:50 -0000	1.408
+++ e-msg-composer.c	26 Aug 2003 16:07:04 -0000	1.410
@@ -388,7 +388,7 @@
 		}
 		data = g_byte_array_new ();
 		g_byte_array_append (data, composer->mime_body, strlen (composer->mime_body));
-		type = header_content_type_decode (composer->mime_type);
+		type = camel_content_type_decode (composer->mime_type);
 	} else {
 		data = get_text (composer->persist_stream_interface, "text/plain");
 		if (!data) {
@@ -399,9 +399,9 @@
 		
 		/* FIXME: we may want to do better than this... */
 		charset = best_charset (data, composer->charset, &plain_encoding);
-		type = header_content_type_new ("text", "plain");
+		type = camel_content_type_new ("text", "plain");
 		if (charset)
-			header_content_type_set_param (type, "charset", charset);
+			camel_content_type_set_param (type, "charset", charset);
 	}
 	
 	stream = camel_stream_mem_new_with_byte_array (data);
@@ -426,7 +426,7 @@
 	camel_object_unref (stream);
 	
 	camel_data_wrapper_set_mime_type_field (plain, type);
-	header_content_type_unref (type);
+	camel_content_type_unref (type);
 	
 	if (composer->send_html) {
 		CORBA_Environment ev;
@@ -2535,7 +2535,7 @@
 	camel_mime_parser_scan_from (mp, TRUE);
 	camel_mime_parser_init_with_stream (mp, stream);
 	
-	while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) {
+	while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) {
 		CamelMimeMessage *message;
 		CamelMimePart *part;
 		
@@ -3211,10 +3211,10 @@
 			e_msg_composer_add_inline_image_from_mime_part (composer, mime_part);
 	} else if (CAMEL_IS_MIME_MESSAGE (wrapper)) {
 		/* do nothing */
-	} else if (related && header_content_type_is (content_type, "image", "*")) {
+	} else if (related && camel_content_type_is (content_type, "image", "*")) {
 		e_msg_composer_add_inline_image_from_mime_part (composer, mime_part);
 	} else {
-		if (header_content_type_is (content_type, "text", "*")) {
+		if (camel_content_type_is (content_type, "text", "*")) {
 			/* do nothing */
 		} else {
 			e_msg_composer_attach (composer, mime_part);
@@ -3231,7 +3231,7 @@
 	gboolean related;
 	int i, nparts;
 	
-	related = header_content_type_is (CAMEL_DATA_WRAPPER (multipart)->mime_type, "multipart", "related");
+	related = camel_content_type_is (CAMEL_DATA_WRAPPER (multipart)->mime_type, "multipart", "related");
 		
 	if (CAMEL_IS_MULTIPART_SIGNED (multipart)) {
 		mime_part = camel_multipart_get_part (multipart, CAMEL_MULTIPART_SIGNED_CONTENT);
@@ -3303,14 +3303,14 @@
 		} else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) {
 			/* decrypt the encrypted content and configure the composer to encrypt outgoing messages */
 			handle_multipart_encrypted (composer, multipart, depth);
-		} else if (header_content_type_is (content_type, "multipart", "alternative")) {
+		} else if (camel_content_type_is (content_type, "multipart", "alternative")) {
 			/* this contains the text/plain and text/html versions of the message body */
 			handle_multipart_alternative (composer, multipart, depth);
 		} else {
 			/* there must be attachments... */
 			handle_multipart (composer, multipart, depth);
 		}
-	} else if (header_content_type_is (content_type, "text", "*")) {
+	} else if (camel_content_type_is (content_type, "text", "*")) {
 		char *text;
 		
 		if ((text = mail_get_message_body (content, FALSE, FALSE)))
@@ -3360,14 +3360,14 @@
 		} else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) {
 			/* decrypt the encrypted content and configure the composer to encrypt outgoing messages */
 			handle_multipart_encrypted (composer, multipart, depth);
-		} else if (header_content_type_is (content_type, "multipart", "alternative")) {
+		} else if (camel_content_type_is (content_type, "multipart", "alternative")) {
 			/* this contains the text/plain and text/html versions of the message body */
 			handle_multipart_alternative (composer, multipart, depth);
 		} else {
 			/* there must be attachments... */
 			handle_multipart (composer, multipart, depth);
 		}
-	} else if (header_content_type_is (content_type, "text", "*")) {
+	} else if (camel_content_type_is (content_type, "text", "*")) {
 		char *text;
 		
 		if ((text = mail_get_message_body (content, FALSE, FALSE)))
@@ -3412,11 +3412,11 @@
 				/* depth doesn't matter so long as we don't pass 0 */
 				handle_multipart (composer, mp, depth + 1);
 			}
-		} else if (header_content_type_is (content_type, "text", "html")) {
+		} else if (camel_content_type_is (content_type, "text", "html")) {
 			/* text/html is preferable, so once we find it we're done... */
 			text_part = mime_part;
 			break;
-		} else if (header_content_type_is (content_type, "text", "*")) {
+		} else if (camel_content_type_is (content_type, "text", "*")) {
 			/* anyt text part not text/html is second rate so the first
 			   text part we find isn't necessarily the one we'll use. */
 			if (!text_part)
@@ -3463,7 +3463,7 @@
 			} else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) {
 				/* decrypt the encrypted content and configure the composer to encrypt outgoing messages */
 				handle_multipart_encrypted (composer, mp, depth + 1);
-			} else if (header_content_type_is (content_type, "multipart", "alternative")) {
+			} else if (camel_content_type_is (content_type, "multipart", "alternative")) {
 				handle_multipart_alternative (composer, mp, depth + 1);
 			} else {
 				/* depth doesn't matter so long as we don't pass 0 */
@@ -3553,7 +3553,7 @@
 	EDestination **Tov, **Ccv, **Bccv;
 	GHashTable *auto_cc, *auto_bcc;
 	CamelContentType *content_type;
-	struct _header_raw *headers;
+	struct _camel_header_raw *headers;
 	CamelDataWrapper *content;
 	EAccount *account = NULL;
 	char *account_name;
@@ -3736,7 +3736,7 @@
 		} else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) {
 			/* decrypt the encrypted content and configure the composer to encrypt outgoing messages */
 			handle_multipart_encrypted (new, multipart, 0);
-		} else if (header_content_type_is (content_type, "multipart", "alternative")) {
+		} else if (camel_content_type_is (content_type, "multipart", "alternative")) {
 			/* this contains the text/plain and text/html versions of the message body */
 			handle_multipart_alternative (new, multipart, 0);
 		} else {
@@ -4188,7 +4188,7 @@
 	camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper);
 	camel_object_unref (wrapper);
 	
-	cid = header_msgid_generate ();
+	cid = camel_header_msgid_generate ();
 	camel_mime_part_set_content_id (part, cid);
 	name = g_path_get_basename(file_name);
 	camel_mime_part_set_filename (part, name);
? 42630.patch
? 45523.patch
? PLAN
? ch.sh
? crash.txt
? foo
? mailer-namespace.patch
? mb.patch
? message-tree.c
? message-tree.h
? namespace.sh
? updated
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2795
retrieving revision 1.2797
diff -u -r1.2795 -r1.2797
--- ChangeLog	22 Aug 2003 21:14:35 -0000	1.2795
+++ ChangeLog	26 Aug 2003 16:20:13 -0000	1.2797
@@ -1,3 +1,32 @@
+2003-08-26  Jeffrey Stedfast  <fejj ximian com>
+
+	* component-factory.c: Updated for camel namespace changes.
+
+	* folder-browser.c: Same.
+
+	* mail-autofilter.c: Here too.
+
+	* mail-callbacks.c: And here.
+
+	* importers/evolution-mbox-importer.c: And finally here.
+
+2003-08-25  Jeffrey Stedfast  <fejj ximian com>
+
+	* mail-display.c: updated for namespace changed made to
+	camel-mime-utils.[c,h]
+
+	* mail-format.c: updated for namespace changed made to
+	camel-mime-utils.[c,h]
+
+	* mail-ops.c: updated for namespace changed made to
+	camel-mime-utils.[c,h]
+
+	* message-list.c: updated for namespace changed made to
+	camel-mime-utils.[c,h]
+
+	* message-tag-followup.c: updated for namespace changed made to
+	camel-mime-utils.[c,h]
+
 2003-08-22  Not Zed  <NotZed Ximian com>
 
 	* mail-format.c (write_date): translate the local time format.
Index: component-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/component-factory.c,v
retrieving revision 1.330
retrieving revision 1.331
diff -u -r1.330 -r1.331
--- component-factory.c	1 Aug 2003 19:30:36 -0000	1.330
+++ component-factory.c	26 Aug 2003 16:20:15 -0000	1.331
@@ -531,7 +531,7 @@
 	camel_mime_parser_scan_from (mp, TRUE);
 	camel_mime_parser_init_with_stream (mp, stream);
 	
-	while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) {
+	while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) {
 		CamelMessageInfo *info;
 		CamelMimeMessage *msg;
 		
Index: folder-browser.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/folder-browser.c,v
retrieving revision 1.352
retrieving revision 1.353
diff -u -r1.352 -r1.353
--- folder-browser.c	23 Jul 2003 15:01:26 -0000	1.352
+++ folder-browser.c	26 Aug 2003 16:20:15 -0000	1.353
@@ -475,7 +475,7 @@
 	camel_mime_parser_scan_from (mp, TRUE);
 	camel_mime_parser_init_with_stream (mp, stream);
 	
-	while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) {
+	while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) {
 		CamelMessageInfo *info;
 		CamelMimeMessage *msg;
 		
Index: mail-autofilter.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-autofilter.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- mail-autofilter.c	6 Feb 2003 18:44:32 -0000	1.35
+++ mail-autofilter.c	26 Aug 2003 16:20:15 -0000	1.36
@@ -265,7 +265,7 @@
 	if (flags & AUTO_MLIST) {
 		char *name, *mlist;
 		
-		mlist = header_raw_check_mailing_list(&((CamelMimePart *)msg)->headers);
+		mlist = camel_header_raw_check_mailing_list(&((CamelMimePart *)msg)->headers);
 		if (mlist) {
 			rule_match_mlist(context, rule, mlist);
 			name = g_strdup_printf (_("%s mailing list"), mlist);
Index: mail-callbacks.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-callbacks.c,v
retrieving revision 1.452
retrieving revision 1.453
diff -u -r1.452 -r1.453
--- mail-callbacks.c	22 Aug 2003 21:14:36 -0000	1.452
+++ mail-callbacks.c	26 Aug 2003 16:20:15 -0000	1.453
@@ -2202,7 +2202,7 @@
 	uids = g_ptr_array_new ();
 	message_list_foreach (fb->message_list, enumerate_msg, uids);
 	
-	now = header_format_date (time (NULL), 0);
+	now = camel_header_format_date (time (NULL), 0);
 	
 	camel_folder_freeze (fb->folder);
 	for (i = 0; i < uids->len; i++) {
Index: mail-display.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-display.c,v
retrieving revision 1.291
retrieving revision 1.292
diff -u -r1.291 -r1.292
--- mail-display.c	19 Aug 2003 04:18:32 -0000	1.291
+++ mail-display.c	25 Aug 2003 21:20:45 -0000	1.292
@@ -1056,7 +1056,7 @@
 		g_object_set_data_full ((GObject *) widget, "uri-list", uri_list, g_free);		
 		break;
 	case DND_TARGET_TYPE_PART_MIME_TYPE:
-		if (header_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*")) {
+		if (camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*")) {
 		        GByteArray *ba;
 			
 			ba = mail_format_get_data_wrapper_text ((CamelDataWrapper *) part, NULL);
@@ -1149,7 +1149,7 @@
 	}
 	
 	/* Drag & Drop */
-	drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target = header_content_type_simple (((CamelDataWrapper *) part)->mime_type);
+	drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target = camel_content_type_simple (((CamelDataWrapper *) part)->mime_type);
 	camel_strdown (drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target);
 	
 	gtk_drag_source_set (button, GDK_BUTTON1_MASK,
@@ -1389,7 +1389,7 @@
 		
 		html_stream = mail_display_stream_new (html, handle);
 		
-		if (header_content_type_is (content_type, "text", "*")) {
+		if (camel_content_type_is (content_type, "text", "*")) {
 			mail_format_data_wrapper_write_to_stream (wrapper, TRUE, md, html_stream);
 		} else {
 			camel_data_wrapper_decode_to_stream (wrapper, html_stream);
@@ -1997,7 +1997,7 @@
 		
 		due_by = camel_tag_get (&md->info->user_tags, "due-by");
 		if (due_by && *due_by) {
-			target_date = header_decode_date (due_by, &offset);
+			target_date = camel_header_decode_date (due_by, &offset);
 			now = time (NULL);
 			if (now >= target_date)
 				overdue = _("Overdue:");
Index: mail-format.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-format.c,v
retrieving revision 1.294
retrieving revision 1.295
diff -u -r1.294 -r1.295
--- mail-format.c	22 Aug 2003 21:14:36 -0000	1.294
+++ mail-format.c	25 Aug 2003 21:20:45 -0000	1.295
@@ -553,13 +553,13 @@
 	 * be customizable.
 	 */
 	content_type = camel_mime_part_get_content_type (part);
-	if (!header_content_type_is (content_type, "message", "*"))
+	if (!camel_content_type_is (content_type, "message", "*"))
 		return TRUE;
 	
 	/* Otherwise, display it inline if it's "anonymous", and
 	 * as an attachment otherwise.
 	 */
-	type = header_content_type_simple (content_type);
+	type = camel_content_type_simple (content_type);
 	anon = is_anonymous (part, type);
 	g_free (type);
 	
@@ -787,8 +787,8 @@
 		time_t msg_date;
 		struct tm local;
 		int local_tz;
-
-		msg_date = header_decode_date(datestr, &msg_offset);
+		
+		msg_date = camel_header_decode_date(datestr, &msg_offset);
 		e_localtime_with_offset(msg_date, &local, &local_tz);
 
 		write_field_row_begin(stream, _("Date"), flags);
@@ -1073,20 +1073,20 @@
 			     bgcolor, fontcolor);
 	
 	if (full) {
-		struct _header_raw *header;
+		struct _camel_header_raw *header;
 		const char *charset;
 		CamelContentType *ct;
 		char *value;
 		
 		ct = camel_mime_part_get_content_type (CAMEL_MIME_PART (message));
-		charset = header_content_type_param (ct, "charset");
+		charset = camel_content_type_param (ct, "charset");
 		charset = e_iconv_charset_name (charset);
 		
 		header = CAMEL_MIME_PART (message)->headers;
 		while (header) {
 			i = default_header_index (header->name);
 			if (i == -1) {
-				value = header_decode_string (header->value, charset);
+				value = camel_header_decode_string (header->value, charset);
 				write_text_header (stream, header->name, value, WRITE_NOCOLUMNS);
 				g_free (value);
 			} else
@@ -1170,7 +1170,7 @@
 	if (mail_display && mail_display->charset) {
 		/* user override charset */
 		charset = g_strdup (mail_display->charset);
-	} else if (content_type && (charset = (char *) header_content_type_param (content_type, "charset"))) {
+	} else if (content_type && (charset = (char *) camel_content_type_param (content_type, "charset"))) {
 		/* try to use the charset declared in the Content-Type header */
 		if (!strncasecmp (charset, "iso-8859-", 9)) {
 			/* Since a few Windows mailers like to claim they sent
@@ -1297,8 +1297,8 @@
 	
 	/* Check for RFC 2646 flowed text. */
 	type = camel_mime_part_get_content_type (part);
-	if (header_content_type_is (type, "text", "plain")) {
-		format = header_content_type_param (type, "format");
+	if (camel_content_type_is (type, "text", "plain")) {
+		format = camel_content_type_param (type, "format");
 		
 		if (format && !strcasecmp (format, "flowed"))
 			flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED;
@@ -1443,7 +1443,7 @@
 	gboolean handled;
 	
 	/* Currently we only handle RFC2015-style PGP encryption. */
-	protocol = header_content_type_param (((CamelDataWrapper *) part)->mime_type, "protocol");
+	protocol = camel_content_type_param (((CamelDataWrapper *) part)->mime_type, "protocol");
 	if (!protocol || strcmp (protocol, "application/pgp-encrypted") != 0)
 		return handle_multipart_mixed (part, mime_type, md, stream);
 	
@@ -1610,7 +1610,7 @@
 	nparts = camel_multipart_get_number (mp);	
 	
 	content_type = camel_mime_part_get_content_type (part);
-	start = header_content_type_param (content_type, "start");
+	start = camel_content_type_param (content_type, "start");
 	if (start) {
 		int len;
 		
@@ -1700,7 +1700,7 @@
 	for (i = 0; i < nparts; i++) {
 		CamelMimePart *part = camel_multipart_get_part (multipart, i);
 		CamelContentType *type = camel_mime_part_get_content_type (part);
-		char *mime_type = header_content_type_simple (type);
+		char *mime_type = camel_content_type_simple (type);
 		
 		camel_strdown (mime_type);
 		if (want_plain && !strcmp (mime_type, "text/plain"))
@@ -1790,7 +1790,7 @@
 	char *url = NULL, *desc = NULL;
 	
 	type = camel_mime_part_get_content_type (part);
-	access_type = header_content_type_param (type, "access-type");
+	access_type = camel_content_type_param (type, "access-type");
 	if (!access_type)
 		goto fallback;
 	
@@ -1799,12 +1799,12 @@
 		const char *name, *site, *dir, *mode, *ftype;
 		char *path;
 		
-		name = header_content_type_param (type, "name");
-		site = header_content_type_param (type, "site");
+		name = camel_content_type_param (type, "name");
+		site = camel_content_type_param (type, "site");
 		if (name == NULL || site == NULL)
 			goto fallback;
-		dir = header_content_type_param (type, "directory");
-		mode = header_content_type_param (type, "mode");
+		dir = camel_content_type_param (type, "directory");
+		mode = camel_content_type_param (type, "mode");
 		
 		/* Generate the path. */
 		if (dir) {
@@ -1834,10 +1834,10 @@
 	} else if (!g_ascii_strcasecmp (access_type, "local-file")) {
 		const char *name, *site;
 		
-		name = header_content_type_param (type, "name");
+		name = camel_content_type_param (type, "name");
 		if (name == NULL)
 			goto fallback;
-		site = header_content_type_param (type, "site");
+		site = camel_content_type_param (type, "site");
 		
 		url = g_strdup_printf ("file://%s%s", *name == '/' ? "" : "/", name);
 		if (site) {
@@ -1852,7 +1852,7 @@
 		
 		/* RFC 2017 */
 		
-		urlparam = header_content_type_param (type, "url");
+		urlparam = camel_content_type_param (type, "url");
 		if (urlparam == NULL)
 			goto fallback;
 		
@@ -1981,7 +1981,7 @@
 	}
 	
 	date_val = camel_mime_message_get_date (message, &offset);
-	buf = header_format_date (date_val, offset);
+	buf = camel_header_format_date (date_val, offset);
 	html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
 	g_string_append_printf (retval, "%s<b>Date:</b> %s<br>", citation, html);
 	g_free (html);
@@ -2031,18 +2031,18 @@
 	/* If it is message/rfc822 or message/news, extract the
 	 * important headers and recursively process the body.
 	 */
-	if (header_content_type_is (mime_type, "message", "rfc822") ||
-	    header_content_type_is (mime_type, "message", "news"))
+	if (camel_content_type_is (mime_type, "message", "rfc822") ||
+	    camel_content_type_is (mime_type, "message", "news"))
 		return mail_get_message_rfc822 (CAMEL_MIME_MESSAGE (data), want_plain, cite);
 	
 	/* If it's a vcard or icalendar, ignore it. */
-	if (header_content_type_is (mime_type, "text", "x-vcard") ||
-	    header_content_type_is (mime_type, "text", "calendar"))
+	if (camel_content_type_is (mime_type, "text", "x-vcard") ||
+	    camel_content_type_is (mime_type, "text", "calendar"))
 		return NULL;
 	
 	/* Get the body data for other text/ or message/ types */
-	if (header_content_type_is (mime_type, "text", "*") ||
-	    header_content_type_is (mime_type, "message", "*")) {
+	if (camel_content_type_is (mime_type, "text", "*") ||
+	    camel_content_type_is (mime_type, "message", "*")) {
 		bytes = mail_format_get_data_wrapper_text (data, NULL);
 		
 		if (bytes) {
@@ -2051,12 +2051,12 @@
 			g_byte_array_free (bytes, FALSE);
 		}
 		
-		if (text && !header_content_type_is(mime_type, "text", "html")) {
+		if (text && !camel_content_type_is(mime_type, "text", "html")) {
 			char *html;
 			
-			if (header_content_type_is(mime_type, "text", "richtext"))
+			if (camel_content_type_is(mime_type, "text", "richtext"))
 				html = camel_enriched_to_html(text, CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT);
-			else if (header_content_type_is(mime_type, "text", "enriched"))
+			else if (camel_content_type_is(mime_type, "text", "enriched"))
 				html = camel_enriched_to_html(text, 0);
 			else
 				html = camel_text_to_html (text, CAMEL_MIME_FILTER_TOHTML_PRE |
@@ -2071,7 +2071,7 @@
 	/* If it's not message and it's not text, and it's not
 	 * multipart, we don't want to deal with it.
 	 */
-	if (!header_content_type_is (mime_type, "multipart", "*"))
+	if (!camel_content_type_is (mime_type, "multipart", "*"))
 		return NULL;
 	
 	mp = CAMEL_MULTIPART (data);
@@ -2085,7 +2085,7 @@
 		
 		data = camel_medium_get_content_object (CAMEL_MEDIUM (subpart));
 		return mail_get_message_body (data, want_plain, cite);
-	} else if (header_content_type_is (mime_type, "multipart", "alternative")) {
+	} else if (camel_content_type_is (mime_type, "multipart", "alternative")) {
 		/* Pick our favorite alternative and reply to it. */
 		
 		subpart = find_preferred_alternative (mp, want_plain);
Index: mail-ops.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-ops.c,v
retrieving revision 1.396
retrieving revision 1.397
diff -u -r1.396 -r1.397
--- mail-ops.c	22 Aug 2003 21:14:36 -0000	1.396
+++ mail-ops.c	25 Aug 2003 21:20:45 -0000	1.397
@@ -1936,7 +1936,7 @@
 			
 			/* We want to save textual parts as 8bit instead of encoded */
 			type = camel_data_wrapper_get_mime_type_field (wrapper);
-			if (header_content_type_is (type, "text", "*"))
+			if (camel_content_type_is (type, "text", "*"))
 				camel_mime_part_set_encoding (mime_part, CAMEL_MIME_PART_ENCODING_8BIT);
 		}
 	}
@@ -2087,8 +2087,8 @@
 	
 	data = camel_medium_get_content_object (CAMEL_MEDIUM (m->part));
 	content_type = camel_mime_part_get_content_type (m->part);
-	if (header_content_type_is (content_type, "text", "*")
-	    && (charset = header_content_type_param (content_type, "charset"))
+	if (camel_content_type_is (content_type, "text", "*")
+	    && (charset = camel_content_type_param (content_type, "charset"))
 	    && strcasecmp (charset, "utf-8") != 0) {
 		charsetfilter = camel_mime_filter_charset_new_convert ("utf-8", charset);
 		filtered_stream = (CamelStream *) camel_stream_filter_new_with_stream (stream_fs);
Index: message-list.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.c,v
retrieving revision 1.349
retrieving revision 1.350
diff -u -r1.349 -r1.350
--- message-list.c	22 Aug 2003 21:14:36 -0000	1.349
+++ message-list.c	25 Aug 2003 21:20:46 -0000	1.350
@@ -931,7 +931,7 @@
 		
 		tag = camel_tag_get ((CamelTag **) &msg_info->user_tags, "due-by");
 		if (tag && *tag) {
-			due_by = header_decode_date (tag, NULL);
+			due_by = camel_header_decode_date (tag, NULL);
 			return GINT_TO_POINTER (due_by);
 		} else {
 			return GINT_TO_POINTER (0);
@@ -1001,7 +1001,7 @@
 				time_t now = time (NULL);
 				time_t target_date;
 				
-				target_date = header_decode_date (due_by, NULL);
+				target_date = camel_header_decode_date (due_by, NULL);
 				if (now >= target_date) {
 					/* FIXME: extract from the xpm somehow. */
 					colour = "#A7453E";
Index: message-tag-followup.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-tag-followup.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- message-tag-followup.c	11 Jun 2003 16:19:36 -0000	1.23
+++ message-tag-followup.c	25 Aug 2003 21:20:46 -0000	1.24
@@ -149,7 +149,7 @@
 	
 	date = e_date_edit_get_time (followup->target_date);
 	if (date != (time_t) -1) {
-		text = header_format_date (date, 0);
+		text = camel_header_format_date (date, 0);
 		camel_tag_set (&tags, "due-by", text);
 		g_free (text);
 	} else {
@@ -157,7 +157,7 @@
 	}
 	
 	if (gtk_toggle_button_get_active (followup->completed)) {
-		text = header_format_date (followup->completed_date, 0);
+		text = camel_header_format_date (followup->completed_date, 0);
 		camel_tag_set (&tags, "completed-on", text);
 		g_free (text);
 	} else {
@@ -180,7 +180,7 @@
 	
 	text = camel_tag_get (&tags, "due-by");
 	if (text && *text) {
-		date = header_decode_date (text, NULL);
+		date = camel_header_decode_date (text, NULL);
 		e_date_edit_set_time (followup->target_date, date);
 	} else {
 		e_date_edit_set_time (followup->target_date, (time_t) -1);
@@ -188,7 +188,7 @@
 	
 	text = camel_tag_get (&tags, "completed-on");
 	if (text && *text) {
-		date = header_decode_date (text, NULL);
+		date = camel_header_decode_date (text, NULL);
 		if (date != (time_t) 0) {
 			gtk_toggle_button_set_active (followup->completed, TRUE);
 			followup->completed_date = date;
Index: importers/evolution-mbox-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/importers/evolution-mbox-importer.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- importers/evolution-mbox-importer.c	2 Apr 2003 16:35:27 -0000	1.30
+++ importers/evolution-mbox-importer.c	26 Aug 2003 16:20:17 -0000	1.31
@@ -133,7 +133,7 @@
 	}
 		
 	ex = camel_exception_new ();
-	if (camel_mime_parser_step (mbi->mp, 0, 0) == HSCAN_FROM) {
+	if (camel_mime_parser_step (mbi->mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) {
 		/* Import the next message */
 		CamelMimeMessage *msg;
 		CamelMessageInfo *info;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]