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:
Eric Fischer
2014-02-05 23:18:27 -08:00
parent 879f9126b3
commit d630aa917e
3 changed files with 45 additions and 45 deletions
+6 -13
View File
@@ -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);