1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

curl_strequal: part of public API/ABI, needs to be kept

These two public functions have been mentioned as deprecated since a
very long time but since they are still part of the API and ABI we need
to keep them around.
This commit is contained in:
Daniel Stenberg 2016-10-31 09:45:17 +01:00
parent 44c53cc38b
commit 8fe4bd0844
4 changed files with 20 additions and 9 deletions

View File

@ -73,8 +73,8 @@
*/
#define curlx_getenv curl_getenv
#define curlx_strcasecompare curl_strcasecompare
#define curlx_strncasecompare curl_strncasecompare
#define curlx_strcasecompare curl_strequal
#define curlx_strncasecompare curl_strnequal
#define curlx_mvsnprintf curl_mvsnprintf
#define curlx_msnprintf curl_msnprintf
#define curlx_maprintf curl_maprintf

View File

@ -102,7 +102,7 @@ char Curl_raw_toupper(char in)
* @unittest: 1301
*/
int curl_strcasecompare(const char *first, const char *second)
int Curl_strcasecompare(const char *first, const char *second)
{
while(*first && *second) {
if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
@ -120,7 +120,7 @@ int curl_strcasecompare(const char *first, const char *second)
/*
* @unittest: 1301
*/
int curl_strncasecompare(const char *first, const char *second, size_t max)
int Curl_strncasecompare(const char *first, const char *second, size_t max)
{
while(*first && *second && max) {
if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) {
@ -150,3 +150,14 @@ void Curl_strntoupper(char *dest, const char *src, size_t n)
*dest++ = Curl_raw_toupper(*src);
} while(*src++ && --n);
}
/* --- public functions --- */
int curl_strequal(const char *first, const char *second)
{
return Curl_strcasecompare(first, second);
}
int curl_strnequal(const char *first, const char *second, size_t max)
{
return Curl_strncasecompare(first, second, max);
}

View File

@ -32,11 +32,11 @@
* non-ascii.
*/
#define strcasecompare(a,b) curl_strcasecompare(a,b)
#define strncasecompare(a,b,c) curl_strncasecompare(a,b,c)
#define strcasecompare(a,b) Curl_strcasecompare(a,b)
#define strncasecompare(a,b,c) Curl_strncasecompare(a,b,c)
int curl_strcasecompare(const char *first, const char *second);
int curl_strncasecompare(const char *first, const char *second, size_t max);
int Curl_strcasecompare(const char *first, const char *second);
int Curl_strncasecompare(const char *first, const char *second, size_t max);
char Curl_raw_toupper(char in);

View File

@ -126,7 +126,7 @@ void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo)
keepit = *end;
*end = 0; /* zero terminate */
for(i = 0; replacements[i].name; i++) {
if(curl_strcasecompare(ptr, replacements[i].name)) {
if(curl_strequal(ptr, replacements[i].name)) {
match = TRUE;
switch(replacements[i].id) {
case VAR_EFFECTIVE_URL: