X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Fwrbuf.h;h=f7eb963f2abfb32355909516d437bfdf104fdb0c;hb=4b768398f592fe19364a3079d968da2f3a9e724f;hp=ba0d04a000376305d3c962a52e63bcc59935725a;hpb=964580242e2e0b2e570f652afa58bfb90ad0bb5e;p=yaz-moved-to-github.git diff --git a/include/yaz/wrbuf.h b/include/yaz/wrbuf.h index ba0d04a..f7eb963 100644 --- a/include/yaz/wrbuf.h +++ b/include/yaz/wrbuf.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-2006, Index Data + * Copyright (c) 1995-2007, Index Data * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: wrbuf.h,v 1.20 2006-10-09 21:02:41 adam Exp $ */ +/* $Id: wrbuf.h,v 1.23 2007-01-06 16:05:24 adam Exp $ */ /** * \file wrbuf.h @@ -48,6 +48,7 @@ typedef struct wrbuf YAZ_EXPORT WRBUF wrbuf_alloc(void); YAZ_EXPORT void wrbuf_free(WRBUF b, int free_buf); +YAZ_EXPORT void wrbuf_destroy(WRBUF b); YAZ_EXPORT void wrbuf_rewind(WRBUF b); YAZ_EXPORT int wrbuf_grow(WRBUF b, int minsize); YAZ_EXPORT int wrbuf_write(WRBUF b, const char *buf, int size); @@ -75,6 +76,8 @@ YAZ_EXPORT void wrbuf_chop_right(WRBUF b); #define wrbuf_len(b) ((b)->pos) #define wrbuf_buf(b) ((b)->buf) +YAZ_EXPORT const char *wrbuf_cstr(WRBUF b); + #define wrbuf_putc(b, c) \ (((b)->pos >= (b)->size ? wrbuf_grow(b, 1) : 0), \ (b)->buf[(b)->pos++] = (c), 0)