aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-fs.h
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>2000-02-15 06:27:54 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-02-15 06:27:54 +0800
commit6cffd8501c17f06066196a19674d6af225ff6381 (patch)
treecc42e7ef4e55ca8bbcf0e879f8b31b35a28289e9 /camel/camel-stream-fs.h
parentfe058b1be72112298e356343f3a8b35fd60a072b (diff)
downloadgsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.gz
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.bz2
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.lz
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.xz
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.zst
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.zip
use the eos stream method. (gmime_read_line_from_stream): ditto.
2000-02-14 bertrand <Bertrand.Guiheneuf@aful.org> * camel/gmime-utils.c (get_header_array_from_stream): use the eos stream method. (gmime_read_line_from_stream): ditto. * camel/camel-stream-fs.h (struct ): add the eof field cosmetics changes. * camel/camel-stream-fs.c (camel_stream_fs_init): set eof. (_read): set eof on end of file. (_eos): implemented. * camel/gmime-utils.c (get_header_array_from_stream): make a blocking version of the header parser. When the fs stream uses gnome-vfs, this should be changed. (gmime_read_line_from_stream): ditto. svn path=/trunk/; revision=1779
Diffstat (limited to 'camel/camel-stream-fs.h')
-rw-r--r--camel/camel-stream-fs.h42
1 files changed, 29 insertions, 13 deletions
diff --git a/camel/camel-stream-fs.h b/camel/camel-stream-fs.h
index 2e7dfd946f..79c7874c74 100644
--- a/camel/camel-stream-fs.h
+++ b/camel/camel-stream-fs.h
@@ -47,6 +47,7 @@ typedef enum
{
CAMEL_STREAM_FS_READ = 1,
CAMEL_STREAM_FS_WRITE = 2
+
} CamelStreamFsMode;
@@ -55,8 +56,9 @@ typedef struct
CamelSeekableStream parent_object;
- gchar *name; /* name of the underlying file */
- gint fd; /* file descriptor on the underlying file */
+ gchar *name; /* name of the underlying file */
+ gboolean eof; /* are we at the end of the file ? */
+ gint fd; /* file descriptor on the underlying file */
guint32 inf_bound; /* first valid position */
gint32 sup_bound; /* last valid position, -1 means, no sup bound */
@@ -68,11 +70,20 @@ typedef struct {
CamelSeekableStreamClass parent_class;
/* Virtual methods */
- void (*init_with_fd) (CamelStreamFs *stream_fs, int fd);
- void (*init_with_fd_and_bounds) (CamelStreamFs *stream_fs, int fd, guint32 inf_bound, gint32 sup_bound);
- void (*init_with_name) (CamelStreamFs *stream_fs, const gchar *name, CamelStreamFsMode mode);
- void (*init_with_name_and_bounds) (CamelStreamFs *stream_fs, const gchar *name,
- CamelStreamFsMode mode, guint32 inf_bound, gint32 sup_bound);
+ void (*init_with_fd) (CamelStreamFs *stream_fs,
+ int fd);
+ void (*init_with_fd_and_bounds) (CamelStreamFs *stream_fs,
+ int fd, guint32 inf_bound,
+ gint32 sup_bound);
+
+ void (*init_with_name) (CamelStreamFs *stream_fs,
+ const gchar *name,
+ CamelStreamFsMode mode);
+ void (*init_with_name_and_bounds) (CamelStreamFs *stream_fs,
+ const gchar *name,
+ CamelStreamFsMode mode,
+ guint32 inf_bound,
+ gint32 sup_bound);
} CamelStreamFsClass;
@@ -83,12 +94,17 @@ GtkType camel_stream_fs_get_type (void);
/* public methods */
-CamelStream *camel_stream_fs_new_with_name (const gchar *name, CamelStreamFsMode mode);
-CamelStream *camel_stream_fs_new_with_name_and_bounds (const gchar *name, CamelStreamFsMode mode,
- guint32 inf_bound, gint32 sup_bound);
-CamelStream *camel_stream_fs_new_with_fd (int fd);
-CamelStream *camel_stream_fs_new_with_fd_and_bounds (int fd,
- guint32 inf_bound, gint32 sup_bound);
+CamelStream * camel_stream_fs_new_with_name (const gchar *name,
+ CamelStreamFsMode mode);
+CamelStream * camel_stream_fs_new_with_name_and_bounds (const gchar *name,
+ CamelStreamFsMode mode,
+ guint32 inf_bound,
+ gint32 sup_bound);
+
+CamelStream * camel_stream_fs_new_with_fd (int fd);
+CamelStream * camel_stream_fs_new_with_fd_and_bounds (int fd,
+ guint32 inf_bound,
+ gint32 sup_bound);
#ifdef __cplusplus
}