diff -r 2ccb9f881420 -r 3eeadf666d6b src/cx/string.h --- a/src/cx/string.h Mon Feb 20 19:14:42 2023 +0100 +++ b/src/cx/string.h Mon Feb 20 19:55:42 2023 +0100 @@ -657,6 +657,38 @@ cxstring s2 ); +/** + * Compares two strings. + * + * This function has a compatible signature for the use as a CxListComparator. + * + * @param s1 the first string + * @param s2 the second string + * @return negative if \p s1 is smaller than \p s2, positive if \p s1 is larger + * than \p s2, zero if both strings equal + */ +__attribute__((__warn_unused_result__, __nonnull__)) +int cx_strcmp_p( + void const *s1, + void const *s2 +); + +/** + * Compares two strings ignoring case. + * + * This function has a compatible signature for the use as a CxListComparator. + * + * @param s1 the first string + * @param s2 the second string + * @return negative if \p s1 is smaller than \p s2, positive if \p s1 is larger + * than \p s2, zero if both strings equal ignoring case + */ +__attribute__((__warn_unused_result__, __nonnull__)) +int cx_strcasecmp_p( + void const *s1, + void const *s2 +); + /** * Creates a duplicate of the specified string.