aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream.h
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-06-07 06:55:06 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-06-07 06:55:06 +0800
commit4b82b86ee5df1cfcbcbc46cc421804a6a0cb8da2 (patch)
tree122b4b705f90414589e8b0d07586ceb7a2489067 /camel/camel-stream.h
parentaf805a2733c9e2ca44e27360c6162d60cfc1aa53 (diff)
downloadgsoc2013-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.h')
-rw-r--r--camel/camel-stream.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/camel/camel-stream.h b/camel/camel-stream.h
index 44562b3321..5660ca6e4c 100644
--- a/camel/camel-stream.h
+++ b/camel/camel-stream.h
@@ -35,6 +35,7 @@ extern "C" {
#include <camel/camel-object.h>
#include <stdarg.h>
+#include <unistd.h>
#define CAMEL_STREAM_TYPE (camel_stream_get_type ())
#define CAMEL_STREAM(obj) (GTK_CHECK_CAST((obj), CAMEL_STREAM_TYPE, CamelStream))
@@ -53,8 +54,8 @@ typedef struct {
/* Virtual methods */
- int (*read) (CamelStream *stream, char *buffer, unsigned int n);
- int (*write) (CamelStream *stream, const char *buffer, unsigned int n);
+ ssize_t (*read) (CamelStream *stream, char *buffer, size_t n);
+ ssize_t (*write) (CamelStream *stream, const char *buffer, size_t n);
int (*close) (CamelStream *stream);
int (*flush) (CamelStream *stream);
gboolean (*eos) (CamelStream *stream);
@@ -66,22 +67,22 @@ typedef struct {
GtkType camel_stream_get_type (void);
/* public methods */
-int camel_stream_read (CamelStream *stream, char *buffer, unsigned int n);
-int camel_stream_write (CamelStream *stream, const char *buffer, unsigned int n);
+ssize_t camel_stream_read (CamelStream *stream, char *buffer, size_t n);
+ssize_t camel_stream_write (CamelStream *stream, const char *buffer, size_t n);
int camel_stream_flush (CamelStream *stream);
int camel_stream_close (CamelStream *stream);
gboolean camel_stream_eos (CamelStream *stream);
int camel_stream_reset (CamelStream *stream);
/* utility macros and funcs */
-int camel_stream_write_string (CamelStream *stream, const char *string);
-int camel_stream_printf (CamelStream *stream, const char *fmt, ... ) G_GNUC_PRINTF (2, 3);
-int camel_stream_vprintf (CamelStream *stream, const char *fmt, va_list ap);
+ssize_t camel_stream_write_string (CamelStream *stream, const char *string);
+ssize_t camel_stream_printf (CamelStream *stream, const char *fmt, ... ) G_GNUC_PRINTF (2, 3);
+ssize_t camel_stream_vprintf (CamelStream *stream, const char *fmt, va_list ap);
/* Write a whole stream to another stream, until eof or error on
* either stream.
*/
-int camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream);
+ssize_t camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream);
#ifdef __cplusplus
}