projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added ZOOM_API() to definition of ZOOM_connection_peek_event
[yaz-moved-to-github.git]
/
src
/
wrbuf.c
diff --git
a/src/wrbuf.c
b/src/wrbuf.c
index
fe3065b
..
fb5968b
100644
(file)
--- a/
src/wrbuf.c
+++ b/
src/wrbuf.c
@@
-1,8
+1,8
@@
/*
/*
- * Copyright (C) 1995-2005, Index Data ApS
+ * Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* See the file LICENSE for details.
*
- * $Id: wrbuf.c,v 1.12 2006-08-28 12:34:41 adam Exp $
+ * $Id: wrbuf.c,v 1.15 2007-01-06 16:05:24 adam Exp $
*/
/**
*/
/**
@@
-41,6
+41,11
@@
void wrbuf_free(WRBUF b, int free_buf)
xfree(b);
}
xfree(b);
}
+void wrbuf_destroy(WRBUF b)
+{
+ wrbuf_free(b, 1);
+}
+
void wrbuf_rewind(WRBUF b)
{
b->pos = 0;
void wrbuf_rewind(WRBUF b)
{
b->pos = 0;
@@
-227,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);
}
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
/*
* Local variables:
* c-basic-offset: 4