aboutsummaryrefslogtreecommitdiff
path: root/src/tag_handler.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-11 19:24:51 +0100
committerMax Kellermann <max@duempel.org>2012-02-12 13:41:48 +0100
commitffea273a28179d2b5bbc24f967517bcf80940c63 (patch)
tree5891ed63a60ba0eed7c2b4433ea72f566f982822 /src/tag_handler.h
parent1783aac4384ccc53d9ad25c237d4286ccdbccbc0 (diff)
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.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tag_handler.h b/src/tag_handler.h
index 13e40f38..65391858 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).