mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-03 17:05:41 +02:00
Put arrays in order by getting rid of the linked lists.
Resizing is ugly, but less ugly than backwards arrays.
This commit is contained in:
+6
-13
@@ -8,25 +8,18 @@ typedef enum json_type {
|
||||
JSON_HASH, JSON_ARRAY, JSON_NUMBER, JSON_STRING, JSON_TRUE, JSON_FALSE, JSON_NULL,
|
||||
} json_type;
|
||||
|
||||
typedef struct json_array {
|
||||
struct json_object *object;
|
||||
struct json_array *next;
|
||||
} json_array;
|
||||
|
||||
typedef struct json_hash {
|
||||
struct json_object *key;
|
||||
struct json_object *value;
|
||||
struct json_hash *next;
|
||||
} json_hash;
|
||||
|
||||
typedef struct json_object {
|
||||
json_type type;
|
||||
struct json_object *parent;
|
||||
|
||||
char *string;
|
||||
double number;
|
||||
json_array *array;
|
||||
json_hash *hash;
|
||||
|
||||
struct json_object **array;
|
||||
struct json_object **keys;
|
||||
struct json_object **values;
|
||||
int length;
|
||||
int __allocated;
|
||||
} json_object;
|
||||
|
||||
json_object *json_parse(FILE *f, json_object *current);
|
||||
|
||||
Reference in New Issue
Block a user