Define JSON_MAX_INDENT

Fixes #191.
This commit is contained in:
Petri Lehtinen 2014-07-07 11:29:10 +03:00
parent 348401e7b8
commit 88943b64e3
2 changed files with 8 additions and 1 deletions

View File

@ -866,6 +866,12 @@ can be ORed together to obtain *flags*.
output. If ``JSON_INDENT`` is not used or *n* is 0, no newlines are output. If ``JSON_INDENT`` is not used or *n* is 0, no newlines are
inserted between array and object items. inserted between array and object items.
The ``JSON_MAX_INDENT`` constant defines the maximum indentation
that can be used, and its value is 31.
.. versionchanged:: 2.7
Added ``JSON_MAX_INDENT``.
``JSON_COMPACT`` ``JSON_COMPACT``
This flag enables a compact representation, i.e. sets the separator This flag enables a compact representation, i.e. sets the separator
between array and object items to ``","`` and between object keys between array and object items to ``","`` and between object keys

View File

@ -259,7 +259,8 @@ json_t *json_load_callback(json_load_callback_t callback, void *data, size_t fla
/* encoding */ /* encoding */
#define JSON_INDENT(n) ((n) & 0x1F) #define JSON_MAX_INDENT 0x1F
#define JSON_INDENT(n) ((n) & JSON_MAX_INDENT)
#define JSON_COMPACT 0x20 #define JSON_COMPACT 0x20
#define JSON_ENSURE_ASCII 0x40 #define JSON_ENSURE_ASCII 0x40
#define JSON_SORT_KEYS 0x80 #define JSON_SORT_KEYS 0x80