diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-08-19 13:48:23 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-08-19 13:48:23 +0000 |
commit | 93ee1a5bab45b4dc57da6ee55885214fd66b0739 (patch) | |
tree | 63556af2ead49fcc66c18ba638d5e4f54908de52 /json.h | |
parent | 7ef6c5e9373d1db5645bd9d69b101b9202e3fd8c (diff) | |
download | gpsd-93ee1a5bab45b4dc57da6ee55885214fd66b0739.tar.gz |
JSON parser can now unpack JSON lists into structure arrays.
Diffstat (limited to 'json.h')
-rw-r--r-- | json.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -5,7 +5,7 @@ #include <ctype.h> typedef enum {integer, real, string, boolean, - flags, object, array, check} json_type; + flags, object, structobject, array, check} json_type; #define nullbool -1 /* not true, not false */ @@ -17,7 +17,11 @@ struct json_enum_t { struct json_array_t { json_type element_type; union { - const struct json_attr_t *subtype; + struct { + const struct json_attr_t *subtype; + char *base; + size_t stride; + } objects; struct { char **ptrs; char *store; @@ -43,6 +47,7 @@ struct json_attr_t { } string; bool *boolean; struct json_array_t array; + size_t offset; } addr; union { int integer; |