summaryrefslogtreecommitdiff
path: root/json.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-18 17:05:46 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-18 17:05:46 +0000
commite91613e46430c7d1459647d33b950a7793899b3f (patch)
treef2e76e1dd4649166421b28bda3f358d55e7bf46a /json.h
parentaca62d992732297cabffeb6cf1d58ebb906e7117 (diff)
downloadgpsd-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.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/json.h b/json.h
index d3002ed0..8910e3b1 100644
--- a/json.h
+++ b/json.h
@@ -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 */