diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-06-07 06:55:06 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-06-07 06:55:06 +0800 |
commit | 4b82b86ee5df1cfcbcbc46cc421804a6a0cb8da2 (patch) | |
tree | 122b4b705f90414589e8b0d07586ceb7a2489067 /camel/camel-stream-fs.c | |
parent | af805a2733c9e2ca44e27360c6162d60cfc1aa53 (diff) | |
download | gsoc2013-evolution-4b82b86ee5df1cfcbcbc46cc421804a6a0cb8da2.tar.gz gsoc2013-evolution-4b82b86ee5df1cfcbcbc46cc421804a6a0cb8da2.tar.zst gsoc2013-evolution-4b82b86ee5df1cfcbcbc46cc421804a6a0cb8da2.zip |
Changed the read and write method prototypes to return an ssize_t type
2000-06-06 Jeffrey Stedfast <fejj@helixcode.com>
* camel-stream.[c,h]: Changed the read and write method prototypes
to return an ssize_t type rather than an int and also changed
the 'number of bytes' to read or write to a size_t type
* camel-stream-fs.c: same as above
* camel-stream-mem.c: again, same as above
* camel-stream-buffer.c: same
* camel-imap-stream.[c,h]: Added this new stream, cache's previously
read data so each successive call will instead read from the cache
svn path=/trunk/; revision=3450
Diffstat (limited to 'camel/camel-stream-fs.c')
-rw-r--r-- | camel/camel-stream-fs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c index 4b5a6015a4..b1a7dde41a 100644 --- a/camel/camel-stream-fs.c +++ b/camel/camel-stream-fs.c @@ -37,8 +37,8 @@ static CamelSeekableStreamClass *parent_class = NULL; /* Returns the class for a CamelStreamFS */ #define CSFS_CLASS(so) CAMEL_STREAM_FS_CLASS (GTK_OBJECT(so)->klass) -static int stream_read (CamelStream *stream, char *buffer, unsigned int n); -static int stream_write (CamelStream *stream, const char *buffer, unsigned int n); +static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n); +static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n); static int stream_flush (CamelStream *stream); static int stream_close (CamelStream *stream); static off_t stream_seek (CamelSeekableStream *stream, off_t offset, @@ -211,12 +211,12 @@ camel_stream_fs_new_with_name_and_bounds (const char *name, int flags, } -static int -stream_read (CamelStream *stream, char *buffer, unsigned int n) +static ssize_t +stream_read (CamelStream *stream, char *buffer, size_t n) { CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream); CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream); - int nread; + ssize_t nread; if (seekable->bound_end != CAMEL_STREAM_UNBOUND) n = MIN (seekable->bound_end - seekable->position, n); @@ -233,12 +233,12 @@ stream_read (CamelStream *stream, char *buffer, unsigned int n) return nread; } -static int -stream_write (CamelStream *stream, const char *buffer, unsigned int n) +static ssize_t +stream_write (CamelStream *stream, const char *buffer, size_t n) { CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream); CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream); - int v, written = 0; + ssize_t v, written = 0; if (seekable->bound_end != CAMEL_STREAM_UNBOUND) n = MIN (seekable->bound_end - seekable->position, n); |