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