/*
- * Copyright (c) 1995-2002, Index Data.
+ * Copyright (c) 1995-2003, Index Data.
* See the file LICENSE for details.
- * Sebastian Hammer, Adam Dickmeiss
*
- * $Id: wrbuf.c,v 1.10 2002-10-22 10:05:36 adam Exp $
+ * $Id: wrbuf.c,v 1.13 2003-07-14 12:58:18 adam Exp $
*/
/*
#include <config.h>
#endif
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
return 0;
}
+int wrbuf_xmlputs(WRBUF b, const char *cp)
+{
+ while (*cp)
+ {
+ switch(*cp)
+ {
+ case '<':
+ wrbuf_puts(b, "<");
+ break;
+ case '>':
+ wrbuf_puts(b, ">");
+ break;
+ case '&':
+ wrbuf_puts(b, "&");
+ break;
+ case '"':
+ wrbuf_puts(b, """);
+ break;
+ case '\'':
+ wrbuf_puts(b, "'");
+ break;
+ default:
+ wrbuf_putc(b, *cp);
+ }
+ cp++;
+ }
+ wrbuf_putc(b, 0);
+ (b->pos)--;
+ return 0;
+}
+
void wrbuf_printf(WRBUF b, const char *fmt, ...)
{
va_list ap;