Decode SRU 2.0 responses
[yaz-moved-to-github.git] / include / yaz / wrbuf.h
index 56b5e60..eebb015 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data.
+ * Copyright (C) 1995-2012 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:
@@ -63,19 +63,33 @@ YAZ_EXPORT void wrbuf_destroy(WRBUF b);
  */
 YAZ_EXPORT void wrbuf_rewind(WRBUF b);
 
-/** \brief append constant size buffer to WRBU
+/** \brief append constant size buffer to WRBUF
     \param b WRBUF
     \param buf buffer
     \param size size of buffer
  */
 YAZ_EXPORT void wrbuf_write(WRBUF b, const char *buf, size_t size);
 
+/** \brief inserts buffer into WRBUF at some position
+    \param b WRBUF
+    \param pos position (0=beginning)
+    \param buf buffer
+    \param size size of buffer
+ */
+YAZ_EXPORT void wrbuf_insert(WRBUF b, size_t pos, const char *buf, size_t size);
+
 /** \brief appends C-string to WRBUF
     \param b WRBUF
     \param buf C-string (0-terminated)
  */
 YAZ_EXPORT void wrbuf_puts(WRBUF b, const char *buf);
 
+/** \brief appends C-string to WRBUF - void pointer variant
+    \param buf C-string
+    \param client_data assumed WRBUF
+*/
+YAZ_EXPORT void wrbuf_vp_puts(const char *buf, void *client_data);
+
 /** \brief writes buffer of certain size to WRBUF and XML encode (as CDATA)
     \param b WRBUF
     \param cp CDATA
@@ -215,7 +229,7 @@ YAZ_EXPORT int wrbuf_grow(WRBUF b, size_t minsize);
 YAZ_EXPORT const char *wrbuf_cstr(WRBUF b);
 
 #define wrbuf_putc(b, c) \
-    (((b)->pos >= (b)->size ? wrbuf_grow(b, 1) : 0),  \
+    ((void) ((b)->pos >= (b)->size ? wrbuf_grow(b, 1) : 0),  \
     (b)->buf[(b)->pos++] = (c), 0)
 
 YAZ_END_CDECL