X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fwrbuf.c;h=fb5968b08cc4594619171edba8281c53f9545609;hb=d040a9ea56b37ca9f625a40a2d56a056f8447d07;hp=b180ef0b17e9422d22df6314a201060acd785d8c;hpb=85aafc49077214164bbdc2b84f247343ef9c3696;p=yaz-moved-to-github.git diff --git a/src/wrbuf.c b/src/wrbuf.c index b180ef0..fb5968b 100644 --- a/src/wrbuf.c +++ b/src/wrbuf.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: wrbuf.c,v 1.14 2007-01-06 15:32:46 adam Exp $ + * $Id: wrbuf.c,v 1.15 2007-01-06 16:05:24 adam Exp $ */ /** @@ -232,6 +232,13 @@ 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); } +const char *wrbuf_cstr(WRBUF b) +{ + wrbuf_write(b, "", 1); /* '\0'-terminate as well */ + (b->pos)--; /* don't include '\0' in count */ + return b->buf; +} + /* * Local variables: * c-basic-offset: 4