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