2016-09-30 23:15:05 +08:00
|
|
|
#ifndef HEADER_CURL_STRCASE_H
|
|
|
|
#define HEADER_CURL_STRCASE_H
|
2002-09-03 19:52:59 +08:00
|
|
|
/***************************************************************************
|
2004-06-13 16:32:57 +08:00
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
2000-05-22 22:09:31 +08:00
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2022-02-03 20:04:30 +08:00
|
|
|
* Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2000-05-22 22:09:31 +08:00
|
|
|
*
|
2002-09-03 19:52:59 +08:00
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
* are also available at https://curl.se/docs/copyright.html.
|
2004-06-13 16:32:57 +08:00
|
|
|
*
|
2001-01-03 17:29:33 +08:00
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
2002-09-03 19:52:59 +08:00
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
2000-05-22 22:09:31 +08:00
|
|
|
*
|
2001-01-03 17:29:33 +08:00
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
2000-05-22 22:09:31 +08:00
|
|
|
*
|
2002-09-03 19:52:59 +08:00
|
|
|
* SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
*
|
2002-09-03 19:52:59 +08:00
|
|
|
***************************************************************************/
|
2001-01-05 18:11:41 +08:00
|
|
|
|
2004-11-09 22:00:56 +08:00
|
|
|
#include <curl/curl.h>
|
|
|
|
|
2016-10-01 00:54:02 +08:00
|
|
|
/*
|
|
|
|
* Only "raw" case insensitive strings. This is meant to be locale independent
|
|
|
|
* and only compare strings we know are safe for this.
|
|
|
|
*
|
2022-02-03 20:04:30 +08:00
|
|
|
* The function is capable of comparing a-z case insensitively.
|
2022-03-31 17:25:56 +08:00
|
|
|
*
|
|
|
|
* Result is 1 if text matches and 0 if not.
|
2016-10-01 00:54:02 +08:00
|
|
|
*/
|
|
|
|
|
2016-10-31 16:45:17 +08:00
|
|
|
#define strcasecompare(a,b) Curl_strcasecompare(a,b)
|
|
|
|
#define strncasecompare(a,b,c) Curl_strncasecompare(a,b,c)
|
2000-05-22 22:09:31 +08:00
|
|
|
|
2016-10-31 16:45:17 +08:00
|
|
|
int Curl_strcasecompare(const char *first, const char *second);
|
2016-11-17 01:49:15 +08:00
|
|
|
int Curl_safe_strcasecompare(const char *first, const char *second);
|
2016-10-31 16:45:17 +08:00
|
|
|
int Curl_strncasecompare(const char *first, const char *second, size_t max);
|
2012-12-28 19:03:09 +08:00
|
|
|
|
2016-10-01 00:54:02 +08:00
|
|
|
char Curl_raw_toupper(char in);
|
|
|
|
|
|
|
|
/* checkprefix() is a shorter version of the above, used when the first
|
2022-02-20 22:16:07 +08:00
|
|
|
argument is the string literal */
|
|
|
|
#define checkprefix(a,b) curl_strnequal(b, STRCONST(a))
|
2016-10-01 00:54:02 +08:00
|
|
|
|
|
|
|
void Curl_strntoupper(char *dest, const char *src, size_t n);
|
2019-09-23 04:17:12 +08:00
|
|
|
void Curl_strntolower(char *dest, const char *src, size_t n);
|
2016-09-30 23:15:05 +08:00
|
|
|
|
2022-04-25 17:44:05 +08:00
|
|
|
bool Curl_safecmp(char *a, char *b);
|
|
|
|
|
2016-09-30 23:15:05 +08:00
|
|
|
#endif /* HEADER_CURL_STRCASE_H */
|