Added wrbuf_destroy(w), equivalent to wrbuf_free(w,1)
[yaz-moved-to-github.git] / src / wrbuf.c
index f361f6b..b180ef0 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 1995-2005, Index Data ApS
+ * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: wrbuf.c,v 1.11 2006-07-07 10:31:26 marc 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;
@@ -215,6 +220,13 @@ 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_putchar(WRBUF b, yaz_iconv_t cd, int ch)
+{
+    char buf[1];
+    buf[0] = ch;
+    return wrbuf_iconv_write(b, cd, buf, 1);
+}
+
 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);