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 <sys/cdefs.h> 44 45 #define __need_NULL 46 #include <stddef.h> 47 48 #define LC_ALL 0 49 #define LC_COLLATE 1 50 #define LC_CTYPE 2 51 #define LC_MONETARY 3 52 #define LC_NUMERIC 4 53 #define LC_TIME 5 54 #define _LC_MESSAGES 6 55 56 _BEGIN_STD_C 57 58 struct lconv 59 { 60 char *decimal_point; 61 char *thousands_sep; 62 char *grouping; 63 char *int_curr_symbol; 64 char *currency_symbol; 65 char *mon_decimal_point; 66 char *mon_thousands_sep; 67 char *mon_grouping; 68 char *positive_sign; 69 char *negative_sign; 70 char int_frac_digits; 71 char frac_digits; 72 char p_cs_precedes; 73 char p_sep_by_space; 74 char n_cs_precedes; 75 char n_sep_by_space; 76 char p_sign_posn; 77 char n_sign_posn; 78 char int_n_cs_precedes; 79 char int_n_sep_by_space; 80 char int_n_sign_posn; 81 char int_p_cs_precedes; 82 char int_p_sep_by_space; 83 char int_p_sign_posn; 84 }; 85 86 char *setlocale (int, const char *); 87 struct lconv *localeconv (void); 88 89 #if __POSIX_VISIBLE >= 200809 90 91 #include <sys/_locale.h> 92 93 #define LC_MESSAGES _LC_MESSAGES 94 95 #define LC_COLLATE_MASK (1 << LC_COLLATE) 96 #define LC_CTYPE_MASK (1 << LC_CTYPE) 97 #define LC_MONETARY_MASK (1 << LC_MONETARY) 98 #define LC_NUMERIC_MASK (1 << LC_NUMERIC) 99 #define LC_TIME_MASK (1 << LC_TIME) 100 #define LC_MESSAGES_MASK (1 << LC_MESSAGES) 101 102 #define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MONETARY_MASK \ 103 | LC_NUMERIC_MASK | LC_TIME_MASK | LC_MESSAGES_MASK) 104 105 #define LC_GLOBAL_LOCALE ((struct __locale_t *) -1) 106 107 locale_t newlocale (int, const char *, locale_t); 108 void freelocale (locale_t); 109 locale_t duplocale (locale_t); 110 locale_t uselocale (locale_t); 111 112 #endif 113 114 #if __POSIX_VISIBLE >= 202405 115 const char *getlocalename_l (int, struct __locale_t *); 116 #endif 117 118 #if __MISC_VISIBLE 119 const char *getlocalename_l (int, struct __locale_t *); 120 #endif 121 122 _END_STD_C 123 124 #endif /* _LOCALE_H_ */ 125