diff --git a/jsoncat.c b/jsoncat.c index 1b18292..d3f3b8d 100644 --- a/jsoncat.c +++ b/jsoncat.c @@ -112,7 +112,7 @@ void process_callback(FILE *f, char *fname) { json_object *j; int level = 0; - while ((j = json_parse_with_separators(jp, callback, &level)) != NULL) { + while ((j = json_read_with_separators(jp, callback, &level)) != NULL) { json_print_one(j, &level); json_free(j); } @@ -126,7 +126,7 @@ void process(FILE *f, char *fname) { json_pull *jp = json_begin_file(f); json_object *j; - while ((j = json_parse(jp)) != NULL) { + while ((j = json_read(jp)) != NULL) { if (j->parent == NULL) { json_print(j, 0); json_free(j); diff --git a/jsonpull.c b/jsonpull.c index b0f0c2f..c71a435 100644 --- a/jsonpull.c +++ b/jsonpull.c @@ -174,7 +174,7 @@ static void string_free(struct string *s) { free(s->buf); } -json_object *json_parse_with_separators(json_pull *j, json_separator_callback cb, void *state) { +json_object *json_read_with_separators(json_pull *j, json_separator_callback cb, void *state) { int c; again: /////////////////////////// Whitespace @@ -474,8 +474,8 @@ again: return NULL; } -json_object *json_parse(json_pull *j) { - return json_parse_with_separators(j, NULL, NULL); +json_object *json_read(json_pull *j) { + return json_read_with_separators(j, NULL, NULL); } void json_free(json_object *o) { diff --git a/jsonpull.h b/jsonpull.h index 17740d5..29173fa 100644 --- a/jsonpull.h +++ b/jsonpull.h @@ -1,8 +1,8 @@ typedef enum json_type { - // These types can be returned by json_parse() + // These types can be returned by json_read() JSON_HASH, JSON_ARRAY, JSON_NUMBER, JSON_STRING, JSON_TRUE, JSON_FALSE, JSON_NULL, - // These and JSON_HASH and JSON_ARRAY can be called back by json_parse_with_separators() + // These and JSON_HASH and JSON_ARRAY can be called back by json_read_with_separators() JSON_COMMA, JSON_COLON, // These are only used internally as expectations of what comes next @@ -43,8 +43,8 @@ json_pull *json_begin_file(FILE *f); json_pull *json_begin_string(char *s); json_pull *json_begin(int (*read)(struct json_pull *), int (*peek)(struct json_pull *), void *source); -json_object *json_parse(json_pull *j); -json_object *json_parse_with_separators(json_pull *j, json_separator_callback cb, void *state); +json_object *json_read(json_pull *j); +json_object *json_read_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);