aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorBertrand Guiheneuf <Bertrand.Guiheneuf@inria.fr>1999-05-11 00:15:19 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-05-11 00:15:19 +0800
commit88f5b33f67bfe54a668bed1dfe203451eba7e027 (patch)
treebf38f9d4667d34f3c43d84a5ff55a6e8a71bc1e2 /camel/camel-mime-part.c
parent62b338094aac49edd76acbc227e18c4f06e726c1 (diff)
downloadgsoc2013-evolution-88f5b33f67bfe54a668bed1dfe203451eba7e027.tar
gsoc2013-evolution-88f5b33f67bfe54a668bed1dfe203451eba7e027.tar.gz
gsoc2013-evolution-88f5b33f67bfe54a668bed1dfe203451eba7e027.tar.bz2
gsoc2013-evolution-88f5b33f67bfe54a668bed1dfe203451eba7e027.tar.lz
gsoc2013-evolution-88f5b33f67bfe54a668bed1dfe203451eba7e027.tar.xz
gsoc2013-evolution-88f5b33f67bfe54a668bed1dfe203451eba7e027.tar.zst
gsoc2013-evolution-88f5b33f67bfe54a668bed1dfe203451eba7e027.zip
A bunch of new set/get func.
1999-05-10 Bertrand Guiheneuf <Bertrand.Guiheneuf@inria.fr> * camel/camel-mime-part.c (__camel_mime_part_get_header_lines): (__camel_mime_part_set_header_lines): (__camel_mime_part_get_content_languages): (__camel_mime_part_set_content_languages): (__camel_mime_part_get_encoding): (__camel_mime_part_set_encoding): (__camel_mime_part_get_content_MD5): (__camel_mime_part_set_content_MD5): (__camel_mime_part_get_content_id): (__camel_mime_part_set_content_id): A bunch of new set/get func. * camel/gstring-util.c (g_string_list_free): convenience function for string list complete deallocation. svn path=/trunk/; revision=900
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c176
1 files changed, 176 insertions, 0 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index eed4e5de0a..4f882bbeef 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -91,3 +91,179 @@ __camel_mime_part_add_header (CamelMimePart *mime_part, GString *header_name, GS
g_hash_table_insert (mime_part->headers, header_name, header_value);
}
+
+
+
+
+
+
+static void
+__camel_mime_part_remove_header (CamelMimePart *mime_part, GString *header_name)
+{
+
+ gboolean header_exists;
+ GString *old_header_name;
+ GString *old_header_value;
+
+ header_exists = g_hash_table_lookup_extended (mime_part->headers, header_name,
+ (gpointer *) &old_header_name,
+ (gpointer *) &old_header_value);
+ if (header_exists) {
+ g_string_free (old_header_name, TRUE);
+ g_string_free (old_header_value, TRUE);
+ }
+
+ g_hash_table_remove (mime_part->headers, header_name);
+
+}
+
+
+static GString *
+__camel_mime_part_get_header (CamelMimePart *mime_part, GString *header_name)
+{
+
+ GString *old_header_name;
+ GString *old_header_value;
+ GString *header_value;
+
+ header_value = (GString *)g_hash_table_lookup (mime_part->headers, header_name);
+ return header_value;
+}
+
+
+static void
+__camel_mime_part_set_description (CamelMimePart *mime_part, GString *description)
+{
+ if (mime_part->description) g_free(mime_part->description);
+ mime_part->description = description;
+}
+
+
+static GString *
+__camel_mime_part_get_description (CamelMimePart *mime_part)
+{
+ return mime_part->description;
+}
+
+
+
+static void
+__camel_mime_part_set_disposition (CamelMimePart *mime_part, GString *disposition)
+{
+ if (mime_part->disposition) g_free(mime_part->disposition);
+ mime_part->disposition = disposition;
+}
+
+
+static GString *
+__camel_mime_part_get_disposition (CamelMimePart *mime_part)
+{
+ return mime_part->disposition;
+}
+
+
+
+static void
+__camel_mime_part_set_filename (CamelMimePart *mime_part, GString *filename)
+{
+ if (mime_part->filename) g_free(mime_part->filename);
+ mime_part->filename = filename;
+}
+
+
+static GString *
+__camel_mime_part_get_filename (CamelMimePart *mime_part)
+{
+ return mime_part->filename;
+}
+
+
+
+/* this routine must not be public */
+static void
+__camel_mime_part_set_content_id (CamelMimePart *mime_part, GString *content_id)
+{
+ if (mime_part->content_id) g_free(mime_part->content_id);
+ mime_part->content_id = content_id;
+}
+
+
+static GString *
+__camel_mime_part_get_content_id (CamelMimePart *mime_part)
+{
+ return mime_part->content_id;
+}
+
+
+
+/* this routine must not be public */
+static void
+__camel_mime_part_set_content_MD5 (CamelMimePart *mime_part, GString *content_MD5)
+{
+ if (mime_part->content_MD5) g_free(mime_part->content_MD5);
+ mime_part->content_MD5 = content_MD5;
+}
+
+
+static GString *
+__camel_mime_part_get_content_MD5 (CamelMimePart *mime_part)
+{
+ return mime_part->content_MD5;
+}
+
+
+
+
+static void
+__camel_mime_part_set_encoding (CamelMimePart *mime_part, GString *encoding)
+{
+ if (mime_part->encoding) g_free(mime_part->encoding);
+ mime_part->encoding = encoding;
+}
+
+
+static GString *
+__camel_mime_part_get_encoding (CamelMimePart *mime_part)
+{
+ return mime_part->encoding;
+}
+
+
+
+
+static void
+__camel_mime_part_set_content_languages (CamelMimePart *mime_part, GList *content_languages)
+{
+ if (mime_part->content_languages) g_string_list_free(mime_part->content_languages);
+ mime_part->content_languages = content_languages;
+}
+
+
+static GList *
+__camel_mime_part_get_content_languages (CamelMimePart *mime_part)
+{
+ return mime_part->content_languages;
+}
+
+
+
+
+
+static void
+__camel_mime_part_set_header_lines (CamelMimePart *mime_part, GList *header_lines)
+{
+ if (mime_part->header_lines) g_string_list_free(mime_part->header_lines);
+ mime_part->header_lines = header_lines;
+}
+
+
+static GList *
+__camel_mime_part_get_header_lines (CamelMimePart *mime_part)
+{
+ return mime_part->header_lines;
+}
+
+
+
+
+