aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-10-31 09:45:17 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-10-31 09:45:17 +0100
commit8fe4bd084412f3085638907268c5ffd8bf93c339 (patch)
tree76559169a181041505bb214e556e8e72028c5118 /lib
parent44c53cc38bea66b7612a82fa4c9b68884b9167fa (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/curlx.h4
-rw-r--r--lib/strcase.c15
-rw-r--r--lib/strcase.h8
3 files changed, 19 insertions, 8 deletions
diff --git a/lib/curlx.h b/lib/curlx.h
index 426467b7f..101491b84 100644
--- a/lib/curlx.h
+++ b/lib/curlx.h
@@ -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
diff --git a/lib/strcase.c b/lib/strcase.c
index 22b9692e2..5f2b700e0 100644
--- a/lib/strcase.c
+++ b/lib/strcase.c
@@ -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);
+}
diff --git a/lib/strcase.h b/lib/strcase.h
index a790653c6..932d79321 100644
--- a/lib/strcase.h
+++ b/lib/strcase.h
@@ -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);