From 38d2e7b4d30b060d3b6dc85e0e3f57c4930c6313 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 27 Jul 2011 15:06:35 +0200 Subject: [PATCH] Adding new utility wrbuf_vp_puts --- include/yaz/wrbuf.h | 6 ++++++ src/wrbuf.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/include/yaz/wrbuf.h b/include/yaz/wrbuf.h index 6cde6ee..9e6176e 100644 --- a/include/yaz/wrbuf.h +++ b/include/yaz/wrbuf.h @@ -76,6 +76,12 @@ YAZ_EXPORT void wrbuf_write(WRBUF b, const char *buf, size_t size); */ YAZ_EXPORT void wrbuf_puts(WRBUF b, const char *buf); +/** \brief appends C-string to WRBUF - void pointer variant + \param buf C-string + \param client_data assumed WRBUF +*/ +void wrbuf_vp_puts(const char *buf, void *client_data); + /** \brief writes buffer of certain size to WRBUF and XML encode (as CDATA) \param b WRBUF \param cp CDATA diff --git a/src/wrbuf.c b/src/wrbuf.c index 06e49de..67de45e 100644 --- a/src/wrbuf.c +++ b/src/wrbuf.c @@ -79,6 +79,12 @@ void wrbuf_puts(WRBUF b, const char *buf) wrbuf_write(b, buf, strlen(buf)); } +void wrbuf_vp_puts(const char *buf, void *client_data) +{ + WRBUF b = (WRBUF) client_data; + wrbuf_puts(b, buf); +} + void wrbuf_puts_replace_char(WRBUF b, const char *buf, const char from, const char to) { -- 1.7.10.4