--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/util.c Mon May 04 20:55:04 2009 +0300
@@ -0,0 +1,27 @@
+#include "util.h"
+#include "../str.h"
+
+const char *dump_strn (const char *str, ssize_t len)
+{
+ static char dump_buf[DUMP_STR_COUNT][DUMP_STR_BUF];
+ static size_t dump_idx = 0;
+
+ // pick a buffer to use
+ char *buf = dump_buf[dump_idx++];
+
+ // cycle
+ if (dump_idx >= DUMP_STR_COUNT)
+ dump_idx = 0;
+
+ // write the quoted string into the selected buf
+ str_quote(buf, DUMP_STR_BUF, str, len);
+
+ // ok
+ return buf;
+}
+
+const char *dump_str (const char *str)
+{
+ return dump_strn(str, -1);
+}
+