aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-08-25 05:01:10 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-08-25 05:01:10 +0800
commit6881fd1bf710f0ce0bd55f9975855bb23622077a (patch)
treeb9a41edaab9742dbd6de39cf868b86905e6d26a7 /camel/camel-mime-part.c
parent86159a122623b0ef936f60e5040981bf0ab5d74e (diff)
downloadgsoc2013-evolution-6881fd1bf710f0ce0bd55f9975855bb23622077a.tar
gsoc2013-evolution-6881fd1bf710f0ce0bd55f9975855bb23622077a.tar.gz
gsoc2013-evolution-6881fd1bf710f0ce0bd55f9975855bb23622077a.tar.bz2
gsoc2013-evolution-6881fd1bf710f0ce0bd55f9975855bb23622077a.tar.lz
gsoc2013-evolution-6881fd1bf710f0ce0bd55f9975855bb23622077a.tar.xz
gsoc2013-evolution-6881fd1bf710f0ce0bd55f9975855bb23622077a.tar.zst
gsoc2013-evolution-6881fd1bf710f0ce0bd55f9975855bb23622077a.zip
new class. Will handle all sort of information media (Mime mail messages,
1999-08-24 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-medium.c (camel_medium_class_init): new class. Will handle all sort of information media (Mime mail messages, Lotus Notes mail messages, postit notes, faxes, who knows .... :) CamelMimePart will inherit from it. * camel/camel-mime-part.c (_set_disposition): (_set_description): description and disposition parameters are now const. * camel/gmime-content-field.c (gmime_content_field_free): added assertion code. * camel/providers/MH/camel-mh-folder.c (_get_message): uses buffered stream. * camel/camel-stream-buffered-fs.c: new stream to accelerate file ops. Thanks to jwz, I've decided to add a level of abstraction to Camel. In the future, it should be able to handle other mail systems, but also non-mail information vehicles. Enough for today. Roller time! svn path=/trunk/; revision=1140
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index fb1caaa70c..edab1636b6 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -54,9 +54,9 @@ static CamelDataWrapperClass *parent_class=NULL;
static void _add_header (CamelMimePart *mime_part, gchar *header_name, gchar *header_value);
static void _remove_header (CamelMimePart *mime_part, const gchar *header_name);
static const gchar *_get_header (CamelMimePart *mime_part, const gchar *header_name);
-static void _set_description (CamelMimePart *mime_part, gchar *description);
+static void _set_description (CamelMimePart *mime_part, const gchar *description);
static const gchar *_get_description (CamelMimePart *mime_part);
-static void _set_disposition (CamelMimePart *mime_part, gchar *disposition);
+static void _set_disposition (CamelMimePart *mime_part, const gchar *disposition);
static const gchar *_get_disposition (CamelMimePart *mime_part);
static void _set_filename (CamelMimePart *mime_part, gchar *filename);
static const gchar *_get_filename (CamelMimePart *mime_part);
@@ -150,6 +150,15 @@ camel_mime_part_init (gpointer object, gpointer klass)
camel_mime_part->headers = g_hash_table_new (g_str_hash, g_str_equal);
camel_mime_part->content_type = gmime_content_field_new (NULL, NULL);
+ camel_mime_part->description = NULL;
+ camel_mime_part->disposition = NULL;
+ camel_mime_part->content_id = NULL;
+ camel_mime_part->content_MD5 = NULL;
+ camel_mime_part->content_languages = NULL;
+ camel_mime_part->encoding = NULL;
+ camel_mime_part->filename = NULL;
+ camel_mime_part->header_lines = NULL;
+ camel_mime_part->content = NULL;
}
@@ -296,14 +305,14 @@ camel_mime_part_get_header (CamelMimePart *mime_part, const gchar *header_name)
static void
-_set_description (CamelMimePart *mime_part, gchar *description)
+_set_description (CamelMimePart *mime_part, const gchar *description)
{
if (mime_part->description) g_free (mime_part->description);
- mime_part->description = description;
+ mime_part->description = g_strdup (description);
}
void
-camel_mime_part_set_description (CamelMimePart *mime_part, gchar *description)
+camel_mime_part_set_description (CamelMimePart *mime_part, const gchar *description)
{
CMP_CLASS(mime_part)->set_description (mime_part, description);
}
@@ -326,19 +335,19 @@ camel_mime_part_get_description (CamelMimePart *mime_part)
static void
-_set_disposition (CamelMimePart *mime_part, gchar *disposition)
+_set_disposition (CamelMimePart *mime_part, const gchar *disposition)
{
#warning Do not use MimeContentfield here !!!
- //if (mime_part->disposition) g_free(mime_part->disposition);
+ if (mime_part->disposition) g_free(mime_part->disposition);
if (!mime_part->disposition)
- mime_part->disposition = g_new (GMimeContentField,1);
+ mime_part->disposition = g_new0 (GMimeContentField,1);
if ((mime_part->disposition)->type) g_free ((mime_part->disposition)->type);
- (mime_part->disposition)->type = disposition;
+ (mime_part->disposition)->type = g_strdup (disposition);
}
void
-camel_mime_part_set_disposition (CamelMimePart *mime_part, gchar *disposition)
+camel_mime_part_set_disposition (CamelMimePart *mime_part, const gchar *disposition)
{
CMP_CLASS(mime_part)->set_disposition (mime_part, disposition);
}