char *strv_find(char **l, const char *name) {
char **i;
- assert(l);
assert(name);
STRV_FOREACH(i, l)
return NULL;
}
+char *strv_find_prefix(char **l, const char *name) {
+ char **i;
+
+ assert(name);
+
+ STRV_FOREACH(i, l)
+ if (startswith(*i, name))
+ return *i;
+
+ return NULL;
+}
+
void strv_free(char **l) {
char **k;
#include "macro.h"
char *strv_find(char **l, const char *name);
+char *strv_find_prefix(char **l, const char *name);
+
void strv_free(char **l);
char **strv_copy(char **l) _malloc_;
unsigned strv_length(char **l);