src/ucx/string.h

changeset 319
0380e438a7ce
parent 318
348fd9cb7b14
child 320
0ffb71f15426
equal deleted inserted replaced
318:348fd9cb7b14 319:0380e438a7ce
254 scstr_t scstrn(const char *cstring, size_t length); 254 scstr_t scstrn(const char *cstring, size_t length);
255 255
256 /** 256 /**
257 * Returns the cumulated length of all specified strings. 257 * Returns the cumulated length of all specified strings.
258 * 258 *
259 * You may arbitrarily mix up mutable (<code>sstr_t</code>) and immutable
260 * (<code>scstr_t</code>) strings.
261 *
262 * <b>Attention:</b> if the count argument does not match the count of the 259 * <b>Attention:</b> if the count argument does not match the count of the
263 * specified strings, the behavior is undefined. 260 * specified strings, the behavior is undefined.
264 * 261 *
265 * @param count the total number of specified strings (so at least 1) 262 * @param count the total number of specified strings (so at least 1)
266 * @param ... all strings 263 * @param ... all strings
267 * @return the cumulated length of all strings 264 * @return the cumulated length of all strings
268 */ 265 */
269 size_t ucx_strnlen(size_t count, ...); 266 size_t scstrnlen(size_t count, ...);
270 267
271 /** 268 /**
272 * Alias for ucx_strnlen(). 269 * Alias for scstrnlen() which automatically casts the arguments.
273 * 270 *
274 * @param count the total number of specified strings (so at least 1) 271 * @param count the total number of specified strings (so at least 1)
275 * @param ... all strings 272 * @param ... all strings
276 * @return the cumulated length of all strings 273 * @return the cumulated length of all strings
277 */ 274 */
278 #define sstrnlen(count, ...) ucx_strnlen(count, __VA_ARGS__) 275 #define sstrnlen(count, ...) scstrnlen(count, __VA_ARGS__)
279 276
280 /** 277 /**
281 * Concatenates two or more strings. 278 * Concatenates two or more strings.
282 * 279 *
283 * The resulting string will be allocated by standard <code>malloc()</code>. 280 * The resulting string will be allocated by standard <code>malloc()</code>.
289 * @param count the total number of strings to concatenate 286 * @param count the total number of strings to concatenate
290 * @param s1 first string 287 * @param s1 first string
291 * @param ... all remaining strings 288 * @param ... all remaining strings
292 * @return the concatenated string 289 * @return the concatenated string
293 */ 290 */
294 sstr_t ucx_strcat(size_t count, scstr_t s1, ...); 291 sstr_t scstrcat(size_t count, scstr_t s1, ...);
295 292
296 /** 293 /**
297 * Alias for ucx_strcat() which automatically casts the first string. 294 * Alias for scstrcat() which automatically casts the arguments.
298 * 295 *
299 * @param count the total number of strings to concatenate 296 * @param count the total number of strings to concatenate
300 * @param s1 first string 297 * @param s1 first string
301 * @param ... all remaining strings 298 * @param ... all remaining strings
302 * @return the concatenated string 299 * @return the concatenated string
303 */ 300 */
304 #define sstrcat(count, s1, ...) ucx_strcat(count, SCSTR(s1), __VA_ARGS__) 301 #define sstrcat(count, s1, ...) scstrcat(count, SCSTR(s1), __VA_ARGS__)
305 302
306 /** 303 /**
307 * Concatenates two or more strings using a UcxAllocator. 304 * Concatenates two or more strings using a UcxAllocator.
308 * 305 *
309 * See sstrcat() for details. 306 * See scstrcat() for details.
310 * 307 *
311 * @param a the allocator to use 308 * @param a the allocator to use
312 * @param count the total number of strings to concatenate 309 * @param count the total number of strings to concatenate
313 * @param s1 first string 310 * @param s1 first string
314 * @param ... all remaining strings 311 * @param ... all remaining strings
315 * @return the concatenated string 312 * @return the concatenated string
316 */ 313 */
317 sstr_t ucx_strcat_a(UcxAllocator *a, size_t count, scstr_t s1, ...); 314 sstr_t scstrcat_a(UcxAllocator *a, size_t count, scstr_t s1, ...);
318 315
319 /** 316 /**
320 * Alias for ucx_strcat_a() which automatically casts the first string. 317 * Alias for scstrcat_a() which automatically casts the arguments.
321 * 318 *
322 * See sstrcat() for details. 319 * See sstrcat() for details.
323 * 320 *
324 * @param a the allocator to use 321 * @param a the allocator to use
325 * @param count the total number of strings to concatenate 322 * @param count the total number of strings to concatenate
326 * @param s1 first string 323 * @param s1 first string
327 * @param ... all remaining strings 324 * @param ... all remaining strings
328 * @return the concatenated string 325 * @return the concatenated string
329 */ 326 */
330 #define sstrcat_a(a, count, s1, ...) \ 327 #define sstrcat_a(a, count, s1, ...) \
331 ucx_strcat_a(a, count, SCSTR(s1), __VA_ARGS__) 328 scstrcat_a(a, count, SCSTR(s1), __VA_ARGS__)
332 329
333 /** 330 /**
334 * Returns a substring starting at the specified location. 331 * Returns a substring starting at the specified location.
335 * 332 *
336 * <b>Attention:</b> the new string references the same memory area as the 333 * <b>Attention:</b> the new string references the same memory area as the
469 * @param match string containing the sequence of characters to match 466 * @param match string containing the sequence of characters to match
470 * @return a substring starting at the first occurrence of 467 * @return a substring starting at the first occurrence of
471 * <code>match</code>, or an empty string, if the sequence is not 468 * <code>match</code>, or an empty string, if the sequence is not
472 * present in <code>string</code> 469 * present in <code>string</code>
473 */ 470 */
474 sstr_t ucx_sstrstr(sstr_t string, scstr_t match); 471 sstr_t scstrsstr(sstr_t string, scstr_t match);
475 472
476 /** 473 /**
477 * Alias for ucx_sstrstr() which automatically casts the match string. 474 * Alias for scstrsstr() which automatically casts the match string.
478 * 475 *
479 * @param string the string to be scanned 476 * @param string the string to be scanned
480 * @param match string containing the sequence of characters to match 477 * @param match string containing the sequence of characters to match
481 * @return a substring starting at the first occurrence of 478 * @return a substring starting at the first occurrence of
482 * <code>match</code>, or an empty string, if the sequence is not 479 * <code>match</code>, or an empty string, if the sequence is not
483 * present in <code>string</code> 480 * present in <code>string</code>
484 */ 481 */
485 #define sstrstr(string, match) ucx_sstrstr(string, SCSTR(match)) 482 #define sstrstr(string, match) scstrsstr(string, SCSTR(match))
486 483
487 /** 484 /**
488 * Returns an immutable substring starting at the location of the 485 * Returns an immutable substring starting at the location of the
489 * first occurrence of the specified immutable string. 486 * first occurrence of the specified immutable string.
490 * 487 *
497 * @param match string containing the sequence of characters to match 494 * @param match string containing the sequence of characters to match
498 * @return a substring starting at the first occurrence of 495 * @return a substring starting at the first occurrence of
499 * <code>match</code>, or an empty string, if the sequence is not 496 * <code>match</code>, or an empty string, if the sequence is not
500 * present in <code>string</code> 497 * present in <code>string</code>
501 */ 498 */
502 scstr_t ucx_scstrstr(scstr_t string, scstr_t match); 499 scstr_t scstrscstr(scstr_t string, scstr_t match);
503 500
504 /** 501 /**
505 * Alias for ucx_scstrstr() which automatically casts the match string. 502 * Alias for scstrscstr() which automatically casts the match string.
506 * 503 *
507 * @param string the string to be scanned 504 * @param string the string to be scanned
508 * @param match string containing the sequence of characters to match 505 * @param match string containing the sequence of characters to match
509 * @return a substring starting at the first occurrence of 506 * @return a substring starting at the first occurrence of
510 * <code>match</code>, or an empty string, if the sequence is not 507 * <code>match</code>, or an empty string, if the sequence is not
511 * present in <code>string</code> 508 * present in <code>string</code>
512 */ 509 */
513 #define scstrstr(string, match) ucx_scstrstr(string, SCSTR(match)) 510 #define sstrscstr(string, match) scstrscstr(string, SCSTR(match))
514 511
515 /** 512 /**
516 * Splits a string into parts by using a delimiter string. 513 * Splits a string into parts by using a delimiter string.
517 * 514 *
518 * This function will return <code>NULL</code>, if one of the following happens: 515 * This function will return <code>NULL</code>, if one of the following happens:
555 * @param count IN: the maximum size of the resulting array (0 = no limit), 552 * @param count IN: the maximum size of the resulting array (0 = no limit),
556 * OUT: the actual size of the array 553 * OUT: the actual size of the array
557 * @return a sstr_t array containing the split strings or 554 * @return a sstr_t array containing the split strings or
558 * <code>NULL</code> on error 555 * <code>NULL</code> on error
559 * 556 *
560 * @see ucx_strsplit_a() 557 * @see scstrsplit_a()
561 */ 558 */
562 sstr_t* ucx_strsplit(scstr_t string, scstr_t delim, ssize_t *count); 559 sstr_t* scstrsplit(scstr_t string, scstr_t delim, ssize_t *count);
563 560
564 /** 561 /**
565 * Alias for ucx_strsplit() which automatically casts the arguments. 562 * Alias for scstrsplit() which automatically casts the arguments.
566 * 563 *
567 * @param string the string to split 564 * @param string the string to split
568 * @param delim the delimiter string 565 * @param delim the delimiter string
569 * @param count IN: the maximum size of the resulting array (0 = no limit), 566 * @param count IN: the maximum size of the resulting array (0 = no limit),
570 * OUT: the actual size of the array 567 * OUT: the actual size of the array
572 * <code>NULL</code> on error 569 * <code>NULL</code> on error
573 * 570 *
574 * @see sstrsplit_a() 571 * @see sstrsplit_a()
575 */ 572 */
576 #define sstrsplit(string, delim, count) \ 573 #define sstrsplit(string, delim, count) \
577 ucx_strsplit(SCSTR(string), SCSTR(delim), count) 574 scstrsplit(SCSTR(string), SCSTR(delim), count)
578 575
579 /** 576 /**
580 * Performing sstrsplit() using a UcxAllocator. 577 * Performing scstrsplit() using a UcxAllocator.
581 * 578 *
582 * <i>Read the description of sstrsplit() for details.</i> 579 * <i>Read the description of scstrsplit() for details.</i>
583 * 580 *
584 * The memory for the sstr_t.ptr pointers of the array items and the memory for 581 * The memory for the sstr_t.ptr pointers of the array items and the memory for
585 * the sstr_t array itself are allocated by using the UcxAllocator.malloc() 582 * the sstr_t array itself are allocated by using the UcxAllocator.malloc()
586 * function. 583 * function.
587 * 584 *
594 * @param count IN: the maximum size of the resulting array (0 = no limit), 591 * @param count IN: the maximum size of the resulting array (0 = no limit),
595 * OUT: the actual size of the array 592 * OUT: the actual size of the array
596 * @return a sstr_t array containing the split strings or 593 * @return a sstr_t array containing the split strings or
597 * <code>NULL</code> on error 594 * <code>NULL</code> on error
598 * 595 *
599 * @see ucx_strsplit() 596 * @see scstrsplit()
600 */ 597 */
601 sstr_t* ucx_strsplit_a(UcxAllocator *allocator, scstr_t string, scstr_t delim, 598 sstr_t* scstrsplit_a(UcxAllocator *allocator, scstr_t string, scstr_t delim,
602 ssize_t *count); 599 ssize_t *count);
603 600
604 /** 601 /**
605 * Alias for ucx_strsplit_a() which automatically casts the arguments. 602 * Alias for scstrsplit_a() which automatically casts the arguments.
606 * 603 *
607 * @param allocator the UcxAllocator used for allocating memory 604 * @param allocator the UcxAllocator used for allocating memory
608 * @param string the string to split 605 * @param string the string to split
609 * @param delim the delimiter string 606 * @param delim the delimiter string
610 * @param count IN: the maximum size of the resulting array (0 = no limit), 607 * @param count IN: the maximum size of the resulting array (0 = no limit),
613 * <code>NULL</code> on error 610 * <code>NULL</code> on error
614 * 611 *
615 * @see sstrsplit() 612 * @see sstrsplit()
616 */ 613 */
617 #define sstrsplit_a(allocator, string, delim, count) \ 614 #define sstrsplit_a(allocator, string, delim, count) \
618 ucx_strsplit_a(allocator, SCSTR(string), SCSTR(delim, count)) 615 scstrsplit_a(allocator, SCSTR(string), SCSTR(delim, count))
619 616
620 /** 617 /**
621 * Compares two UCX strings with standard <code>memcmp()</code>. 618 * Compares two UCX strings with standard <code>memcmp()</code>.
622 * 619 *
623 * At first it compares the scstr_t.length attribute of the two strings. The 620 * At first it compares the scstr_t.length attribute of the two strings. The
627 * @param s2 the second string 624 * @param s2 the second string
628 * @return -1, if the length of s1 is less than the length of s2 or 1, if the 625 * @return -1, if the length of s1 is less than the length of s2 or 1, if the
629 * length of s1 is greater than the length of s2 or the result of 626 * length of s1 is greater than the length of s2 or the result of
630 * <code>memcmp()</code> otherwise (i.e. 0 if the strings match) 627 * <code>memcmp()</code> otherwise (i.e. 0 if the strings match)
631 */ 628 */
632 int ucx_strcmp(scstr_t s1, scstr_t s2); 629 int scstrcmp(scstr_t s1, scstr_t s2);
633 630
634 /** 631 /**
635 * Alias for ucx_strcmp() which automatically casts its arguments. 632 * Alias for scstrcmp() which automatically casts its arguments.
636 * 633 *
637 * @param s1 the first string 634 * @param s1 the first string
638 * @param s2 the second string 635 * @param s2 the second string
639 * @return -1, if the length of s1 is less than the length of s2 or 1, if the 636 * @return -1, if the length of s1 is less than the length of s2 or 1, if the
640 * length of s1 is greater than the length of s2 or the result of 637 * length of s1 is greater than the length of s2 or the result of
641 * <code>memcmp()</code> otherwise (i.e. 0 if the strings match) 638 * <code>memcmp()</code> otherwise (i.e. 0 if the strings match)
642 */ 639 */
643 #define sstrcmp(s1, s2) ucx_strcmp(SCSTR(s1), SCSTR(s2)) 640 #define sstrcmp(s1, s2) scstrcmp(SCSTR(s1), SCSTR(s2))
644 641
645 /** 642 /**
646 * Compares two UCX strings ignoring the case. 643 * Compares two UCX strings ignoring the case.
647 * 644 *
648 * At first it compares the sstr_t.length attribute of the two strings. If and 645 * At first it compares the scstr_t.length attribute of the two strings. If and
649 * only if the lengths match, both strings are compared char by char ignoring 646 * only if the lengths match, both strings are compared char by char ignoring
650 * the case. 647 * the case.
651 * 648 *
652 * @param s1 the first string 649 * @param s1 the first string
653 * @param s2 the second string 650 * @param s2 the second string
654 * @return -1, if the length of s1 is less than the length of s2 or 1, if the 651 * @return -1, if the length of s1 is less than the length of s2 or 1, if the
655 * length of s1 is greater than the length of s2 or the result of the platform 652 * length of s1 is greater than the length of s2 or the result of the platform
656 * specific string comparison function ignoring the case. 653 * specific string comparison function ignoring the case.
657 */ 654 */
658 int ucx_strcasecmp(scstr_t s1, scstr_t s2); 655 int scstrcasecmp(scstr_t s1, scstr_t s2);
659 656
660 /** 657 /**
661 * Alias for ucx_strcasecmp() which automatically casts the arguments. 658 * Alias for scstrcasecmp() which automatically casts the arguments.
662 * 659 *
663 * @param s1 the first string 660 * @param s1 the first string
664 * @param s2 the second string 661 * @param s2 the second string
665 * @return -1, if the length of s1 is less than the length of s2 or 1, if the 662 * @return -1, if the length of s1 is less than the length of s2 or 1, if the
666 * length of s1 is greater than the length of s2 or the result of the platform 663 * length of s1 is greater than the length of s2 or the result of the platform
667 * specific string comparison function ignoring the case. 664 * specific string comparison function ignoring the case.
668 */ 665 */
669 #define sstrcasecmp(s1, s2) ucx_strcasecmp(SCSTR(s1), SCSTR(s2)) 666 #define sstrcasecmp(s1, s2) scstrcasecmp(SCSTR(s1), SCSTR(s2))
670 667
671 /** 668 /**
672 * Creates a duplicate of the specified string. 669 * Creates a duplicate of the specified string.
673 * 670 *
674 * The new sstr_t will contain a copy allocated by standard 671 * The new sstr_t will contain a copy allocated by standard
678 * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>- 675 * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>-
679 * terminated and mutable, regardless of the argument. 676 * terminated and mutable, regardless of the argument.
680 * 677 *
681 * @param string the string to duplicate 678 * @param string the string to duplicate
682 * @return a duplicate of the string 679 * @return a duplicate of the string
683 * @see ucx_strdup_a() 680 * @see scstrdup_a()
684 */ 681 */
685 sstr_t ucx_strdup(scstr_t string); 682 sstr_t scstrdup(scstr_t string);
686 683
687 /** 684 /**
688 * Alias for ucx_strdup() which automatically casts the argument. 685 * Alias for scstrdup() which automatically casts the argument.
689 * 686 *
690 * @param string the string to duplicate 687 * @param string the string to duplicate
691 * @return a duplicate of the string 688 * @return a duplicate of the string
692 * @see sstrdup_a() 689 * @see sstrdup_a()
693 */ 690 */
694 #define sstrdup(string) ucx_strdup(SCSTR(string)) 691 #define sstrdup(string) scstrdup(SCSTR(string))
695 692
696 /** 693 /**
697 * Creates a duplicate of the specified string using a UcxAllocator. 694 * Creates a duplicate of the specified string using a UcxAllocator.
698 * 695 *
699 * The new sstr_t will contain a copy allocated by the allocators 696 * The new sstr_t will contain a copy allocated by the allocators
700 * ucx_allocator_malloc function. So it is implementation depended, whether the 697 * UcxAllocator.malloc() function. So it is implementation depended, whether the
701 * returned sstr_t.ptr pointer must be passed to the allocators 698 * returned sstr_t.ptr pointer must be passed to the allocators
702 * ucx_allocator_free function manually. 699 * UcxAllocator.free() function manually.
703 * 700 *
704 * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>- 701 * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>-
705 * terminated and mutable, regardless of the argument. 702 * terminated and mutable, regardless of the argument.
706 * 703 *
707 * @param allocator a valid instance of a UcxAllocator 704 * @param allocator a valid instance of a UcxAllocator
708 * @param string the string to duplicate 705 * @param string the string to duplicate
709 * @return a duplicate of the string 706 * @return a duplicate of the string
710 * @see ucx_strdup() 707 * @see scstrdup()
711 */ 708 */
712 sstr_t ucx_strdup_a(UcxAllocator *allocator, scstr_t string); 709 sstr_t scstrdup_a(UcxAllocator *allocator, scstr_t string);
713 710
714 /** 711 /**
715 * Alias for ucx_strdup_a() which automatically casts the argument. 712 * Alias for scstrdup_a() which automatically casts the argument.
716 * 713 *
717 * @param allocator a valid instance of a UcxAllocator 714 * @param allocator a valid instance of a UcxAllocator
718 * @param string the string to duplicate 715 * @param string the string to duplicate
719 * @return a duplicate of the string 716 * @return a duplicate of the string
720 * @see ucx_strdup() 717 * @see scstrdup()
721 */ 718 */
722 #define sstrdup_a(allocator, string) ucx_strdup_a(allocator, SCSTR(string)) 719 #define sstrdup_a(allocator, string) scstrdup_a(allocator, SCSTR(string))
723 720
724 721
725 /** 722 /**
726 * Omits leading and trailing spaces. 723 * Omits leading and trailing spaces.
727 * 724 *
764 * Checks, if a string has a specific prefix. 761 * Checks, if a string has a specific prefix.
765 * @param string the string to check 762 * @param string the string to check
766 * @param prefix the prefix the string should have 763 * @param prefix the prefix the string should have
767 * @return 1, if and only if the string has the specified prefix, 0 otherwise 764 * @return 1, if and only if the string has the specified prefix, 0 otherwise
768 */ 765 */
769 int ucx_strprefix(scstr_t string, scstr_t prefix); 766 int scstrprefix(scstr_t string, scstr_t prefix);
770 767
771 /** 768 /**
772 * Alias for ucx_strprefix() which automatically casts the arguments. 769 * Alias for scstrprefix() which automatically casts the arguments.
773 * 770 *
774 * @param string the string to check 771 * @param string the string to check
775 * @param prefix the prefix the string should have 772 * @param prefix the prefix the string should have
776 * @return 1, if and only if the string has the specified prefix, 0 otherwise 773 * @return 1, if and only if the string has the specified prefix, 0 otherwise
777 */ 774 */
778 #define sstrprefix(string, prefix) ucx_strprefix(SCSTR(string), SCSTR(prefix)) 775 #define sstrprefix(string, prefix) scstrprefix(SCSTR(string), SCSTR(prefix))
779 776
780 /** 777 /**
781 * Checks, if a string has a specific suffix. 778 * Checks, if a string has a specific suffix.
782 * @param string the string to check 779 * @param string the string to check
783 * @param suffix the suffix the string should have 780 * @param suffix the suffix the string should have
784 * @return 1, if and only if the string has the specified suffix, 0 otherwise 781 * @return 1, if and only if the string has the specified suffix, 0 otherwise
785 */ 782 */
786 int ucx_strsuffix(scstr_t string, scstr_t suffix); 783 int scstrsuffix(scstr_t string, scstr_t suffix);
787 784
788 /** 785 /**
789 * Alias for ucx_strsuffix() which automatically casts the arguments. 786 * Alias for scstrsuffix() which automatically casts the arguments.
790 * 787 *
791 * @param string the string to check 788 * @param string the string to check
792 * @param suffix the suffix the string should have 789 * @param suffix the suffix the string should have
793 * @return 1, if and only if the string has the specified suffix, 0 otherwise 790 * @return 1, if and only if the string has the specified suffix, 0 otherwise
794 */ 791 */
795 #define sstrsuffix(string, suffix) ucx_strsuffix(SCSTR(string), SCSTR(suffix)) 792 #define sstrsuffix(string, suffix) scstrsuffix(SCSTR(string), SCSTR(suffix))
796 793
797 /** 794 /**
798 * Returns a lower case version of a string. 795 * Returns a lower case version of a string.
799 * 796 *
800 * This function creates a duplicate of the input string, first. See the 797 * This function creates a duplicate of the input string, first. See the
802 * 799 *
803 * @param string the input string 800 * @param string the input string
804 * @return the resulting lower case string 801 * @return the resulting lower case string
805 * @see scstrdup() 802 * @see scstrdup()
806 */ 803 */
807 sstr_t ucx_strlower(scstr_t string); 804 sstr_t scstrlower(scstr_t string);
808 805
809 /** 806 /**
810 * Alias for ucx_strlower() which automatically casts the argument. 807 * Alias for scstrlower() which automatically casts the argument.
811 * 808 *
812 * @param string the input string 809 * @param string the input string
813 * @return the resulting lower case string 810 * @return the resulting lower case string
814 */ 811 */
815 #define sstrlower(string) ucx_strlower(SCSTR(string)) 812 #define sstrlower(string) scstrlower(SCSTR(string))
816 813
817 /** 814 /**
818 * Returns a lower case version of a string. 815 * Returns a lower case version of a string.
819 * 816 *
820 * This function creates a duplicate of the input string, first. See the 817 * This function creates a duplicate of the input string, first. See the
823 * @param allocator the allocator used for duplicating the string 820 * @param allocator the allocator used for duplicating the string
824 * @param string the input string 821 * @param string the input string
825 * @return the resulting lower case string 822 * @return the resulting lower case string
826 * @see scstrdup_a() 823 * @see scstrdup_a()
827 */ 824 */
828 sstr_t ucx_strlower_a(UcxAllocator *allocator, scstr_t string); 825 sstr_t scstrlower_a(UcxAllocator *allocator, scstr_t string);
829 826
830 827
831 /** 828 /**
832 * Alias for ucx_strlower_a() which automatically casts the argument. 829 * Alias for scstrlower_a() which automatically casts the argument.
833 * 830 *
834 * @param allocator the allocator used for duplicating the string 831 * @param allocator the allocator used for duplicating the string
835 * @param string the input string 832 * @param string the input string
836 * @return the resulting lower case string 833 * @return the resulting lower case string
837 */ 834 */
838 #define sstrlower_a(allocator, string) ucx_strlower_a(allocator, SCSTR(string)) 835 #define sstrlower_a(allocator, string) scstrlower_a(allocator, SCSTR(string))
839 836
840 /** 837 /**
841 * Returns a upper case version of a string. 838 * Returns a upper case version of a string.
842 * 839 *
843 * This function creates a duplicate of the input string, first. See the 840 * This function creates a duplicate of the input string, first. See the
845 * 842 *
846 * @param string the input string 843 * @param string the input string
847 * @return the resulting upper case string 844 * @return the resulting upper case string
848 * @see scstrdup() 845 * @see scstrdup()
849 */ 846 */
850 sstr_t ucx_strupper(scstr_t string); 847 sstr_t scstrupper(scstr_t string);
851 848
852 /** 849 /**
853 * Alias for ucx_strupper() which automatically casts the argument. 850 * Alias for scstrupper() which automatically casts the argument.
854 * 851 *
855 * @param string the input string 852 * @param string the input string
856 * @return the resulting upper case string 853 * @return the resulting upper case string
857 */ 854 */
858 #define sstrupper(string) ucx_strupper(SCSTR(string)) 855 #define sstrupper(string) scstrupper(SCSTR(string))
859 856
860 /** 857 /**
861 * Returns a upper case version of a string. 858 * Returns a upper case version of a string.
862 * 859 *
863 * This function creates a duplicate of the input string, first. See the 860 * This function creates a duplicate of the input string, first. See the
866 * @param allocator the allocator used for duplicating the string 863 * @param allocator the allocator used for duplicating the string
867 * @param string the input string 864 * @param string the input string
868 * @return the resulting upper case string 865 * @return the resulting upper case string
869 * @see scstrdup_a() 866 * @see scstrdup_a()
870 */ 867 */
871 sstr_t ucx_strupper_a(UcxAllocator *allocator, scstr_t string); 868 sstr_t scstrupper_a(UcxAllocator *allocator, scstr_t string);
872 869
873 /** 870 /**
874 * Alias for ucx_strupper_a() which automatically casts the argument. 871 * Alias for scstrupper_a() which automatically casts the argument.
875 * 872 *
876 * @param allocator the allocator used for duplicating the string 873 * @param allocator the allocator used for duplicating the string
877 * @param string the input string 874 * @param string the input string
878 * @return the resulting upper case string 875 * @return the resulting upper case string
879 */ 876 */
880 #define sstrupper_a(allocator, string) ucx_strupper_a(allocator, string) 877 #define sstrupper_a(allocator, string) scstrupper_a(allocator, string)
881 878
882 #ifdef __cplusplus 879 #ifdef __cplusplus
883 } 880 }
884 #endif 881 #endif
885 882

mercurial