X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fwrbuf.c;h=47dbe9ae29aa2e729b60456b70f5e0c3fec87911;hb=d775854eb4b203433c54239cc447f20511850ef9;hp=94704772b95628b55cb456cea244d284e92478ab;hpb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505;p=yaz-moved-to-github.git diff --git a/src/wrbuf.c b/src/wrbuf.c index 9470477..47dbe9a 100644 --- a/src/wrbuf.c +++ b/src/wrbuf.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: wrbuf.c,v 1.8 2005-06-25 15:46:06 adam Exp $ + * $Id: wrbuf.c,v 1.10 2006-04-19 10:05:03 adam Exp $ */ /** @@ -81,6 +81,15 @@ int wrbuf_puts(WRBUF b, const char *buf) return 0; } +void wrbuf_chop_right(WRBUF b) +{ + while (b->pos && b->buf[b->pos-1] == ' ') + { + (b->pos)--; + b->buf[b->pos] = '\0'; + } +} + int wrbuf_xmlputs(WRBUF b, const char *cp) { return wrbuf_xmlputs_n(b, cp, strlen(cp)); @@ -186,6 +195,11 @@ int wrbuf_iconv_write(WRBUF b, yaz_iconv_t cd, const char *buf, int size) return wrbuf_iconv_write_x(b, cd, buf, size, 0); } +int wrbuf_iconv_puts(WRBUF b, yaz_iconv_t cd, const char *strz) +{ + return wrbuf_iconv_write(b, cd, strz, strlen(strz)); +} + int wrbuf_iconv_write_cdata(WRBUF b, yaz_iconv_t cd, const char *buf, int size) { return wrbuf_iconv_write_x(b, cd, buf, size, 1);