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 /src/tag_handler.h | |
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 'src/tag_handler.h')
-rw-r--r-- | src/tag_handler.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tag_handler.h b/src/tag_handler.h index 13e40f38d..653918588 100644 --- a/src/tag_handler.h +++ b/src/tag_handler.h @@ -43,6 +43,12 @@ struct tag_handler { * invalid after returning */ void (*tag)(enum tag_type type, const char *value, void *ctx); + + /** + * A name-value pair has been read. It is the codec specific + * representation of tags. + */ + void (*pair)(const char *key, const char *value, void *ctx); }; static inline void @@ -67,6 +73,18 @@ tag_handler_invoke_tag(const struct tag_handler *handler, void *ctx, handler->tag(type, value, ctx); } +static inline void +tag_handler_invoke_pair(const struct tag_handler *handler, void *ctx, + const char *name, const char *value) +{ + assert(handler != NULL); + assert(name != NULL); + assert(value != NULL); + + if (handler->pair != NULL) + handler->pair(name, value, ctx); +} + /** * This #tag_handler implementation adds tag values to a #tag object * (casted from the context pointer). |