Mon, 21 Jul 2014 13:04:57 +0200
added sstrcat documentation
ucx/string.h | file | annotate | diff | comparison | revisions |
1.1 --- a/ucx/string.h Mon Jul 14 16:54:10 2014 +0200 1.2 +++ b/ucx/string.h Mon Jul 21 13:04:57 2014 +0200 1.3 @@ -120,13 +120,34 @@ 1.4 size_t sstrnlen(size_t count, sstr_t string, ...); 1.5 1.6 /** 1.7 - * Concatenates strings. 1.8 + * Concatenates two or more strings. 1.9 + * 1.10 + * The resulting string will be allocated by standard <code>malloc()</code>. 1.11 + * So developers <b>MUST</b> pass the sstr_t.ptr to <code>free()</code>. 1.12 + * 1.13 + * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>- 1.14 + * terminated. 1.15 * 1.16 * @param count the total number of strings to concatenate 1.17 - * @param ... all strings 1.18 + * @param s1 first string 1.19 + * @param s2 second string 1.20 + * @param ... all remaining strings 1.21 * @return the concatenated string 1.22 */ 1.23 sstr_t sstrcat(size_t count, sstr_t s1, sstr_t s2, ...); 1.24 + 1.25 +/** 1.26 + * Concatenates two or more strings using an UcxAllocator. 1.27 + * 1.28 + * See sstrcat() for details. 1.29 + * 1.30 + * @param a the allocator to use 1.31 + * @param count the total number of strings to concatenate 1.32 + * @param s1 first string 1.33 + * @param s2 second string 1.34 + * @param ... all remaining strings 1.35 + * @return the concatenated string 1.36 + */ 1.37 sstr_t sstrcat_a(UcxAllocator *a, size_t count, sstr_t s1, sstr_t s2, ...); 1.38 1.39