diff options
author | Dan Winship <danw@src.gnome.org> | 2000-03-28 00:58:32 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-03-28 00:58:32 +0800 |
commit | f8c580e8fda4cb3e28b57172c1fe3197ce7f7bc7 (patch) | |
tree | 5f8918583fc0eeeffe3b4b31cff7031fb225c8da /camel/camel-stream-mem.c | |
parent | edc4a9dfd6c18e17e64b92bdc434467bf1c22dec (diff) | |
download | gsoc2013-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
Diffstat (limited to 'camel/camel-stream-mem.c')
-rw-r--r-- | camel/camel-stream-mem.c | 23 |
1 files changed, 15 insertions, 8 deletions
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); } |