From fd7c52231fc4ca6e4ad2a72955a053f321cb0fb4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 9 Apr 2009 14:28:38 +1000 Subject: added _const versions of some of the str_list_*() functions These const versions don't copy the strings themselves, which is useful when those strings point at known constant data (into the schema in this case) --- lib/util/util.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/util/util.h') diff --git a/lib/util/util.h b/lib/util/util.h index 78fc87ebe1..81c7edfbdf 100644 --- a/lib/util/util.h +++ b/lib/util/util.h @@ -468,6 +468,26 @@ _PUBLIC_ char **str_list_unique(char **list); */ _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 */ -- cgit