aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog2
-rw-r--r--camel/camel-stream-mem.c3
-rw-r--r--camel/camel-stream.c23
3 files changed, 14 insertions, 14 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 5340f5cef2..3a475f6507 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,7 @@
2000-07-12 Jeffrey Stedfast <fejj@helixcode.com>
+ * camel-stream.c: Use size_t and ssize_t for read/write methods
+
* providers/imap/camel-imap-folder.c (imap_set_message_flags):
Updated to emit the message_changed signal.
(imap_delete_message): Updated to use imap_set_message_flags ().
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
index 722b49f3f8..08c5e266d4 100644
--- a/camel/camel-stream-mem.c
+++ b/camel/camel-stream-mem.c
@@ -251,6 +251,3 @@ stream_seek (CamelSeekableStream *stream, off_t offset,
return position;
}
-
-
-
diff --git a/camel/camel-stream.c b/camel/camel-stream.c
index 244b6cf9d8..2cdabacaba 100644
--- a/camel/camel-stream.c
+++ b/camel/camel-stream.c
@@ -84,8 +84,8 @@ camel_stream_get_type (void)
* Return value: number of bytes actually read, or -1 on error and
* set errno.
**/
-int
-camel_stream_read (CamelStream *stream, char *buffer, unsigned int n)
+ssize_t
+camel_stream_read (CamelStream *stream, char *buffer, size_t n)
{
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
g_return_val_if_fail (n == 0 || buffer, -1);
@@ -104,8 +104,8 @@ camel_stream_read (CamelStream *stream, char *buffer, unsigned int n)
* Return value: the number of bytes actually written to the stream,
* or -1 on error.
**/
-int
-camel_stream_write (CamelStream *stream, const char *buffer, unsigned int n)
+ssize_t
+camel_stream_write (CamelStream *stream, const char *buffer, size_t n)
{
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
g_return_val_if_fail (n == 0 || buffer, -1);
@@ -216,7 +216,7 @@ camel_stream_reset (CamelStream *stream)
*
* Return value: the number of characters output, -1 on error.
**/
-int
+ssize_t
camel_stream_write_string (CamelStream *stream, const char *string)
{
return camel_stream_write (stream, string, strlen (string));
@@ -231,7 +231,7 @@ camel_stream_write_string (CamelStream *stream, const char *string)
*
* Return value: the number of characters output, -1 on error.
**/
-int
+ssize_t
camel_stream_printf (CamelStream *stream, const char *fmt, ... )
{
va_list args;
@@ -263,13 +263,13 @@ camel_stream_printf (CamelStream *stream, const char *fmt, ... )
* Return value: Returns -1 on error, or the number of bytes succesfully
* copied across streams.
**/
-int
+ssize_t
camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream)
{
char tmp_buf[4096];
- int total = 0;
- int nb_read;
- int nb_written;
+ ssize_t total = 0;
+ ssize_t nb_read;
+ ssize_t nb_written;
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
g_return_val_if_fail (CAMEL_IS_STREAM (output_stream), -1);
@@ -282,7 +282,8 @@ camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream)
nb_written = 0;
while (nb_written < nb_read) {
- int len = camel_stream_write (output_stream, tmp_buf + nb_written, nb_read - nb_written);
+ ssize_t len = camel_stream_write (output_stream, tmp_buf + nb_written,
+ nb_read - nb_written);
if (len < 0)
return -1;
nb_written += len;