diff options
author | Jeremy Allison <jra@samba.org> | 2009-04-09 22:46:59 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-04-09 22:46:59 -0700 |
commit | 7f10bf980edef3ace1522d0c9c082b35e225c950 (patch) | |
tree | d4e9af21de194cca812e754b28f9358a3651f4ce /lib/util/util.h | |
parent | f8f68703da58cf7f61b655b48bbbc45cda647748 (diff) | |
parent | f930f504e1d5e78d2f6f36cab9ce36dbeb34e955 (diff) | |
download | samba-7f10bf980edef3ace1522d0c9c082b35e225c950.tar.gz samba-7f10bf980edef3ace1522d0c9c082b35e225c950.tar.bz2 samba-7f10bf980edef3ace1522d0c9c082b35e225c950.zip |
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'lib/util/util.h')
-rw-r--r-- | lib/util/util.h | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/lib/util/util.h b/lib/util/util.h index defef127d9..81c7edfbdf 100644 --- a/lib/util/util.h +++ b/lib/util/util.h @@ -422,7 +422,7 @@ _PUBLIC_ char *str_list_join_shell(TALLOC_CTX *mem_ctx, const char **list, char /** return the number of elements in a string list */ -_PUBLIC_ size_t str_list_length(const char * const *list); +_PUBLIC_ size_t str_list_length(const char **list); /** copy a string list @@ -437,7 +437,7 @@ _PUBLIC_ bool str_list_equal(const char **list1, const char **list2); /** add an entry to a string list */ -_PUBLIC_ const char **str_list_add(const char **list, const char *s); +_PUBLIC_ char **str_list_add(char **list, const char *s); /** remove an entry from a string list @@ -453,6 +453,40 @@ _PUBLIC_ bool str_list_check(const char **list, const char *s); return true if a string is in a list, case insensitively */ _PUBLIC_ bool str_list_check_ci(const char **list, const char *s); +/** + append one list to another - expanding list1 +*/ +_PUBLIC_ char **str_list_append(char **list1, const char **list2); + +/** + remove duplicate elements from a list +*/ +_PUBLIC_ char **str_list_unique(char **list); + +/* + very useful when debugging complex list related code + */ +_PUBLIC_ void str_list_show(const char **list); + + +/** + append one list to another - expanding list1 + this assumes the elements of list2 are const pointers, so we can re-use them +*/ +_PUBLIC_ char **str_list_append_const(char **list1, const char **list2); + +/** + add an entry to a string list + this assumes s will not change +*/ +_PUBLIC_ char **str_list_add_const(char **list, const char *s); + +/** + copy a string list + this assumes list will not change +*/ +_PUBLIC_ char **str_list_copy_const(TALLOC_CTX *mem_ctx, const char **list); + /* The following definitions come from lib/util/util_file.c */ |