mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 09:32:40 +00:00
ad7976c33e
It has been changed in one of the iterations of the patch during review, but bstr doesn't have to be null terminated. Fix it by adding dedicated node_map helper. Fixes: 1a27f3c
22 lines
1.0 KiB
C
22 lines
1.0 KiB
C
#ifndef MP_MISC_NODE_H_
|
|
#define MP_MISC_NODE_H_
|
|
|
|
#include "libmpv/client.h"
|
|
#include "misc/bstr.h"
|
|
|
|
void node_init(struct mpv_node *dst, int format, struct mpv_node *parent);
|
|
struct mpv_node *node_array_add(struct mpv_node *dst, int format);
|
|
struct mpv_node *node_map_add(struct mpv_node *dst, const char *key, int format);
|
|
struct mpv_node *node_map_badd(struct mpv_node *dst, struct bstr key, int format);
|
|
void node_map_add_string(struct mpv_node *dst, const char *key, const char *val);
|
|
void node_map_add_bstr(struct mpv_node *dst, const char *key, bstr val);
|
|
void node_map_add_int64(struct mpv_node *dst, const char *key, int64_t v);
|
|
void node_map_add_double(struct mpv_node *dst, const char *key, double v);
|
|
void node_map_add_flag(struct mpv_node *dst, const char *key, bool v);
|
|
mpv_node *node_map_get(mpv_node *src, const char *key);
|
|
mpv_node *node_map_bget(mpv_node *src, struct bstr key);
|
|
bool equal_mpv_value(const void *a, const void *b, mpv_format format);
|
|
bool equal_mpv_node(const struct mpv_node *a, const struct mpv_node *b);
|
|
|
|
#endif
|