diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/node.c | 15 | ||||
-rw-r--r-- | misc/node.h | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/misc/node.c b/misc/node.c index 1ea8ea7da5..73e95e61b0 100644 --- a/misc/node.c +++ b/misc/node.c @@ -63,3 +63,18 @@ void node_map_add_string(struct mpv_node *dst, const char *key, const char *val) entry->format = MPV_FORMAT_STRING; entry->u.string = talloc_strdup(dst->u.list, val); } + +void node_map_add_int64(struct mpv_node *dst, const char *key, int64_t v) +{ + node_map_add(dst, key, MPV_FORMAT_INT64)->u.int64 = v; +} + +void node_map_add_double(struct mpv_node *dst, const char *key, double v) +{ + node_map_add(dst, key, MPV_FORMAT_DOUBLE)->u.double_ = v; +} + +void node_map_add_flag(struct mpv_node *dst, const char *key, bool v) +{ + node_map_add(dst, key, MPV_FORMAT_FLAG)->u.flag = v; +} diff --git a/misc/node.h b/misc/node.h index c3b4501dc8..a1bdab0ae1 100644 --- a/misc/node.h +++ b/misc/node.h @@ -7,5 +7,8 @@ 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); void node_map_add_string(struct mpv_node *dst, const char *key, const char *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); #endif |