curl_strequal.3 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .\" generated by cd2nroff 0.1 from curl_strequal.md
  2. .TH curl_strequal 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_strequal \- compare two strings ignoring case
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. int curl_strequal(const char *str1, const char *str2);
  9. .fi
  10. .SH DESCRIPTION
  11. The \fIcurl_strequal(3)\fP function compares the two strings \fIstr1\fP and \fIstr2\fP,
  12. ignoring the case of the characters. It returns a non\-zero (TRUE) integer if
  13. the strings are identical.
  14. This function uses plain ASCII based comparisons completely disregarding the
  15. locale \- contrary to how \fBstrcasecmp\fP and other system case insensitive
  16. string comparisons usually work.
  17. This function is provided by libcurl to enable applications to compare strings
  18. in a truly portable manner. There are no standard portable case insensitive
  19. string comparison functions. This function works on all platforms.
  20. .SH PROTOCOLS
  21. This functionality affects all supported protocols
  22. .SH EXAMPLE
  23. .nf
  24. int main(int argc, char **argv)
  25. {
  26. const char *name = "compare";
  27. if(curl_strequal(name, argv[1]))
  28. printf("Name and input matches\\n");
  29. }
  30. .fi
  31. .SH AVAILABILITY
  32. Added in curl 7.1
  33. .SH RETURN VALUE
  34. Non\-zero if the strings are identical. Zero if they are not.
  35. .SH SEE ALSO
  36. .BR curl_strnequal (3),
  37. .BR strcasecmp (3),
  38. .BR strcmp (3)