diff options
author | Max Kellermann <max@duempel.org> | 2009-11-06 19:50:47 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-06 19:50:47 +0100 |
commit | f9218423b90a8effafba323abb088cebba34fb25 (patch) | |
tree | 994e8c48dd6bca294cca60398c49d27b7e4abb54 /src/utils.h | |
parent | ba34d48cf093cbfbe9d6e63e7177ba79791c6a4a (diff) | |
download | mpd-f9218423b90a8effafba323abb088cebba34fb25.tar.gz mpd-f9218423b90a8effafba323abb088cebba34fb25.tar.xz mpd-f9218423b90a8effafba323abb088cebba34fb25.zip |
utils: renamed stringFoundInStringArray()
No CamelCase. Use bool instead of int. Make both arguments
mandatory.
Diffstat (limited to '')
-rw-r--r-- | src/utils.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/utils.h b/src/utils.h index d114003be..a77d4a03d 100644 --- a/src/utils.h +++ b/src/utils.h @@ -20,6 +20,8 @@ #ifndef MPD_UTILS_H #define MPD_UTILS_H +#include <stdbool.h> + #ifndef assert_static /* Compile time assertion developed by Ralf Holly */ /* http://pera-software.com/articles/compile-time-assertions.pdf */ @@ -33,6 +35,15 @@ char *parsePath(char *path); int set_nonblocking(int fd); -int stringFoundInStringArray(const char *const*array, const char *suffix); +/** + * Checks whether a string array contains the specified string. + * + * @param haystack a NULL terminated list of strings + * @param needle the string to search for; the comparison is + * case-insensitive for ASCII characters + * @return true if found + */ +bool +string_array_contains(const char *const* haystack, const char *needle); #endif |