aboutsummaryrefslogtreecommitdiffstats
path: root/camel/gmime-content-field.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@inria.fr>1999-06-23 00:12:27 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-06-23 00:12:27 +0800
commit7f81757d52326126f88e898241dc40c1668f5164 (patch)
treece4f1671ce7d1280f8b1a375c15bbc79bd87cad9 /camel/gmime-content-field.c
parent5deed2f193e7ab91f159f1a764b78578861044cd (diff)
downloadgsoc2013-evolution-7f81757d52326126f88e898241dc40c1668f5164.tar.gz
gsoc2013-evolution-7f81757d52326126f88e898241dc40c1668f5164.tar.zst
gsoc2013-evolution-7f81757d52326126f88e898241dc40c1668f5164.zip
moved all the content-type stuff here. (camel_data_wrapper_init):
1999-06-22 bertrand <Bertrand.Guiheneuf@inria.fr> * camel/camel-data-wrapper.c (_get_content_type): moved all the content-type stuff here. (camel_data_wrapper_init): initialize the instance content-type field. * camel/camel-mime-part.c (_parse_header_pair): parse Content-Type stuff in header. (_write_to_stream): write the content type stuff to the stream. svn path=/trunk/; revision=985
Diffstat (limited to 'camel/gmime-content-field.c')
-rw-r--r--camel/gmime-content-field.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/camel/gmime-content-field.c b/camel/gmime-content-field.c
index a22bbe2979..06e4384437 100644
--- a/camel/gmime-content-field.c
+++ b/camel/gmime-content-field.c
@@ -26,18 +26,20 @@
#include "gmime-content-field.h"
#include "gstring-util.h"
+#include "camel-log.h"
GMimeContentField *
gmime_content_field_new (GString *type, GString *subtype)
{
- GMimeContentField *ct;
+ GMimeContentField *ctf;
- ct = g_new (GMimeContentField,1);
- ct->type = type;
- ct->subtype = subtype;
- ct->parameters = g_hash_table_new(g_string_hash, g_string_equal_for_hash);
+ ctf = g_new (GMimeContentField,1);
+ ctf->type = type;
+ ctf->subtype = subtype;
+ ctf->parameters = g_hash_table_new(g_string_hash, g_string_equal_for_hash);
+ return ctf;
}
@@ -122,16 +124,25 @@ gmime_content_field_construct_from_string (GMimeContentField *content_field, GSt
GString *param_name, *param_value;
gboolean param_end;
+ CAMEL_LOG (TRACE, "Entering gmime_content_field_construct_from_string\n");
g_assert (string);
g_assert (string->str);
-
- if (content_field->type) g_string_free (content_field->type, FALSE);
- if (content_field->subtype) g_string_free (content_field->subtype, FALSE);
+ g_assert (content_field);
+
+ if (content_field->type) {
+ CAMEL_LOG (FULL_DEBUG, "Freeing old mime type string\n");
+ g_string_free (content_field->type, FALSE);
+ }
+ if (content_field->subtype) {
+ CAMEL_LOG (FULL_DEBUG, "Freeing old mime type substring\n");
+ g_string_free (content_field->subtype, FALSE);
+ }
str = string->str;
first = 0;
len = string->len;
if (!len) return;
+ CAMEL_LOG (TRACE, "All checks done\n");
/* find the type */
while ( (i<len) && (!strchr ("/;", str[i])) ) i++;
@@ -140,7 +151,7 @@ gmime_content_field_construct_from_string (GMimeContentField *content_field, GSt
type = g_string_new (g_strndup (str, i));
content_field->type = type;
-
+ CAMEL_LOG (TRACE, "Found mime type : %s\n", type->str);
if (i == len) {
content_field->subtype = NULL;
return;
@@ -178,6 +189,7 @@ gmime_content_field_construct_from_string (GMimeContentField *content_field, GSt
}
} while ((!param_end) && (first < len));
+
}