aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-03-28 00:58:32 +0800
committerDan Winship <danw@src.gnome.org>2000-03-28 00:58:32 +0800
commitf8c580e8fda4cb3e28b57172c1fe3197ce7f7bc7 (patch)
tree5f8918583fc0eeeffe3b4b31cff7031fb225c8da
parentedc4a9dfd6c18e17e64b92bdc434467bf1c22dec (diff)
downloadgsoc2013-evolution-f8c580e8fda4cb3e28b57172c1fe3197ce7f7bc7.tar
gsoc2013-evolution-f8c580e8fda4cb3e28b57172c1fe3197ce7f7bc7.tar.gz
gsoc2013-evolution-f8c580e8fda4cb3e28b57172c1fe3197ce7f7bc7.tar.bz2
gsoc2013-evolution-f8c580e8fda4cb3e28b57172c1fe3197ce7f7bc7.tar.lz
gsoc2013-evolution-f8c580e8fda4cb3e28b57172c1fe3197ce7f7bc7.tar.xz
gsoc2013-evolution-f8c580e8fda4cb3e28b57172c1fe3197ce7f7bc7.tar.zst
gsoc2013-evolution-f8c580e8fda4cb3e28b57172c1fe3197ce7f7bc7.zip
rename camel_stream_mem_new_with_buffer to ..._with_byte_array and add a
* camel-stream-mem.c (camel_stream_mem_new_with_buffer): rename camel_stream_mem_new_with_buffer to ..._with_byte_array and add a new ..._with_buffer that takes a char * rather than a GByteArray. svn path=/trunk/; revision=2189
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/camel-stream-mem.c23
-rw-r--r--camel/camel-stream-mem.h8
3 files changed, 24 insertions, 11 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 5feff9dc20..669a71e114 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,9 @@
2000-03-27 Dan Winship <danw@helixcode.com>
+ * camel-stream-mem.c (camel_stream_mem_new_with_buffer): rename
+ camel_stream_mem_new_with_buffer to ..._with_byte_array and add a
+ new ..._with_buffer that takes a char * rather than a GByteArray.
+
* Remove CamelStreamBufferedFs, since CamelStreamBuffer makes it
redundant.
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
index 0b8633493c..8842e229cc 100644
--- a/camel/camel-stream-mem.c
+++ b/camel/camel-stream-mem.c
@@ -108,23 +108,30 @@ camel_stream_mem_get_type (void)
CamelStream *
camel_stream_mem_new (CamelStreamMemMode mode)
{
- CamelStreamMem *stream_mem;
- GByteArray *buffer;
-
- buffer = g_byte_array_new ();
- stream_mem = (CamelStreamMem *)camel_stream_mem_new_with_buffer (buffer, mode);
- return CAMEL_STREAM (stream_mem);
+ return camel_stream_mem_new_with_byte_array (g_byte_array_new (),
+ mode);
}
+CamelStream *
+camel_stream_mem_new_with_buffer (const char *buffer, unsigned int len,
+ CamelStreamMemMode mode)
+{
+ GByteArray *ba;
+
+ ba = g_byte_array_new ();
+ g_byte_array_append (ba, (const guint8 *)buffer, len);
+ return camel_stream_mem_new_with_byte_array (ba, mode);
+}
CamelStream *
-camel_stream_mem_new_with_buffer (GByteArray *buffer, CamelStreamMemMode mode)
+camel_stream_mem_new_with_byte_array (GByteArray *byte_array,
+ CamelStreamMemMode mode)
{
CamelStreamMem *stream_mem;
stream_mem = gtk_type_new (camel_stream_mem_get_type ());
stream_mem->mode = mode;
- stream_mem->buffer = buffer;
+ stream_mem->buffer = byte_array;
return CAMEL_STREAM (stream_mem);
}
diff --git a/camel/camel-stream-mem.h b/camel/camel-stream-mem.h
index c7339b98e4..65b9748715 100644
--- a/camel/camel-stream-mem.h
+++ b/camel/camel-stream-mem.h
@@ -78,9 +78,11 @@ GtkType camel_stream_mem_get_type (void);
/* public methods */
CamelStream *camel_stream_mem_new (CamelStreamMemMode mode);
-CamelStream * camel_stream_mem_new_with_buffer (GByteArray *buffer,
- CamelStreamMemMode mode);
-
+CamelStream *camel_stream_mem_new_with_byte_array (GByteArray *buffer,
+ CamelStreamMemMode mode);
+CamelStream *camel_stream_mem_new_with_buffer (const char *buffer,
+ unsigned int len,
+ CamelStreamMemMode mode);
#ifdef __cplusplus