diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-08-18 17:05:46 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-08-18 17:05:46 +0000 |
commit | e91613e46430c7d1459647d33b950a7793899b3f (patch) | |
tree | f2e76e1dd4649166421b28bda3f358d55e7bf46a /json.h | |
parent | aca62d992732297cabffeb6cf1d58ebb906e7117 (diff) | |
download | gpsd-e91613e46430c7d1459647d33b950a7793899b3f.tar.gz |
Add check-string attributes to JSON parser.
Add JSON unit test to default test sequence.
Diffstat (limited to 'json.h')
-rw-r--r-- | json.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -4,7 +4,7 @@ #include <stdbool.h> #include <ctype.h> -typedef enum {integer, real, string, boolean, object, array} json_type; +typedef enum {integer, real, string, boolean, object, array, check} json_type; #define nullbool -1 /* not true, not false */ @@ -38,8 +38,8 @@ struct json_attr_t { union { int integer; double real; - char string; bool boolean; + char *check; } dflt; }; @@ -65,5 +65,6 @@ const char *json_error_string(int); #define JSON_ERR_BADSUBTRAIL 13 /* garbage while expecting array comma */ #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 */ /* json.h ends here */ |