1OPENSSL_STRCASECMP(3ossl) OpenSSL OPENSSL_STRCASECMP(3ossl)
2
3
4
6 OPENSSL_strcasecmp, OPENSSL_strncasecmp - compare two strings ignoring
7 case
8
10 #include <openssl/crypto.h>
11
12 int OPENSSL_strcasecmp(const char *s1, const char *s2);
13 int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n);
14
16 The OPENSSL_strcasecmp function performs a byte-by-byte comparison of
17 the strings s1 and s2, ignoring the case of the characters.
18
19 The OPENSSL_strncasecmp function is similar, except that it compares no
20 more than n bytes of s1 and s2.
21
22 In POSIX-compatible system and on Windows these functions use "C"
23 locale for case insensitive. Otherwise the comparison is done in
24 current locale.
25
27 Both functions return an integer less than, equal to, or greater than
28 zero if s1 is found, respectively, to be less than, to match, or be
29 greater than s2.
30
32 OpenSSL extensively uses case insensitive comparison of ASCII strings.
33 Though OpenSSL itself is locale-agnostic, the applications using
34 OpenSSL libraries may unpredictably suffer when they use localization
35 (e.g. Turkish locale is well-known with a specific I/i cases). These
36 functions use C locale for string comparison.
37
39 Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
40
41 Licensed under the Apache License 2.0 (the "License"). You may not use
42 this file except in compliance with the License. You can obtain a copy
43 in the file LICENSE in the source distribution or at
44 <https://www.openssl.org/source/license.html>.
45
46
47
483.0.5 2022-07-05 OPENSSL_STRCASECMP(3ossl)