ucx/string.h

changeset 183
6a694f8f0084
parent 180
2185f19dcc45
child 192
1e51558b9d09
equal deleted inserted replaced
182:998bf7c643b4 183:6a694f8f0084
118 * @return the cumulated length of all strings 118 * @return the cumulated length of all strings
119 */ 119 */
120 size_t sstrnlen(size_t count, sstr_t string, ...); 120 size_t sstrnlen(size_t count, sstr_t string, ...);
121 121
122 /** 122 /**
123 * Concatenates strings. 123 * Concatenates two or more strings.
124 *
125 * The resulting string will be allocated by standard <code>malloc()</code>.
126 * So developers <b>MUST</b> pass the sstr_t.ptr to <code>free()</code>.
127 *
128 * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>-
129 * terminated.
124 * 130 *
125 * @param count the total number of strings to concatenate 131 * @param count the total number of strings to concatenate
126 * @param ... all strings 132 * @param s1 first string
133 * @param s2 second string
134 * @param ... all remaining strings
127 * @return the concatenated string 135 * @return the concatenated string
128 */ 136 */
129 sstr_t sstrcat(size_t count, sstr_t s1, sstr_t s2, ...); 137 sstr_t sstrcat(size_t count, sstr_t s1, sstr_t s2, ...);
138
139 /**
140 * Concatenates two or more strings using an UcxAllocator.
141 *
142 * See sstrcat() for details.
143 *
144 * @param a the allocator to use
145 * @param count the total number of strings to concatenate
146 * @param s1 first string
147 * @param s2 second string
148 * @param ... all remaining strings
149 * @return the concatenated string
150 */
130 sstr_t sstrcat_a(UcxAllocator *a, size_t count, sstr_t s1, sstr_t s2, ...); 151 sstr_t sstrcat_a(UcxAllocator *a, size_t count, sstr_t s1, sstr_t s2, ...);
131 152
132 153
133 /** 154 /**
134 * Returns a substring starting at the specified location. 155 * Returns a substring starting at the specified location.

mercurial