mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
str_list_del
This commit is contained in:
parent
aa37899857
commit
13057fe53f
@ -33,3 +33,16 @@ int str_list_add(struct pool *mem, struct list *sl, const char *str)
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_list_del(struct list *sl, const char *str)
|
||||
{
|
||||
struct list *slh, *slht;
|
||||
|
||||
list_iterate_safe(slh, slht, sl) {
|
||||
if (!strcmp(str, list_item(slh, struct str_list)->str))
|
||||
list_del(slh);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -10,5 +10,6 @@
|
||||
#include "pool.h"
|
||||
|
||||
int str_list_add(struct pool *mem, struct list *sl, const char *str);
|
||||
int str_list_del(struct list *sl, const char *str);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user