summaryrefslogtreecommitdiff
path: root/json.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-27 10:03:16 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-27 10:03:16 +0000
commit222c36d2fa933c6677f947bd7f976cb4d70bd9c5 (patch)
tree0386c0aa55799ee07720642b7b53900ec076c026 /json.h
parent1f2705a78dd65fedec2b98bf4f5890811b3e2c20 (diff)
downloadgpsd-222c36d2fa933c6677f947bd7f976cb4d70bd9c5.tar.gz
Add an unsigned integer field type to the JSON parser (needed for RTCM2).
Also add a unit test for this.
Diffstat (limited to 'json.h')
-rw-r--r--json.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/json.h b/json.h
index e3d1243c..54aedf4e 100644
--- a/json.h
+++ b/json.h
@@ -4,7 +4,7 @@
#include <stdbool.h>
#include <ctype.h>
-typedef enum {integer, real, string, boolean, character,
+typedef enum {integer, uinteger, real, string, boolean, character,
object, structobject, array, check} json_type;
#define nullbool -1 /* not true, not false */
@@ -31,6 +31,7 @@ struct json_attr_t {
json_type type;
union {
int *integer;
+ unsigned int *uinteger;
double *real;
char *string;
bool *boolean;
@@ -40,6 +41,7 @@ struct json_attr_t {
} addr;
union {
int integer;
+ unsigned int uinteger;
double real;
bool boolean;
char character;