summaryrefslogtreecommitdiff
path: root/json.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-07-12 21:24:39 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-07-12 21:24:39 +0000
commit2d77583582a736b38f0012cc9c315d0b51c3a331 (patch)
treec7e4fff8e98c7369c629c4038d9c5fa5d297bd01 /json.h
parent7b06ee55fb57ee3d1695ac3ffcd600c660a414ff (diff)
downloadgpsd-2d77583582a736b38f0012cc9c315d0b51c3a331.tar.gz
Make #defines for JSON error codes.
Diffstat (limited to 'json.h')
-rw-r--r--json.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/json.h b/json.h
index 34b98c06..e98e04b7 100644
--- a/json.h
+++ b/json.h
@@ -21,6 +21,7 @@ struct json_attr_t {
} string;
bool *boolean;
struct json_array_t *array;
+ int offset;
} addr;
union {
int integer;
@@ -35,4 +36,16 @@ struct json_attr_t {
int json_read_object(const char *, char *, const struct json_attr_t *, const char **end);
+#define JSON_ERR_OBSTART -1 /* non-WZ when expecting object start */
+#define JSON_ERR_ATTRSTART -2 /* non-WZ when expecting attrib start */
+#define JSON_ERR_BADATTR -3 /* unknown attribute name */
+#define JSON_ERR_ATTRLEN -4 /* attribute name too long */
+#define JSON_ERR_NOARRAY -5 /* saw [ when not expecting array */
+#define JSON_ERR_NOBRAK -6 /* array element specified, but no [ */
+#define JSON_ERR_STRLONG -7 /* string value too long */
+#define JSON_ERR_TOKLONG -8 /* token value too long */
+#define JSON_ERR_SUBSTRING -9 /* no strings in array subobjects */
+#define JSON_ERR_BADTRAIL -10 /* garbage while expecting , or } */
+#define JSON_ERR_ARRAYSTART -11 /* didn't find expected array start */
+
/* json.h ends here */