mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
datastruct: Add str_list_add_list.
This commit is contained in:
parent
8a87fadbb0
commit
9506760c7e
@ -1,5 +1,6 @@
|
||||
Version 2.02.119 -
|
||||
==================================
|
||||
Add str_list_add_list() to combine two lists.
|
||||
Fix LV processing with selection to always do the selection on initial state.
|
||||
|
||||
Version 2.02.118 - 23rd March 2015
|
||||
|
@ -71,6 +71,21 @@ int str_list_add(struct dm_pool *mem, struct dm_list *sll, const char *str)
|
||||
return str_list_add_no_dup_check(mem, sll, str);
|
||||
}
|
||||
|
||||
/* Add contents of sll2 to sll */
|
||||
int str_list_add_list(struct dm_pool *mem, struct dm_list *sll, struct dm_list *sll2)
|
||||
{
|
||||
struct dm_str_list *sl;
|
||||
|
||||
if (!sll2)
|
||||
return_0;
|
||||
|
||||
dm_list_iterate_items(sl, sll2)
|
||||
if (!str_list_add(mem, sll, sl->str))
|
||||
return_0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void str_list_del(struct dm_list *sll, const char *str)
|
||||
{
|
||||
struct dm_list *slh, *slht;
|
||||
|
@ -21,6 +21,7 @@ struct dm_pool;
|
||||
|
||||
struct dm_list *str_list_create(struct dm_pool *mem);
|
||||
int str_list_add(struct dm_pool *mem, struct dm_list *sll, const char *str);
|
||||
int str_list_add_list(struct dm_pool *mem, struct dm_list *sll, struct dm_list *sll2);
|
||||
int str_list_add_no_dup_check(struct dm_pool *mem, struct dm_list *sll, const char *str);
|
||||
int str_list_add_h_no_dup_check(struct dm_pool *mem, struct dm_list *sll, const char *str);
|
||||
void str_list_del(struct dm_list *sll, const char *str);
|
||||
|
Loading…
Reference in New Issue
Block a user