diff options
author | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-06-19 04:32:18 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-06-19 04:32:18 +0800 |
commit | 19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767 (patch) | |
tree | 04f063fc3c18e43eea5251943be93fa89cfd5549 /camel/gmime-content-field.c | |
parent | 499ae51b86891889ffb5fd9954b1f60efcadfed2 (diff) | |
download | gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.tar gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.tar.gz gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.tar.bz2 gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.tar.lz gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.tar.xz gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.tar.zst gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.zip |
Commit of all Netherlands changes.
All mime stuff uses streams now, and it still works.
Bertrand
svn path=/trunk/; revision=981
Diffstat (limited to 'camel/gmime-content-field.c')
-rw-r--r-- | camel/gmime-content-field.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/camel/gmime-content-field.c b/camel/gmime-content-field.c index 29c5fb61ec..87ceaf39f0 100644 --- a/camel/gmime-content-field.c +++ b/camel/gmime-content-field.c @@ -63,29 +63,39 @@ gmime_content_field_set_parameter(GMimeContentField *content_field, GString *att static void _print_parameter (gpointer name, gpointer value, gpointer user_data) { - FILE *file = (FILE *)user_data; + CamelStream *stream = (CamelStream *)user_data; + + camel_stream_write_strings (stream, + "; \n ", + ((GString *)name)->str, + "=", + ((GString *)value)->str, + NULL); - fprintf (file, "; \n %s=%s", ((GString *)name)->str, ((GString *)value)->str); } /** - * gmime_content_field_write_to_file: write a mime content type to a file + * gmime_content_field_write_to: write a mime content type to a stream * @content_field: content type object - * @file: file to write the content type field + * @stream: the stream * * **/ void -gmime_content_field_write_to_file(GMimeContentField *content_field, FILE *file) +gmime_content_field_write_to_stream (GMimeContentField *content_field, CamelStream *stream) { if (!content_field) return; if ((content_field->type) && ((content_field->type)->str)) { - fprintf (file, "Content-Type: %s", content_field->type->str); + //fprintf (file, "Content-Type: %s", content_field->type->str); + camel_stream_write_strings (stream, "Content-Type: ", content_field->type->str, NULL); if ((content_field->subtype) && ((content_field->subtype)->str)) { - fprintf (file, "/%s", content_field->subtype->str); + //fprintf (file, "/%s", content_field->subtype->str); + camel_stream_write_strings (stream, "/", content_field->type->str, NULL); } /* print all parameters */ - g_hash_table_foreach (content_field->parameters, _print_parameter, file); - fprintf (file, "\n"); + g_hash_table_foreach (content_field->parameters, _print_parameter, stream); + //fprintf (file, "\n"); + camel_stream_write_string (stream, "\n"); } } + |