2
0
mirror of https://codeberg.org/kiss-community/repo synced 2025-01-07 18:24:59 -07:00
repo/core/curl/files/curl_strnequal.3

45 lines
1.4 KiB
Groff
Raw Normal View History

.\" generated by cd2nroff 0.1 from curl_strnequal.md
2024-08-02 19:52:59 -06:00
.TH curl_strnequal 3 "2024-08-02" libcurl
.SH NAME
2024-07-29 18:00:04 -06:00
curl_strnequal \- compare two strings ignoring case
.SH SYNOPSIS
.nf
#include <curl/curl.h>
int curl_strnequal(const char *str1, const char *str2, size_t length);
.fi
.SH DESCRIPTION
2024-07-29 18:00:04 -06:00
The \fIcurl_strnequal(3)\fP function compares the two strings \fIstr1\fP and \fIstr2\fP,
ignoring the case of the characters. It returns a non\-zero (TRUE) integer if
the strings are identical.
2024-07-29 18:00:04 -06:00
This function compares no more than the first \fIlength\fP bytes of \fIstr1\fP and
\fIstr2\fP.
2024-07-29 18:00:04 -06:00
This function uses plain ASCII based comparisons completely disregarding the
locale \- contrary to how \fBstrcasecmp\fP and other system case insensitive
string comparisons usually work.
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.
2024-03-30 12:28:04 -06:00
.SH PROTOCOLS
2024-07-29 18:00:04 -06:00
This functionality affects all supported protocols
.SH EXAMPLE
.nf
int main(int argc, char **argv)
{
const char *name = "compare";
if(curl_strnequal(name, argv[1], 5))
printf("Name and input matches in the 5 first bytes\\n");
}
.fi
.SH AVAILABILITY
2024-07-29 18:00:04 -06:00
Added in curl 7.1
.SH RETURN VALUE
Non\-zero if the strings are identical. Zero if they are not.
.SH SEE ALSO
2024-07-29 18:00:04 -06:00
.BR curl_strequal (3),
.BR strcasecmp (3),
.BR strcmp (3)