A container object makes the state transitions more straightforward

And should make it possible to free an object that has just been read
and still know what the next state will be, importantly.
This commit is contained in:
Eric Fischer
2014-02-06 18:56:22 -08:00
parent 55510cac04
commit 979b9243d8
3 changed files with 109 additions and 112 deletions
+12 -1
View File
@@ -13,7 +13,18 @@ typedef struct json_object {
struct json_object **keys;
struct json_object **values;
int length;
int expect;
} json_object;
json_object *json_parse(FILE *f, json_object *current, char **error);
struct json_pull {
json_object *container;
char *error;
FILE *f;
};
typedef struct json_pull json_pull;
json_pull *json_begin(FILE *f);
json_object *json_parse(json_pull *j);
json_object *json_hash_get(json_object *o, char *s);