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
Got rid of a few warnings WRT signed/unsigned types
[yaz-moved-to-github.git]
/
src
/
wrbuf.c
diff --git
a/src/wrbuf.c
b/src/wrbuf.c
index
d8a709e
..
a7910b6
100644
(file)
--- a/
src/wrbuf.c
+++ b/
src/wrbuf.c
@@
-1,8
+1,6
@@
-/*
- * Copyright (C) 1995-2007, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2008 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: wrbuf.c,v 1.20 2007-09-17 19:14:26 adam Exp $
*/
/**
*/
/**
@@
-80,6
+78,11
@@
int wrbuf_puts(WRBUF b, const char *buf)
return 0;
}
return 0;
}
+void wrbuf_vputs(const char *buf, void *client_data)
+{
+ wrbuf_write((WRBUF) client_data, buf, strlen(buf));
+}
+
int wrbuf_puts_replace_char(WRBUF b, const char *buf,
const char from, const char to)
{
int wrbuf_puts_replace_char(WRBUF b, const char *buf,
const char from, const char to)
{
@@
-160,7
+163,7
@@
static int wrbuf_iconv_write_x(WRBUF b, yaz_iconv_t cd, const char *buf,
{
if (cd)
{
{
if (cd)
{
- char outbuf[12];
+ char outbuf[16];
size_t inbytesleft = size;
const char *inp = buf;
while (inbytesleft)
size_t inbytesleft = size;
const char *inp = buf;
while (inbytesleft)
@@
-213,11
+216,16
@@
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);
}
+int wrbuf_iconv_puts_cdata(WRBUF b, yaz_iconv_t cd, const char *strz)
+{
+ return wrbuf_iconv_write_x(b, cd, strz, strlen(strz), 1);
+}
+
void wrbuf_iconv_reset(WRBUF b, yaz_iconv_t cd)
{
if (cd)
{
void wrbuf_iconv_reset(WRBUF b, yaz_iconv_t cd)
{
if (cd)
{
- char outbuf[12];
+ char outbuf[16];
size_t outbytesleft = sizeof(outbuf);
char *outp = outbuf;
size_t r = yaz_iconv(cd, 0, 0, &outp, &outbytesleft);
size_t outbytesleft = sizeof(outbuf);
char *outp = outbuf;
size_t r = yaz_iconv(cd, 0, 0, &outp, &outbytesleft);
@@
-240,7
+248,12
@@
void wrbuf_cut_right(WRBUF b, size_t no_to_remove)
b->pos = b->pos - no_to_remove;
}
b->pos = b->pos - no_to_remove;
}
-void wrbuf_verbose_str(WRBUF b, const char *str, size_t len)
+void wrbuf_puts_escaped(WRBUF b, const char *str)
+{
+ wrbuf_write_escaped(b, str, strlen(str));
+}
+
+void wrbuf_write_escaped(WRBUF b, const char *str, size_t len)
{
size_t i;
for (i = 0; i < len; i++)
{
size_t i;
for (i = 0; i < len; i++)