1*6236dae4SAndroid Build Coastguard Worker--- 2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al. 3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl 4*6236dae4SAndroid Build Coastguard WorkerTitle: curl_strequal 5*6236dae4SAndroid Build Coastguard WorkerSection: 3 6*6236dae4SAndroid Build Coastguard WorkerSource: libcurl 7*6236dae4SAndroid Build Coastguard WorkerSee-also: 8*6236dae4SAndroid Build Coastguard Worker - curl_strnequal (3) 9*6236dae4SAndroid Build Coastguard Worker - strcasecmp (3) 10*6236dae4SAndroid Build Coastguard Worker - strcmp (3) 11*6236dae4SAndroid Build Coastguard WorkerProtocol: 12*6236dae4SAndroid Build Coastguard Worker - All 13*6236dae4SAndroid Build Coastguard WorkerAdded-in: 7.1 14*6236dae4SAndroid Build Coastguard Worker--- 15*6236dae4SAndroid Build Coastguard Worker 16*6236dae4SAndroid Build Coastguard Worker# NAME 17*6236dae4SAndroid Build Coastguard Worker 18*6236dae4SAndroid Build Coastguard Workercurl_strequal - compare two strings ignoring case 19*6236dae4SAndroid Build Coastguard Worker 20*6236dae4SAndroid Build Coastguard Worker# SYNOPSIS 21*6236dae4SAndroid Build Coastguard Worker 22*6236dae4SAndroid Build Coastguard Worker~~~c 23*6236dae4SAndroid Build Coastguard Worker#include <curl/curl.h> 24*6236dae4SAndroid Build Coastguard Worker 25*6236dae4SAndroid Build Coastguard Workerint curl_strequal(const char *str1, const char *str2); 26*6236dae4SAndroid Build Coastguard Worker~~~ 27*6236dae4SAndroid Build Coastguard Worker 28*6236dae4SAndroid Build Coastguard Worker# DESCRIPTION 29*6236dae4SAndroid Build Coastguard Worker 30*6236dae4SAndroid Build Coastguard WorkerThe curl_strequal(3) function compares the two strings *str1* and *str2*, 31*6236dae4SAndroid Build Coastguard Workerignoring the case of the characters. It returns a non-zero (TRUE) integer if 32*6236dae4SAndroid Build Coastguard Workerthe strings are identical. 33*6236dae4SAndroid Build Coastguard Worker 34*6236dae4SAndroid Build Coastguard WorkerThis function uses plain ASCII based comparisons completely disregarding the 35*6236dae4SAndroid Build Coastguard Workerlocale - contrary to how **strcasecmp** and other system case insensitive 36*6236dae4SAndroid Build Coastguard Workerstring comparisons usually work. 37*6236dae4SAndroid Build Coastguard Worker 38*6236dae4SAndroid Build Coastguard WorkerThis function is provided by libcurl to enable applications to compare strings 39*6236dae4SAndroid Build Coastguard Workerin a truly portable manner. There are no standard portable case insensitive 40*6236dae4SAndroid Build Coastguard Workerstring comparison functions. This function works on all platforms. 41*6236dae4SAndroid Build Coastguard Worker 42*6236dae4SAndroid Build Coastguard Worker# %PROTOCOLS% 43*6236dae4SAndroid Build Coastguard Worker 44*6236dae4SAndroid Build Coastguard Worker# EXAMPLE 45*6236dae4SAndroid Build Coastguard Worker 46*6236dae4SAndroid Build Coastguard Worker~~~c 47*6236dae4SAndroid Build Coastguard Workerint main(int argc, char **argv) 48*6236dae4SAndroid Build Coastguard Worker{ 49*6236dae4SAndroid Build Coastguard Worker const char *name = "compare"; 50*6236dae4SAndroid Build Coastguard Worker if(curl_strequal(name, argv[1])) 51*6236dae4SAndroid Build Coastguard Worker printf("Name and input matches\n"); 52*6236dae4SAndroid Build Coastguard Worker} 53*6236dae4SAndroid Build Coastguard Worker~~~ 54*6236dae4SAndroid Build Coastguard Worker 55*6236dae4SAndroid Build Coastguard Worker# %AVAILABILITY% 56*6236dae4SAndroid Build Coastguard Worker 57*6236dae4SAndroid Build Coastguard Worker# RETURN VALUE 58*6236dae4SAndroid Build Coastguard Worker 59*6236dae4SAndroid Build Coastguard WorkerNon-zero if the strings are identical. Zero if they are not. 60