aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-08-26 17:44:33 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-08-26 17:44:33 +0800
commit2a912b33018b0389672d9a4f09496b6a57071388 (patch)
treea34375a629d3d36575eae930a39ee3e76f2fba3c /camel/camel-mime-part.c
parenta76dccf18b6d8b854280031dbcc9187cd5744958 (diff)
downloadgsoc2013-evolution-2a912b33018b0389672d9a4f09496b6a57071388.tar.gz
gsoc2013-evolution-2a912b33018b0389672d9a4f09496b6a57071388.tar.zst
gsoc2013-evolution-2a912b33018b0389672d9a4f09496b6a57071388.zip
new file, groups mime-part related utils. Meant to be used by providers
1999-08-26 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-mime-part-utils.c: new file, groups mime-part related utils. Meant to be used by providers subclassing MimeMessage. (camel_mime_part_construct_headers_from_stream): (camel_mime_part_construct_content_from_stream): no more useless temporary hash table. * camel/camel-mime-part.c (_construct_from_stream): calls mime-part-utils functions now. * camel/gmime-utils.c (_store_header_pair_from_string): do not use hash table to store header, use an array instead. * MimePart cleanup. Not complete yet. Content must not be parsed when constructing but only when content object is requested. Default implementation will keep content in a stream. svn path=/trunk/; revision=1144
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c71
1 files changed, 6 insertions, 65 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 1e41e5038d..ef01a54ba4 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -719,77 +719,18 @@ _parse_header_pair (CamelMimePart *mime_part, gchar *header_name, gchar *header_
}
-/* calls _parse_header_pair, but can be called
- in a g_hash_table_for_each */
-void
-_parse_hash_table_pair (gpointer key, gpointer value, gpointer user_data)
-{
- gchar *header_name = (gchar *)key;
- gchar *header_value = (gchar *)value;
- CamelMimePart *mime_part = (CamelMimePart *) user_data;
-
-
- CAMEL_LOG_FULL_DEBUG ("\n--------- New Header ----------\n");
- if (header_name)
- CAMEL_LOG_FULL_DEBUG ( "header name :%s\n", header_name);
- if (header_value)
- CAMEL_LOG_FULL_DEBUG ( "header value :%s\n", header_value);
-
- camel_medium_add_header ( CAMEL_MEDIUM (mime_part), header_name, header_value);
-
- CAMEL_LOG_FULL_DEBUG ( "--------- End -----------------\n");
-}
void
_construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
- GHashTable *header_table;
+
CamelMimePart *mime_part = CAMEL_MIME_PART (data_wrapper);
- GMimeContentField *content_type;
- gchar *mime_type;
- GtkType content_object_type;
- CamelDataWrapper *content_object;
-
- CAMEL_LOG_FULL_DEBUG ("CamelMimePart:: Entering _construct_from_stream\n");
- g_assert (stream);
- CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream parsing headers\n");
- /* parse all header lines */
- header_table = get_header_table_from_stream (stream);
- if (header_table) {
- g_hash_table_foreach (header_table, _parse_hash_table_pair, (gpointer)mime_part);
- }
- g_hash_table_destroy (header_table);
- CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream headers parsed \n");
-
- /* now parse the content */
- /* find its mime type */
- CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream parsing content\n");
- content_type = camel_mime_part_get_content_type (mime_part);
- mime_type = gmime_content_field_get_mime_type (content_type);
-
- if (!mime_type) {
- CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream content type field not found "
- "using default \"text/plain\"\n");
- mime_type = g_strdup ("text/plain");
- camel_mime_part_set_content_type (mime_part, mime_type);
- }
- content_object_type = data_wrapper_repository_get_data_wrapper_type (mime_type);
-
- CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream content type object type used: %s\n", gtk_type_name (content_object_type));
- g_free (mime_type);
- content_object = CAMEL_DATA_WRAPPER (gtk_type_new (content_object_type));
- camel_data_wrapper_set_mime_type_field (content_object, camel_mime_part_get_content_type (mime_part));
- camel_medium_set_content_object ( CAMEL_MEDIUM (mime_part), content_object);
- camel_data_wrapper_construct_from_stream (content_object, stream);
-
- /* the object is referenced in the set_content_object method, so unref it here */
- gtk_object_unref (GTK_OBJECT (content_object));
-
-
- CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream content parsed\n");
-
-
+
+ camel_mime_part_construct_headers_from_stream (mime_part, stream);
+ camel_mime_part_construct_content_from_stream (mime_part, stream);
+
CAMEL_LOG_FULL_DEBUG ("CamelMimePart:: Leaving _construct_from_stream\n");
+
}
itle='2004-01-02 18:10:46 +0800'>2004-01-022-2/+2 * - Fix REINPLACE_CMDkrion2003-12-192-2/+2 * Add ircd-hybrid-ru 7.1,krion2003-12-1526-0/+978 * Add conflicts on xmms-[0-9]*fjoe2003-12-081-0/+2 * New port: ru-xmmsfjoe2003-12-082-0/+19 * - Add WITH_MOTIF knob to enable pixmaps in indicator iconsergei2003-12-062-6/+26 * Update to version 1.3.29+30.19+2.8.16lev2003-11-214-33/+10 * Update to latest version 30.19+1.3.29lev2003-11-214-31/+8 * new Russian-language, i386 Linux binary port of Firebird Web browser,trevor2003-11-204-0/+39 * USE_REINPLACE must be defined before REINPLACE_CMD may be used.trevor2003-11-171-0/+1 * Do not attempt to apply patches for OO 1.0.3 to version 1.1.kan2003-11-141-3/+0 * Use the FIND and XARGS macros introduced in bsd.port.mk 1.391.trevor2003-11-131-1/+1 * Bump PORTREVISION.fjoe2003-11-101-0/+1 * Obey CFLAGS.fjoe2003-11-091-2/+1 * OpenOffice -> OpenOffice.orgmaho2003-11-093-3/+3 * Add OpenOffice.org 1.1 for russian languagemaho2003-11-092-0/+23 * Forgot to change Makefile s..maho2003-11-081-1/+1 * rename openoffice* to openoffice-1.0* accodingly (repo copy).maho2003-11-081-1/+1 * rename openoffice to openoffice-1.0 after repocopymaho2003-11-082-23/+1 * Partial backout. I missed fjoe's commit from a few days ago thatlinimon2003-11-021-4/+0 * Per bento logs, mark broken on 5.x (gcc3.3) and alpha. The distfilelinimon2003-11-021-1/+11 * ports with possibly unreachable MAINTAINERsedwin2003-11-021-1/+1 * Clean up the patch.fjoe2003-10-281-1/+1 * Fix build with gcc 3.3.1.fjoe2003-10-282-3/+4 * Fix typo.lev2003-10-251-1/+1 * [1] Use bsd.port.(pre|post).mklev2003-10-244-720/+732 * utilize SITE_PERLijliao2003-10-246-22/+20 * Fix problem with zombies.lev2003-10-234-1/+52 * Update to version 0.99f6.demon2003-10-192-2/+2 * - Make tarballs fetchablekrion2003-10-181-3/+5 * Update the distribution sites and the maintainer's address.roam2003-10-102-5/+7 * Fix building of suexec with Russian and SLL patches.lev2003-10-092-3/+17 * Fix typo (mod_charest -> mod_charset).fjoe2003-10-082-2/+2 * New port: russian/muttprint (pretty print mail in russian)edwin2003-10-073-0/+160 * new port: russian/koi2koiedwin2003-10-078-0/+629 * Translation update: fix checksum.will2003-09-222-2/+2 * Upgrade to Qt 3.2.1 / KDE 3.1.4. See x11/kde3/Makefile rev 1.64 for details.will2003-09-182-2/+2 * Make portlint-compilant.osa2003-09-032-16/+16 * Fix build on -CURRENT (gcc-3.x)osa2003-09-031-0/+11 * Additional lib->share fixesache2003-08-202-6/+6 * spaces -> tab, += -> =ache2003-08-121-1/+1 * Unbroke (fix path)ache2003-08-121-3/+2 * BROKEN: Broken dependencykris2003-08-071-0/+2 * Update to 1.3.28+30.18+2.8.15lev2003-08-034-36/+28 * Update to 1.3.28+30.18lev2003-08-034-32/+24 * Update to version 0.99f5.demon2003-07-292-2/+2 * Update KDE to the latest official release, KDE 3.1.3lofi2003-07-296-4/+20 * Bump libmm shlib version after recent update of devel/mm.demon2003-07-251-1/+1 * Change my mail to @FreeBSD.orgkrion2003-07-221-1/+1 * Unbreak russian/xxkb by updating MASTER_SITES [1]osa2003-07-163-9/+9 * Fix plist.arved2003-07-082-2/+0 * Add CONFLICTS with other httpd ports: all apache variants and `www/publicfile'lev2003-06-252-0/+17 * Change MAINTAINER field of my ports to lev@FReeBSD.org, my brand-newlev2003-06-172-2/+2 * Fix pkg-plistarved2003-06-164-0/+10 * - Update to 1.10;sobomax2003-05-204-9/+8 * Update to KDE 3.1.2lioux2003-05-204-10/+8 * Bring back from Attic: localized messages and documentation for kofficelioux2003-05-2013-0/+415 * Remove bogus hypen dict.mbr2003-05-141-1/+0 * Add russian ooodict port.mbr2003-05-142-0/+21 * Re-add russian language patch.mbr2003-05-142-2/+2 * Remove Y2K conformance statement URLs.fenner2003-05-091-1/+0 * Update to 3.2arved2003-05-052-3/+3 * Add ksocrat, a KDE russian-english dictionary.arved2003-05-015-0/+55 * Fix breakage caused by old translating patches.mbr2003-04-252-2/+2 * [PATCH] russian/wmcyrx: fix MASTER_SITESedwin2003-04-071-3/+2 * Update to 1.3.27PL30.17+2.8.14.nork2003-04-062-2/+2 * Rejoice, for the long awaited upgrade to kde 3.1.1 is here!alane2003-04-064-26/+68 * Remove manpage directories on deinstallkris2003-04-051-0/+2 * Update Russian Apache + mod_ssl to patchlevel 30.17edwin2003-03-312-3/+3 * Update Russian Apache to patchlevel 30.17edwin2003-03-312-4/+3 * Clear moonlight beckons.ade2003-03-0722-11/+11 * Update MASTER_SITE for port russian/apache13 to lateset mirror listedwin2003-02-241-15/+1 * Update MASTER_SITE for port russian/apache13-modssl to lateset mirror listedwin2003-02-241-29/+10 * Update russian/rus-ispell to more recent version: 0.99f4edwin2003-02-242-11/+11 * Remove RESTRICTED tag for crypto stuff.nork2003-02-231-2/+0 * De-pkg-comment.knu2003-02-2120-10/+10 * De-pkg-comment.knu2003-02-212-1/+1 * De-pkg-comment.knu2003-02-218-4/+4 * update to fortuneru-0.4leeym2003-02-192-12/+7 * Update to 1.15.3.naddy2003-02-173-4/+4 * Upgrade to 0.3.naddy2003-02-155-16/+27 * Remove redundant category 'editors' in slave ports.mbr2003-02-132-2/+2 * Add correct encodings for the russian port.mbr2003-02-132-0/+8 * Upgrade kde-i18n to 3.1. Note that the following modules did not get awill2003-01-294-84/+692 * Add russian language distribution patch.mbr2003-01-222-0/+6 * Mark sites/distfiles with tags to minimize false hitsache2003-01-171-5/+5 * Master site changedache2003-01-172-2/+2 * Upgrade to 1.5ache2003-01-033-4/+6 * Upgrade to 0.99f3ache2003-01-023-6/+4 * Update to version 1.8.3.edwin2002-12-132-2/+9 * Fix maintainers email addressedwin2002-12-131-1/+1 * Typo in pkg-descredwin2002-12-111-1/+1 * spelling-typoedwin2002-12-111-1/+1 * Remove all netscape ports with a vulnerability of JRE.sada2002-11-176-45/+0 * - upgrade mod-ssl to 2.8.12 so that distfile could be fetchable again.sada2002-11-114-10/+107 * Add login classes support for suexecsada2002-11-113-9/+105 * o Rollback PORTCOMMENT modifications while this feature's implementationlioux2002-11-1112-12/+6 * Use PORTCOMMENT in the Makefile, and whack the pkg-comment.adamw2002-11-0712-6/+12 * PERL -> REINPLACEedwin2002-11-041-0/+1