summaryrefslogtreecommitdiffstats
path: root/src/json-c-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/json-c-test.c')
-rw-r--r--src/json-c-test.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/json-c-test.c b/src/json-c-test.c
new file mode 100644
index 0000000..676d6be
--- /dev/null
+++ b/src/json-c-test.c
@@ -0,0 +1,23 @@
+/*
+ * This file is part of MXE.
+ * See index.html for further information.
+ */
+
+#include <json/json.h>
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ json_object *jobj;
+
+ (void)argc;
+ (void)argv;
+
+ jobj = json_object_new_object();
+ if (!jobj) {
+ return 1;
+ }
+ json_object_object_add(jobj, "key", json_object_new_string("value"));
+ printf("%s", json_object_to_json_string(jobj));
+ return 0;
+}