From: Adam Dickmeiss Date: Wed, 27 Jul 2011 13:06:35 +0000 (+0200) Subject: Adding new utility wrbuf_vp_puts X-Git-Tag: v4.2.6~6 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=38d2e7b4d30b060d3b6dc85e0e3f57c4930c6313;p=yaz-moved-to-github.git Adding new utility wrbuf_vp_puts --- 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) {