aboutsummaryrefslogtreecommitdiff
path: root/jdtalk.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2022-06-12 13:25:16 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2022-06-12 13:25:16 -0400
commit9caf88c263f2bee43e997cb70ca1e46a5d61517f (patch)
treee95665eb1d2a0c11764964a5b5f1984c10f36ebb /jdtalk.h
parent688289f1abb3fea7ee85cefccd9248fb9de0fe5c (diff)
downloadjdtalkc-9caf88c263f2bee43e997cb70ca1e46a5d61517f.tar.gz
Add error field to json output
Diffstat (limited to 'jdtalk.h')
-rw-r--r--jdtalk.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/jdtalk.h b/jdtalk.h
index 1c79f75..7ad5e4b 100644
--- a/jdtalk.h
+++ b/jdtalk.h
@@ -24,14 +24,15 @@
#define WT_ADVERB 3
#define WT_VERB 4
-#define JSON_BEGIN(FP) fprintf(FP, "{\n");
+#define JSON_BEGIN(FP) fprintf(FP, "{\n")
#define JSON_INDENT(FP, LEVEL) for (size_t indenter = 0; indenter < LEVEL; indenter++) { fprintf(FP, " "); }
-#define JSON_NEXT_ITEM(FP) fprintf(FP, ",\n");
-#define JSON_NEXT_LINE(FP) fprintf(FP, "\n");
-#define JSON_LIST_BEGIN(FP, KEY) JSON_INDENT(FP, 1); fprintf(FP, "\"%s\": [", KEY);
-#define JSON_LIST_APPEND(FP, VALUE) JSON_INDENT(FP, 2); fprintf(FP, "\"%s\"", VALUE);
-#define JSON_LIST_END(FP) fprintf(FP, "]\n");
-#define JSON_END(FP) fprintf(FP, "}\n");
+#define JSON_NEXT_ITEM(FP) fprintf(FP, ",\n")
+#define JSON_NEXT_LINE(FP) fprintf(FP, "\n")
+#define JSON_LIST_BEGIN(FP, KEY) JSON_INDENT(FP, 1); fprintf(FP, "\"%s\": [", KEY)
+#define JSON_LIST_APPEND(FP, VALUE) JSON_INDENT(FP, 2); fprintf(FP, "\"%s\"", VALUE)
+#define JSON_LIST_END(FP) fprintf(FP, "]")
+#define JSON_STRING(FP, KEY, VALUE) JSON_INDENT(FP, 1); fprintf(FP, "\"%s\": \"%s\"", KEY, VALUE)
+#define JSON_END(FP) fprintf(FP, "}\n")
struct Word {
char *word;