Commit 3813ef71 authored by Bernhard Link's avatar Bernhard Link

Added strlist_subset

parent f001fb41
......@@ -39,6 +39,22 @@ int strlist_in(const struct strlist *strlist,const char *element) {
return 0;
}
int strlist_subset(const struct strlist *strlist,const struct strlist *subset) {
int c;
char **t;
assert(subset != NULL);
c = subset->count;
t = subset->values;
while( c-- != 0 ) {
if( !strlist_in(strlist,*(t++)) )
return 0;
}
return 1;
}
retvalue strlist_init_n(int startsize,struct strlist *strlist) {
assert(strlist != NULL && startsize >= 0);
......
......@@ -30,5 +30,6 @@ retvalue strlist_dup(struct strlist *dest,const struct strlist *orig);
void strlist_move(struct strlist *dest,struct strlist *orig);
int strlist_in(const struct strlist *strlist,const char *element);
int strlist_subset(const struct strlist *strlist,const struct strlist *subset);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment