Function rcutils_strncasecmp

Function Documentation

int rcutils_strncasecmp(const char *s1, const char *s2, size_t n, int *value)

Case insensitive string compare up to count characters.

This function compares two strings ignoring case in a portable way. This performs a byte-by-byte comparison of the strings s1 and s2 up to count characters of s1 and s2, ignoring the case of the characters.

Parameters:
  • s1[in] First string to compare.

  • s2[in] Second string to compare.

  • n[in] Count of characters to compare.

  • value[out] Pointer to comparison result. An integer less than, equal to, or greater than zero if s1 is, after ignoring case, found to be less than, to match, or be greater than s2, respectively.

Returns:

0 if method succeeded, or

Returns:

-1 if failed.