xref: /netbsd-src/crypto/external/bsd/openssl/dist/doc/man3/OPENSSL_strcasecmp.pod (revision b0d1725196a7921d003d2c66a14f186abda4176b)
1*b0d17251Schristos=pod
2*b0d17251Schristos
3*b0d17251Schristos=head1 NAME
4*b0d17251Schristos
5*b0d17251SchristosOPENSSL_strcasecmp, OPENSSL_strncasecmp - compare two strings ignoring case
6*b0d17251Schristos
7*b0d17251Schristos=head1 SYNOPSIS
8*b0d17251Schristos
9*b0d17251Schristos #include <openssl/crypto.h>
10*b0d17251Schristos
11*b0d17251Schristos int OPENSSL_strcasecmp(const char *s1, const char *s2);
12*b0d17251Schristos int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n);
13*b0d17251Schristos
14*b0d17251Schristos=head1 DESCRIPTION
15*b0d17251Schristos
16*b0d17251SchristosThe OPENSSL_strcasecmp function performs a byte-by-byte comparison of the strings
17*b0d17251SchristosB<s1> and B<s2>, ignoring the case of the characters.
18*b0d17251Schristos
19*b0d17251SchristosThe OPENSSL_strncasecmp function is similar, except that it compares no more than
20*b0d17251SchristosB<n> bytes of B<s1> and B<s2>.
21*b0d17251Schristos
22*b0d17251SchristosIn POSIX-compatible system and on Windows these functions use "C" locale for
23*b0d17251Schristoscase insensitive. Otherwise the comparison is done in current locale.
24*b0d17251Schristos
25*b0d17251Schristos=head1 RETURN VALUES
26*b0d17251Schristos
27*b0d17251SchristosBoth functions return an integer less than, equal to, or greater than zero if
28*b0d17251Schristoss1 is found, respectively, to be less than, to match, or be greater than s2.
29*b0d17251Schristos
30*b0d17251Schristos=head1 NOTES
31*b0d17251Schristos
32*b0d17251SchristosOpenSSL extensively uses case insensitive comparison of ASCII strings. Though
33*b0d17251SchristosOpenSSL itself is locale-agnostic, the applications using OpenSSL libraries may
34*b0d17251Schristosunpredictably suffer when they use localization (e.g. Turkish locale is
35*b0d17251Schristoswell-known with a specific I/i cases). These functions use C locale for string
36*b0d17251Schristoscomparison.
37*b0d17251Schristos
38*b0d17251Schristos=head1 COPYRIGHT
39*b0d17251Schristos
40*b0d17251SchristosCopyright 2022 The OpenSSL Project Authors. All Rights Reserved.
41*b0d17251Schristos
42*b0d17251SchristosLicensed under the Apache License 2.0 (the "License").  You may not use
43*b0d17251Schristosthis file except in compliance with the License.  You can obtain a copy
44*b0d17251Schristosin the file LICENSE in the source distribution or at
45*b0d17251SchristosL<https://www.openssl.org/source/license.html>.
46*b0d17251Schristos
47*b0d17251Schristos=cut
48