sd-json: reorder enum so that SD_JSON_FORMAT_OFF is first

This doesn't really matter, all bits in a word are created equal, but having
the "off" value in the middle seems strange.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2024-10-04 17:37:25 +02:00
committed by Mike Yuan
parent f819a516db
commit ac36c4dcd9

View File

@@ -136,18 +136,18 @@ int sd_json_variant_is_sensitive_recursive(sd_json_variant *v);
int sd_json_variant_get_source(sd_json_variant *v, const char **ret_source, unsigned *ret_line, unsigned *reterr_column);
__extension__ typedef enum _SD_ENUM_TYPE_S64(sd_json_format_flags_t) {
SD_JSON_FORMAT_NEWLINE = 1 << 0, /* suffix with newline */
SD_JSON_FORMAT_PRETTY = 1 << 1, /* add internal whitespace to appeal to human readers */
SD_JSON_FORMAT_PRETTY_AUTO = 1 << 2, /* same, but only if connected to a tty (and JSON_FORMAT_NEWLINE otherwise) */
SD_JSON_FORMAT_COLOR = 1 << 3, /* insert ANSI color sequences */
SD_JSON_FORMAT_COLOR_AUTO = 1 << 4, /* insert ANSI color sequences if colors_enabled() says so */
SD_JSON_FORMAT_SOURCE = 1 << 5, /* prefix with source filename/line/column */
SD_JSON_FORMAT_SSE = 1 << 6, /* prefix/suffix with W3C server-sent events */
SD_JSON_FORMAT_SEQ = 1 << 7, /* prefix/suffix with RFC 7464 application/json-seq */
SD_JSON_FORMAT_FLUSH = 1 << 8, /* call fflush() after dumping JSON */
SD_JSON_FORMAT_EMPTY_ARRAY = 1 << 9, /* output "[]" for empty input */
SD_JSON_FORMAT_OFF = 1 << 10, /* make json_variant_format() fail with -ENOEXEC */
SD_JSON_FORMAT_CENSOR_SENSITIVE = 1 << 11, /* Replace all sensitive elements with the string "<sensitive data>" */
SD_JSON_FORMAT_OFF = 1 << 0, /* disable json output, make json_variant_format() fail with -ENOEXEC */
SD_JSON_FORMAT_NEWLINE = 1 << 1, /* suffix with newline */
SD_JSON_FORMAT_PRETTY = 1 << 2, /* add internal whitespace to appeal to human readers */
SD_JSON_FORMAT_PRETTY_AUTO = 1 << 3, /* same, but only if connected to a tty (and JSON_FORMAT_NEWLINE otherwise) */
SD_JSON_FORMAT_COLOR = 1 << 4, /* insert ANSI color sequences */
SD_JSON_FORMAT_COLOR_AUTO = 1 << 5, /* insert ANSI color sequences if colors_enabled() says so */
SD_JSON_FORMAT_SOURCE = 1 << 6, /* prefix with source filename/line/column */
SD_JSON_FORMAT_SSE = 1 << 7, /* prefix/suffix with W3C server-sent events */
SD_JSON_FORMAT_SEQ = 1 << 8, /* prefix/suffix with RFC 7464 application/json-seq */
SD_JSON_FORMAT_FLUSH = 1 << 9, /* call fflush() after dumping JSON */
SD_JSON_FORMAT_EMPTY_ARRAY = 1 << 10, /* output "[]" for empty input */
SD_JSON_FORMAT_CENSOR_SENSITIVE = 1 << 11, /* replace all sensitive elements with the string "<sensitive data>" */
_SD_ENUM_FORCE_S64(JSON_FORMAT_FLAGS)
} sd_json_format_flags_t;