1716024cdSPeter Avalos.\" Copyright (c) 1990, 1991, 1993 2716024cdSPeter Avalos.\" The Regents of the University of California. All rights reserved. 3716024cdSPeter Avalos.\" 4716024cdSPeter Avalos.\" This code is derived from software contributed to Berkeley by 5716024cdSPeter Avalos.\" Chris Torek and the American National Standards Committee X3, 6716024cdSPeter Avalos.\" on Information Processing Systems. 7716024cdSPeter Avalos.\" 8716024cdSPeter Avalos.\" Redistribution and use in source and binary forms, with or without 9716024cdSPeter Avalos.\" modification, are permitted provided that the following conditions 10716024cdSPeter Avalos.\" are met: 11716024cdSPeter Avalos.\" 1. Redistributions of source code must retain the above copyright 12716024cdSPeter Avalos.\" notice, this list of conditions and the following disclaimer. 13716024cdSPeter Avalos.\" 2. Redistributions in binary form must reproduce the above copyright 14716024cdSPeter Avalos.\" notice, this list of conditions and the following disclaimer in the 15716024cdSPeter Avalos.\" documentation and/or other materials provided with the distribution. 16dc71b7abSJustin C. Sherrill.\" 3. Neither the name of the University nor the names of its contributors 17716024cdSPeter Avalos.\" may be used to endorse or promote products derived from this software 18716024cdSPeter Avalos.\" without specific prior written permission. 19716024cdSPeter Avalos.\" 20716024cdSPeter Avalos.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21716024cdSPeter Avalos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22716024cdSPeter Avalos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23716024cdSPeter Avalos.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24716024cdSPeter Avalos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25716024cdSPeter Avalos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26716024cdSPeter Avalos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27716024cdSPeter Avalos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28716024cdSPeter Avalos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29716024cdSPeter Avalos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30716024cdSPeter Avalos.\" SUCH DAMAGE. 31716024cdSPeter Avalos.\" 32716024cdSPeter Avalos.\" @(#)strcoll.3 8.1 (Berkeley) 6/4/93 330d5acd74SJohn Marino.\" $FreeBSD: head/lib/libc/string/wcscoll.3 251069 2013-05-28 20:57:40Z emaste $ 34716024cdSPeter Avalos.\" 35afaecc57SJohn Marino.Dd July 26, 2015 36716024cdSPeter Avalos.Dt WCSCOLL 3 37716024cdSPeter Avalos.Os 38716024cdSPeter Avalos.Sh NAME 39577b750eSSascha Wildner.Nm wcscoll , 40577b750eSSascha Wildner.Nm wcscoll_l 41716024cdSPeter Avalos.Nd compare wide strings according to current collation 42716024cdSPeter Avalos.Sh LIBRARY 43716024cdSPeter Avalos.Lb libc 44716024cdSPeter Avalos.Sh SYNOPSIS 45716024cdSPeter Avalos.In wchar.h 46716024cdSPeter Avalos.Ft int 47716024cdSPeter Avalos.Fn wcscoll "const wchar_t *s1" "const wchar_t *s2" 48577b750eSSascha Wildner.Ft int 49577b750eSSascha Wildner.Fn wcscoll_l "const wchar_t *s1" "const wchar_t *s2" "locale_t locale" 50716024cdSPeter Avalos.Sh DESCRIPTION 51716024cdSPeter AvalosThe 52716024cdSPeter Avalos.Fn wcscoll 53716024cdSPeter Avalosfunction compares the null-terminated strings 54716024cdSPeter Avalos.Fa s1 55716024cdSPeter Avalosand 56716024cdSPeter Avalos.Fa s2 57716024cdSPeter Avalosaccording to the current locale collation order. 58716024cdSPeter AvalosIn the 59716024cdSPeter Avalos.Dq Li C 60716024cdSPeter Avaloslocale, 61716024cdSPeter Avalos.Fn wcscoll 62716024cdSPeter Avalosis equivalent to 63716024cdSPeter Avalos.Fn wcscmp . 64577b750eSSascha Wildner.Pp 65577b750eSSascha WildnerThe 66afaecc57SJohn Marino.Fn wcscoll_l 67577b750eSSascha Wildnerfunction is identical to 68afaecc57SJohn Marino.Fn wcscoll 69577b750eSSascha Wildnerbut takes an explicit 70577b750eSSascha Wildner.Fa locale 71577b750eSSascha Wildnerargument, whereas 72afaecc57SJohn Marino.Fn wcscoll 73577b750eSSascha Wildneruses the current global or per-thread locale. 74716024cdSPeter Avalos.Sh RETURN VALUES 75716024cdSPeter AvalosThe 76716024cdSPeter Avalos.Fn wcscoll 77577b750eSSascha Wildnerand 78577b750eSSascha Wildner.Fn wcscoll_l 79577b750eSSascha Wildnerfunctions return an integer greater than, equal to, or less than 0, 80716024cdSPeter Avalosif 81716024cdSPeter Avalos.Fa s1 82716024cdSPeter Avalosis greater than, equal to, or less than 83716024cdSPeter Avalos.Fa s2 . 84716024cdSPeter Avalos.Pp 85716024cdSPeter AvalosNo return value is reserved to indicate errors; 86716024cdSPeter Avaloscallers should set 87716024cdSPeter Avalos.Va errno 88716024cdSPeter Avalosto 0 before calling 89716024cdSPeter Avalos.Fn wcscoll . 90716024cdSPeter AvalosIf it is non-zero upon return from 91716024cdSPeter Avalos.Fn wcscoll , 92716024cdSPeter Avalosan error has occurred. 93716024cdSPeter Avalos.Sh ERRORS 94716024cdSPeter AvalosThe 95716024cdSPeter Avalos.Fn wcscoll 96577b750eSSascha Wildnerand 97577b750eSSascha Wildner.Fn wcscoll_l 98577b750eSSascha Wildnerfunctions will fail if: 99716024cdSPeter Avalos.Bl -tag -width Er 100716024cdSPeter Avalos.It Bq Er EILSEQ 101716024cdSPeter AvalosAn invalid wide character code was specified. 102716024cdSPeter Avalos.It Bq Er ENOMEM 103716024cdSPeter AvalosCannot allocate enough memory for temporary buffers. 104716024cdSPeter Avalos.El 105716024cdSPeter Avalos.Sh SEE ALSO 106716024cdSPeter Avalos.Xr setlocale 3 , 107716024cdSPeter Avalos.Xr strcoll 3 , 108716024cdSPeter Avalos.Xr wcscmp 3 , 109716024cdSPeter Avalos.Xr wcsxfrm 3 110716024cdSPeter Avalos.Sh STANDARDS 111716024cdSPeter AvalosThe 112716024cdSPeter Avalos.Fn wcscoll 113716024cdSPeter Avalosfunction 114716024cdSPeter Avalosconforms to 115716024cdSPeter Avalos.St -isoC-99 . 116*681546acSSascha WildnerThe 117*681546acSSascha Wildner.Fn wcscoll_l 118*681546acSSascha Wildnerfunction conforms to 119*681546acSSascha Wildner.St -p1003.1-2008 . 120716024cdSPeter Avalos.Sh BUGS 121716024cdSPeter AvalosThe current implementation of 122716024cdSPeter Avalos.Fn wcscoll 123577b750eSSascha Wildnerand 124577b750eSSascha Wildner.Fn wcscoll_l 125716024cdSPeter Avalosonly works in single-byte 126716024cdSPeter Avalos.Dv LC_CTYPE 127716024cdSPeter Avaloslocales, and falls back to using 128716024cdSPeter Avalos.Fn wcscmp 129716024cdSPeter Avalosin locales with extended character sets. 130