basic: add STRCASE_IN_SET() which is to STR_IN_SET() what strcaseeq() is to streq()

This commit is contained in:
Lennart Poettering
2020-05-04 10:11:19 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 2d4f8cf467
commit ddd6a22a0f
5 changed files with 60 additions and 19 deletions
+12
View File
@@ -28,6 +28,18 @@ char *strv_find(char * const *l, const char *name) {
return NULL;
}
char *strv_find_case(char * const *l, const char *name) {
char * const *i;
assert(name);
STRV_FOREACH(i, l)
if (strcaseeq(*i, name))
return *i;
return NULL;
}
char *strv_find_prefix(char * const *l, const char *name) {
char * const *i;