curl_strequal(3)

πŸ’… curl_strequal β€” compare two strings ignoring case πŸ’…

okay so this is curl_strequal(3) from the Library Functions Manual, and bestie, it's literally the "are these two strings the same if we ignore the vibes of capital letters" function. let me put you on 🫢


✨ SYNOPSIS ✨

#include <curl/curl.h>

int curl_strequal(const char *str1, const char *str2);

that's it. two strings in, one int out. no drama πŸ’…


🌸 DESCRIPTION 🌸

The curl_strequal(3) function compares the two strings str1 and str2, ignoring the case of the characters. It returns a non-zero (TRUE) integer if the strings are identical.

so like, "HELLO" and "hello"? same girl. same. πŸ’–

now this is the important part β€” this function uses plain ASCII based comparisons completely disregarding the locale β€” contrary to how strcasecmp and other system case insensitive string comparisons usually work. no locale nonsense, no "well actually in this region i and I are different" behavior. straight ASCII, no cap ✨

This function is provided by libcurl to enable applications to compare strings in a truly portable manner. There are no standard portable case insensitive string comparison functions. This function works on all platforms. every single one of them. iconic. πŸ‘‘


πŸ¦‹ PROTOCOLS πŸ¦‹

This functionality affects all supported protocols ✨ (yes, all of them, it's giving universal main character energy 🌈)


πŸŽ€ EXAMPLE πŸŽ€

int main(int argc, char **argv)
{
  const char *name = "compare";
  if(curl_strequal(name, argv[1]))
    printf("Name and input matches\n");
}

look at her go 😭 literally comparing "compare" against whatever you pass in and printing Name and input matches if they match (case doesn't matter, she's not judging). copy it exactly, don't @ me πŸ’€


⭐ AVAILABILITY ⭐

Added in curl 7.1 β€” so she's been serving since forever, a true vintage icon πŸŽ€


πŸ‘‘ RETURN VALUE πŸ‘‘

  • Non-zero if the strings are identical βœ…
  • Zero if they are not ❌

that's the whole vibe check, fr fr πŸ’œ


πŸ’€ SEE ALSO πŸ’€


⚠️ tiny caution bestie: remember this is ASCII-only and locale-blind β€” that's the whole point, but don't expect fancy locale-aware collation behavior, because she will not give it to you πŸ™ˆ

sign-off time πŸŽ€ this page came to you courtesy of libcurl, dated 2026-10-12, and honestly she ate. go compare some strings, babe πŸ’…βœ¨

πŸ“¦ where this page comes from