xref: /dflybsd-src/lib/libc/locale/newlocale.3 (revision 5a3bf4ef93783dc91e940c6d920e4e3f87cdf605)
10d5acd74SJohn Marino.\" Copyright (c) 2011 The FreeBSD Foundation
20d5acd74SJohn Marino.\" All rights reserved.
30d5acd74SJohn Marino.\"
40d5acd74SJohn Marino.\" This documentation was written by David Chisnall under sponsorship from
50d5acd74SJohn Marino.\" the FreeBSD Foundation.
60d5acd74SJohn Marino.\"
70d5acd74SJohn Marino.\" Redistribution and use in source and binary forms, with or without
80d5acd74SJohn Marino.\" modification, are permitted provided that the following conditions
90d5acd74SJohn Marino.\" are met:
100d5acd74SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
110d5acd74SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
120d5acd74SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
130d5acd74SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
140d5acd74SJohn Marino.\"    documentation and/or other materials provided with the distribution.
150d5acd74SJohn Marino.\"
160d5acd74SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
170d5acd74SJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
180d5acd74SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
190d5acd74SJohn Marino.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
200d5acd74SJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
210d5acd74SJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
220d5acd74SJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
230d5acd74SJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
240d5acd74SJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
250d5acd74SJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
260d5acd74SJohn Marino.\" SUCH DAMAGE.
270d5acd74SJohn Marino.\"
281c87de76Szrj.\" $FreeBSD: head/lib/libc/locale/newlocale.3 281925 2015-04-24 10:17:55Z theraven $
290d5acd74SJohn Marino.Dd September 17, 2011
300d5acd74SJohn Marino.Dt NEWLOCALE 3
310d5acd74SJohn Marino.Os
320d5acd74SJohn Marino.Sh NAME
330d5acd74SJohn Marino.Nm newlocale
340d5acd74SJohn Marino.Nd Creates a new locale
350d5acd74SJohn Marino.Sh LIBRARY
360d5acd74SJohn Marino.Lb libc
370d5acd74SJohn Marino.Sh SYNOPSIS
381c87de76Szrj.In locale.h
390d5acd74SJohn Marino.Ft locale_t
400d5acd74SJohn Marino.Fn newlocale "int mask" "const char * locale" "locale_t base"
410d5acd74SJohn Marino.Sh DESCRIPTION
420d5acd74SJohn MarinoCreates a new locale, inheriting some properties from an existing locale.
430d5acd74SJohn MarinoThe
440d5acd74SJohn Marino.Fa mask
450d5acd74SJohn Marinodefines the components that the new locale will have set to the locale with the
460d5acd74SJohn Marinoname specified in the
470d5acd74SJohn Marino.Fa locale
480d5acd74SJohn Marinoparameter.
490d5acd74SJohn MarinoAny other components will be inherited from
500d5acd74SJohn Marino.Fa base .
510d5acd74SJohn MarinoThe
520d5acd74SJohn Marino.Fa mask
530d5acd74SJohn Marinois either
54*5a3bf4efSSascha Wildner.Dv LC_ALL_MASK ,
550d5acd74SJohn Marinoindicating all possible locale components,
560d5acd74SJohn Marinoor the logical OR of some combination of the following:
57*5a3bf4efSSascha Wildner.Bl -tag -width ".Dv LC_MESSAGES_MASK" -offset indent
58*5a3bf4efSSascha Wildner.It Dv LC_COLLATE_MASK
590d5acd74SJohn MarinoThe locale for string collation routines.
600d5acd74SJohn MarinoThis controls alphabetic ordering in
610d5acd74SJohn Marino.Xr strcoll 3
620d5acd74SJohn Marinoand
630d5acd74SJohn Marino.Xr strxfrm 3 .
64*5a3bf4efSSascha Wildner.It Dv LC_CTYPE_MASK
650d5acd74SJohn MarinoThe locale for the
660d5acd74SJohn Marino.Xr ctype 3
670d5acd74SJohn Marinoand
680d5acd74SJohn Marino.Xr multibyte 3
690d5acd74SJohn Marinofunctions.
700d5acd74SJohn MarinoThis controls recognition of upper and lower case, alphabetic or
710d5acd74SJohn Marinonon-alphabetic characters, and so on.
72*5a3bf4efSSascha Wildner.It Dv LC_MESSAGES_MASK
730d5acd74SJohn MarinoSet a locale for message catalogs, see
740d5acd74SJohn Marino.Xr catopen 3
750d5acd74SJohn Marinofunction.
76*5a3bf4efSSascha Wildner.It Dv LC_MONETARY_MASK
770d5acd74SJohn MarinoSet a locale for formatting monetary values; this affects
780d5acd74SJohn Marinothe
790d5acd74SJohn Marino.Xr localeconv 3
800d5acd74SJohn Marinofunction.
81*5a3bf4efSSascha Wildner.It Dv LC_NUMERIC_MASK
820d5acd74SJohn MarinoSet a locale for formatting numbers.
830d5acd74SJohn MarinoThis controls the formatting of decimal points in input and output of floating
840d5acd74SJohn Marinopoint numbers in functions such as
850d5acd74SJohn Marino.Xr printf 3
860d5acd74SJohn Marinoand
870d5acd74SJohn Marino.Xr scanf 3 ,
880d5acd74SJohn Marinoas well as values returned by
890d5acd74SJohn Marino.Xr localeconv 3 .
90*5a3bf4efSSascha Wildner.It Dv LC_TIME_MASK
910d5acd74SJohn MarinoSet a locale for formatting dates and times using the
920d5acd74SJohn Marino.Xr strftime 3
930d5acd74SJohn Marinofunction.
940d5acd74SJohn Marino.El
950d5acd74SJohn MarinoThis function uses the same rules for loading locale components as
960d5acd74SJohn Marino.Xr setlocale 3 .
970d5acd74SJohn Marino.Sh RETURN VALUES
980d5acd74SJohn MarinoReturns a new, valid,
990d5acd74SJohn Marino.Fa locale_t
1000d5acd74SJohn Marinoor NULL if an error occurs.
1010d5acd74SJohn MarinoYou must free the returned locale with
1020d5acd74SJohn Marino.Xr freelocale 3 .
1030d5acd74SJohn Marino.Sh SEE ALSO
1040d5acd74SJohn Marino.Xr duplocale 3 ,
1050d5acd74SJohn Marino.Xr freelocale 3 ,
1060d5acd74SJohn Marino.Xr localeconv 3 ,
1070d5acd74SJohn Marino.Xr querylocale 3 ,
1080d5acd74SJohn Marino.Xr uselocale 3 ,
1090d5acd74SJohn Marino.Xr xlocale 3
1100d5acd74SJohn Marino.Sh STANDARDS
1110d5acd74SJohn MarinoThis function conforms to
1120d5acd74SJohn Marino.St -p1003.1-2008 .
113