3 .\" This file and its contents are supplied under the terms of the
4 .\" Common Development and Distribution License ("CDDL"), version 1.0.
5 .\" You may only use this file in accordance with the terms of version
8 .\" A full copy of the text of the CDDL should have accompanied this
9 .\" source. A copy of the CDDL is also available via the Internet at
10 .\" http://www.illumos.org/license/CDDL.
13 .\" Copyright (c) 2014 Joyent, Inc. All rights reserved.
14 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
16 .TH NEWLOCALE 3C "Jun 23, 2014"
18 duplocale, freelocale, newlocale \- create, duplicate, and destroy locale objects
24 \fBlocale_t\fR \fBnewlocale\fR(\fBint\fR \fIcategory_mask\fR, \fBconst char *\fR\fIlocale\fR,
25 \fBlocale_t\fR \fIbase\fR);
29 \fBlocale_t\fR \fBduplocale\fR(\fBlocale_t\fR \fIloc\fR);
33 \fBvoid\fR \fBfreelocale\fR(\fBlocale_t\fR \fIloc\fR);
37 These functions manipulate locale objects that can be used
39 and functions that take arguments of type
44 can be used to create a new locale object. It can also be used to modify an
45 existing locale object, the new locale object will be a replacement for the
46 modified locale object. To create a new locale, the argument
48 should be passed the special argument
50 This will use a copy of the current global locale as a starting point. To modify
51 an existing locale object, it should be passed in as the argument
53 The new locale object is constructed by taking the categories specified in
55 from the locale specified by the string
57 and filling in the remaining categories from the locale
61 returns, callers must no longer use
65 has been called on it. In addition to locales defined on the system, the
66 following three locales may always be passed in as the string
70 Specifies the traditional UNIX system behavior.
73 An alternate name fo the locale "C".
76 Indicates that the locale should be processed based in the values in the
85 is a bitwise-inclusive or of the following macros which correspond to categories
92 Character classification and case conversion.
98 Date and time formatting.
107 Formats of informative and diagnostic messages and interactive responses.
110 Mask of all categories.
114 duplicates the locale object specified by
116 If the locale object passed is
117 .BR LC_GLOBAL_LOCALE ,
119 creates a copy of the current global locale as defined through calls to
124 removes and releases all resources associated with the locale object
126 Programs must not call
129 .BR LC_GLOBAL_LOCALE .
132 On success, the functions
136 return a new locale object that can be used with functions that take a
138 Locale objects created this way should be freed with
140 On error, the functions
148 is set to indicate the error. The
150 function does not set
158 functions will fail if:
161 Insufficient memory was available to create the locale object or to load the
162 requested locale data.
166 function will fail if:
169 An unknown bit is specified in
173 Locale data was not found for a category specified in
179 ATTRIBUTE TYPE ATTRIBUTE VALUE
181 Interface Stability Standard