1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: curl_strnequal 5Section: 3 6Source: libcurl 7See-also: 8 - curl_strequal (3) 9 - strcasecmp (3) 10 - strcmp (3) 11Protocol: 12 - All 13Added-in: 7.1 14--- 15 16# NAME 17 18curl_strnequal - compare two strings ignoring case 19 20# SYNOPSIS 21 22~~~c 23#include <curl/curl.h> 24 25int curl_strnequal(const char *str1, const char *str2, size_t length); 26~~~ 27 28# DESCRIPTION 29 30The curl_strnequal(3) function compares the two strings *str1* and *str2*, 31ignoring the case of the characters. It returns a non-zero (TRUE) integer if 32the strings are identical. 33 34This function compares no more than the first *length* bytes of *str1* and 35*str2*. 36 37This function uses plain ASCII based comparisons completely disregarding the 38locale - contrary to how **strcasecmp** and other system case insensitive 39string comparisons usually work. 40 41This function is provided by libcurl to enable applications to compare strings 42in a truly portable manner. There are no standard portable case insensitive 43string comparison functions. This function works on all platforms. 44 45# %PROTOCOLS% 46 47# EXAMPLE 48 49~~~c 50int main(int argc, char **argv) 51{ 52 const char *name = "compare"; 53 if(curl_strnequal(name, argv[1], 5)) 54 printf("Name and input matches in the 5 first bytes\n"); 55} 56~~~ 57 58# %AVAILABILITY% 59 60# RETURN VALUE 61 62Non-zero if the strings are identical. Zero if they are not. 63