From f9d9a2a9a84a7a83137cab3fcd3c2244a299976f Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sun, 30 Sep 2012 00:41:59 +0200 Subject: [PATCH] Add cfw_stream_write_string(). --- src/stream.c | 8 ++++++++ src/stream.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/stream.c b/src/stream.c index 0c54f5d..754476e 100644 --- a/src/stream.c +++ b/src/stream.c @@ -24,6 +24,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include + #include "stream.h" static bool @@ -68,6 +70,12 @@ cfw_stream_write(void *ptr, const void *buf, size_t len) return stream->ops->write(stream, buf, len); } +bool +cfw_stream_write_string(void *ptr, const char *str) +{ + return cfw_stream_write(ptr, str, strlen(str)); +} + bool cfw_stream_eof(void *ptr) { diff --git a/src/stream.h b/src/stream.h index 3aaa6f0..c5693de 100644 --- a/src/stream.h +++ b/src/stream.h @@ -47,6 +47,7 @@ typedef struct CFWStream { extern CFWClass *cfw_stream; extern ssize_t cfw_stream_read(void*, void*, size_t); extern bool cfw_stream_write(void*, const void*, size_t); +extern bool cfw_stream_write_string(void*, const char*); extern bool cfw_stream_eof(void*); extern void cfw_stream_close(void*); #endif