src/cx/string.h

changeset 1334
7763892ed801
parent 1332
02946dc73e6a
equal deleted inserted replaced
1333:2fc1c25441f1 1334:7763892ed801
165 /** 165 /**
166 * Wraps a mutable string that must be zero-terminated. 166 * Wraps a mutable string that must be zero-terminated.
167 * 167 *
168 * The length is implicitly inferred by using a call to @c strlen(). 168 * The length is implicitly inferred by using a call to @c strlen().
169 * 169 *
170 * When @c NULL is passed, the length will be set to zero.
171 *
170 * @note the wrapped string will share the specified pointer to the string. 172 * @note the wrapped string will share the specified pointer to the string.
171 * If you do want a copy, use cx_strdup() on the return value of this function. 173 * If you do want a copy, use cx_strdup() on the return value of this function.
172 * 174 *
173 * If you need to wrap a constant string, use cx_str(). 175 * If you need to wrap a constant string, use cx_str().
174 * 176 *
175 * @param cstring the string to wrap, must be zero-terminated 177 * @param cstring the string to wrap, must be zero-terminated
176 * @return the wrapped string 178 * @return the wrapped string
177 * 179 *
178 * @see cx_mutstrn() 180 * @see cx_mutstrn()
179 */ 181 */
180 cx_attr_nonnull
181 cx_attr_nodiscard 182 cx_attr_nodiscard
182 cx_attr_cstr_arg(1) 183 cx_attr_cstr_arg(1)
183 cx_attr_export 184 cx_attr_export
184 cxmutstr cx_mutstr(char *cstring); 185 cxmutstr cx_mutstr(char *cstring);
185 186
210 /** 211 /**
211 * Wraps a string that must be zero-terminated. 212 * Wraps a string that must be zero-terminated.
212 * 213 *
213 * The length is implicitly inferred by using a call to @c strlen(). 214 * The length is implicitly inferred by using a call to @c strlen().
214 * 215 *
216 * When @c NULL is passed, the length will be set to zero.
217 *
215 * @note the wrapped string will share the specified pointer to the string. 218 * @note the wrapped string will share the specified pointer to the string.
216 * If you do want a copy, use cx_strdup() on the return value of this function. 219 * If you do want a copy, use cx_strdup() on the return value of this function.
217 * 220 *
218 * If you need to wrap a non-constant string, use cx_mutstr(). 221 * If you need to wrap a non-constant string, use cx_mutstr().
219 * 222 *
220 * @param cstring the string to wrap, must be zero-terminated 223 * @param cstring the string to wrap, must be zero-terminated
221 * @return the wrapped string 224 * @return the wrapped string
222 * 225 *
223 * @see cx_strn() 226 * @see cx_strn()
224 */ 227 */
225 cx_attr_nonnull
226 cx_attr_nodiscard 228 cx_attr_nodiscard
227 cx_attr_cstr_arg(1) 229 cx_attr_cstr_arg(1)
228 cx_attr_export 230 cx_attr_export
229 cxstring cx_str(const char *cstring); 231 cxstring cx_str(const char *cstring);
230 232

mercurial