]> git.ozlabs.org Git - ccan/blobdiff - ccan/json/test/common.h
json: new module for parsing and generating JSON
[ccan] / ccan / json / test / common.h
diff --git a/ccan/json/test/common.h b/ccan/json/test/common.h
new file mode 100644 (file)
index 0000000..328cb73
--- /dev/null
@@ -0,0 +1,18 @@
+#include <ccan/json/json.c>
+#include <ccan/tap/tap.h>
+
+#include <errno.h>
+#include <string.h>
+
+static char *chomp(char *s)
+{
+       char *e;
+       
+       if (s == NULL || *s == 0)
+               return s;
+       
+       e = strchr(s, 0);
+       if (e[-1] == '\n')
+               *--e = 0;
+       return s;
+}