diff options
author | Sumit Bose <sbose@redhat.com> | 2012-11-13 21:20:32 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-11-14 10:42:34 +0100 |
commit | 032d0980dfe5a27a5954f44f9d519e03fc7d1ced (patch) | |
tree | b78b6ea906b1833acc64153a6e6d4d6c3b24cfb8 /src/util/util.h | |
parent | 5fe7390f295321f6a13afddf2023aae45a32aad2 (diff) | |
download | sssd-032d0980dfe5a27a5954f44f9d519e03fc7d1ced.tar.gz sssd-032d0980dfe5a27a5954f44f9d519e03fc7d1ced.tar.xz sssd-032d0980dfe5a27a5954f44f9d519e03fc7d1ced.zip |
Add string_in_list() and add_string_to_list() with tests
string_in_list() and add_string_to_list() are two utilities for NULL
terminated strings arrays. add_string_to_list() adds a new string to an
existing list or creates a new one with the strings as only item if
there is not list. string_in_list() checks if a given string is in the
list. It can be used case sensitive or in-sensitive.
Diffstat (limited to 'src/util/util.h')
-rw-r--r-- | src/util/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/util.h b/src/util/util.h index b6ecfc2c9..56e7e0bed 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -535,6 +535,12 @@ sss_escape_ip_address(TALLOC_CTX *mem_ctx, int family, const char *addr); errno_t remove_ipv6_brackets(char *ipv6addr); + +errno_t add_string_to_list(TALLOC_CTX *mem_ctx, const char *string, + char ***list_p); + +bool string_in_list(const char *string, char **list, bool case_sensitive); + /* from sss_tc_utf8.c */ char * sss_tc_utf8_str_tolower(TALLOC_CTX *mem_ctx, const char *s); |