aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder_list.h')
-rw-r--r--src/decoder_list.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/decoder_list.h b/src/decoder_list.h
index d259cb195..d0a6ade7e 100644
--- a/src/decoder_list.h
+++ b/src/decoder_list.h
@@ -27,6 +27,16 @@ struct decoder_plugin;
extern const struct decoder_plugin *const decoder_plugins[];
extern bool decoder_plugins_enabled[];
+#define decoder_plugins_for_each(plugin) \
+ for (const struct decoder_plugin *plugin, \
+ *const*decoder_plugin_iterator = &decoder_plugins[0]; \
+ (plugin = *decoder_plugin_iterator) != NULL; \
+ ++decoder_plugin_iterator)
+
+#define decoder_plugins_for_each_enabled(plugin) \
+ decoder_plugins_for_each(plugin) \
+ if (decoder_plugins_enabled[decoder_plugin_iterator - decoder_plugins])
+
/* interface for using plugins */
/**