diff options
author | Max Kellermann <max@duempel.org> | 2012-02-11 19:24:51 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-02-12 13:41:48 +0100 |
commit | ffea273a28179d2b5bbc24f967517bcf80940c63 (patch) | |
tree | 5891ed63a60ba0eed7c2b4433ea72f566f982822 /test | |
parent | 1783aac4384ccc53d9ad25c237d4286ccdbccbc0 (diff) | |
download | mpd-ffea273a28179d2b5bbc24f967517bcf80940c63.tar.gz mpd-ffea273a28179d2b5bbc24f967517bcf80940c63.tar.xz mpd-ffea273a28179d2b5bbc24f967517bcf80940c63.zip |
tag_handler: handle arbitrary name/value pairs
The new method pair() receives an arbitrary name/value pair. Support
for this is being added to a few decoder plugins.
Diffstat (limited to '')
-rw-r--r-- | test/read_tags.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/read_tags.c b/test/read_tags.c index 9fcf1acfe..b5ca8e55a 100644 --- a/test/read_tags.c +++ b/test/read_tags.c @@ -145,13 +145,20 @@ print_duration(unsigned seconds, G_GNUC_UNUSED void *ctx) static void print_tag(enum tag_type type, const char *value, G_GNUC_UNUSED void *ctx) { - g_print("%s=%s\n", tag_item_names[type], value); + g_print("[%s]=%s\n", tag_item_names[type], value); empty = false; } +static void +print_pair(const char *name, const char *value, G_GNUC_UNUSED void *ctx) +{ + g_print("\"%s\"=%s\n", name, value); +} + static const struct tag_handler print_handler = { .duration = print_duration, .tag = print_tag, + .pair = print_pair, }; int main(int argc, char **argv) |