586 return strncasecmp(string.ptr + string.length - suffix.length, |
586 return strncasecmp(string.ptr + string.length - suffix.length, |
587 suffix.ptr, suffix.length) == 0; |
587 suffix.ptr, suffix.length) == 0; |
588 #endif |
588 #endif |
589 } |
589 } |
590 |
590 |
591 void cx_strlower(cxmutstr string) { |
|
592 for (size_t i = 0; i < string.length; i++) { |
|
593 if ((unsigned int) (string.ptr[i] - 'A') < 26u) { |
|
594 string.ptr[i] += 'a' - 'A'; |
|
595 } |
|
596 } |
|
597 } |
|
598 |
|
599 void cx_strupper(cxmutstr string) { |
|
600 for (size_t i = 0; i < string.length; i++) { |
|
601 if ((unsigned int) (string.ptr[i] - 'a') < 26u) { |
|
602 string.ptr[i] += 'A' - 'a'; |
|
603 } |
|
604 } |
|
605 } |
|
606 |
|
607 #ifndef CX_STRREPLACE_INDEX_BUFFER_SIZE |
591 #ifndef CX_STRREPLACE_INDEX_BUFFER_SIZE |
608 #define CX_STRREPLACE_INDEX_BUFFER_SIZE 64 |
592 #define CX_STRREPLACE_INDEX_BUFFER_SIZE 64 |
609 #endif |
593 #endif |
610 |
594 |
611 struct cx_strreplace_ibuf { |
595 struct cx_strreplace_ibuf { |