Sun, 19 Oct 2025 21:17:21 +0200
add ui_splitview_window_set_visible (GTK)
| 174 | 1 | /* |
| 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
| 3 | * | |
| 4 | * Copyright 2021 Mike Becker, Olaf Wintermann All rights reserved. | |
| 5 | * | |
| 6 | * Redistribution and use in source and binary forms, with or without | |
| 7 | * modification, are permitted provided that the following conditions are met: | |
| 8 | * | |
| 9 | * 1. Redistributions of source code must retain the above copyright | |
| 10 | * notice, this list of conditions and the following disclaimer. | |
| 11 | * | |
| 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
| 13 | * notice, this list of conditions and the following disclaimer in the | |
| 14 | * documentation and/or other materials provided with the distribution. | |
| 15 | * | |
| 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
| 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
| 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
| 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
| 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
| 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
| 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
| 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
| 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 26 | * POSSIBILITY OF SUCH DAMAGE. | |
| 27 | */ | |
| 28 | /** | |
| 440 | 29 | * @file string.h |
| 30 | * @brief Strings that know their length. | |
| 31 | * @author Mike Becker | |
| 32 | * @author Olaf Wintermann | |
| 33 | * @copyright 2-Clause BSD License | |
| 174 | 34 | */ |
| 35 | ||
| 36 | #ifndef UCX_STRING_H | |
| 37 | #define UCX_STRING_H | |
| 38 | ||
| 39 | #include "common.h" | |
| 40 | #include "allocator.h" | |
| 41 | ||
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
42 | /** Expands a UCX string as printf arguments. */ |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
43 | #define CX_SFMT(s) (int) (s).length, (s).ptr |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
44 | |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
45 | /** Format specifier for a UCX string */ |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
46 | #define CX_PRIstr ".*s" |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
47 | |
| 174 | 48 | /** |
|
253
087cc9216f28
initial newapi GTK port
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
49 | * The maximum length of the "needle" in cx_strstr() that can use SBO. |
|
087cc9216f28
initial newapi GTK port
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
50 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
51 | cx_attr_export |
| 440 | 52 | extern const unsigned cx_strstr_sbo_size; |
|
253
087cc9216f28
initial newapi GTK port
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
53 | |
|
087cc9216f28
initial newapi GTK port
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
54 | /** |
| 174 | 55 | * The UCX string structure. |
| 56 | */ | |
| 57 | struct cx_mutstr_s { | |
| 58 | /** | |
| 59 | * A pointer to the string. | |
| 440 | 60 | * @note The string is not necessarily @c NULL terminated. |
| 174 | 61 | */ |
| 62 | char *ptr; | |
| 63 | /** The length of the string */ | |
| 64 | size_t length; | |
| 65 | }; | |
| 66 | ||
| 67 | /** | |
| 68 | * A mutable string. | |
| 69 | */ | |
| 70 | typedef struct cx_mutstr_s cxmutstr; | |
| 71 | ||
| 72 | /** | |
| 73 | * The UCX string structure for immutable (constant) strings. | |
| 74 | */ | |
| 75 | struct cx_string_s { | |
| 76 | /** | |
| 77 | * A pointer to the immutable string. | |
| 440 | 78 | * @note The string is not necessarily @c NULL terminated. |
| 174 | 79 | */ |
| 324 | 80 | const char *ptr; |
| 174 | 81 | /** The length of the string */ |
| 82 | size_t length; | |
| 83 | }; | |
| 84 | ||
| 85 | /** | |
| 86 | * An immutable string. | |
| 87 | */ | |
| 88 | typedef struct cx_string_s cxstring; | |
| 89 | ||
| 90 | /** | |
| 91 | * Context for string tokenizing. | |
| 92 | */ | |
| 93 | struct cx_strtok_ctx_s { | |
| 94 | /** | |
| 95 | * The string to tokenize. | |
| 96 | */ | |
| 97 | cxstring str; | |
| 98 | /** | |
| 99 | * The primary delimiter. | |
| 100 | */ | |
| 101 | cxstring delim; | |
| 102 | /** | |
| 103 | * Optional array of more delimiters. | |
| 104 | */ | |
| 324 | 105 | const cxstring *delim_more; |
| 174 | 106 | /** |
| 107 | * Length of the array containing more delimiters. | |
| 108 | */ | |
| 109 | size_t delim_more_count; | |
| 110 | /** | |
| 111 | * Position of the currently active token in the source string. | |
| 112 | */ | |
| 113 | size_t pos; | |
| 114 | /** | |
| 845 | 115 | * Position of the next delimiter in the source string. |
| 174 | 116 | * |
| 117 | * If the tokenizer has not yet returned a token, the content of this field | |
| 845 | 118 | * is undefined. If the tokenizer reaches the end of the string, this field |
| 174 | 119 | * contains the length of the source string. |
| 120 | */ | |
| 121 | size_t delim_pos; | |
| 122 | /** | |
| 123 | * The position of the next token in the source string. | |
| 124 | */ | |
| 125 | size_t next_pos; | |
| 126 | /** | |
| 127 | * The number of already found tokens. | |
| 128 | */ | |
| 129 | size_t found; | |
| 130 | /** | |
| 131 | * The maximum number of tokens that shall be returned. | |
| 132 | */ | |
| 133 | size_t limit; | |
| 134 | }; | |
| 135 | ||
| 136 | /** | |
| 137 | * A string tokenizing context. | |
| 138 | */ | |
| 139 | typedef struct cx_strtok_ctx_s CxStrtokCtx; | |
| 140 | ||
| 141 | #ifdef __cplusplus | |
| 142 | extern "C" { | |
| 143 | ||
| 144 | /** | |
| 145 | * A literal initializer for an UCX string structure. | |
| 146 | * | |
| 147 | * @param literal the string literal | |
| 148 | */ | |
| 149 | #define CX_STR(literal) cxstring{literal, sizeof(literal) - 1} | |
| 150 | ||
| 151 | #else // __cplusplus | |
| 152 | ||
| 153 | /** | |
| 154 | * A literal initializer for an UCX string structure. | |
| 155 | * | |
| 440 | 156 | * The argument MUST be a string (const char*) @em literal. |
| 174 | 157 | * |
| 158 | * @param literal the string literal | |
| 159 | */ | |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
160 | #define CX_STR(literal) ((cxstring){literal, sizeof(literal) - 1}) |
| 174 | 161 | |
| 162 | #endif | |
| 163 | ||
| 164 | ||
| 165 | /** | |
| 166 | * Wraps a mutable string that must be zero-terminated. | |
| 167 | * | |
| 440 | 168 | * The length is implicitly inferred by using a call to @c strlen(). |
| 174 | 169 | * |
| 845 | 170 | * When @c NULL is passed, the length will be set to zero. |
| 171 | * | |
| 440 | 172 | * @note the wrapped string will share the specified pointer to the string. |
| 174 | 173 | * If you do want a copy, use cx_strdup() on the return value of this function. |
| 174 | * | |
| 175 | * If you need to wrap a constant string, use cx_str(). | |
| 176 | * | |
| 845 | 177 | * @param cstring the string to wrap (must be zero-terminated) |
| 174 | 178 | * @return the wrapped string |
| 179 | * | |
| 180 | * @see cx_mutstrn() | |
| 181 | */ | |
| 440 | 182 | cx_attr_nodiscard |
| 183 | cx_attr_cstr_arg(1) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
184 | cx_attr_export |
| 174 | 185 | cxmutstr cx_mutstr(char *cstring); |
| 186 | ||
| 187 | /** | |
| 188 | * Wraps a string that does not need to be zero-terminated. | |
| 189 | * | |
| 440 | 190 | * The argument may be @c NULL if the length is zero. |
| 174 | 191 | * |
| 440 | 192 | * @note the wrapped string will share the specified pointer to the string. |
| 174 | 193 | * If you do want a copy, use cx_strdup() on the return value of this function. |
| 194 | * | |
| 195 | * If you need to wrap a constant string, use cx_strn(). | |
| 196 | * | |
| 440 | 197 | * @param cstring the string to wrap (or @c NULL, only if the length is zero) |
| 174 | 198 | * @param length the length of the string |
| 199 | * @return the wrapped string | |
| 200 | * | |
| 201 | * @see cx_mutstr() | |
| 202 | */ | |
| 440 | 203 | cx_attr_nodiscard |
| 204 | cx_attr_access_rw(1, 2) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
205 | cx_attr_export |
| 174 | 206 | cxmutstr cx_mutstrn( |
| 207 | char *cstring, | |
| 208 | size_t length | |
| 209 | ); | |
| 210 | ||
| 211 | /** | |
| 212 | * Wraps a string that must be zero-terminated. | |
| 213 | * | |
| 440 | 214 | * The length is implicitly inferred by using a call to @c strlen(). |
| 174 | 215 | * |
| 845 | 216 | * When @c NULL is passed, the length will be set to zero. |
| 217 | * | |
| 440 | 218 | * @note the wrapped string will share the specified pointer to the string. |
| 174 | 219 | * If you do want a copy, use cx_strdup() on the return value of this function. |
| 220 | * | |
| 221 | * If you need to wrap a non-constant string, use cx_mutstr(). | |
| 222 | * | |
| 845 | 223 | * @param cstring the string to wrap (must be zero-terminated) |
| 174 | 224 | * @return the wrapped string |
| 225 | * | |
| 226 | * @see cx_strn() | |
| 227 | */ | |
| 440 | 228 | cx_attr_nodiscard |
| 229 | cx_attr_cstr_arg(1) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
230 | cx_attr_export |
| 324 | 231 | cxstring cx_str(const char *cstring); |
| 174 | 232 | |
| 233 | ||
| 234 | /** | |
| 235 | * Wraps a string that does not need to be zero-terminated. | |
| 236 | * | |
| 440 | 237 | * The argument may be @c NULL if the length is zero. |
| 174 | 238 | * |
| 440 | 239 | * @note the wrapped string will share the specified pointer to the string. |
| 174 | 240 | * If you do want a copy, use cx_strdup() on the return value of this function. |
| 241 | * | |
| 242 | * If you need to wrap a non-constant string, use cx_mutstrn(). | |
| 243 | * | |
| 440 | 244 | * @param cstring the string to wrap (or @c NULL, only if the length is zero) |
| 174 | 245 | * @param length the length of the string |
| 246 | * @return the wrapped string | |
| 247 | * | |
| 248 | * @see cx_str() | |
| 249 | */ | |
| 440 | 250 | cx_attr_nodiscard |
| 251 | cx_attr_access_r(1, 2) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
252 | cx_attr_export |
| 174 | 253 | cxstring cx_strn( |
| 324 | 254 | const char *cstring, |
| 174 | 255 | size_t length |
| 256 | ); | |
| 257 | ||
| 440 | 258 | #ifdef __cplusplus |
| 259 | } // extern "C" | |
| 260 | cx_attr_nodiscard | |
| 261 | static inline cxstring cx_strcast(cxmutstr str) { | |
| 262 | return cx_strn(str.ptr, str.length); | |
| 263 | } | |
| 264 | cx_attr_nodiscard | |
| 265 | static inline cxstring cx_strcast(cxstring str) { | |
| 266 | return str; | |
| 267 | } | |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
268 | cx_attr_nodiscard |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
269 | static inline cxstring cx_strcast(const char *str) { |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
270 | return cx_str(str); |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
271 | } |
| 440 | 272 | extern "C" { |
| 273 | #else | |
| 274 | /** | |
| 275 | * Internal function, do not use. | |
| 276 | * @param str | |
| 277 | * @return | |
| 278 | * @see cx_strcast() | |
| 279 | */ | |
| 280 | cx_attr_nodiscard | |
| 281 | static inline cxstring cx_strcast_m(cxmutstr str) { | |
| 282 | return (cxstring) {str.ptr, str.length}; | |
| 283 | } | |
| 284 | /** | |
| 285 | * Internal function, do not use. | |
| 286 | * @param str | |
| 287 | * @return | |
| 288 | * @see cx_strcast() | |
| 289 | */ | |
| 290 | cx_attr_nodiscard | |
| 291 | static inline cxstring cx_strcast_c(cxstring str) { | |
| 292 | return str; | |
| 293 | } | |
| 294 | ||
| 174 | 295 | /** |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
296 | * Internal function, do not use. |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
297 | * @param str |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
298 | * @return |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
299 | * @see cx_strcast() |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
300 | */ |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
301 | cx_attr_nodiscard |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
302 | static inline cxstring cx_strcast_z(const char *str) { |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
303 | return cx_str(str); |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
304 | } |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
305 | |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
306 | /** |
| 845 | 307 | * Wraps any string into an UCX string. |
| 308 | * | |
| 309 | * @param str (any supported string type) the string to cast | |
| 310 | * @return (@c cxstring) the string wrapped as UCX string | |
| 311 | */ | |
| 440 | 312 | #define cx_strcast(str) _Generic((str), \ |
| 313 | cxmutstr: cx_strcast_m, \ | |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
314 | cxstring: cx_strcast_c, \ |
| 845 | 315 | const unsigned char*: cx_strcast_z, \ |
| 316 | unsigned char *: cx_strcast_z, \ | |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
317 | const char*: cx_strcast_z, \ |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
318 | char *: cx_strcast_z) (str) |
| 440 | 319 | #endif |
| 174 | 320 | |
| 321 | /** | |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
322 | * Passes the pointer in this string to the cxDefaultAllocator's @c free() function. |
| 174 | 323 | * |
| 845 | 324 | * The pointer in the struct is set to @c NULL, and the length is set to zero, |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
325 | * which means that this function protects you against double-free. |
| 174 | 326 | * |
| 440 | 327 | * @note There is no implementation for cxstring, because it is unlikely that |
| 324 | 328 | * you ever have a <code>const char*</code> you are really supposed to free. |
| 845 | 329 | * If you encounter such a situation, you should double-check your code. |
| 174 | 330 | * |
| 331 | * @param str the string to free | |
| 332 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
333 | cx_attr_export |
| 174 | 334 | void cx_strfree(cxmutstr *str); |
| 335 | ||
| 336 | /** | |
| 845 | 337 | * Passes the pointer in this string to the allocator's free function. |
| 174 | 338 | * |
| 845 | 339 | * The pointer in the struct is set to @c NULL, and the length is set to zero, |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
340 | * which means that this function protects you against double-free. |
| 174 | 341 | * |
| 440 | 342 | * @note There is no implementation for cxstring, because it is unlikely that |
| 324 | 343 | * you ever have a <code>const char*</code> you are really supposed to free. |
| 845 | 344 | * If you encounter such a situation, you should double-check your code. |
| 174 | 345 | * |
| 346 | * @param alloc the allocator | |
| 347 | * @param str the string to free | |
| 348 | */ | |
| 440 | 349 | cx_attr_nonnull_arg(1) |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
350 | cx_attr_export |
| 174 | 351 | void cx_strfree_a( |
| 324 | 352 | const CxAllocator *alloc, |
| 174 | 353 | cxmutstr *str |
| 354 | ); | |
| 355 | ||
| 356 | /** | |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
357 | * Copies a string. |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
358 | * |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
359 | * The memory in the @p dest structure is either allocated or re-allocated to fit the entire |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
360 | * source string, including a zero-terminator. |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
361 | * |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
362 | * The string in @p dest is guaranteed to be zero-terminated, regardless of whether @p src is. |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
363 | * |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
364 | * @param alloc the allocator |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
365 | * @param dest a pointer to the structure where to copy the contents to |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
366 | * @param src the source string |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
367 | * |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
368 | * @retval zero success |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
369 | * @retval non-zero if re-allocation failed |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
370 | */ |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
371 | cx_attr_nonnull_arg(1) |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
372 | cx_attr_export |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
373 | int cx_strcpy_a( |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
374 | const CxAllocator *alloc, |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
375 | cxmutstr *dest, |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
376 | cxstring src |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
377 | ); |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
378 | |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
379 | |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
380 | /** |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
381 | * Copies a string. |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
382 | * |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
383 | * The memory in the @p dest structure is either allocated or re-allocated to fit the entire |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
384 | * source string, including a zero-terminator. |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
385 | * |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
386 | * The string in @p dest is guaranteed to be zero-terminated, regardless of whether @p src is. |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
387 | * |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
388 | * @param dest (@c cxmutstr*) a pointer to the structure where to copy the contents to |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
389 | * @param src (@c cxstring) the source string |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
390 | * |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
391 | * @retval zero success |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
392 | * @retval non-zero if re-allocation failed |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
393 | */ |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
394 | #define cx_strcpy(dest, src) cx_strcpy_a(cxDefaultAllocator, dest, src) |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
395 | |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
396 | /** |
| 174 | 397 | * Returns the accumulated length of all specified strings. |
| 440 | 398 | * |
| 399 | * If this sum overflows, errno is set to EOVERFLOW. | |
| 174 | 400 | * |
| 440 | 401 | * @attention if the count argument is larger than the number of the |
| 174 | 402 | * specified strings, the behavior is undefined. |
| 403 | * | |
| 404 | * @param count the total number of specified strings | |
| 405 | * @param ... all strings | |
| 406 | * @return the accumulated length of all strings | |
| 407 | */ | |
| 440 | 408 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
409 | cx_attr_export |
| 174 | 410 | size_t cx_strlen( |
| 411 | size_t count, | |
| 412 | ... | |
| 413 | ); | |
| 414 | ||
| 415 | /** | |
| 416 | * Concatenates strings. | |
| 417 | * | |
| 418 | * The resulting string will be allocated by the specified allocator. | |
| 440 | 419 | * So developers @em must pass the return value to cx_strfree_a() eventually. |
| 174 | 420 | * |
| 440 | 421 | * If @p str already contains a string, the memory will be reallocated and |
| 174 | 422 | * the other strings are appended. Otherwise, new memory is allocated. |
| 423 | * | |
| 440 | 424 | * If memory allocation fails, the pointer in the returned string will |
| 425 | * be @c NULL. Depending on the allocator, @c errno might be set. | |
| 426 | * | |
| 427 | * @note It is guaranteed that there is only one allocation for the | |
| 428 | * resulting string. | |
| 174 | 429 | * It is also guaranteed that the returned string is zero-terminated. |
| 430 | * | |
| 431 | * @param alloc the allocator to use | |
| 432 | * @param str the string the other strings shall be concatenated to | |
| 433 | * @param count the number of the other following strings to concatenate | |
| 440 | 434 | * @param ... all other UCX strings |
| 174 | 435 | * @return the concatenated string |
| 436 | */ | |
| 440 | 437 | cx_attr_nodiscard |
| 438 | cx_attr_nonnull | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
439 | cx_attr_export |
| 174 | 440 | cxmutstr cx_strcat_ma( |
| 324 | 441 | const CxAllocator *alloc, |
| 174 | 442 | cxmutstr str, |
| 443 | size_t count, | |
| 444 | ... | |
| 445 | ); | |
| 446 | ||
| 447 | /** | |
| 448 | * Concatenates strings and returns a new string. | |
| 449 | * | |
| 450 | * The resulting string will be allocated by the specified allocator. | |
| 440 | 451 | * So developers @em must pass the return value to cx_strfree_a() eventually. |
| 174 | 452 | * |
| 440 | 453 | * If memory allocation fails, the pointer in the returned string will |
| 454 | * be @c NULL. Depending on the allocator, @c errno might be set. | |
| 455 | * | |
| 456 | * @note It is guaranteed that there is only one allocation for the | |
| 457 | * resulting string. | |
| 174 | 458 | * It is also guaranteed that the returned string is zero-terminated. |
| 459 | * | |
| 440 | 460 | * @param alloc (@c CxAllocator*) the allocator to use |
| 461 | * @param count (@c size_t) the number of the other following strings to concatenate | |
| 462 | * @param ... all other UCX strings | |
| 463 | * @return (@c cxmutstr) the concatenated string | |
| 174 | 464 | */ |
| 465 | #define cx_strcat_a(alloc, count, ...) \ | |
| 466 | cx_strcat_ma(alloc, cx_mutstrn(NULL, 0), count, __VA_ARGS__) | |
| 467 | ||
| 468 | /** | |
| 469 | * Concatenates strings and returns a new string. | |
| 470 | * | |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
471 | * The resulting string will be allocated by the cxDefaultAllocator. |
| 440 | 472 | * So developers @em must pass the return value to cx_strfree() eventually. |
| 174 | 473 | * |
| 440 | 474 | * If memory allocation fails, the pointer in the returned string will |
| 475 | * be @c NULL and @c errno might be set. | |
| 476 | * | |
| 477 | * @note It is guaranteed that there is only one allocation for the | |
| 478 | * resulting string. | |
| 174 | 479 | * It is also guaranteed that the returned string is zero-terminated. |
| 480 | * | |
| 440 | 481 | * @param count (@c size_t) the number of the other following strings to concatenate |
| 482 | * @param ... all other UCX strings | |
| 483 | * @return (@c cxmutstr) the concatenated string | |
| 174 | 484 | */ |
| 485 | #define cx_strcat(count, ...) \ | |
| 486 | cx_strcat_ma(cxDefaultAllocator, cx_mutstrn(NULL, 0), count, __VA_ARGS__) | |
| 487 | ||
| 488 | /** | |
| 489 | * Concatenates strings. | |
| 490 | * | |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
491 | * The resulting string will be allocated by the cxDefaultAllocator. |
| 440 | 492 | * So developers @em must pass the return value to cx_strfree() eventually. |
| 174 | 493 | * |
| 440 | 494 | * If @p str already contains a string, the memory will be reallocated and |
| 174 | 495 | * the other strings are appended. Otherwise, new memory is allocated. |
| 496 | * | |
| 440 | 497 | * If memory allocation fails, the pointer in the returned string will |
| 498 | * be @c NULL and @c errno might be set. | |
| 499 | * | |
| 500 | * @note It is guaranteed that there is only one allocation for the | |
| 501 | * resulting string. | |
| 174 | 502 | * It is also guaranteed that the returned string is zero-terminated. |
| 503 | * | |
| 440 | 504 | * @param str (@c cxmutstr) the string the other strings shall be concatenated to |
| 505 | * @param count (@c size_t) the number of the other following strings to concatenate | |
| 506 | * @param ... all other strings | |
| 507 | * @return (@c cxmutstr) the concatenated string | |
| 174 | 508 | */ |
| 509 | #define cx_strcat_m(str, count, ...) \ | |
| 510 | cx_strcat_ma(cxDefaultAllocator, str, count, __VA_ARGS__) | |
| 511 | ||
| 512 | /** | |
| 513 | * Returns a substring starting at the specified location. | |
| 514 | * | |
| 440 | 515 | * @attention the new string references the same memory area as the |
| 516 | * input string and is usually @em not zero-terminated. | |
| 174 | 517 | * Use cx_strdup() to get a copy. |
| 518 | * | |
| 519 | * @param string input string | |
| 520 | * @param start start location of the substring | |
| 440 | 521 | * @return a substring of @p string starting at @p start |
| 174 | 522 | * |
| 523 | * @see cx_strsubsl() | |
| 524 | * @see cx_strsubs_m() | |
| 525 | * @see cx_strsubsl_m() | |
| 526 | */ | |
| 440 | 527 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
528 | cx_attr_export |
| 174 | 529 | cxstring cx_strsubs( |
| 530 | cxstring string, | |
| 531 | size_t start | |
| 532 | ); | |
| 533 | ||
| 534 | /** | |
| 535 | * Returns a substring starting at the specified location. | |
| 536 | * | |
| 440 | 537 | * The returned string will be limited to @p length bytes or the number |
| 538 | * of bytes available in @p string, whichever is smaller. | |
| 174 | 539 | * |
| 440 | 540 | * @attention the new string references the same memory area as the |
| 541 | * input string and is usually @em not zero-terminated. | |
| 174 | 542 | * Use cx_strdup() to get a copy. |
| 543 | * | |
| 544 | * @param string input string | |
| 545 | * @param start start location of the substring | |
| 546 | * @param length the maximum length of the returned string | |
| 440 | 547 | * @return a substring of @p string starting at @p start |
| 174 | 548 | * |
| 549 | * @see cx_strsubs() | |
| 550 | * @see cx_strsubs_m() | |
| 551 | * @see cx_strsubsl_m() | |
| 552 | */ | |
| 440 | 553 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
554 | cx_attr_export |
| 174 | 555 | cxstring cx_strsubsl( |
| 556 | cxstring string, | |
| 557 | size_t start, | |
| 558 | size_t length | |
| 559 | ); | |
| 560 | ||
| 561 | /** | |
| 562 | * Returns a substring starting at the specified location. | |
| 563 | * | |
| 440 | 564 | * @attention the new string references the same memory area as the |
| 565 | * input string and is usually @em not zero-terminated. | |
| 174 | 566 | * Use cx_strdup() to get a copy. |
| 567 | * | |
| 568 | * @param string input string | |
| 569 | * @param start start location of the substring | |
| 440 | 570 | * @return a substring of @p string starting at @p start |
| 174 | 571 | * |
| 572 | * @see cx_strsubsl_m() | |
| 573 | * @see cx_strsubs() | |
| 574 | * @see cx_strsubsl() | |
| 575 | */ | |
| 440 | 576 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
577 | cx_attr_export |
| 174 | 578 | cxmutstr cx_strsubs_m( |
| 579 | cxmutstr string, | |
| 580 | size_t start | |
| 581 | ); | |
| 582 | ||
| 583 | /** | |
| 584 | * Returns a substring starting at the specified location. | |
| 585 | * | |
| 440 | 586 | * The returned string will be limited to @p length bytes or the number |
| 587 | * of bytes available in @p string, whichever is smaller. | |
| 174 | 588 | * |
| 440 | 589 | * @attention the new string references the same memory area as the |
| 590 | * input string and is usually @em not zero-terminated. | |
| 174 | 591 | * Use cx_strdup() to get a copy. |
| 592 | * | |
| 593 | * @param string input string | |
| 594 | * @param start start location of the substring | |
| 595 | * @param length the maximum length of the returned string | |
| 440 | 596 | * @return a substring of @p string starting at @p start |
| 174 | 597 | * |
| 598 | * @see cx_strsubs_m() | |
| 599 | * @see cx_strsubs() | |
| 600 | * @see cx_strsubsl() | |
| 601 | */ | |
| 440 | 602 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
603 | cx_attr_export |
| 174 | 604 | cxmutstr cx_strsubsl_m( |
| 605 | cxmutstr string, | |
| 606 | size_t start, | |
| 607 | size_t length | |
| 608 | ); | |
| 609 | ||
| 610 | /** | |
| 611 | * Returns a substring starting at the location of the first occurrence of the | |
| 612 | * specified character. | |
| 613 | * | |
| 614 | * If the string does not contain the character, an empty string is returned. | |
| 615 | * | |
| 616 | * @param string the string where to locate the character | |
| 617 | * @param chr the character to locate | |
| 440 | 618 | * @return a substring starting at the first location of @p chr |
| 174 | 619 | * |
| 620 | * @see cx_strchr_m() | |
| 621 | */ | |
| 440 | 622 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
623 | cx_attr_export |
| 174 | 624 | cxstring cx_strchr( |
| 625 | cxstring string, | |
| 626 | int chr | |
| 627 | ); | |
| 628 | ||
| 629 | /** | |
| 630 | * Returns a substring starting at the location of the first occurrence of the | |
| 631 | * specified character. | |
| 632 | * | |
| 633 | * If the string does not contain the character, an empty string is returned. | |
| 634 | * | |
| 635 | * @param string the string where to locate the character | |
| 636 | * @param chr the character to locate | |
| 440 | 637 | * @return a substring starting at the first location of @p chr |
| 174 | 638 | * |
| 639 | * @see cx_strchr() | |
| 640 | */ | |
| 440 | 641 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
642 | cx_attr_export |
| 174 | 643 | cxmutstr cx_strchr_m( |
| 644 | cxmutstr string, | |
| 645 | int chr | |
| 646 | ); | |
| 647 | ||
| 648 | /** | |
| 649 | * Returns a substring starting at the location of the last occurrence of the | |
| 650 | * specified character. | |
| 651 | * | |
| 652 | * If the string does not contain the character, an empty string is returned. | |
| 653 | * | |
| 654 | * @param string the string where to locate the character | |
| 655 | * @param chr the character to locate | |
| 440 | 656 | * @return a substring starting at the last location of @p chr |
| 174 | 657 | * |
| 658 | * @see cx_strrchr_m() | |
| 659 | */ | |
| 440 | 660 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
661 | cx_attr_export |
| 174 | 662 | cxstring cx_strrchr( |
| 663 | cxstring string, | |
| 664 | int chr | |
| 665 | ); | |
| 666 | ||
| 667 | /** | |
| 668 | * Returns a substring starting at the location of the last occurrence of the | |
| 669 | * specified character. | |
| 670 | * | |
| 671 | * If the string does not contain the character, an empty string is returned. | |
| 672 | * | |
| 673 | * @param string the string where to locate the character | |
| 674 | * @param chr the character to locate | |
| 440 | 675 | * @return a substring starting at the last location of @p chr |
| 174 | 676 | * |
| 677 | * @see cx_strrchr() | |
| 678 | */ | |
| 440 | 679 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
680 | cx_attr_export |
| 174 | 681 | cxmutstr cx_strrchr_m( |
| 682 | cxmutstr string, | |
| 683 | int chr | |
| 684 | ); | |
| 685 | ||
| 686 | /** | |
| 687 | * Returns a substring starting at the location of the first occurrence of the | |
| 688 | * specified string. | |
| 689 | * | |
| 440 | 690 | * If @p haystack does not contain @p needle, an empty string is returned. |
| 174 | 691 | * |
| 440 | 692 | * If @p needle is an empty string, the complete @p haystack is |
| 174 | 693 | * returned. |
| 694 | * | |
| 695 | * @param haystack the string to be scanned | |
| 696 | * @param needle string containing the sequence of characters to match | |
| 697 | * @return a substring starting at the first occurrence of | |
| 440 | 698 | * @p needle, or an empty string, if the sequence is not |
| 174 | 699 | * contained |
| 700 | * @see cx_strstr_m() | |
| 701 | */ | |
| 440 | 702 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
703 | cx_attr_export |
| 174 | 704 | cxstring cx_strstr( |
| 705 | cxstring haystack, | |
| 706 | cxstring needle | |
| 707 | ); | |
| 708 | ||
| 709 | /** | |
| 710 | * Returns a substring starting at the location of the first occurrence of the | |
| 711 | * specified string. | |
| 712 | * | |
| 440 | 713 | * If @p haystack does not contain @p needle, an empty string is returned. |
| 174 | 714 | * |
| 440 | 715 | * If @p needle is an empty string, the complete @p haystack is |
| 174 | 716 | * returned. |
| 717 | * | |
| 718 | * @param haystack the string to be scanned | |
| 719 | * @param needle string containing the sequence of characters to match | |
| 720 | * @return a substring starting at the first occurrence of | |
| 440 | 721 | * @p needle, or an empty string, if the sequence is not |
| 174 | 722 | * contained |
| 723 | * @see cx_strstr() | |
| 724 | */ | |
| 440 | 725 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
726 | cx_attr_export |
| 174 | 727 | cxmutstr cx_strstr_m( |
| 728 | cxmutstr haystack, | |
| 729 | cxstring needle | |
| 730 | ); | |
| 731 | ||
| 732 | /** | |
| 733 | * Splits a given string using a delimiter string. | |
| 734 | * | |
| 440 | 735 | * @note The resulting array contains strings that point to the source |
| 736 | * @p string. Use cx_strdup() to get copies. | |
| 174 | 737 | * |
| 738 | * @param string the string to split | |
| 739 | * @param delim the delimiter | |
| 740 | * @param limit the maximum number of split items | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
741 | * @param output a preallocated array of at least @p limit length |
| 174 | 742 | * @return the actual number of split items |
| 743 | */ | |
| 440 | 744 | cx_attr_nodiscard |
| 745 | cx_attr_nonnull | |
| 746 | cx_attr_access_w(4, 3) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
747 | cx_attr_export |
| 174 | 748 | size_t cx_strsplit( |
| 749 | cxstring string, | |
| 750 | cxstring delim, | |
| 751 | size_t limit, | |
| 752 | cxstring *output | |
| 753 | ); | |
| 754 | ||
| 755 | /** | |
| 756 | * Splits a given string using a delimiter string. | |
| 757 | * | |
| 440 | 758 | * The array pointed to by @p output will be allocated by @p allocator. |
| 174 | 759 | * |
| 440 | 760 | * @note The resulting array contains strings that point to the source |
| 761 | * @p string. Use cx_strdup() to get copies. | |
| 174 | 762 | * |
| 440 | 763 | * @attention If allocation fails, the @c NULL pointer will be written to |
| 764 | * @p output and the number returned will be zero. | |
| 174 | 765 | * |
| 766 | * @param allocator the allocator to use for allocating the resulting array | |
| 767 | * @param string the string to split | |
| 768 | * @param delim the delimiter | |
| 769 | * @param limit the maximum number of split items | |
| 770 | * @param output a pointer where the address of the allocated array shall be | |
| 771 | * written to | |
| 772 | * @return the actual number of split items | |
| 773 | */ | |
| 440 | 774 | cx_attr_nodiscard |
| 775 | cx_attr_nonnull | |
| 776 | cx_attr_access_w(5) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
777 | cx_attr_export |
| 174 | 778 | size_t cx_strsplit_a( |
| 324 | 779 | const CxAllocator *allocator, |
| 174 | 780 | cxstring string, |
| 781 | cxstring delim, | |
| 782 | size_t limit, | |
| 783 | cxstring **output | |
| 784 | ); | |
| 785 | ||
| 786 | ||
| 787 | /** | |
| 788 | * Splits a given string using a delimiter string. | |
| 789 | * | |
| 440 | 790 | * @note The resulting array contains strings that point to the source |
| 791 | * @p string. Use cx_strdup() to get copies. | |
| 174 | 792 | * |
| 793 | * @param string the string to split | |
| 794 | * @param delim the delimiter | |
| 795 | * @param limit the maximum number of split items | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
796 | * @param output a preallocated array of at least @p limit length |
| 174 | 797 | * @return the actual number of split items |
| 798 | */ | |
| 440 | 799 | cx_attr_nodiscard |
| 800 | cx_attr_nonnull | |
| 801 | cx_attr_access_w(4, 3) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
802 | cx_attr_export |
| 174 | 803 | size_t cx_strsplit_m( |
| 804 | cxmutstr string, | |
| 805 | cxstring delim, | |
| 806 | size_t limit, | |
| 807 | cxmutstr *output | |
| 808 | ); | |
| 809 | ||
| 810 | /** | |
| 811 | * Splits a given string using a delimiter string. | |
| 812 | * | |
| 440 | 813 | * The array pointed to by @p output will be allocated by @p allocator. |
| 174 | 814 | * |
| 440 | 815 | * @note The resulting array contains strings that point to the source |
| 816 | * @p string. Use cx_strdup() to get copies. | |
| 174 | 817 | * |
| 440 | 818 | * @attention If allocation fails, the @c NULL pointer will be written to |
| 819 | * @p output and the number returned will be zero. | |
| 174 | 820 | * |
| 821 | * @param allocator the allocator to use for allocating the resulting array | |
| 822 | * @param string the string to split | |
| 823 | * @param delim the delimiter | |
| 824 | * @param limit the maximum number of split items | |
| 825 | * @param output a pointer where the address of the allocated array shall be | |
| 826 | * written to | |
| 827 | * @return the actual number of split items | |
| 828 | */ | |
| 440 | 829 | cx_attr_nodiscard |
| 830 | cx_attr_nonnull | |
| 831 | cx_attr_access_w(5) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
832 | cx_attr_export |
| 174 | 833 | size_t cx_strsplit_ma( |
| 324 | 834 | const CxAllocator *allocator, |
| 174 | 835 | cxmutstr string, |
| 836 | cxstring delim, | |
| 837 | size_t limit, | |
| 838 | cxmutstr **output | |
| 839 | ); | |
| 840 | ||
| 841 | /** | |
| 842 | * Compares two strings. | |
| 843 | * | |
| 844 | * @param s1 the first string | |
| 845 | * @param s2 the second string | |
| 440 | 846 | * @return negative if @p s1 is smaller than @p s2, positive if @p s1 is larger |
| 847 | * than @p s2, zero if both strings equal | |
| 174 | 848 | */ |
| 440 | 849 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
850 | cx_attr_export |
| 174 | 851 | int cx_strcmp( |
| 852 | cxstring s1, | |
| 853 | cxstring s2 | |
| 854 | ); | |
| 855 | ||
| 856 | /** | |
| 857 | * Compares two strings ignoring case. | |
| 858 | * | |
| 859 | * @param s1 the first string | |
| 860 | * @param s2 the second string | |
| 440 | 861 | * @return negative if @p s1 is smaller than @p s2, positive if @p s1 is larger |
| 862 | * than @p s2, zero if both strings equal ignoring case | |
| 174 | 863 | */ |
| 440 | 864 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
865 | cx_attr_export |
| 174 | 866 | int cx_strcasecmp( |
| 867 | cxstring s1, | |
| 868 | cxstring s2 | |
| 869 | ); | |
| 870 | ||
| 871 | /** | |
| 872 | * Compares two strings. | |
| 873 | * | |
| 874 | * This function has a compatible signature for the use as a cx_compare_func. | |
| 875 | * | |
| 876 | * @param s1 the first string | |
| 877 | * @param s2 the second string | |
| 440 | 878 | * @return negative if @p s1 is smaller than @p s2, positive if @p s1 is larger |
| 879 | * than @p s2, zero if both strings equal | |
| 174 | 880 | */ |
| 440 | 881 | cx_attr_nodiscard |
| 882 | cx_attr_nonnull | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
883 | cx_attr_export |
| 174 | 884 | int cx_strcmp_p( |
| 324 | 885 | const void *s1, |
| 886 | const void *s2 | |
| 174 | 887 | ); |
| 888 | ||
| 889 | /** | |
| 890 | * Compares two strings ignoring case. | |
| 891 | * | |
| 892 | * This function has a compatible signature for the use as a cx_compare_func. | |
| 893 | * | |
| 894 | * @param s1 the first string | |
| 895 | * @param s2 the second string | |
| 440 | 896 | * @return negative if @p s1 is smaller than @p s2, positive if @p s1 is larger |
| 897 | * than @p s2, zero if both strings equal ignoring case | |
| 174 | 898 | */ |
| 440 | 899 | cx_attr_nodiscard |
| 900 | cx_attr_nonnull | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
901 | cx_attr_export |
| 174 | 902 | int cx_strcasecmp_p( |
| 324 | 903 | const void *s1, |
| 904 | const void *s2 | |
| 174 | 905 | ); |
| 906 | ||
| 907 | ||
| 908 | /** | |
| 909 | * Creates a duplicate of the specified string. | |
| 910 | * | |
| 440 | 911 | * The new string will contain a copy allocated by @p allocator. |
| 174 | 912 | * |
| 440 | 913 | * @note The returned string is guaranteed to be zero-terminated. |
| 174 | 914 | * |
| 915 | * @param allocator the allocator to use | |
| 916 | * @param string the string to duplicate | |
| 917 | * @return a duplicate of the string | |
| 918 | * @see cx_strdup() | |
| 919 | */ | |
| 440 | 920 | cx_attr_nodiscard |
| 921 | cx_attr_nonnull | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
922 | cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
923 | cxmutstr cx_strdup_a_( |
| 324 | 924 | const CxAllocator *allocator, |
| 174 | 925 | cxstring string |
| 926 | ); | |
| 927 | ||
| 928 | /** | |
| 929 | * Creates a duplicate of the specified string. | |
| 930 | * | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
931 | * The new string will contain a copy allocated by @p allocator. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
932 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
933 | * @note The returned string is guaranteed to be zero-terminated. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
934 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
935 | * @param allocator (@c CxAllocator*) the allocator to use |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
936 | * @param string the string to duplicate |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
937 | * @return (@c cxmutstr) a duplicate of the string |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
938 | * @see cx_strdup() |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
939 | * @see cx_strfree_a() |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
940 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
941 | #define cx_strdup_a(allocator, string) \ |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
942 | cx_strdup_a_((allocator), cx_strcast(string)) |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
943 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
944 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
945 | * Creates a duplicate of the specified string. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
946 | * |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
947 | * The new string will contain a copy allocated by the cxDefaultAllocator. |
|
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
948 | * So developers @em must pass the return value to cx_strfree(). |
| 174 | 949 | * |
| 440 | 950 | * @note The returned string is guaranteed to be zero-terminated. |
| 174 | 951 | * |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
952 | * @param string the string to duplicate |
| 440 | 953 | * @return (@c cxmutstr) a duplicate of the string |
| 174 | 954 | * @see cx_strdup_a() |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
955 | * @see cx_strfree() |
| 174 | 956 | */ |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
957 | #define cx_strdup(string) cx_strdup_a(cxDefaultAllocator, string) |
| 174 | 958 | |
| 959 | /** | |
| 960 | * Omits leading and trailing spaces. | |
| 961 | * | |
| 440 | 962 | * @note the returned string references the same memory, thus you |
| 963 | * must @em not free the returned memory. | |
| 174 | 964 | * |
| 965 | * @param string the string that shall be trimmed | |
| 966 | * @return the trimmed string | |
| 967 | */ | |
| 440 | 968 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
969 | cx_attr_export |
| 174 | 970 | cxstring cx_strtrim(cxstring string); |
| 971 | ||
| 972 | /** | |
| 973 | * Omits leading and trailing spaces. | |
| 974 | * | |
| 440 | 975 | * @note the returned string references the same memory, thus you |
| 976 | * must @em not free the returned memory. | |
| 174 | 977 | * |
| 978 | * @param string the string that shall be trimmed | |
| 979 | * @return the trimmed string | |
| 980 | */ | |
| 440 | 981 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
982 | cx_attr_export |
| 174 | 983 | cxmutstr cx_strtrim_m(cxmutstr string); |
| 984 | ||
| 985 | /** | |
| 845 | 986 | * Checks if a string has a specific prefix. |
| 174 | 987 | * |
| 988 | * @param string the string to check | |
| 989 | * @param prefix the prefix the string should have | |
| 440 | 990 | * @return @c true, if and only if the string has the specified prefix, |
| 991 | * @c false otherwise | |
| 174 | 992 | */ |
| 440 | 993 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
994 | cx_attr_export |
| 174 | 995 | bool cx_strprefix( |
| 996 | cxstring string, | |
| 997 | cxstring prefix | |
| 998 | ); | |
| 999 | ||
| 1000 | /** | |
| 845 | 1001 | * Checks if a string has a specific suffix. |
| 174 | 1002 | * |
| 1003 | * @param string the string to check | |
| 1004 | * @param suffix the suffix the string should have | |
| 440 | 1005 | * @return @c true, if and only if the string has the specified suffix, |
| 1006 | * @c false otherwise | |
| 174 | 1007 | */ |
| 440 | 1008 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1009 | cx_attr_export |
| 174 | 1010 | bool cx_strsuffix( |
| 1011 | cxstring string, | |
| 1012 | cxstring suffix | |
| 1013 | ); | |
| 1014 | ||
| 1015 | /** | |
| 845 | 1016 | * Checks if a string has a specific prefix, ignoring the case. |
| 174 | 1017 | * |
| 1018 | * @param string the string to check | |
| 1019 | * @param prefix the prefix the string should have | |
| 440 | 1020 | * @return @c true, if and only if the string has the specified prefix, |
| 1021 | * @c false otherwise | |
| 174 | 1022 | */ |
| 440 | 1023 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1024 | cx_attr_export |
| 174 | 1025 | bool cx_strcaseprefix( |
| 1026 | cxstring string, | |
| 1027 | cxstring prefix | |
| 1028 | ); | |
| 1029 | ||
| 1030 | /** | |
| 1031 | * Checks, if a string has a specific suffix, ignoring the case. | |
| 1032 | * | |
| 1033 | * @param string the string to check | |
| 1034 | * @param suffix the suffix the string should have | |
| 440 | 1035 | * @return @c true, if and only if the string has the specified suffix, |
| 1036 | * @c false otherwise | |
| 174 | 1037 | */ |
| 440 | 1038 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1039 | cx_attr_export |
| 174 | 1040 | bool cx_strcasesuffix( |
| 1041 | cxstring string, | |
| 1042 | cxstring suffix | |
| 1043 | ); | |
| 1044 | ||
| 1045 | /** | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1046 | * Replaces a string with another string. |
| 174 | 1047 | * |
| 845 | 1048 | * The function replaces at most @p replmax occurrences. |
| 174 | 1049 | * |
| 440 | 1050 | * The returned string will be allocated by @p allocator and is guaranteed |
| 174 | 1051 | * to be zero-terminated. |
| 1052 | * | |
| 1053 | * If allocation fails, or the input string is empty, | |
| 1054 | * the returned string will be empty. | |
| 1055 | * | |
| 1056 | * @param allocator the allocator to use | |
| 1057 | * @param str the string where replacements should be applied | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1058 | * @param search the string to search for |
| 174 | 1059 | * @param replacement the replacement string |
| 1060 | * @param replmax maximum number of replacements | |
| 1061 | * @return the resulting string after applying the replacements | |
| 1062 | */ | |
| 440 | 1063 | cx_attr_nodiscard |
| 1064 | cx_attr_nonnull | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1065 | cx_attr_export |
| 174 | 1066 | cxmutstr cx_strreplacen_a( |
| 324 | 1067 | const CxAllocator *allocator, |
| 174 | 1068 | cxstring str, |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1069 | cxstring search, |
| 174 | 1070 | cxstring replacement, |
| 1071 | size_t replmax | |
| 1072 | ); | |
| 1073 | ||
| 1074 | /** | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1075 | * Replaces a string with another string. |
| 174 | 1076 | * |
| 845 | 1077 | * The function replaces at most @p replmax occurrences. |
| 174 | 1078 | * |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
1079 | * The returned string will be allocated by the cxDefaultAllocator and is guaranteed |
| 174 | 1080 | * to be zero-terminated. |
| 1081 | * | |
| 1082 | * If allocation fails, or the input string is empty, | |
| 1083 | * the returned string will be empty. | |
| 1084 | * | |
| 440 | 1085 | * @param str (@c cxstring) the string where replacements should be applied |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1086 | * @param search (@c cxstring) the string to search for |
| 440 | 1087 | * @param replacement (@c cxstring) the replacement string |
| 1088 | * @param replmax (@c size_t) maximum number of replacements | |
| 1089 | * @return (@c cxmutstr) the resulting string after applying the replacements | |
| 174 | 1090 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1091 | #define cx_strreplacen(str, search, replacement, replmax) \ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1092 | cx_strreplacen_a(cxDefaultAllocator, str, search, replacement, replmax) |
| 174 | 1093 | |
| 1094 | /** | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1095 | * Replaces a string with another string. |
| 174 | 1096 | * |
| 440 | 1097 | * The returned string will be allocated by @p allocator and is guaranteed |
| 174 | 1098 | * to be zero-terminated. |
| 1099 | * | |
| 1100 | * If allocation fails, or the input string is empty, | |
| 1101 | * the returned string will be empty. | |
| 1102 | * | |
| 440 | 1103 | * @param allocator (@c CxAllocator*) the allocator to use |
| 1104 | * @param str (@c cxstring) the string where replacements should be applied | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1105 | * @param search (@c cxstring) the string to search for |
| 440 | 1106 | * @param replacement (@c cxstring) the replacement string |
| 1107 | * @return (@c cxmutstr) the resulting string after applying the replacements | |
| 174 | 1108 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1109 | #define cx_strreplace_a(allocator, str, search, replacement) \ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1110 | cx_strreplacen_a(allocator, str, search, replacement, SIZE_MAX) |
| 174 | 1111 | |
| 1112 | /** | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1113 | * Replaces a string with another string. |
| 174 | 1114 | * |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
1115 | * The returned string will be allocated by the cxDefaultAllocator and is guaranteed |
| 174 | 1116 | * to be zero-terminated. |
| 1117 | * | |
| 1118 | * If allocation fails, or the input string is empty, | |
| 1119 | * the returned string will be empty. | |
| 1120 | * | |
| 440 | 1121 | * @param str (@c cxstring) the string where replacements should be applied |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1122 | * @param search (@c cxstring) the string to search for |
| 440 | 1123 | * @param replacement (@c cxstring) the replacement string |
| 1124 | * @return (@c cxmutstr) the resulting string after applying the replacements | |
| 174 | 1125 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1126 | #define cx_strreplace(str, search, replacement) \ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1127 | cx_strreplacen_a(cxDefaultAllocator, str, search, replacement, SIZE_MAX) |
| 174 | 1128 | |
| 1129 | /** | |
| 1130 | * Creates a string tokenization context. | |
| 1131 | * | |
| 1132 | * @param str the string to tokenize | |
| 1133 | * @param delim the delimiter (must not be empty) | |
| 1134 | * @param limit the maximum number of tokens that shall be returned | |
| 1135 | * @return a new string tokenization context | |
| 1136 | */ | |
| 440 | 1137 | cx_attr_nodiscard |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1138 | cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1139 | CxStrtokCtx cx_strtok_( |
| 174 | 1140 | cxstring str, |
| 1141 | cxstring delim, | |
| 1142 | size_t limit | |
| 1143 | ); | |
| 1144 | ||
| 1145 | /** | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1146 | * Creates a string tokenization context. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1147 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1148 | * @param str the string to tokenize |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1149 | * @param delim the delimiter string (must not be empty) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1150 | * @param limit (@c size_t) the maximum number of tokens that shall be returned |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1151 | * @return (@c CxStrtokCtx) a new string tokenization context |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1152 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1153 | #define cx_strtok(str, delim, limit) \ |
|
629
0385a450c2a6
add list initializer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
471
diff
changeset
|
1154 | cx_strtok_(cx_strcast(str), cx_strcast(delim), (limit)) |
| 174 | 1155 | |
| 1156 | /** | |
| 1157 | * Returns the next token. | |
| 1158 | * | |
| 1159 | * The token will point to the source string. | |
| 1160 | * | |
| 1161 | * @param ctx the tokenization context | |
| 1162 | * @param token a pointer to memory where the next token shall be stored | |
| 1163 | * @return true if successful, false if the limit or the end of the string | |
| 1164 | * has been reached | |
| 1165 | */ | |
| 440 | 1166 | cx_attr_nonnull |
| 1167 | cx_attr_nodiscard | |
| 1168 | cx_attr_access_w(2) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1169 | cx_attr_export |
| 174 | 1170 | bool cx_strtok_next( |
| 1171 | CxStrtokCtx *ctx, | |
| 1172 | cxstring *token | |
| 1173 | ); | |
| 1174 | ||
| 1175 | /** | |
| 1176 | * Returns the next token of a mutable string. | |
| 1177 | * | |
| 1178 | * The token will point to the source string. | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1179 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1180 | * @attention |
| 174 | 1181 | * If the context was not initialized over a mutable string, modifying |
| 1182 | * the data of the returned token is undefined behavior. | |
| 1183 | * | |
| 1184 | * @param ctx the tokenization context | |
| 1185 | * @param token a pointer to memory where the next token shall be stored | |
| 1186 | * @return true if successful, false if the limit or the end of the string | |
| 1187 | * has been reached | |
| 1188 | */ | |
| 440 | 1189 | cx_attr_nonnull |
| 1190 | cx_attr_nodiscard | |
| 1191 | cx_attr_access_w(2) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1192 | cx_attr_export |
| 174 | 1193 | bool cx_strtok_next_m( |
| 1194 | CxStrtokCtx *ctx, | |
| 1195 | cxmutstr *token | |
| 1196 | ); | |
| 1197 | ||
| 1198 | /** | |
| 1199 | * Defines an array of more delimiters for the specified tokenization context. | |
| 1200 | * | |
| 1201 | * @param ctx the tokenization context | |
| 1202 | * @param delim array of more delimiters | |
| 1203 | * @param count number of elements in the array | |
| 1204 | */ | |
| 440 | 1205 | cx_attr_nonnull |
| 1206 | cx_attr_access_r(2, 3) | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1207 | cx_attr_export |
| 174 | 1208 | void cx_strtok_delim( |
| 1209 | CxStrtokCtx *ctx, | |
| 324 | 1210 | const cxstring *delim, |
| 174 | 1211 | size_t count |
| 1212 | ); | |
| 1213 | ||
| 440 | 1214 | /* ------------------------------------------------------------------------- * |
| 1215 | * string to number conversion functions * | |
| 1216 | * ------------------------------------------------------------------------- */ | |
| 1217 | ||
| 1218 | /** | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1219 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1220 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1221 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1222 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1223 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1224 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1225 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1226 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1227 | * @param base 2, 8, 10, or 16 |
| 845 | 1228 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1229 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1230 | * @retval non-zero conversion was not possible |
| 440 | 1231 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1232 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1233 | int cx_strtos_lc_(cxstring str, short *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1234 | |
| 440 | 1235 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1236 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1237 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1238 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1239 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1240 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1241 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1242 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1243 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1244 | * @param base 2, 8, 10, or 16 |
| 845 | 1245 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1246 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1247 | * @retval non-zero conversion was not possible |
| 440 | 1248 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1249 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1250 | int cx_strtoi_lc_(cxstring str, int *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1251 | |
| 440 | 1252 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1253 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1254 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1255 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1256 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1257 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1258 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1259 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1260 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1261 | * @param base 2, 8, 10, or 16 |
| 845 | 1262 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1263 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1264 | * @retval non-zero conversion was not possible |
| 440 | 1265 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1266 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1267 | int cx_strtol_lc_(cxstring str, long *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1268 | |
| 440 | 1269 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1270 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1271 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1272 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1273 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1274 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1275 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1276 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1277 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1278 | * @param base 2, 8, 10, or 16 |
| 845 | 1279 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1280 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1281 | * @retval non-zero conversion was not possible |
| 440 | 1282 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1283 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1284 | int cx_strtoll_lc_(cxstring str, long long *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1285 | |
| 440 | 1286 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1287 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1288 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1289 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1290 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1291 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1292 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1293 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1294 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1295 | * @param base 2, 8, 10, or 16 |
| 845 | 1296 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1297 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1298 | * @retval non-zero conversion was not possible |
| 440 | 1299 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1300 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1301 | int cx_strtoi8_lc_(cxstring str, int8_t *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1302 | |
| 440 | 1303 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1304 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1305 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1306 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1307 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1308 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1309 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1310 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1311 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1312 | * @param base 2, 8, 10, or 16 |
| 845 | 1313 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1314 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1315 | * @retval non-zero conversion was not possible |
| 440 | 1316 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1317 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1318 | int cx_strtoi16_lc_(cxstring str, int16_t *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1319 | |
| 440 | 1320 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1321 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1322 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1323 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1324 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1325 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1326 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1327 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1328 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1329 | * @param base 2, 8, 10, or 16 |
| 845 | 1330 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1331 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1332 | * @retval non-zero conversion was not possible |
| 440 | 1333 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1334 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1335 | int cx_strtoi32_lc_(cxstring str, int32_t *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1336 | |
| 440 | 1337 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1338 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1339 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1340 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1341 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1342 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1343 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1344 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1345 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1346 | * @param base 2, 8, 10, or 16 |
| 845 | 1347 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1348 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1349 | * @retval non-zero conversion was not possible |
| 440 | 1350 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1351 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1352 | int cx_strtoi64_lc_(cxstring str, int64_t *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1353 | |
| 440 | 1354 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1355 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1356 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1357 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1358 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1359 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1360 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1361 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1362 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1363 | * @param base 2, 8, 10, or 16 |
| 845 | 1364 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1365 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1366 | * @retval non-zero conversion was not possible |
| 440 | 1367 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1368 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1369 | int cx_strtous_lc_(cxstring str, unsigned short *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1370 | |
| 440 | 1371 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1372 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1373 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1374 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1375 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1376 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1377 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1378 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1379 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1380 | * @param base 2, 8, 10, or 16 |
| 845 | 1381 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1382 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1383 | * @retval non-zero conversion was not possible |
| 440 | 1384 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1385 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1386 | int cx_strtou_lc_(cxstring str, unsigned int *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1387 | |
| 440 | 1388 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1389 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1390 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1391 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1392 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1393 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1394 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1395 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1396 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1397 | * @param base 2, 8, 10, or 16 |
| 845 | 1398 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1399 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1400 | * @retval non-zero conversion was not possible |
| 440 | 1401 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1402 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1403 | int cx_strtoul_lc_(cxstring str, unsigned long *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1404 | |
| 440 | 1405 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1406 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1407 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1408 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1409 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1410 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1411 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1412 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1413 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1414 | * @param base 2, 8, 10, or 16 |
| 845 | 1415 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1416 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1417 | * @retval non-zero conversion was not possible |
| 440 | 1418 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1419 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1420 | int cx_strtoull_lc_(cxstring str, unsigned long long *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1421 | |
| 440 | 1422 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1423 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1424 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1425 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1426 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1427 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1428 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1429 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1430 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1431 | * @param base 2, 8, 10, or 16 |
| 845 | 1432 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1433 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1434 | * @retval non-zero conversion was not possible |
| 440 | 1435 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1436 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1437 | int cx_strtou8_lc_(cxstring str, uint8_t *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1438 | |
| 440 | 1439 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1440 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1441 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1442 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1443 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1444 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1445 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1446 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1447 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1448 | * @param base 2, 8, 10, or 16 |
| 845 | 1449 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1450 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1451 | * @retval non-zero conversion was not possible |
| 440 | 1452 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1453 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1454 | int cx_strtou16_lc_(cxstring str, uint16_t *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1455 | |
| 440 | 1456 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1457 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1458 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1459 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1460 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1461 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1462 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1463 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1464 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1465 | * @param base 2, 8, 10, or 16 |
| 845 | 1466 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1467 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1468 | * @retval non-zero conversion was not possible |
| 440 | 1469 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1470 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1471 | int cx_strtou32_lc_(cxstring str, uint32_t *output, int base, const char *groupsep); |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1472 | |
| 440 | 1473 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1474 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1475 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1476 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1477 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1478 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1479 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1480 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1481 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1482 | * @param base 2, 8, 10, or 16 |
| 845 | 1483 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1484 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1485 | * @retval non-zero conversion was not possible |
| 440 | 1486 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1487 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1488 | int cx_strtou64_lc_(cxstring str, uint64_t *output, int base, const char *groupsep); |
| 440 | 1489 | |
| 1490 | /** | |
| 1491 | * Converts a string to a number. | |
| 1492 | * | |
| 1493 | * The function returns non-zero when conversion is not possible. | |
| 1494 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. | |
| 1495 | * It sets errno to ERANGE when the target datatype is too small. | |
| 1496 | * | |
| 1497 | * @param str the string to convert | |
| 1498 | * @param output a pointer to the integer variable where the result shall be stored | |
| 1499 | * @param base 2, 8, 10, or 16 | |
| 845 | 1500 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
| 440 | 1501 | * @retval zero success |
| 1502 | * @retval non-zero conversion was not possible | |
| 1503 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1504 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1505 | int cx_strtoz_lc_(cxstring str, size_t *output, int base, const char *groupsep); |
| 440 | 1506 | |
| 1507 | /** | |
| 845 | 1508 | * Converts a string to a single precision floating-point number. |
| 440 | 1509 | * |
| 1510 | * The function returns non-zero when conversion is not possible. | |
| 1511 | * In that case the function sets errno to EINVAL when the reason is an invalid character. | |
| 1512 | * It sets errno to ERANGE when the necessary representation would exceed the limits defined in libc's float.h. | |
| 1513 | * | |
| 1514 | * @param str the string to convert | |
| 1515 | * @param output a pointer to the float variable where the result shall be stored | |
| 1516 | * @param decsep the decimal separator | |
| 845 | 1517 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
| 440 | 1518 | * @retval zero success |
| 1519 | * @retval non-zero conversion was not possible | |
| 1520 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1521 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1522 | int cx_strtof_lc_(cxstring str, float *output, char decsep, const char *groupsep); |
| 440 | 1523 | |
| 1524 | /** | |
| 845 | 1525 | * Converts a string to a double precision floating-point number. |
| 440 | 1526 | * |
| 1527 | * The function returns non-zero when conversion is not possible. | |
| 1528 | * In that case the function sets errno to EINVAL when the reason is an invalid character. | |
| 1529 | * It sets errno to ERANGE when the necessary representation would exceed the limits defined in libc's float.h. | |
| 1530 | * | |
| 1531 | * @param str the string to convert | |
| 1532 | * @param output a pointer to the float variable where the result shall be stored | |
| 1533 | * @param decsep the decimal separator | |
| 845 | 1534 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
| 440 | 1535 | * @retval zero success |
| 1536 | * @retval non-zero conversion was not possible | |
| 1537 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1538 | cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1539 | int cx_strtod_lc_(cxstring str, double *output, char decsep, const char *groupsep); |
| 440 | 1540 | |
| 1541 | /** | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1542 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1543 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1544 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1545 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1546 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1547 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1548 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1549 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1550 | * @param base 2, 8, 10, or 16 |
| 845 | 1551 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1552 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1553 | * @retval non-zero conversion was not possible |
| 440 | 1554 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1555 | #define cx_strtos_lc(str, output, base, groupsep) cx_strtos_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1556 | |
| 440 | 1557 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1558 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1559 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1560 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1561 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1562 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1563 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1564 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1565 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1566 | * @param base 2, 8, 10, or 16 |
| 845 | 1567 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1568 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1569 | * @retval non-zero conversion was not possible |
| 440 | 1570 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1571 | #define cx_strtoi_lc(str, output, base, groupsep) cx_strtoi_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1572 | |
| 440 | 1573 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1574 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1575 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1576 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1577 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1578 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1579 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1580 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1581 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1582 | * @param base 2, 8, 10, or 16 |
| 845 | 1583 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1584 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1585 | * @retval non-zero conversion was not possible |
| 440 | 1586 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1587 | #define cx_strtol_lc(str, output, base, groupsep) cx_strtol_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1588 | |
| 440 | 1589 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1590 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1591 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1592 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1593 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1594 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1595 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1596 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1597 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1598 | * @param base 2, 8, 10, or 16 |
| 845 | 1599 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1600 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1601 | * @retval non-zero conversion was not possible |
| 440 | 1602 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1603 | #define cx_strtoll_lc(str, output, base, groupsep) cx_strtoll_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1604 | |
| 440 | 1605 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1606 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1607 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1608 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1609 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1610 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1611 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1612 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1613 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1614 | * @param base 2, 8, 10, or 16 |
| 845 | 1615 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1616 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1617 | * @retval non-zero conversion was not possible |
| 440 | 1618 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1619 | #define cx_strtoi8_lc(str, output, base, groupsep) cx_strtoi8_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1620 | |
| 440 | 1621 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1622 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1623 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1624 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1625 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1626 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1627 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1628 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1629 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1630 | * @param base 2, 8, 10, or 16 |
| 845 | 1631 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1632 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1633 | * @retval non-zero conversion was not possible |
| 440 | 1634 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1635 | #define cx_strtoi16_lc(str, output, base, groupsep) cx_strtoi16_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1636 | |
| 440 | 1637 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1638 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1639 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1640 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1641 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1642 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1643 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1644 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1645 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1646 | * @param base 2, 8, 10, or 16 |
| 845 | 1647 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1648 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1649 | * @retval non-zero conversion was not possible |
| 440 | 1650 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1651 | #define cx_strtoi32_lc(str, output, base, groupsep) cx_strtoi32_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1652 | |
| 440 | 1653 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1654 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1655 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1656 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1657 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1658 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1659 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1660 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1661 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1662 | * @param base 2, 8, 10, or 16 |
| 845 | 1663 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1664 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1665 | * @retval non-zero conversion was not possible |
| 440 | 1666 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1667 | #define cx_strtoi64_lc(str, output, base, groupsep) cx_strtoi64_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1668 | |
| 440 | 1669 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1670 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1671 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1672 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1673 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1674 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1675 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1676 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1677 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1678 | * @param base 2, 8, 10, or 16 |
| 845 | 1679 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1680 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1681 | * @retval non-zero conversion was not possible |
| 440 | 1682 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1683 | #define cx_strtous_lc(str, output, base, groupsep) cx_strtous_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1684 | |
| 440 | 1685 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1686 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1687 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1688 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1689 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1690 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1691 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1692 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1693 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1694 | * @param base 2, 8, 10, or 16 |
| 845 | 1695 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1696 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1697 | * @retval non-zero conversion was not possible |
| 440 | 1698 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1699 | #define cx_strtou_lc(str, output, base, groupsep) cx_strtou_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1700 | |
| 440 | 1701 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1702 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1703 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1704 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1705 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1706 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1707 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1708 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1709 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1710 | * @param base 2, 8, 10, or 16 |
| 845 | 1711 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1712 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1713 | * @retval non-zero conversion was not possible |
| 440 | 1714 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1715 | #define cx_strtoul_lc(str, output, base, groupsep) cx_strtoul_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1716 | |
| 440 | 1717 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1718 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1719 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1720 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1721 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1722 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1723 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1724 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1725 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1726 | * @param base 2, 8, 10, or 16 |
| 845 | 1727 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1728 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1729 | * @retval non-zero conversion was not possible |
| 440 | 1730 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1731 | #define cx_strtoull_lc(str, output, base, groupsep) cx_strtoull_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1732 | |
| 440 | 1733 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1734 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1735 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1736 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1737 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1738 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1739 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1740 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1741 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1742 | * @param base 2, 8, 10, or 16 |
| 845 | 1743 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1744 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1745 | * @retval non-zero conversion was not possible |
| 440 | 1746 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1747 | #define cx_strtou8_lc(str, output, base, groupsep) cx_strtou8_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1748 | |
| 440 | 1749 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1750 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1751 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1752 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1753 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1754 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1755 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1756 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1757 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1758 | * @param base 2, 8, 10, or 16 |
| 845 | 1759 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1760 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1761 | * @retval non-zero conversion was not possible |
| 440 | 1762 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1763 | #define cx_strtou16_lc(str, output, base, groupsep) cx_strtou16_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1764 | |
| 440 | 1765 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1766 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1767 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1768 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1769 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1770 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1771 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1772 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1773 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1774 | * @param base 2, 8, 10, or 16 |
| 845 | 1775 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1776 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1777 | * @retval non-zero conversion was not possible |
| 440 | 1778 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1779 | #define cx_strtou32_lc(str, output, base, groupsep) cx_strtou32_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1780 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1781 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1782 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1783 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1784 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1785 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1786 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1787 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1788 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1789 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1790 | * @param base 2, 8, 10, or 16 |
| 845 | 1791 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1792 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1793 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1794 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1795 | #define cx_strtou64_lc(str, output, base, groupsep) cx_strtou64_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1796 | |
| 440 | 1797 | /** |
| 1798 | * Converts a string to a number. | |
| 1799 | * | |
| 1800 | * The function returns non-zero when conversion is not possible. | |
| 1801 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. | |
| 1802 | * It sets errno to ERANGE when the target datatype is too small. | |
| 1803 | * | |
| 1804 | * @param str the string to convert | |
| 1805 | * @param output a pointer to the integer variable where the result shall be stored | |
| 1806 | * @param base 2, 8, 10, or 16 | |
| 845 | 1807 | * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1808 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1809 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1810 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1811 | #define cx_strtoz_lc(str, output, base, groupsep) cx_strtoz_lc_(cx_strcast(str), output, base, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1812 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1813 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1814 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1815 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1816 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1817 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1818 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1819 | * |
| 845 | 1820 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1821 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1822 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1823 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1824 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1825 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1826 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1827 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1828 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1829 | #define cx_strtos(str, output, base) cx_strtos_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1830 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1831 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1832 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1833 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1834 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1835 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1836 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1837 | * |
| 845 | 1838 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1839 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1840 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1841 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1842 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1843 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1844 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1845 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1846 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1847 | #define cx_strtoi(str, output, base) cx_strtoi_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1848 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1849 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1850 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1851 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1852 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1853 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1854 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1855 | * |
| 845 | 1856 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1857 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1858 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1859 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1860 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1861 | * @param base 2, 8, 10, or 16 |
| 440 | 1862 | * @retval zero success |
| 1863 | * @retval non-zero conversion was not possible | |
| 1864 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1865 | #define cx_strtol(str, output, base) cx_strtol_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1866 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1867 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1868 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1869 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1870 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1871 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1872 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1873 | * |
| 845 | 1874 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1875 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1876 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1877 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1878 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1879 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1880 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1881 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1882 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1883 | #define cx_strtoll(str, output, base) cx_strtoll_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1884 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1885 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1886 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1887 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1888 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1889 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1890 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1891 | * |
| 845 | 1892 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1893 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1894 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1895 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1896 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1897 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1898 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1899 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1900 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1901 | #define cx_strtoi8(str, output, base) cx_strtoi8_lc_(cx_strcast(str), output, base, ",") |
| 440 | 1902 | |
| 1903 | /** | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1904 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1905 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1906 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1907 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1908 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1909 | * |
| 845 | 1910 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1911 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1912 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1913 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1914 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1915 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1916 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1917 | * @retval non-zero conversion was not possible |
| 440 | 1918 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1919 | #define cx_strtoi16(str, output, base) cx_strtoi16_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1920 | |
| 440 | 1921 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1922 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1923 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1924 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1925 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1926 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1927 | * |
| 845 | 1928 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1929 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1930 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1931 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1932 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1933 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1934 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1935 | * @retval non-zero conversion was not possible |
| 440 | 1936 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1937 | #define cx_strtoi32(str, output, base) cx_strtoi32_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1938 | |
| 440 | 1939 | /** |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1940 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1941 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1942 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1943 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1944 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1945 | * |
| 845 | 1946 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1947 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1948 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1949 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1950 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1951 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1952 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1953 | * @retval non-zero conversion was not possible |
| 440 | 1954 | */ |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1955 | #define cx_strtoi64(str, output, base) cx_strtoi64_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1956 | |
| 440 | 1957 | /** |
| 1958 | * Converts a string to a number. | |
| 1959 | * | |
| 1960 | * The function returns non-zero when conversion is not possible. | |
| 1961 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. | |
| 1962 | * It sets errno to ERANGE when the target datatype is too small. | |
| 1963 | * | |
| 845 | 1964 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1965 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1966 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1967 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1968 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1969 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1970 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1971 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1972 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1973 | #define cx_strtoz(str, output, base) cx_strtoz_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1974 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1975 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1976 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1977 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1978 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1979 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1980 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1981 | * |
| 845 | 1982 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1983 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1984 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1985 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1986 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1987 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1988 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1989 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1990 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1991 | #define cx_strtous(str, output, base) cx_strtous_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1992 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1993 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1994 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1995 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1996 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1997 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1998 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
1999 | * |
| 845 | 2000 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2001 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2002 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2003 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2004 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2005 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2006 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2007 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2008 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2009 | #define cx_strtou(str, output, base) cx_strtou_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2010 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2011 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2012 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2013 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2014 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2015 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2016 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2017 | * |
| 845 | 2018 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2019 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
| 440 | 2020 | * |
| 2021 | * @param str the string to convert | |
| 2022 | * @param output a pointer to the integer variable where the result shall be stored | |
| 2023 | * @param base 2, 8, 10, or 16 | |
| 2024 | * @retval zero success | |
| 2025 | * @retval non-zero conversion was not possible | |
| 2026 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2027 | #define cx_strtoul(str, output, base) cx_strtoul_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2028 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2029 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2030 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2031 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2032 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2033 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2034 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2035 | * |
| 845 | 2036 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2037 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2038 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2039 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2040 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2041 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2042 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2043 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2044 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2045 | #define cx_strtoull(str, output, base) cx_strtoull_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2046 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2047 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2048 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2049 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2050 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2051 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2052 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2053 | * |
| 845 | 2054 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2055 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2056 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2057 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2058 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2059 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2060 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2061 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2062 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2063 | #define cx_strtou8(str, output, base) cx_strtou8_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2064 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2065 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2066 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2067 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2068 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2069 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2070 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2071 | * |
| 845 | 2072 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2073 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2074 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2075 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2076 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2077 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2078 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2079 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2080 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2081 | #define cx_strtou16(str, output, base) cx_strtou16_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2082 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2083 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2084 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2085 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2086 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2087 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2088 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2089 | * |
| 845 | 2090 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2091 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2092 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2093 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2094 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2095 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2096 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2097 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2098 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2099 | #define cx_strtou32(str, output, base) cx_strtou32_lc_(cx_strcast(str), output, base, ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2100 | |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2101 | /** |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2102 | * Converts a string to a number. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2103 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2104 | * The function returns non-zero when conversion is not possible. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2105 | * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2106 | * It sets errno to ERANGE when the target datatype is too small. |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2107 | * |
| 845 | 2108 | * The comma character is treated as a group separator and ignored during parsing. |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2109 | * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()). |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2110 | * |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2111 | * @param str the string to convert |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2112 | * @param output a pointer to the integer variable where the result shall be stored |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2113 | * @param base 2, 8, 10, or 16 |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2114 | * @retval zero success |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2115 | * @retval non-zero conversion was not possible |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2116 | */ |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2117 | #define cx_strtou64(str, output, base) cx_strtou64_lc_(cx_strcast(str), output, base, ",") |
| 440 | 2118 | |
| 2119 | /** | |
| 845 | 2120 | * Converts a string to a single precision floating-point number. |
| 440 | 2121 | * |
| 2122 | * The function returns non-zero when conversion is not possible. | |
| 2123 | * In that case the function sets errno to EINVAL when the reason is an invalid character. | |
| 2124 | * It sets errno to ERANGE when the necessary representation would exceed the limits defined in libc's float.h. | |
| 2125 | * | |
| 2126 | * @param str the string to convert | |
| 2127 | * @param output a pointer to the float variable where the result shall be stored | |
| 2128 | * @param decsep the decimal separator | |
| 845 | 2129 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
| 440 | 2130 | * @retval zero success |
| 2131 | * @retval non-zero conversion was not possible | |
| 2132 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2133 | #define cx_strtof_lc(str, output, decsep, groupsep) cx_strtof_lc_(cx_strcast(str), output, decsep, groupsep) |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2134 | |
| 440 | 2135 | /** |
| 845 | 2136 | * Converts a string to a double precision floating-point number. |
| 440 | 2137 | * |
| 2138 | * The function returns non-zero when conversion is not possible. | |
| 2139 | * In that case the function sets errno to EINVAL when the reason is an invalid character. | |
| 2140 | * | |
| 2141 | * @param str the string to convert | |
| 2142 | * @param output a pointer to the double variable where the result shall be stored | |
| 2143 | * @param decsep the decimal separator | |
| 845 | 2144 | * @param groupsep each character in this string is treated as a group separator and ignored during conversion |
| 440 | 2145 | * @retval zero success |
| 2146 | * @retval non-zero conversion was not possible | |
| 2147 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2148 | #define cx_strtod_lc(str, output, decsep, groupsep) cx_strtod_lc_(cx_strcast(str), output, decsep, groupsep) |
| 440 | 2149 | |
| 2150 | /** | |
| 845 | 2151 | * Converts a string to a single precision floating-point number. |
| 440 | 2152 | * |
| 2153 | * The function returns non-zero when conversion is not possible. | |
| 2154 | * In that case the function sets errno to EINVAL when the reason is an invalid character. | |
| 2155 | * It sets errno to ERANGE when the necessary representation would exceed the limits defined in libc's float.h. | |
| 2156 | * | |
| 2157 | * The decimal separator is assumed to be a dot character. | |
| 845 | 2158 | * The comma character is treated as a group separator and ignored during parsing. |
| 440 | 2159 | * If you want to choose a different format, use cx_strtof_lc(). |
| 2160 | * | |
| 2161 | * @param str the string to convert | |
| 2162 | * @param output a pointer to the float variable where the result shall be stored | |
| 2163 | * @retval zero success | |
| 2164 | * @retval non-zero conversion was not possible | |
| 2165 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2166 | #define cx_strtof(str, output) cx_strtof_lc_(cx_strcast(str), output, '.', ",") |
|
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2167 | |
| 440 | 2168 | /** |
| 845 | 2169 | * Converts a string to a double precision floating-point number. |
| 440 | 2170 | * |
| 2171 | * The function returns non-zero when conversion is not possible. | |
| 2172 | * In that case the function sets errno to EINVAL when the reason is an invalid character. | |
| 2173 | * | |
| 2174 | * The decimal separator is assumed to be a dot character. | |
| 845 | 2175 | * The comma character is treated as a group separator and ignored during parsing. |
| 440 | 2176 | * If you want to choose a different format, use cx_strtof_lc(). |
| 2177 | * | |
| 2178 | * @param str the string to convert | |
| 2179 | * @param output a pointer to the double variable where the result shall be stored | |
| 2180 | * @retval zero success | |
| 2181 | * @retval non-zero conversion was not possible | |
| 2182 | */ | |
|
471
063a9f29098c
ucx update + fix doc attach/detach + fix ui_set with unbound values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
440
diff
changeset
|
2183 | #define cx_strtod(str, output) cx_strtod_lc_(cx_strcast(str), output, '.', ",") |
| 174 | 2184 | |
| 2185 | #ifdef __cplusplus | |
| 2186 | } // extern "C" | |
| 2187 | #endif | |
| 2188 | ||
| 2189 | #endif //UCX_STRING_H |