mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-03 08:55:41 +02:00
Simplify the filter format, and actually run the filter.
This commit is contained in:
+2
-2
@@ -69,7 +69,7 @@ json_pull *json_begin_file(FILE *f) {
|
||||
}
|
||||
|
||||
static ssize_t read_string(json_pull *j, char *buffer, size_t n) {
|
||||
char *cp = j->source;
|
||||
const char *cp = j->source;
|
||||
size_t out = 0;
|
||||
|
||||
while (out < n && cp[out] != '\0') {
|
||||
@@ -81,7 +81,7 @@ static ssize_t read_string(json_pull *j, char *buffer, size_t n) {
|
||||
return out;
|
||||
}
|
||||
|
||||
json_pull *json_begin_string(char *s) {
|
||||
json_pull *json_begin_string(const char *s) {
|
||||
return json_begin(read_string, s);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ typedef struct json_pull {
|
||||
int line;
|
||||
|
||||
ssize_t (*read)(struct json_pull *, char *buf, size_t n);
|
||||
void *source;
|
||||
const void *source;
|
||||
char *buffer;
|
||||
ssize_t buffer_tail;
|
||||
ssize_t buffer_head;
|
||||
@@ -56,7 +56,7 @@ typedef struct json_pull {
|
||||
} json_pull;
|
||||
|
||||
json_pull *json_begin_file(FILE *f);
|
||||
json_pull *json_begin_string(char *s);
|
||||
json_pull *json_begin_string(const char *s);
|
||||
|
||||
json_pull *json_begin(ssize_t (*read)(struct json_pull *, char *buffer, size_t n), void *source);
|
||||
void json_end(json_pull *p);
|
||||
|
||||
Reference in New Issue
Block a user