Add a callback interface for non-closing punctuation

This commit is contained in:
Eric Fischer
2014-02-07 15:51:46 -08:00
parent f67e97cd08
commit fee27e1353
3 changed files with 84 additions and 20 deletions
+4
View File
@@ -1,5 +1,6 @@
typedef enum json_type {
JSON_HASH, JSON_ARRAY, JSON_NUMBER, JSON_STRING, JSON_TRUE, JSON_FALSE, JSON_NULL,
JSON_COMMA, JSON_COLON, JSON_ITEM, JSON_KEY, JSON_VALUE,
} json_type;
typedef struct json_object {
@@ -30,9 +31,12 @@ struct json_pull {
};
typedef struct json_pull json_pull;
typedef void (*json_separator_callback)(json_type type, json_pull *j, void *state);
json_pull *json_begin_file(FILE *f);
json_pull *json_begin_string(char *s);
json_object *json_parse(json_pull *j);
json_object *json_parse_with_separators(json_pull *j, json_separator_callback cb, void *state);
void json_free(json_object *j);
json_object *json_hash_get(json_object *o, char *s);