src/json.c

changeset 1077
911a154dd469
parent 1075
0cc4b63a0ae0
child 1078
ffa8bb4e9288
equal deleted inserted replaced
1076:bb4da3255de3 1077:911a154dd469
921 static const CxJsonWriter cx_json_writer_default = { 921 static const CxJsonWriter cx_json_writer_default = {
922 false, 922 false,
923 true, 923 true,
924 255, 924 255,
925 false, 925 false,
926 0, 926 4,
927 false, 927 false,
928 0 928 80
929 }; 929 };
930 930
931 // TODO: add default for pretty printing and add functions to create default structs 931 CxJsonWriter cxJsonWriterCompact(void) {
932 return cx_json_writer_default;
933 }
934
935 CxJsonWriter cxJsonWriterPretty(bool use_spaces) {
936 return (CxJsonWriter) {
937 true,
938 true,
939 255,
940 use_spaces,
941 4,
942 false,
943 80
944 };
945 }
932 946
933 947
934 int cx_json_write_rec( 948 int cx_json_write_rec(
935 void *target, 949 void *target,
936 const CxJsonValue *value, 950 const CxJsonValue *value,

mercurial