1 .\" This file is part of the Public Domain C Library (PDCLib).
2 .\" Permission is granted to use, modify, and / or redistribute at will.
10 .Nd POSIX extended locale functions
13 .Sy #define _POSIX_C_SOURCE >= 200112L
15 .Vt typedef <anonymous> locale_t;
19 <constant of type locale_t>;
20 .Fn "locale_t uselocale" "locale_t newlocale"
21 .Fn "locale_t duplocale" "locale_t loc"
22 .Fn "locale_t newlocale" "int category_mask" "const char *locale" "locale_t base"
23 .Fn "void freelocale" "locale_t loc"
26 The ISO C standard defines the
28 function, which can be used for modifying the application global locale. In
29 multithreaded programs, it can sometimes be useful to allow a thread to, either
30 temporarily or permanently, assume a different locale from the rest of the
31 application. POSIX defines extended locale functions which permit this.
36 is used to change the locale of the current thread. If
38 is the symbolic constant
39 .Dv LC_GLOBAL_LOCALE ,
40 then the thread locale will be set to the application global locale. If
44 then the locale will not be changed. Otherwise,
46 should be a value returned from either of the
50 functions. The return value will be the previous thread locale; or
52 if the thread has no current locale.
57 is used to make an exact copy of an existing locale. The passed locale object
58 must have been returned from a call to either
66 is used to modify an existing locale or create a new locale. The returned locale
67 will have the properties defined by
69 set to the values from
73 with the remainder being taken from either
75 (which must be a locale object previously returned by
79 if it is specified, or otherwise from the "C" locale.
85 or frees it and creates a new locale.
90 function is used to free a locale previously created via
101 is not a valid locale.
110 is not a valid locale
112 shall be returned if the system had insufficient memory to satisfy the request.
122 contains a bit which does not correspond to a valid category, and may be
125 is not a valid locale object.
127 shall be returned if the system did not have enough memory to allocate a new
128 locale object or read the locale data
130 shall be returned if the locale specified does not contain data for all the
138 .Sh IMPLEMENTATION NOTES