From 85aafc49077214164bbdc2b84f247343ef9c3696 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sat, 6 Jan 2007 15:32:46 +0000 Subject: [PATCH] Added wrbuf_destroy(w), equivalent to wrbuf_free(w,1) --- include/yaz/wrbuf.h | 3 ++- src/wrbuf.c | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/yaz/wrbuf.h b/include/yaz/wrbuf.h index 173ca27..99d82a9 100644 --- a/include/yaz/wrbuf.h +++ b/include/yaz/wrbuf.h @@ -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.21 2007-01-03 08:42:14 adam Exp $ */ +/* $Id: wrbuf.h,v 1.22 2007-01-06 15:32:46 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); diff --git a/src/wrbuf.c b/src/wrbuf.c index 5882072..b180ef0 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.13 2007-01-03 08:42:15 adam Exp $ + * $Id: wrbuf.c,v 1.14 2007-01-06 15:32:46 adam Exp $ */ /** @@ -41,6 +41,11 @@ void wrbuf_free(WRBUF b, int free_buf) xfree(b); } +void wrbuf_destroy(WRBUF b) +{ + wrbuf_free(b, 1); +} + void wrbuf_rewind(WRBUF b) { b->pos = 0; -- 1.7.10.4