Fix PSP compiled

This commit is contained in:
2025-11-09 20:42:03 -06:00
parent f23e26d9da
commit d6c497731f
10 changed files with 48 additions and 34 deletions

View File

@@ -155,4 +155,17 @@ bool_t stringEndsWith(const char_t *str, const char_t *suffix) {
size_t suffixLen = strlen(suffix);
if(suffixLen > strLen) return false;
return strcmp(str + strLen - suffixLen, suffix) == 0;
}
bool_t stringEndsWithCaseInsensitive(
const char_t *str,
const char_t *suffix
) {
assertNotNull(str, "str must not be NULL");
assertNotNull(suffix, "suffix must not be NULL");
size_t strLen = strlen(str);
size_t suffixLen = strlen(suffix);
if(suffixLen > strLen) return false;
return strcasecmp(str + strLen - suffixLen, suffix) == 0;
}

View File

@@ -143,4 +143,13 @@ bool_t stringToF32(const char_t *str, float_t *out);
* @param suffix The suffix to check for.
* @return TRUE if the string ends with the suffix, FALSE otherwise.
*/
bool_t stringEndsWith(const char_t *str, const char_t *suffix);
bool_t stringEndsWith(const char_t *str, const char_t *suffix);
/**
* Determines if a string ends with a specified suffix, ignoring case.
*
* @param str The string to check.
* @param suffix The suffix to check for.
* @return TRUE if the string ends with the suffix, FALSE otherwise.
*/
bool_t stringEndsWithCaseInsensitive(const char_t *str, const char_t *suffix);