8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libbc / inc / include / locale.h
blob1018fb3700a49e3926ee1b30ecc503670b3d135a
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 1988 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef __locale_h
28 #define __locale_h
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * Locale indices.
36 #ifndef NULL
37 #define NULL 0
38 #endif
40 #define LC_ALL 0
41 #define LC_CTYPE 1
42 #define LC_NUMERIC 2
43 #define LC_TIME 3
44 #define LC_MONETARY 4
45 #ifndef _POSIX_SOURCE
46 #define LANGINFO 5
47 #endif
48 #define LC_COLLATE 6
49 #define LC_MESSAGES 7
51 #ifndef _POSIX_SOURCE
52 #define MAXLOCALE 8
54 #define ON 1
55 #define OFF 0
56 /* The maximum number of characters in the locale name */
58 #define MAXLOCALENAME 14
60 /* The maximum number of substitute mappings in LC_COLLATE table */
62 #define MAXSUBS 64
64 /* Max width of domain name */
66 #define MAXDOMAIN 255
68 /* Max width of format string for message domains */
70 #define MAXFMTS 32
72 /* Max width of the message string */
74 #define MAXMSGSTR 255
76 /* The directory where category components are kept */
78 #define LOCALE_DIR "/usr/share/lib/locale/"
80 /* The directory that is private to an individual workstation user */
82 #define PRIVATE_LOCALE_DIR "/etc/locale/"
84 /* The name of the file that contains default locale */
86 #define DEFAULT_LOC ".default"
89 /* size of "ctype" */
91 #define CTYPE_SIZE 514
92 #endif /* _POSIX_SOURCE */
94 extern char * setlocale(/* int category, const char *locale */);
95 extern struct lconv * localeconv(/* void */);
96 #ifndef _POSIX_SOURCE
97 extern struct dtconv * localdtconv();
98 #endif
101 * Numeric and monetary conversion information.
103 struct lconv {
104 char *decimal_point; /* decimal point character */
105 char *thousands_sep; /* thousands separator character */
106 char *grouping; /* grouping of digits */
107 char *int_curr_symbol; /* international currency symbol */
108 char *currency_symbol; /* local currency symbol */
109 char *mon_decimal_point; /* monetary decimal point character */
110 char *mon_thousands_sep; /* monetary thousands separator */
111 char *mon_grouping; /* monetary grouping of digits */
112 char *positive_sign; /* monetary credit symbol */
113 char *negative_sign; /* monetary debit symbol */
114 char int_frac_digits; /* intl monetary number of fractional digits */
115 char frac_digits; /* monetary number of fractional digits */
116 char p_cs_precedes; /* true if currency symbol precedes credit */
117 char p_sep_by_space; /* true if space separates c.s. from credit */
118 char n_cs_precedes; /* true if currency symbol precedes debit */
119 char n_sep_by_space; /* true if space separates c.s. from debit */
120 char p_sign_posn; /* position of sign for credit */
121 char n_sign_posn; /* position of sign for debit */
124 #ifndef _POSIX_SOURCE
126 * Date and time conversion information.
128 struct dtconv {
129 char *abbrev_month_names[12]; /* abbreviated month names */
130 char *month_names[12]; /* full month names */
131 char *abbrev_weekday_names[7]; /* abbreviated weekday names */
132 char *weekday_names[7]; /* full weekday names */
133 char *time_format; /* time format */
134 char *sdate_format; /* short date format */
135 char *dtime_format; /* date/time format */
136 char *am_string; /* AM string */
137 char *pm_string; /* PM string */
138 char *ldate_format; /* long date format */
142 * Langinfo
144 struct langinfo {
145 char *yesstr; /* yes string */
146 char *nostr; /* nostr */
150 * NLS nl_init
152 #define valid(ptr) (ptr != (char *) NULL)
153 #define nl_init(lang) ((valid(lang) && *lang) ? \
154 (valid(setlocale (LC_ALL, lang) ) ? 0 : -1) \
155 : -1)
156 #endif /* _POSIX_SOURCE */
158 #endif /* !__locale_h */