aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@inria.fr>1999-06-29 00:05:09 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-06-29 00:05:09 +0800
commit1659afa3d3159f2546bbde6b3cd6353735a81646 (patch)
treea9a5e63850cdb2d5ca0dc961271377a991d23d13 /camel/camel-mime-part.c
parent817f237398296dbdafc091d51a6fed2053a9c1c1 (diff)
downloadgsoc2013-evolution-1659afa3d3159f2546bbde6b3cd6353735a81646.tar.gz
gsoc2013-evolution-1659afa3d3159f2546bbde6b3cd6353735a81646.tar.zst
gsoc2013-evolution-1659afa3d3159f2546bbde6b3cd6353735a81646.zip
now use CamelDataWrapper::contruct_form_stream to test message parsing
1999-06-28 bertrand <Bertrand.Guiheneuf@inria.fr> * tests/test2.c (main): now use CamelDataWrapper::contruct_form_stream to test message parsing * camel/camel-data-wrapper.c: * camel/camel-data-wrapper.h: construct_from_stream no longer has maximimum size arg. * camel/camel-mime-part.c (_construct_from_stream): new. Construct the mime_part from a stream. svn path=/trunk/; revision=1003
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 5bba86f54a..0fdf749d38 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -27,6 +27,7 @@
#include "gmime-content-field.h"
#include "gstring-util.h"
#include "camel-log.h"
+#include "gmime-utils.h"
typedef enum {
@@ -75,6 +76,7 @@ static CamelDataWrapper *_get_content_object(CamelMimePart *mime_part);
static void _write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
static gboolean _parse_header_pair (CamelMimePart *mime_part, GString *header_name, GString *header_value);
+void _construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
/* loads in a hash table the set of header names we */
@@ -130,6 +132,7 @@ camel_mime_part_class_init (CamelMimePartClass *camel_mime_part_class)
/* virtual method overload */
camel_data_wrapper_class->write_to_stream = _write_to_stream;
+ camel_data_wrapper_class->construct_from_stream = _construct_from_stream;
}
static void
@@ -675,3 +678,37 @@ _parse_header_pair (CamelMimePart *mime_part, GString *header_name, GString *hea
} else return FALSE;
}
+
+/* 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)
+{
+ GString *header_name = (GString *)key;
+ GString *header_value = (GString *)value;
+ CamelMimePart *mime_part = (CamelMimePart *) user_data;
+
+
+ CAMEL_LOG (FULL_DEBUG,"\n--------- New Header ----------\n");
+ if ((header_name) && (header_name->str))
+ CAMEL_LOG (FULL_DEBUG, "header name :%s\n", header_name->str);
+ if ((header_value) && (header_value->str))
+ CAMEL_LOG (FULL_DEBUG, "header value :%s\n", header_value->str);
+
+ camel_mime_part_add_header (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);
+
+ 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);
+}
+
9750b02e48974982bd8660370d43b6dbe0'>libogg.so.8: Bump PORTREVISION for ports that depend on libogg,naddy2012-07-201-0/+1 * Update to version 0.6.0pawel2012-07-055-50/+110 * - Update to 0.5.6scheidell2012-06-244-145/+111 * - Convert USE_QT_VER=4 and QT_COMPONETS to USE_QT4miwi2012-06-061-2/+1 * - update png to 1.5.10dinoex2012-06-011-0/+1 * Update to 0.5.5pawel2012-05-303-8/+10 * Update to 0.5.4crees2012-03-024-24/+26 * - Chase audio/wildmidi shlib bumppgollucci2012-02-251-2/+2 * - Bump PORTREVISION to chase the update of multimedia/libvpxashish2012-02-161-1/+1 * Chase libcdio shlib bumparved2012-01-191-1/+2 * - Update to version 0.5.2pawel2011-10-306-171/+470 * Bump due to ffmpeg update to 0.7.1mm2011-06-251-0/+1