1 /*
2 Copyright (c) 1991, 1993
3 The Regents of the University of California.  All rights reserved.
4 c) UNIX System Laboratories, Inc.
5 All or some portions of this file are derived from material licensed
6 to the University of California by American Telephone and Telegraph
7 Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 the permission of UNIX System Laboratories, Inc.
9 
10 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions
12 are met:
13 1. Redistributions of source code must retain the above copyright
14 notice, this list of conditions and the following disclaimer.
15 2. Redistributions in binary form must reproduce the above copyright
16 notice, this list of conditions and the following disclaimer in the
17 documentation and/or other materials provided with the distribution.
18 3. Neither the name of the University nor the names of its contributors
19 may be used to endorse or promote products derived from this software
20 without specific prior written permission.
21 
22 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 SUCH DAMAGE.
33  */
34 /*
35 	locale.h
36 	Values appropriate for the formatting of monetary and other
37 	numberic quantities.
38 */
39 
40 #ifndef _LOCALE_H_
41 #define _LOCALE_H_
42 
43 #include "_ansi.h"
44 #include <sys/cdefs.h>
45 
46 #define __need_NULL
47 #include <stddef.h>
48 
49 #define LC_ALL	    0
50 #define LC_COLLATE  1
51 #define LC_CTYPE    2
52 #define LC_MONETARY 3
53 #define LC_NUMERIC  4
54 #define LC_TIME     5
55 #define LC_MESSAGES 6
56 
57 #if __POSIX_VISIBLE >= 200809 || defined (_LIBC)
58 
59 #include <sys/_locale.h>
60 
61 #define LC_ALL_MASK		(1 << LC_ALL)
62 #define LC_COLLATE_MASK		(1 << LC_COLLATE)
63 #define LC_CTYPE_MASK		(1 << LC_CTYPE)
64 #define LC_MONETARY_MASK	(1 << LC_MONETARY)
65 #define LC_NUMERIC_MASK		(1 << LC_NUMERIC)
66 #define LC_TIME_MASK		(1 << LC_TIME)
67 #define LC_MESSAGES_MASK	(1 << LC_MESSAGES)
68 
69 #define LC_GLOBAL_LOCALE	((struct __locale_t *) -1)
70 
71 #endif /* __POSIX_VISIBLE >= 200809 */
72 
73 _BEGIN_STD_C
74 
75 struct lconv
76 {
77   char *decimal_point;
78   char *thousands_sep;
79   char *grouping;
80   char *int_curr_symbol;
81   char *currency_symbol;
82   char *mon_decimal_point;
83   char *mon_thousands_sep;
84   char *mon_grouping;
85   char *positive_sign;
86   char *negative_sign;
87   char int_frac_digits;
88   char frac_digits;
89   char p_cs_precedes;
90   char p_sep_by_space;
91   char n_cs_precedes;
92   char n_sep_by_space;
93   char p_sign_posn;
94   char n_sign_posn;
95   char int_n_cs_precedes;
96   char int_n_sep_by_space;
97   char int_n_sign_posn;
98   char int_p_cs_precedes;
99   char int_p_sep_by_space;
100   char int_p_sign_posn;
101 };
102 
103 #ifndef _REENT_ONLY
104 
105 char *setlocale (int, const char *);
106 struct lconv *localeconv (void);
107 
108 #if __POSIX_VISIBLE >= 200809
109 locale_t newlocale (int, const char *, locale_t);
110 void freelocale (locale_t);
111 locale_t duplocale (locale_t);
112 locale_t uselocale (locale_t);
113 #endif /* __POSIX_VISIBLE >= 200809 */
114 
115 #endif /* _REENT_ONLY */
116 
117 _END_STD_C
118 
119 #endif /* _LOCALE_H_ */
120