summaryrefslogtreecommitdiff
path: root/json.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-07-11 21:54:16 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-07-11 21:54:16 +0000
commitb4eae60c38152d04a43f03b6749441d7e20c1919 (patch)
tree7b76a3a5a89b65d4dc91d12604fae0bbbbff5991 /json.h
parentb0b1b44e6b6873e5f0116bea235829246e969eaa (diff)
downloadgpsd-b4eae60c38152d04a43f03b6749441d7e20c1919.tar.gz
First steps towards parsing JSON arrays.
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 a254b448..52206f92 100644
--- a/json.h
+++ b/json.h
@@ -5,12 +5,13 @@
struct json_attr_t {
char *attribute;
- enum {integer, real, string, boolean} type;
+ enum {integer, real, string, boolean, array} type;
union {
int *integer;
double *real;
char *string;
bool *boolean;
+ struct json_attr_t *array;
} addr;
union {
int integer;
@@ -23,6 +24,6 @@ struct json_attr_t {
#define JSON_ATTR_MAX 31 /* max charss in JSON attribute name */
#define JSON_VAL_MAX 63 /* max charss in JSON value part */
-int parse_json(const char *, const struct json_attr_t *);
+int json_read_object(const char *, const struct json_attr_t *);
/* json.h ends here */