summaryrefslogtreecommitdiff
path: root/json.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-19 13:48:23 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-19 13:48:23 +0000
commit93ee1a5bab45b4dc57da6ee55885214fd66b0739 (patch)
tree63556af2ead49fcc66c18ba638d5e4f54908de52 /json.h
parent7ef6c5e9373d1db5645bd9d69b101b9202e3fd8c (diff)
downloadgpsd-93ee1a5bab45b4dc57da6ee55885214fd66b0739.tar.gz
JSON parser can now unpack JSON lists into structure arrays.
Diffstat (limited to 'json.h')
-rw-r--r--json.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/json.h b/json.h
index 24e82f4e..bd0d46e5 100644
--- a/json.h
+++ b/json.h
@@ -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;