diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-04-23 15:48:41 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-02-20 09:18:30 +0100 |
commit | d40d9e7c5f718936f3a126a8b7c3c9e1bb1c6290 (patch) | |
tree | 2a19eb022b797732fb9cebf0088797ee8d329071 /src/decoder/decoder_plugin.c | |
parent | 748f9b72fa43b7ab91ff0a2bc708760fa1f9a241 (diff) |
Move all decoder c files under decoder/
Diffstat (limited to 'src/decoder/decoder_plugin.c')
-rw-r--r-- | src/decoder/decoder_plugin.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/decoder/decoder_plugin.c b/src/decoder/decoder_plugin.c new file mode 100644 index 00000000..d32043f0 --- /dev/null +++ b/src/decoder/decoder_plugin.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2003-2011 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "config.h" +#include "decoder_plugin.h" +#include "string_util.h" + +#include <assert.h> + +bool +decoder_plugin_supports_suffix(const struct decoder_plugin *plugin, + const char *suffix) +{ + assert(plugin != NULL); + assert(suffix != NULL); + + return plugin->suffixes != NULL && + string_array_contains(plugin->suffixes, suffix); + +} + +bool +decoder_plugin_supports_mime_type(const struct decoder_plugin *plugin, + const char *mime_type) +{ + assert(plugin != NULL); + assert(mime_type != NULL); + + return plugin->mime_types != NULL && + string_array_contains(plugin->mime_types, mime_type); +} |