aboutsummaryrefslogtreecommitdiffstats
path: root/src/encoder_list.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-06-12 20:39:53 +0200
committerMax Kellermann <max@duempel.org>2012-06-12 20:39:53 +0200
commitedbfa46cbc01bfbb1f7f1b624aaeae635408528c (patch)
treeea82a05865eed99a9e82ba7ab2585ef8f3e46fc3 /src/encoder_list.h
parent90709a6de4dbfc25c86ec1bb9249836720dc07b8 (diff)
downloadmpd-edbfa46cbc01bfbb1f7f1b624aaeae635408528c.tar.gz
mpd-edbfa46cbc01bfbb1f7f1b624aaeae635408528c.tar.xz
mpd-edbfa46cbc01bfbb1f7f1b624aaeae635408528c.zip
encoder_list: add macro _for_each()
Diffstat (limited to 'src/encoder_list.h')
-rw-r--r--src/encoder_list.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/encoder_list.h b/src/encoder_list.h
index 95f853004..4fe87e16c 100644
--- a/src/encoder_list.h
+++ b/src/encoder_list.h
@@ -24,6 +24,14 @@
struct encoder_plugin;
+extern const struct encoder_plugin *const encoder_plugins[];
+
+#define encoder_plugins_for_each(plugin) \
+ for (const struct encoder_plugin *plugin, \
+ *const*encoder_plugin_iterator = &encoder_plugins[0]; \
+ (plugin = *encoder_plugin_iterator) != NULL; \
+ ++encoder_plugin_iterator)
+
/**
* Looks up an encoder plugin by its name.
*