From edbfa46cbc01bfbb1f7f1b624aaeae635408528c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 12 Jun 2012 20:39:53 +0200 Subject: encoder_list: add macro _for_each() --- src/encoder_list.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/encoder_list.h') 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. * -- cgit v1.2.3