diff options
author | Sumit Bose <sbose@redhat.com> | 2014-10-27 16:53:44 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-11-05 15:17:09 +0100 |
commit | 9ce7a46f6578a86b72f20acd7b0e55b1b4ebea09 (patch) | |
tree | 383d0f8294f894279c4f2317810205905079ee35 /src/util/util.h | |
parent | 3937736546e2a4b7cccc58fded3efdff9ae690fc (diff) | |
download | sssd-9ce7a46f6578a86b72f20acd7b0e55b1b4ebea09.tar.gz sssd-9ce7a46f6578a86b72f20acd7b0e55b1b4ebea09.tar.xz sssd-9ce7a46f6578a86b72f20acd7b0e55b1b4ebea09.zip |
Add add_strings_lists() utility function
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/util/util.h')
-rw-r--r-- | src/util/util.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util/util.h b/src/util/util.h index 69074c93c..ffc8a87ea 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -426,6 +426,24 @@ errno_t sss_hash_create_ex(TALLOC_CTX *mem_ctx, hash_delete_callback *delete_callback, void *delete_private_data); +/** + * @brief Add two list of strings + * + * Create a new NULL-termintated list of strings by adding two lists together. + * + * @param[in] mem_ctx Talloc memory context for the new list. + * @param[in] l1 First NULL-termintated list of strings. + * @param[in] l2 Second NULL-termintated list of strings. + * @param[in] copy_strings If set to 'true' the list items will be copied + * otherwise only the pointers to the items are + * copied. + * @param[out] new_list New NULL-terminated list of strings. Must be freed + * with talloc_free() by the caller. If copy_strings + * is 'true' the new elements will be freed as well. + */ +errno_t add_strings_lists(TALLOC_CTX *mem_ctx, const char **l1, const char **l2, + bool copy_strings, char ***_new_list); + /* Copy a NULL-terminated string list * Returns NULL on out of memory error or invalid input */ |