diff options
author | Max Kellermann <max@duempel.org> | 2008-11-01 14:51:41 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-01 14:51:41 +0100 |
commit | 5036368f540af93372b750fe80e1c191b409a7a9 (patch) | |
tree | 38fcbd9a827f1271995e86307db4e80e2c201945 /src/decoder_list.c | |
parent | 83f6222ae74e6601383cf934a1bbf176656bf5c5 (diff) | |
download | mpd-5036368f540af93372b750fe80e1c191b409a7a9.tar.gz mpd-5036368f540af93372b750fe80e1c191b409a7a9.tar.xz mpd-5036368f540af93372b750fe80e1c191b409a7a9.zip |
decoder: return const decoder_plugin structs
The decoder_plugin structs must never change. Don't work with
non-const pointers.
Diffstat (limited to 'src/decoder_list.c')
-rw-r--r-- | src/decoder_list.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/decoder_list.c b/src/decoder_list.c index 57a013ec9..e99f6a5fd 100644 --- a/src/decoder_list.c +++ b/src/decoder_list.c @@ -65,12 +65,12 @@ static int stringFoundInStringArray(const char *const*array, const char *suffix) return 0; } -struct decoder_plugin *decoder_plugin_from_suffix(const char *suffix, - unsigned int next) +const struct decoder_plugin * +decoder_plugin_from_suffix(const char *suffix, unsigned int next) { static ListNode *pos; ListNode *node; - struct decoder_plugin *plugin; + const struct decoder_plugin *plugin; if (suffix == NULL) return NULL; @@ -95,8 +95,8 @@ struct decoder_plugin *decoder_plugin_from_suffix(const char *suffix, return NULL; } -struct decoder_plugin *decoder_plugin_from_mime_type(const char *mimeType, - unsigned int next) +const struct decoder_plugin * +decoder_plugin_from_mime_type(const char *mimeType, unsigned int next) { static ListNode *pos; ListNode *node; @@ -119,13 +119,14 @@ struct decoder_plugin *decoder_plugin_from_mime_type(const char *mimeType, return NULL; } -struct decoder_plugin *decoder_plugin_from_name(const char *name) +const struct decoder_plugin * +decoder_plugin_from_name(const char *name) { void *plugin = NULL; findInList(inputPlugin_list, name, &plugin); - return (struct decoder_plugin *) plugin; + return (const struct decoder_plugin *) plugin; } void decoder_plugin_print_all_suffixes(FILE * fp) |