[vlc-devel] [PATCH] demux: json: add json_reader context
Rémi Denis-Courmont
remi at remlab.net
Wed Oct 14 18:02:07 CEST 2020
Le keskiviikkona 14. lokakuuta 2020, 17.52.52 EEST Francois Cartegnie a écrit
:
> diff --git a/modules/demux/json/json.h b/modules/demux/json/json.h
> index 8274ceb652..bc254693f3 100644
> --- a/modules/demux/json/json.h
> +++ b/modules/demux/json/json.h
> @@ -59,11 +59,16 @@ struct json_member {
> struct json_value value;
> };
>
> -size_t json_read(void *data, void *buf, size_t max);
> -void json_parse_error(void *log, const char *msg);
> +struct json_reader {
> + void *priv;
> + ssize_t (*read)(void *, void *, size_t);
> + void (*logger)(void *, const struct json_object *, const char *);
> +};
I don't see the point in having a log callback. The VLC logger is already
essentially a log callback by itself. We don't need two indirection layers.
> +
> char *json_unescape(const char *, size_t);
>
> -int json_parse(void *log, struct json_object *result);
> +int json_parse(struct json_reader *, struct json_object *result);
> +
> void json_free(struct json_object *);
>
> const struct json_value *json_get(const struct json_object *obj,
--
レミ・デニ-クールモン
http://www.remlab.net/
More information about the vlc-devel
mailing list