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