aboutsummaryrefslogtreecommitdiffstats
path: root/camel/gmime-utils.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@inria.fr>1999-05-31 05:56:11 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-05-31 05:56:11 +0800
commit1c1106598f9162efbbc6df7622c93b02940a4743 (patch)
tree16eb3c8ca5c509446fd983032c5df66f64a4b178 /camel/gmime-utils.c
parentb3cdb41a122e797572b834fac6d5e11ddd579d5e (diff)
downloadgsoc2013-evolution-1c1106598f9162efbbc6df7622c93b02940a4743.tar
gsoc2013-evolution-1c1106598f9162efbbc6df7622c93b02940a4743.tar.gz
gsoc2013-evolution-1c1106598f9162efbbc6df7622c93b02940a4743.tar.bz2
gsoc2013-evolution-1c1106598f9162efbbc6df7622c93b02940a4743.tar.lz
gsoc2013-evolution-1c1106598f9162efbbc6df7622c93b02940a4743.tar.xz
gsoc2013-evolution-1c1106598f9162efbbc6df7622c93b02940a4743.tar.zst
gsoc2013-evolution-1c1106598f9162efbbc6df7622c93b02940a4743.zip
use new stream code instead of raw file * stuff.
1999-05-31 bertrand <Bertrand.Guiheneuf@inria.fr> * tests/test2.c (main): use new stream code instead of raw file * stuff. * camel/gmime-utils.c (get_header_table_from_stream): new func. Will replace get_header_table_from_file and will be used to parse headers from files as well as from memory buffers. * camel/camel-stream-fs.c: CamelStream Subclass. File system based stream. svn path=/trunk/; revision=961
Diffstat (limited to 'camel/gmime-utils.c')
-rw-r--r--camel/gmime-utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/camel/gmime-utils.c b/camel/gmime-utils.c
index b2d95e439e..591706adc6 100644
--- a/camel/gmime-utils.c
+++ b/camel/gmime-utils.c
@@ -172,9 +172,9 @@ get_header_table_from_file (FILE *file)
GHashTable *
-get_header_table_from_stream (GnomeStream *stream)
+get_header_table_from_stream (CamelStream *stream)
{
- int next_char;
+ gchar next_char;
gboolean crlf = FALSE;
gboolean end_of_header_line = FALSE;
@@ -184,7 +184,7 @@ get_header_table_from_stream (GnomeStream *stream)
GHashTable *header_table;
header_table = g_hash_table_new (g_string_hash, g_string_equal_for_hash);
- //next_char = fgetc (file);
+ camel_stream_read (stream, &next_char, 1);
do {
header_line = g_string_new("");
end_of_header_line = FALSE;
@@ -193,7 +193,7 @@ get_header_table_from_stream (GnomeStream *stream)
/* read a whole header line */
do {
switch (next_char) {
- case EOF:
+ case -1:
end_of_file=TRUE;
end_of_header_line = TRUE;
break;
@@ -215,7 +215,7 @@ get_header_table_from_stream (GnomeStream *stream)
/* if we have read a whole header line, we have also read
the first character of the next line to be sure the
crlf was not followed by a space or a tab char */
- //if (!end_of_header_line) next_char = fgetc (file);
+ if (!end_of_header_line) camel_stream_read (stream, &next_char, 1);
} while ( !end_of_header_line );
if ( strlen(header_line->str) )