1f07f0fb6SGarrett D'Amore.\" 2f07f0fb6SGarrett D'Amore.\" This file and its contents are supplied under the terms of the 3f07f0fb6SGarrett D'Amore.\" Common Development and Distribution License ("CDDL"), version 1.0. 4f07f0fb6SGarrett D'Amore.\" You may only use this file in accordance with the terms of version 5f07f0fb6SGarrett D'Amore.\" 1.0 of the CDDL. 6f07f0fb6SGarrett D'Amore.\" 7f07f0fb6SGarrett D'Amore.\" A full copy of the text of the CDDL should have accompanied this 8f07f0fb6SGarrett D'Amore.\" source. A copy of the CDDL is also available via the Internet at 9f07f0fb6SGarrett D'Amore.\" http://www.illumos.org/license/CDDL. 10f07f0fb6SGarrett D'Amore.\" 11f07f0fb6SGarrett D'Amore.\" 12f07f0fb6SGarrett D'Amore.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> 13f07f0fb6SGarrett D'Amore.\" 14*4a8d6d7cSPeter Tribble.Dd "February 17, 2023" 15f07f0fb6SGarrett D'Amore.Dt WCSCASECMP 3C 16f07f0fb6SGarrett D'Amore.Os 17f07f0fb6SGarrett D'Amore.Sh NAME 18f07f0fb6SGarrett D'Amore.Nm wcscasecmp , 19f07f0fb6SGarrett D'Amore.Nm wcscasecmp_l , 20f07f0fb6SGarrett D'Amore.Nm wcsncasecmp , 21f07f0fb6SGarrett D'Amore.Nm wcsncasecmp_l 22f07f0fb6SGarrett D'Amore.Nd case-insensitive wide-character string comparison 23f07f0fb6SGarrett D'Amore.Sh SYNOPSIS 24f07f0fb6SGarrett D'Amore.In wchar.h 25f07f0fb6SGarrett D'Amore. 26f07f0fb6SGarrett D'Amore.Ft int 27f07f0fb6SGarrett D'Amore.Fo wcscasecmp 28f07f0fb6SGarrett D'Amore.Fa "const wchar_t *ws1" 29f07f0fb6SGarrett D'Amore.Fa "const wchar_t *ws2" 30f07f0fb6SGarrett D'Amore.Fc 31f07f0fb6SGarrett D'Amore. 32f07f0fb6SGarrett D'Amore.Ft int 33f07f0fb6SGarrett D'Amore.Fo wcscasecmp_l 34f07f0fb6SGarrett D'Amore.Fa "const wchar_t *ws1" 35f07f0fb6SGarrett D'Amore.Fa "const wchar_t *ws2" 36f07f0fb6SGarrett D'Amore.Fa "locale_t loc" 37f07f0fb6SGarrett D'Amore.Fc 38f07f0fb6SGarrett D'Amore. 39f07f0fb6SGarrett D'Amore.Ft int 40f07f0fb6SGarrett D'Amore.Fo wcsncasecmp 41f07f0fb6SGarrett D'Amore.Fa "const wchar_t *ws1" 42f07f0fb6SGarrett D'Amore.Fa "const wchar_t *ws2" 43f07f0fb6SGarrett D'Amore.Fa "size_t n" 44f07f0fb6SGarrett D'Amore.Fc 45f07f0fb6SGarrett D'Amore. 46f07f0fb6SGarrett D'Amore.Ft int 47f07f0fb6SGarrett D'Amore.Fo wcsncasecmp_l 48f07f0fb6SGarrett D'Amore.Fa "const wchar_t *ws1" 49f07f0fb6SGarrett D'Amore.Fa "const wchar_t *ws2" 50f07f0fb6SGarrett D'Amore.Fa "size_t n" 51f07f0fb6SGarrett D'Amore.Fa "locale_t loc" 52f07f0fb6SGarrett D'Amore.Fc 53f07f0fb6SGarrett D'Amore.Sh DESCRIPTION 54f07f0fb6SGarrett D'AmoreThese functions perform case-insensitive comparison of wide-character 55f07f0fb6SGarrett D'Amorestrings 56f07f0fb6SGarrett D'Amore.Fa ws1 57f07f0fb6SGarrett D'Amoreand 58f07f0fb6SGarrett D'Amore.Fa ws2 . 59f07f0fb6SGarrett D'AmorePairs of wide-characters from each of 60f07f0fb6SGarrett D'Amore.Fa ws1 61f07f0fb6SGarrett D'Amoreand 62f07f0fb6SGarrett D'Amore.Fa ws2 6372d3dbb9SYuri Pankovare compared consecutively, ignoring differences in case (if the "POSIX" locale 6472d3dbb9SYuri Pankovupper case characters are treated as lower case). 6572d3dbb9SYuri PankovIf the two values are different, the comparison stops and either a negative 6672d3dbb9SYuri Pankovvalue is returned if the character from 67f07f0fb6SGarrett D'Amore.Fa ws1 68f07f0fb6SGarrett D'Amoreis less than that from 69f07f0fb6SGarrett D'Amore.Fa ws2 , 70f07f0fb6SGarrett D'Amoreor a positive is returned if the character from 71f07f0fb6SGarrett D'Amore.Fa ws1 72f07f0fb6SGarrett D'Amoreis greater than that from 73f07f0fb6SGarrett D'Amore.Fa ws2 . 74f07f0fb6SGarrett D'AmoreThe comparison also stops if both characters are null wide-characters, 75f07f0fb6SGarrett D'Amoreor, in the case of 76f07f0fb6SGarrett D'Amore.Fn wcsncasecmp 77f07f0fb6SGarrett D'Amoreand 78f07f0fb6SGarrett D'Amore.Fn wcsncasecmp_l , 79f07f0fb6SGarrett D'Amoreafter 80f07f0fb6SGarrett D'Amore.Fa n 8172d3dbb9SYuri Pankovcomparisons have been made without finding a difference. 8272d3dbb9SYuri PankovIn either of these two cases, 0 is returned. 83f07f0fb6SGarrett D'Amore.Lp 84f07f0fb6SGarrett D'AmoreThe 85f07f0fb6SGarrett D'Amore.Fn wcscasecmp 86f07f0fb6SGarrett D'Amoreand 87f07f0fb6SGarrett D'Amore.Fn wcsncasecmp 88f07f0fb6SGarrett D'Amorefunctions use the 89f07f0fb6SGarrett D'Amore.Dv LC_CTYPE 9072d3dbb9SYuri Pankovcategory of the current locale to determine case. 9172d3dbb9SYuri PankovThe 92f07f0fb6SGarrett D'Amore.Fn wcscasecmp_l 93f07f0fb6SGarrett D'Amoreand 94f07f0fb6SGarrett D'Amore.Fn wcsncasecmp_l 95f07f0fb6SGarrett D'Amorefunctions use the 96f07f0fb6SGarrett D'Amore.Dv LC_CTYPE 97f07f0fb6SGarrett D'Amorecategory of the locale pointed to by 98f07f0fb6SGarrett D'Amore.Fa loc 99f07f0fb6SGarrett D'Amoreto determine case. 100f07f0fb6SGarrett D'Amore.Lp 101f07f0fb6SGarrett D'AmorePassing 102f07f0fb6SGarrett D'Amore.Dv LC_GLOBAL_LOCALE 103f07f0fb6SGarrett D'Amorefor 104f07f0fb6SGarrett D'Amore.Fa loc 105f07f0fb6SGarrett D'Amoreresults in undefined behavior. 106f07f0fb6SGarrett D'Amore.Lp 107f07f0fb6SGarrett D'AmoreThe 108f07f0fb6SGarrett D'Amore.Fn wcscasecmp , 109f07f0fb6SGarrett D'Amore.Fn wcsncasecmp , 110f07f0fb6SGarrett D'Amore.Fn wcscasecmp_l , 111f07f0fb6SGarrett D'Amoreand 112f07f0fb6SGarrett D'Amore.Fn wcsncasecmp_l 113f07f0fb6SGarrett D'Amorefunctions are the wide-character equivalents of the 114f07f0fb6SGarrett D'Amore.Fn strcasecmp , 115f07f0fb6SGarrett D'Amore.Fn strncasecmp , 116*4a8d6d7cSPeter Tribble.Fn strcasecmp_l , 117f07f0fb6SGarrett D'Amoreand 118f07f0fb6SGarrett D'Amore.Fn strncasecmp_l 119f07f0fb6SGarrett D'Amorefunctions, respectively. 120f07f0fb6SGarrett D'Amore.Sh RETURN VALUES 121f07f0fb6SGarrett D'AmoreThese functions return a negative value if, ignoring case, 122f07f0fb6SGarrett D'Amore.Fa ws1 123f07f0fb6SGarrett D'Amoreis less than 124f07f0fb6SGarrett D'Amore.Fa ws1 , 125f07f0fb6SGarrett D'Amoreor a positive value if 126f07f0fb6SGarrett D'Amore.Fa ws1 127f07f0fb6SGarrett D'Amoreis greater than 128f07f0fb6SGarrett D'Amore.Fa ws2 , 129f07f0fb6SGarrett D'Amoreor 0 if the both 130f07f0fb6SGarrett D'Amore.Fa ws1 131f07f0fb6SGarrett D'Amoreand 132f07f0fb6SGarrett D'Amore.Fa ws2 133f07f0fb6SGarrett D'Amoreare the same. 134f07f0fb6SGarrett D'Amore.Sh ERRORS 135f07f0fb6SGarrett D'AmoreNone. 136f07f0fb6SGarrett D'Amore.Sh INTERFACE STABILITY 137f07f0fb6SGarrett D'Amore.Sy Standard . 138f07f0fb6SGarrett D'Amore.Sh MT-LEVEL 139f07f0fb6SGarrett D'Amore.Sy MT-Safe . 140f07f0fb6SGarrett D'Amore.Sh SEE ALSO 141f07f0fb6SGarrett D'Amore.Xr newlocale 3C , 142f07f0fb6SGarrett D'Amore.Xr setlocale 3C , 143f07f0fb6SGarrett D'Amore.Xr strcasecmp 3C , 144f07f0fb6SGarrett D'Amore.Xr strcasecmp_l 3C , 145f07f0fb6SGarrett D'Amore.Xr strncasecmp 3C , 146f07f0fb6SGarrett D'Amore.Xr strncasecmp_l 3C , 147f07f0fb6SGarrett D'Amore.Xr uselocale 3C , 148f07f0fb6SGarrett D'Amore.Xr wchar.h 3HEAD , 149bbf21555SRichard Lowe.Xr locale 7 , 150bbf21555SRichard Lowe.Xr standards 7 151f07f0fb6SGarrett D'Amore.Sh STANDARDS 152f07f0fb6SGarrett D'AmoreThe 153f07f0fb6SGarrett D'Amore.Fn wcscasecmp , 154f07f0fb6SGarrett D'Amore.Fn wcsncasecmp , 155f07f0fb6SGarrett D'Amore.Fn wcscasecmp_l , 156f07f0fb6SGarrett D'Amoreand 157f07f0fb6SGarrett D'Amore.Fn wcsncasecmp_l 158f07f0fb6SGarrett D'Amorefunctions were introduced in 159f07f0fb6SGarrett D'Amore.St -p1003.1-2008 . 160