Implement JSON_SORT_KEYS encoding flag

With this flag, the objects are sorted by key when encoding.
This commit is contained in:
Petri Lehtinen
2009-12-07 13:16:45 +02:00
parent 3add1cf361
commit 19a606d736
8 changed files with 132 additions and 13 deletions

View File

@@ -53,6 +53,9 @@ int main(int argc, char *argv[])
if(getenv_int("JSON_ENSURE_ASCII"))
flags |= JSON_ENSURE_ASCII;
if(getenv_int("JSON_SORT_KEYS"))
flags |= JSON_SORT_KEYS;
json = json_loadf(stdin, &error);
if(!json) {
fprintf(stderr, "%d\n%s\n", error.line, error.text);