summaryrefslogtreecommitdiff
path: root/json.h
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-05-17 12:29:04 -0700
committerGary E. Miller <gem@rellim.com>2019-05-17 12:29:04 -0700
commitef9f2331677beab2e146a56a19161bab979ae3b6 (patch)
tree6b278b0a22b0fc50c71136d4a581ec96b945eeb6 /json.h
parent192618af67245eb9f07ddde3b5754cd26276ff2a (diff)
downloadgpsd-ef9f2331677beab2e146a56a19161bab979ae3b6.tar.gz
json.h: Add t_byte and t_ubyte to json_type.
This is to allow the existing practice of using unsigned char fields in satellite_t and meas_t. Those existing uses are overflowing their fields.
Diffstat (limited to 'json.h')
-rw-r--r--json.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/json.h b/json.h
index c2bfc62b..19682e47 100644
--- a/json.h
+++ b/json.h
@@ -1,18 +1,25 @@
/* Structures for JSON parsing using only fixed-extent memory
*
- * This file is Copyright (c) 2010 by the GPSD project
+ * This file is Copyright (c) 2010-2019 by the GPSD project
* SPDX-License-Identifier: BSD-2-clause
*/
#include <stdbool.h>
#include <ctype.h>
+/* the json_type is the type of the C variable the JSON
+ * value gets placed in. It is NOT the JSON type as used
+ * in the JSON standard. But it does partly specify how
+ * the JSON value is decoded.
+ *
+ * For example a t_character must be in quotes, but a t_byte
+ * is a bare number. */
typedef enum {t_integer, t_uinteger, t_real,
t_string, t_boolean, t_character,
t_time,
t_object, t_structobject, t_array,
t_check, t_ignore,
- t_short, t_ushort}
+ t_short, t_ushort, t_byte, t_ubyte}
json_type;
struct json_enum_t {