aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorViliam Mateicka <viliam.mateicka@gmail.com>2008-12-09 17:36:10 +0100
committerViliam Mateicka <viliam.mateicka@gmail.com>2008-12-09 17:36:10 +0100
commit01c591fb84dff8c481dc5dc59420300880e37fcc (patch)
tree2954a437ddcddf31206a874d6c68e63811133566 /src
parente61ba50ebd77e992f36deddb7f579c090eff0995 (diff)
downloadmpd-01c591fb84dff8c481dc5dc59420300880e37fcc.tar.gz
mpd-01c591fb84dff8c481dc5dc59420300880e37fcc.tar.xz
mpd-01c591fb84dff8c481dc5dc59420300880e37fcc.zip
utils: moving stringFoundInStringArray() from decoder into utils
Diffstat (limited to 'src')
-rw-r--r--src/decoder_list.c12
-rw-r--r--src/utils.c11
-rw-r--r--src/utils.h2
3 files changed, 14 insertions, 11 deletions
diff --git a/src/decoder_list.c b/src/decoder_list.c
index c7f66289f..c70d6334c 100644
--- a/src/decoder_list.c
+++ b/src/decoder_list.c
@@ -18,6 +18,7 @@
#include "decoder_list.h"
#include "decoder_api.h"
+#include "utils.h"
#include <glib.h>
@@ -76,17 +77,6 @@ enum {
/** which plugins have been initialized successfully? */
static bool decoder_plugins_enabled[num_decoder_plugins];
-static int stringFoundInStringArray(const char *const*array, const char *suffix)
-{
- while (array && *array) {
- if (strcasecmp(*array, suffix) == 0)
- return 1;
- array++;
- }
-
- return 0;
-}
-
const struct decoder_plugin *
decoder_plugin_from_suffix(const char *suffix, unsigned int next)
{
diff --git a/src/utils.c b/src/utils.c
index 9b75748da..1b12cd810 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -235,3 +235,14 @@ void xpthread_cond_destroy(pthread_cond_t *cond)
if ((err = pthread_cond_destroy(cond)))
FATAL("failed to destroy cond: %s\n", strerror(err));
}
+
+int stringFoundInStringArray(const char *const*array, const char *suffix)
+{
+ while (array && *array) {
+ if (strcasecmp(*array, suffix) == 0)
+ return 1;
+ array++;
+ }
+
+ return 0;
+}
diff --git a/src/utils.h b/src/utils.h
index 0990185ee..e7594c261 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -108,4 +108,6 @@ void xpthread_mutex_destroy(pthread_mutex_t *mutex);
void xpthread_cond_destroy(pthread_cond_t *cond);
+int stringFoundInStringArray(const char *const*array, const char *suffix);
+
#endif