src/json.c

changeset 1077
911a154dd469
parent 1075
0cc4b63a0ae0
child 1078
ffa8bb4e9288
--- a/src/json.c	Wed Jan 01 16:06:32 2025 +0100
+++ b/src/json.c	Thu Jan 02 19:07:56 2025 +0100
@@ -923,12 +923,26 @@
     true,
     255,
     false,
-    0,
+    4,
     false,
-    0
+    80
 };
 
-// TODO: add default for pretty printing and add functions to create default structs
+CxJsonWriter cxJsonWriterCompact(void) {
+    return cx_json_writer_default;
+}
+
+CxJsonWriter cxJsonWriterPretty(bool use_spaces) {
+    return (CxJsonWriter) {
+        true,
+        true,
+        255,
+        use_spaces,
+        4,
+        false,
+        80
+    };
+}
 
 
 int cx_json_write_rec(

mercurial