utils: renamed stringFoundInStringArray()

No CamelCase.  Use bool instead of int.  Make both arguments
mandatory.
This commit is contained in:
Max Kellermann
2009-11-06 19:50:47 +01:00
parent ba34d48cf0
commit f9218423b9
6 changed files with 35 additions and 30 deletions

View File

@@ -132,13 +132,15 @@ int set_nonblocking(int fd)
#endif
}
int stringFoundInStringArray(const char *const*array, const char *suffix)
bool
string_array_contains(const char *const* haystack, const char *needle)
{
while (array && *array) {
if (g_ascii_strcasecmp(*array, suffix) == 0)
return 1;
array++;
}
assert(haystack != NULL);
assert(needle != NULL);
return 0;
for (; *haystack != NULL; ++haystack)
if (g_ascii_strcasecmp(*haystack, needle) == 0)
return true;
return false;
}