utils: moving stringFoundInStringArray() from decoder into utils
This commit is contained in:
parent
e61ba50ebd
commit
01c591fb84
@ -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)
|
||||
{
|
||||
|
11
src/utils.c
11
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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user