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