Update.
[glibc.git] / locale / locale.h
blob41cb669bbec2d0b7c2523a821b8213dcbf61de41
1 /* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
20 * ISO C Standard: 4.4 LOCALIZATION <locale.h>
23 #ifndef _LOCALE_H
24 #define _LOCALE_H 1
26 #include <features.h>
28 #define __need_NULL
29 #include <stddef.h>
31 __BEGIN_DECLS
33 /* These are the possibilities for the first argument to setlocale.
34 The code assumes that LC_ALL is the highest value, and zero the lowest. */
35 #define LC_CTYPE 0
36 #define LC_NUMERIC 1
37 #define LC_TIME 2
38 #define LC_COLLATE 3
39 #define LC_MONETARY 4
40 #define LC_MESSAGES 5
41 #define LC_ALL 6
44 /* Structure giving information about numeric and monetary notation. */
45 struct lconv
47 /* Numeric (non-monetary) information. */
49 char *decimal_point; /* Decimal point character. */
50 char *thousands_sep; /* Thousands separator. */
51 /* Each element is the number of digits in each group;
52 elements with higher indices are farther left.
53 An element with value CHAR_MAX means that no further grouping is done.
54 An element with value 0 means that the previous element is used
55 for all groups farther left. */
56 char *grouping;
58 /* Monetary information. */
60 /* First three chars are a currency symbol from ISO 4217.
61 Fourth char is the separator. Fifth char is '\0'. */
62 char *int_curr_symbol;
63 char *currency_symbol; /* Local currency symbol. */
64 char *mon_decimal_point; /* Decimal point character. */
65 char *mon_thousands_sep; /* Thousands separator. */
66 char *mon_grouping; /* Like `grouping' element (above). */
67 char *positive_sign; /* Sign for positive values. */
68 char *negative_sign; /* Sign for negative values. */
69 char int_frac_digits; /* Int'l fractional digits. */
70 char frac_digits; /* Local fractional digits. */
71 /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */
72 char p_cs_precedes;
73 /* 1 iff a space separates currency_symbol from a positive value. */
74 char p_sep_by_space;
75 /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */
76 char n_cs_precedes;
77 /* 1 iff a space separates currency_symbol from a negative value. */
78 char n_sep_by_space;
79 /* Positive and negative sign positions:
80 0 Parentheses surround the quantity and currency_symbol.
81 1 The sign string precedes the quantity and currency_symbol.
82 2 The sign string follows the quantity and currency_symbol.
83 3 The sign string immediately precedes the currency_symbol.
84 4 The sign string immediately follows the currency_symbol. */
85 char p_sign_posn;
86 char n_sign_posn;
90 /* Set and/or return the current locale. */
91 extern char *setlocale __P ((int __category, __const char *__locale));
93 /* Return the numeric/monetary information for the current locale. */
94 extern struct lconv *localeconv __P ((void));
96 #ifdef __USE_GNU
97 /* The concept of one static locale per category is not very well
98 thought out. Many applications will need to process its data using
99 information from several different locales. Another application is
100 the implementation of the internationalization handling in the
101 upcoming ISO C++ standard library. To support this another set of
102 the functions using locale data exist which have an additional
103 argument.
105 Attention: all these functions are *not* standardized in any form.
106 This is a proof-of-concept implementation. */
108 /* Get locale datatype definition. */
109 # include <xlocale.h>
111 /* Return a reference to a data structure representing a set of locale
112 datasets. Unlike for the CATEGORY parameter for `setlocale' the
113 CATEGORY_MASK parameter here uses a single bit for each category.
114 I.e., 1 << LC_CTYPE means to load data for this category. If
115 BASE is non-null the appropriate category information in the BASE
116 record is replaced. */
117 extern __locale_t __newlocale __P ((int __category_mask,
118 __const char *__locale,
119 __locale_t __base));
121 /* Return a duplicate of the set of locale in DATASET. All usage
122 counters are increased if necessary. */
123 extern __locale_t __duplocale __P ((__locale_t __dataset));
125 /* Free the data associated with a locale dataset previously returned
126 by a call to `setlocale_r'. */
127 extern void __freelocale __P ((__locale_t __dataset));
128 #endif
130 __END_DECLS
132 #endif /* locale.h */