diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-08-19 05:42:24 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-08-19 05:42:24 +0000 |
commit | 98e5d53668d9b9c11dab4e7c703d2d2166398cfe (patch) | |
tree | 2a3bba33cdb4d61a62cc7b781aab1ffec4bd5986 /json.h | |
parent | 6098283d8394544b97c70f473a9743d0c4527d2f (diff) | |
download | gpsd-98e5d53668d9b9c11dab4e7c703d2d2166398cfe.tar.gz |
Change enumerated array JSON type to yield a bitmask rather than an array.
Diffstat (limited to 'json.h')
-rw-r--r-- | json.h | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -5,13 +5,13 @@ #include <ctype.h> typedef enum {integer, real, string, boolean, - enumerated, object, array, check} json_type; + flags, object, array, check} json_type; #define nullbool -1 /* not true, not false */ struct json_enum_t { char *name; - int value; + int mask; }; struct json_array_t { @@ -25,9 +25,8 @@ struct json_array_t { } strings; struct { const struct json_enum_t *map; - int *store; - int storelen; - } enumerated; + int *bits; + } flags; } arr; int *count, maxlen; }; @@ -77,6 +76,6 @@ const char *json_error_string(int); #define JSON_ERR_SUBTYPE 14 /* unsupported array element type */ #define JSON_ERR_BADSTRING 15 /* error while string parsing */ #define JSON_ERR_CHECKFAIL 16 /* check attribute not matched */ -#define JSON_ERR_BADENUM 17 /* invalid enumerated value */ +#define JSON_ERR_BADENUM 17 /* invalid flag token */ /* json.h ends here */ |