Wed, 16 May 2018 14:02:59 +0200
adds remaining documentation for the scstr functions
src/string.c | file | annotate | diff | comparison | revisions | |
src/ucx/string.h | file | annotate | diff | comparison | revisions |
1.1 --- a/src/string.c Wed May 16 13:13:33 2018 +0200 1.2 +++ b/src/string.c Wed May 16 14:02:59 2018 +0200 1.3 @@ -201,8 +201,8 @@ 1.4 return ret; 1.5 } 1.6 1.7 -scstr_t scstrsubs(scstr_t s, size_t start) { 1.8 - return scstrsubsl (s, start, s.length-start); 1.9 +scstr_t scstrsubs(scstr_t string, size_t start) { 1.10 + return scstrsubsl(string, start, string.length-start); 1.11 } 1.12 1.13 scstr_t scstrsubsl(scstr_t s, size_t start, size_t length) { 1.14 @@ -215,9 +215,9 @@ 1.15 } 1.16 1.17 1.18 -int ucx_strchr(const char *string, size_t length, int chr, size_t *pos) { 1.19 +static int ucx_strchr(const char *str, size_t length, int chr, size_t *pos) { 1.20 for(size_t i=0;i<length;i++) { 1.21 - if(string[i] == chr) { 1.22 + if(str[i] == chr) { 1.23 *pos = i; 1.24 return 1; 1.25 } 1.26 @@ -225,10 +225,10 @@ 1.27 return 0; 1.28 } 1.29 1.30 -int ucx_strrchr(const char *string, size_t length, int chr, size_t *pos) { 1.31 +static int ucx_strrchr(const char *str, size_t length, int chr, size_t *pos) { 1.32 if(length > 0) { 1.33 for(size_t i=length ; i>0 ; i--) { 1.34 - if(string[i-1] == chr) { 1.35 + if(str[i-1] == chr) { 1.36 *pos = i-1; 1.37 return 1; 1.38 } 1.39 @@ -278,7 +278,7 @@ 1.40 } while (0); 1.41 1.42 1.43 -const char* ucx_strstr( 1.44 +static const char* ucx_strstr( 1.45 const char *str, 1.46 size_t length, 1.47 const char *match, 1.48 @@ -511,11 +511,11 @@ 1.49 } 1.50 } 1.51 1.52 -sstr_t scstrdup(scstr_t s) { 1.53 +sstr_t ucx_strdup(scstr_t s) { 1.54 return sstrdup_a(ucx_default_allocator(), s); 1.55 } 1.56 1.57 -sstr_t scstrdup_a(UcxAllocator *allocator, scstr_t s) { 1.58 +sstr_t ucx_strdup_a(UcxAllocator *allocator, scstr_t s) { 1.59 sstr_t newstring; 1.60 newstring.ptr = (char*)almalloc(allocator, s.length + 1); 1.61 if (newstring.ptr) { 1.62 @@ -531,7 +531,7 @@ 1.63 } 1.64 1.65 1.66 -size_t ucx_strtrim(const char *s, size_t len, size_t *newlen) { 1.67 +static size_t ucx_strtrim(const char *s, size_t len, size_t *newlen) { 1.68 const char *newptr = s; 1.69 size_t length = len; 1.70
2.1 --- a/src/ucx/string.h Wed May 16 13:13:33 2018 +0200 2.2 +++ b/src/ucx/string.h Wed May 16 14:02:59 2018 +0200 2.3 @@ -255,19 +255,26 @@ 2.4 2.5 /** 2.6 * Returns the cumulated length of all specified strings. 2.7 - * 2.8 - * At least one string must be specified. 2.9 + * 2.10 + * You may arbitrarily mix up mutable (<code>sstr_t</code>) and immutable 2.11 + * (<code>scstr_t</code>) strings. 2.12 * 2.13 * <b>Attention:</b> if the count argument does not match the count of the 2.14 * specified strings, the behavior is undefined. 2.15 * 2.16 * @param count the total number of specified strings (so at least 1) 2.17 - * @param string the first string 2.18 - * @param ... all other strings 2.19 + * @param ... all strings 2.20 * @return the cumulated length of all strings 2.21 */ 2.22 size_t ucx_strnlen(size_t count, ...); 2.23 2.24 +/** 2.25 + * Alias for ucx_strnlen(). 2.26 + * 2.27 + * @param count the total number of specified strings (so at least 1) 2.28 + * @param ... all strings 2.29 + * @return the cumulated length of all strings 2.30 + */ 2.31 #define sstrnlen(count, ...) ucx_strnlen(count, __VA_ARGS__) 2.32 2.33 /** 2.34 @@ -286,6 +293,14 @@ 2.35 */ 2.36 sstr_t ucx_strcat(size_t count, scstr_t s1, ...); 2.37 2.38 +/** 2.39 + * Alias for ucx_strcat() which automatically casts the first string. 2.40 + * 2.41 + * @param count the total number of strings to concatenate 2.42 + * @param s1 first string 2.43 + * @param ... all remaining strings 2.44 + * @return the concatenated string 2.45 + */ 2.46 #define sstrcat(count, s1, ...) ucx_strcat(count, SCSTR(s1), __VA_ARGS__) 2.47 2.48 /** 2.49 @@ -301,7 +316,19 @@ 2.50 */ 2.51 sstr_t ucx_strcat_a(UcxAllocator *a, size_t count, scstr_t s1, ...); 2.52 2.53 -#define sstrcat_a(count, s1, ...) ucx_strcat_a(count, SCSTR(s1), __VA_ARGS__) 2.54 +/** 2.55 + * Alias for ucx_strcat_a() which automatically casts the first string. 2.56 + * 2.57 + * See sstrcat() for details. 2.58 + * 2.59 + * @param a the allocator to use 2.60 + * @param count the total number of strings to concatenate 2.61 + * @param s1 first string 2.62 + * @param ... all remaining strings 2.63 + * @return the concatenated string 2.64 + */ 2.65 +#define sstrcat_a(a, count, s1, ...) \ 2.66 + ucx_strcat_a(a, count, SCSTR(s1), __VA_ARGS__) 2.67 2.68 /** 2.69 * Returns a substring starting at the specified location. 2.70 @@ -337,13 +364,42 @@ 2.71 */ 2.72 sstr_t sstrsubsl(sstr_t string, size_t start, size_t length); 2.73 2.74 -scstr_t scstrsubs(scstr_t s, size_t start); 2.75 +/** 2.76 + * Returns a substring of an immutable string starting at the specified 2.77 + * location. 2.78 + * 2.79 + * <b>Attention:</b> the new string references the same memory area as the 2.80 + * input string and will <b>NOT</b> be <code>NULL</code>-terminated. 2.81 + * Use scstrdup() to get a copy. 2.82 + * 2.83 + * @param string input string 2.84 + * @param start start location of the substring 2.85 + * @return a substring of <code>string</code> starting at <code>start</code> 2.86 + * 2.87 + * @see scstrsubsl() 2.88 + * @see scstrchr() 2.89 + */ 2.90 +scstr_t scstrsubs(scstr_t string, size_t start); 2.91 + 2.92 +/** 2.93 + * Returns a substring of an immutable string with a maximum length starting 2.94 + * at the specified location. 2.95 + * 2.96 + * <b>Attention:</b> the new string references the same memory area as the 2.97 + * input string and will <b>NOT</b> be <code>NULL</code>-terminated. 2.98 + * Use scstrdup() to get a copy. 2.99 + * 2.100 + * @param string input string 2.101 + * @param start start location of the substring 2.102 + * @param length the maximum length of the substring 2.103 + * @return a substring of <code>string</code> starting at <code>start</code> 2.104 + * with a maximum length of <code>length</code> 2.105 + * 2.106 + * @see scstrsubs() 2.107 + * @see scstrchr() 2.108 + */ 2.109 scstr_t scstrsubsl(scstr_t string, size_t start, size_t length); 2.110 2.111 - 2.112 -int ucx_strchr(const char *string, size_t length, int chr, size_t *pos); 2.113 -int ucx_strrchr(const char *string, size_t length, int chr, size_t *pos); 2.114 - 2.115 /** 2.116 * Returns a substring starting at the location of the first occurrence of the 2.117 * specified character. 2.118 @@ -372,17 +428,34 @@ 2.119 */ 2.120 sstr_t sstrrchr(sstr_t string, int chr); 2.121 2.122 +/** 2.123 + * Returns an immutable substring starting at the location of the first 2.124 + * occurrence of the specified character. 2.125 + * 2.126 + * If the string does not contain the character, an empty string is returned. 2.127 + * 2.128 + * @param string the string where to locate the character 2.129 + * @param chr the character to locate 2.130 + * @return a substring starting at the first location of <code>chr</code> 2.131 + * 2.132 + * @see scstrsubs() 2.133 + */ 2.134 +scstr_t scstrchr(scstr_t string, int chr); 2.135 2.136 -scstr_t scstrchr(scstr_t string, int chr); 2.137 +/** 2.138 + * Returns an immutable substring starting at the location of the last 2.139 + * occurrence of the specified character. 2.140 + * 2.141 + * If the string does not contain the character, an empty string is returned. 2.142 + * 2.143 + * @param string the string where to locate the character 2.144 + * @param chr the character to locate 2.145 + * @return a substring starting at the last location of <code>chr</code> 2.146 + * 2.147 + * @see scstrsubs() 2.148 + */ 2.149 scstr_t scstrrchr(scstr_t string, int chr); 2.150 2.151 -const char* ucx_strstr( 2.152 - const char *str, 2.153 - size_t length, 2.154 - const char *match, 2.155 - size_t matchlen, 2.156 - size_t *newlen); 2.157 - 2.158 /** 2.159 * Returns a substring starting at the location of the first occurrence of the 2.160 * specified string. 2.161 @@ -399,9 +472,44 @@ 2.162 * present in <code>string</code> 2.163 */ 2.164 sstr_t ucx_sstrstr(sstr_t string, scstr_t match); 2.165 + 2.166 +/** 2.167 + * Alias for ucx_sstrstr() which automatically casts the match string. 2.168 + * 2.169 + * @param string the string to be scanned 2.170 + * @param match string containing the sequence of characters to match 2.171 + * @return a substring starting at the first occurrence of 2.172 + * <code>match</code>, or an empty string, if the sequence is not 2.173 + * present in <code>string</code> 2.174 + */ 2.175 #define sstrstr(string, match) ucx_sstrstr(string, SCSTR(match)) 2.176 2.177 +/** 2.178 + * Returns an immutable substring starting at the location of the 2.179 + * first occurrence of the specified immutable string. 2.180 + * 2.181 + * If the string does not contain the other string, an empty string is returned. 2.182 + * 2.183 + * If <code>match</code> is an empty string, the complete <code>string</code> is 2.184 + * returned. 2.185 + * 2.186 + * @param string the string to be scanned 2.187 + * @param match string containing the sequence of characters to match 2.188 + * @return a substring starting at the first occurrence of 2.189 + * <code>match</code>, or an empty string, if the sequence is not 2.190 + * present in <code>string</code> 2.191 + */ 2.192 scstr_t ucx_scstrstr(scstr_t string, scstr_t match); 2.193 + 2.194 +/** 2.195 + * Alias for ucx_scstrstr() which automatically casts the match string. 2.196 + * 2.197 + * @param string the string to be scanned 2.198 + * @param match string containing the sequence of characters to match 2.199 + * @return a substring starting at the first occurrence of 2.200 + * <code>match</code>, or an empty string, if the sequence is not 2.201 + * present in <code>string</code> 2.202 + */ 2.203 #define scstrstr(string, match) ucx_scstrstr(string, SCSTR(match)) 2.204 2.205 /** 2.206 @@ -447,13 +555,26 @@ 2.207 * @param count IN: the maximum size of the resulting array (0 = no limit), 2.208 * OUT: the actual size of the array 2.209 * @return a sstr_t array containing the split strings or 2.210 - * <code>NULL</code> on error 2.211 + * <code>NULL</code> on error 2.212 + * 2.213 + * @see ucx_strsplit_a() 2.214 + */ 2.215 +sstr_t* ucx_strsplit(scstr_t string, scstr_t delim, ssize_t *count); 2.216 + 2.217 +/** 2.218 + * Alias for ucx_strsplit() which automatically casts the arguments. 2.219 + * 2.220 + * @param string the string to split 2.221 + * @param delim the delimiter string 2.222 + * @param count IN: the maximum size of the resulting array (0 = no limit), 2.223 + * OUT: the actual size of the array 2.224 + * @return a sstr_t array containing the split strings or 2.225 + * <code>NULL</code> on error 2.226 * 2.227 * @see sstrsplit_a() 2.228 */ 2.229 -sstr_t* ucx_strsplit(scstr_t string, scstr_t delim, ssize_t *count); 2.230 - 2.231 -#define sstrsplit(s, delim, count) ucx_strsplit(SCSTR(s), SCSTR(delim), count) 2.232 +#define sstrsplit(string, delim, count) \ 2.233 + ucx_strsplit(SCSTR(string), SCSTR(delim), count) 2.234 2.235 /** 2.236 * Performing sstrsplit() using a UcxAllocator. 2.237 @@ -473,19 +594,33 @@ 2.238 * @param count IN: the maximum size of the resulting array (0 = no limit), 2.239 * OUT: the actual size of the array 2.240 * @return a sstr_t array containing the split strings or 2.241 - * <code>NULL</code> on error 2.242 + * <code>NULL</code> on error 2.243 * 2.244 - * @see sstrsplit() 2.245 + * @see ucx_strsplit() 2.246 */ 2.247 sstr_t* ucx_strsplit_a(UcxAllocator *allocator, scstr_t string, scstr_t delim, 2.248 ssize_t *count); 2.249 2.250 -#define sstrsplit_a(a, s, d, c) ucx_strsplit_a(a, SCSTR(s), SCSTR(d, c)) 2.251 +/** 2.252 + * Alias for ucx_strsplit_a() which automatically casts the arguments. 2.253 + * 2.254 + * @param allocator the UcxAllocator used for allocating memory 2.255 + * @param string the string to split 2.256 + * @param delim the delimiter string 2.257 + * @param count IN: the maximum size of the resulting array (0 = no limit), 2.258 + * OUT: the actual size of the array 2.259 + * @return a sstr_t array containing the split strings or 2.260 + * <code>NULL</code> on error 2.261 + * 2.262 + * @see sstrsplit() 2.263 + */ 2.264 +#define sstrsplit_a(allocator, string, delim, count) \ 2.265 + ucx_strsplit_a(allocator, SCSTR(string), SCSTR(delim, count)) 2.266 2.267 /** 2.268 * Compares two UCX strings with standard <code>memcmp()</code>. 2.269 * 2.270 - * At first it compares the sstr_t.length attribute of the two strings. The 2.271 + * At first it compares the scstr_t.length attribute of the two strings. The 2.272 * <code>memcmp()</code> function is called, if and only if the lengths match. 2.273 * 2.274 * @param s1 the first string 2.275 @@ -496,6 +631,15 @@ 2.276 */ 2.277 int ucx_strcmp(scstr_t s1, scstr_t s2); 2.278 2.279 +/** 2.280 + * Alias for ucx_strcmp() which automatically casts its arguments. 2.281 + * 2.282 + * @param s1 the first string 2.283 + * @param s2 the second string 2.284 + * @return -1, if the length of s1 is less than the length of s2 or 1, if the 2.285 + * length of s1 is greater than the length of s2 or the result of 2.286 + * <code>memcmp()</code> otherwise (i.e. 0 if the strings match) 2.287 + */ 2.288 #define sstrcmp(s1, s2) ucx_strcmp(SCSTR(s1), SCSTR(s2)) 2.289 2.290 /** 2.291 @@ -508,12 +652,20 @@ 2.292 * @param s1 the first string 2.293 * @param s2 the second string 2.294 * @return -1, if the length of s1 is less than the length of s2 or 1, if the 2.295 - * length of s1 is greater than the length of s2 or the difference between the 2.296 - * first two differing characters otherwise (i.e. 0 if the strings match and 2.297 - * no characters differ) 2.298 + * length of s1 is greater than the length of s2 or the result of the platform 2.299 + * specific string comparison function ignoring the case. 2.300 */ 2.301 int ucx_strcasecmp(scstr_t s1, scstr_t s2); 2.302 2.303 +/** 2.304 + * Alias for ucx_strcasecmp() which automatically casts the arguments. 2.305 + * 2.306 + * @param s1 the first string 2.307 + * @param s2 the second string 2.308 + * @return -1, if the length of s1 is less than the length of s2 or 1, if the 2.309 + * length of s1 is greater than the length of s2 or the result of the platform 2.310 + * specific string comparison function ignoring the case. 2.311 + */ 2.312 #define sstrcasecmp(s1, s2) ucx_strcasecmp(SCSTR(s1), SCSTR(s2)) 2.313 2.314 /** 2.315 @@ -524,15 +676,22 @@ 2.316 * <code>free()</code>. 2.317 * 2.318 * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>- 2.319 - * terminated and mutable. 2.320 + * terminated and mutable, regardless of the argument. 2.321 + * 2.322 + * @param string the string to duplicate 2.323 + * @return a duplicate of the string 2.324 + * @see ucx_strdup_a() 2.325 + */ 2.326 +sstr_t ucx_strdup(scstr_t string); 2.327 + 2.328 +/** 2.329 + * Alias for ucx_strdup() which automatically casts the argument. 2.330 * 2.331 * @param string the string to duplicate 2.332 * @return a duplicate of the string 2.333 * @see sstrdup_a() 2.334 */ 2.335 -sstr_t scstrdup(scstr_t string); 2.336 - 2.337 -#define sstrdup(s) scstrdup(SCSTR(s)) 2.338 +#define sstrdup(string) ucx_strdup(SCSTR(string)) 2.339 2.340 /** 2.341 * Creates a duplicate of the specified string using a UcxAllocator. 2.342 @@ -543,20 +702,26 @@ 2.343 * ucx_allocator_free function manually. 2.344 * 2.345 * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>- 2.346 - * terminated. 2.347 + * terminated and mutable, regardless of the argument. 2.348 * 2.349 * @param allocator a valid instance of a UcxAllocator 2.350 * @param string the string to duplicate 2.351 * @return a duplicate of the string 2.352 - * @see sstrdup() 2.353 + * @see ucx_strdup() 2.354 */ 2.355 -sstr_t scstrdup_a(UcxAllocator *allocator, scstr_t string); 2.356 +sstr_t ucx_strdup_a(UcxAllocator *allocator, scstr_t string); 2.357 2.358 -#define sstrdup_a(allocator, s) scstrdup_a(allocator, SCSTR(s)) 2.359 +/** 2.360 + * Alias for ucx_strdup_a() which automatically casts the argument. 2.361 + * 2.362 + * @param allocator a valid instance of a UcxAllocator 2.363 + * @param string the string to duplicate 2.364 + * @return a duplicate of the string 2.365 + * @see ucx_strdup() 2.366 + */ 2.367 +#define sstrdup_a(allocator, string) ucx_strdup_a(allocator, SCSTR(string)) 2.368 2.369 2.370 -size_t ucx_strtrim(const char *str, size_t length, size_t *newlen); 2.371 - 2.372 /** 2.373 * Omits leading and trailing spaces. 2.374 * 2.375 @@ -576,6 +741,23 @@ 2.376 */ 2.377 sstr_t sstrtrim(sstr_t string); 2.378 2.379 +/** 2.380 + * Omits leading and trailing spaces. 2.381 + * 2.382 + * This function returns a new scstr_t containing a trimmed version of the 2.383 + * specified string. 2.384 + * 2.385 + * <b>Note:</b> the new scstr_t references the same memory, thus you 2.386 + * <b>MUST NOT</b> pass the scstr_t.ptr of the return value to 2.387 + * <code>free()</code>. It is also highly recommended to avoid assignments like 2.388 + * <code>mystr = scstrtrim(mystr);</code> as you lose the reference to the 2.389 + * source string. Assignments of this type are only permitted, if the 2.390 + * scstr_t.ptr of the source string does not need to be freed or if another 2.391 + * reference to the source string exists. 2.392 + * 2.393 + * @param string the string that shall be trimmed 2.394 + * @return a new scstr_t containing the trimmed string 2.395 + */ 2.396 scstr_t scstrtrim(scstr_t string); 2.397 2.398 /** 2.399 @@ -586,6 +768,13 @@ 2.400 */ 2.401 int ucx_strprefix(scstr_t string, scstr_t prefix); 2.402 2.403 +/** 2.404 + * Alias for ucx_strprefix() which automatically casts the arguments. 2.405 + * 2.406 + * @param string the string to check 2.407 + * @param prefix the prefix the string should have 2.408 + * @return 1, if and only if the string has the specified prefix, 0 otherwise 2.409 + */ 2.410 #define sstrprefix(string, prefix) ucx_strprefix(SCSTR(string), SCSTR(prefix)) 2.411 2.412 /** 2.413 @@ -596,64 +785,98 @@ 2.414 */ 2.415 int ucx_strsuffix(scstr_t string, scstr_t suffix); 2.416 2.417 -#define sstrsuffix(string, prefix) ucx_strsuffix(SCSTR(string), SCSTR(prefix)) 2.418 +/** 2.419 + * Alias for ucx_strsuffix() which automatically casts the arguments. 2.420 + * 2.421 + * @param string the string to check 2.422 + * @param suffix the suffix the string should have 2.423 + * @return 1, if and only if the string has the specified suffix, 0 otherwise 2.424 + */ 2.425 +#define sstrsuffix(string, suffix) ucx_strsuffix(SCSTR(string), SCSTR(suffix)) 2.426 2.427 /** 2.428 * Returns a lower case version of a string. 2.429 * 2.430 * This function creates a duplicate of the input string, first. See the 2.431 - * documentation of sstrdup() for the implications. 2.432 + * documentation of scstrdup() for the implications. 2.433 * 2.434 * @param string the input string 2.435 * @return the resulting lower case string 2.436 - * @see sstrdup() 2.437 + * @see scstrdup() 2.438 */ 2.439 sstr_t ucx_strlower(scstr_t string); 2.440 2.441 +/** 2.442 + * Alias for ucx_strlower() which automatically casts the argument. 2.443 + * 2.444 + * @param string the input string 2.445 + * @return the resulting lower case string 2.446 + */ 2.447 #define sstrlower(string) ucx_strlower(SCSTR(string)) 2.448 2.449 /** 2.450 * Returns a lower case version of a string. 2.451 * 2.452 * This function creates a duplicate of the input string, first. See the 2.453 - * documentation of sstrdup_a() for the implications. 2.454 + * documentation of scstrdup_a() for the implications. 2.455 * 2.456 * @param allocator the allocator used for duplicating the string 2.457 * @param string the input string 2.458 * @return the resulting lower case string 2.459 - * @see sstrdup_a() 2.460 + * @see scstrdup_a() 2.461 */ 2.462 sstr_t ucx_strlower_a(UcxAllocator *allocator, scstr_t string); 2.463 2.464 + 2.465 +/** 2.466 + * Alias for ucx_strlower_a() which automatically casts the argument. 2.467 + * 2.468 + * @param allocator the allocator used for duplicating the string 2.469 + * @param string the input string 2.470 + * @return the resulting lower case string 2.471 + */ 2.472 #define sstrlower_a(allocator, string) ucx_strlower_a(allocator, SCSTR(string)) 2.473 2.474 /** 2.475 * Returns a upper case version of a string. 2.476 * 2.477 * This function creates a duplicate of the input string, first. See the 2.478 - * documentation of sstrdup() for the implications. 2.479 + * documentation of scstrdup() for the implications. 2.480 * 2.481 * @param string the input string 2.482 * @return the resulting upper case string 2.483 - * @see sstrdup() 2.484 + * @see scstrdup() 2.485 */ 2.486 sstr_t ucx_strupper(scstr_t string); 2.487 2.488 +/** 2.489 + * Alias for ucx_strupper() which automatically casts the argument. 2.490 + * 2.491 + * @param string the input string 2.492 + * @return the resulting upper case string 2.493 + */ 2.494 #define sstrupper(string) ucx_strupper(SCSTR(string)) 2.495 2.496 /** 2.497 * Returns a upper case version of a string. 2.498 * 2.499 * This function creates a duplicate of the input string, first. See the 2.500 - * documentation of sstrdup_a() for the implications. 2.501 + * documentation of scstrdup_a() for the implications. 2.502 * 2.503 * @param allocator the allocator used for duplicating the string 2.504 * @param string the input string 2.505 * @return the resulting upper case string 2.506 - * @see sstrdup_a() 2.507 + * @see scstrdup_a() 2.508 */ 2.509 sstr_t ucx_strupper_a(UcxAllocator *allocator, scstr_t string); 2.510 2.511 +/** 2.512 + * Alias for ucx_strupper_a() which automatically casts the argument. 2.513 + * 2.514 + * @param allocator the allocator used for duplicating the string 2.515 + * @param string the input string 2.516 + * @return the resulting upper case string 2.517 + */ 2.518 #define sstrupper_a(allocator, string) ucx_strupper_a(allocator, string) 2.519 2.520 #ifdef __cplusplus