diff options
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r-- | camel/camel-mime-part.c | 176 |
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; +} + + + + + |