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
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms