diff options
author | Dave Beckett <dave@dajobe.org> | 2004-11-26 18:21:41 +0000 |
---|---|---|
committer | Dave Beckett <dave@dajobe.org> | 2004-11-26 18:21:41 +0000 |
commit | 2a9fcd72b89f77f318ba2b6c1a14e194ea74dd35 (patch) | |
tree | 2a82321369f18b60ca9e4bfcf91481239a18c01f /src/raptor_iostream.c | |
parent | 6e8b0f90059502370d0888ec533b1ce14ae58d98 (diff) | |
download | raptor-2a9fcd72b89f77f318ba2b6c1a14e194ea74dd35.tar.gz |
(raptor_iostream_write_stringbuffer) Added
Diffstat (limited to 'src/raptor_iostream.c')
-rw-r--r-- | src/raptor_iostream.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/raptor_iostream.c b/src/raptor_iostream.c index 785ed02e..445e8fa7 100644 --- a/src/raptor_iostream.c +++ b/src/raptor_iostream.c @@ -479,6 +479,31 @@ raptor_iostream_get_bytes_written_count(raptor_iostream *iostr) /** + * raptor_iostream_write_stringbuffer - Write a stringbuffer to an iostream + * @iostr: raptor iostream + * @sb: &raptor_stringbuffer to write + * + * Return value: non-0 on failure + **/ +int +raptor_iostream_write_stringbuffer(raptor_iostream* iostr, + raptor_stringbuffer *sb) +{ + size_t length; + if(!sb) + return 1; + + length=raptor_stringbuffer_length(sb); + if(length) + return (raptor_iostream_write_bytes(iostr, + raptor_stringbuffer_as_string(sb), 1, length) + != length); + else + return 0; +} + + +/** * raptor_iostream_write_decimal - Write an integer in decimal to the iostream * @iostr: raptor iostream * @integer: integer to format as decimal |