From df4db509047766235063f98f0ddd61cbf221fea5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 29 Dec 2013 16:18:33 +0100 Subject: DecoderList: add function decoder_plugins_supports_suffix() Replaces decoder_plugin_from_suffix(). --- src/DecoderList.hxx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/DecoderList.hxx') diff --git a/src/DecoderList.hxx b/src/DecoderList.hxx index 3cfaaae7b..2ca8eb794 100644 --- a/src/DecoderList.hxx +++ b/src/DecoderList.hxx @@ -20,6 +20,8 @@ #ifndef MPD_DECODER_LIST_HXX #define MPD_DECODER_LIST_HXX +#include "Compiler.h" + struct DecoderPlugin; extern const struct DecoderPlugin *const decoder_plugins[]; @@ -27,17 +29,6 @@ extern bool decoder_plugins_enabled[]; /* interface for using plugins */ -/** - * Find the next enabled decoder plugin which supports the specified suffix. - * - * @param suffix the file name suffix - * @param plugin the previous plugin, or nullptr to find the first plugin - * @return a plugin, or nullptr if none matches - */ -const struct DecoderPlugin * -decoder_plugin_from_suffix(const char *suffix, - const struct DecoderPlugin *plugin); - const struct DecoderPlugin * decoder_plugin_from_name(const char *name); @@ -86,4 +77,12 @@ decoder_plugins_for_each_enabled(F f) f(*decoder_plugins[i]); } +/** + * Is there at least once #DecoderPlugin that supports the specified + * file name suffix? + */ +gcc_pure gcc_nonnull_all +bool +decoder_plugins_supports_suffix(const char *suffix); + #endif -- cgit v1.2.3