X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Finclude%2Futils%2Fstrings.h;h=24f7fc11f8aa8f0bef5d7227c7c7e5d38200e11b;hp=61298ee7cc9d0e96d72bd02a4bb9a259aa07bc5f;hb=61e96ed1855b508dc544c5ab2a39de450483f208;hpb=3dea9329ce61105077cda3d2a9102589360de878 diff --git a/src/include/utils/strings.h b/src/include/utils/strings.h index 61298ee..24f7fc1 100644 --- a/src/include/utils/strings.h +++ b/src/include/utils/strings.h @@ -37,7 +37,8 @@ extern "C" { /* * stringv_copy: * Copy a string vector from 'src' to 'dst'. If non-NULL, 'dst' will be - * reallocated to fit the required size. + * reallocated to fit the required size and old entries will be freed before + * overriding them. * * Returns: * - 0 on success @@ -47,6 +48,17 @@ int stringv_copy(char ***dst, size_t *dst_len, const char * const *src, size_t src_len); +/* + * stringv_append: + * Append a string to a string vector. + * + * Returns: + * - 0 on success + * - a negative value else + */ +int +stringv_append(char ***s, size_t *s_len, const char *elem); + /* * stringv_free: * Free the memory used by 's' and all of it's elements.