mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-02 01:08:14 +00:00
Get rid of root node to simplify. Walk the tree if you need it.
This commit is contained in:
parent
e99c037be3
commit
0fd66048c8
@ -10,7 +10,6 @@ json_pull *json_begin(int (*read)(struct json_pull *), int (*peek)(struct json_p
|
||||
|
||||
j->error = NULL;
|
||||
j->line = 1;
|
||||
j->root = NULL;
|
||||
j->container = NULL;
|
||||
|
||||
j->read = read;
|
||||
@ -123,8 +122,6 @@ static json_object *add_object(json_pull *j, json_type type) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
j->root = o;
|
||||
}
|
||||
|
||||
return o;
|
||||
|
12
jsonpull.h
12
jsonpull.h
@ -24,8 +24,7 @@ typedef struct json_object {
|
||||
int expect;
|
||||
} json_object;
|
||||
|
||||
struct json_pull {
|
||||
json_object *root;
|
||||
typedef struct json_pull {
|
||||
char *error;
|
||||
|
||||
int (*read)(struct json_pull *);
|
||||
@ -34,15 +33,16 @@ struct json_pull {
|
||||
int line;
|
||||
|
||||
json_object *container;
|
||||
};
|
||||
typedef struct json_pull json_pull;
|
||||
|
||||
typedef void (*json_separator_callback)(json_type type, json_pull *j, void *state);
|
||||
} json_pull;
|
||||
|
||||
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);
|
||||
void json_end(json_pull *p);
|
||||
|
||||
typedef void (*json_separator_callback)(json_type type, json_pull *j, void *state);
|
||||
|
||||
json_object *json_read_tree(json_pull *j);
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user