Allow specifying whether top level elements should be comma separated

This commit is contained in:
ktkk 2026-06-05 15:16:02 +00:00
parent 0a0a6d918d
commit e2ba1175db
10 changed files with 310 additions and 8 deletions

3
json.h
View file

@ -25,9 +25,10 @@ typedef struct Json {
Whitespace whitespace;
int indent_level;
Punctuation next_punctuation;
bool comma_separate;
} Json;
Json json_init(FILE* stream, Whitespace whitespace);
Json json_init(FILE* stream, Whitespace whitespace, bool comma_separate);
void json_free(Json* json);
void json_begin_array(Json* json);