initial import
[platform/upstream/glibc.git] / locale / locale.h
1 /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
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.
8
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.
13
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
16 not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA.  */
18
19 /*
20  *      ANSI Standard: 4.4 LOCALIZATION <locale.h>
21  */
22
23 #ifndef _LOCALE_H
24
25 #define _LOCALE_H       1
26 #include <features.h>
27
28 __BEGIN_DECLS
29
30 /* These are the possibilities for the first argument to setlocale.
31    Note that although they are bit masks, they cannot be OR'd together
32    to form a new argument to pass.  They must be used one at a time.  */
33 #define LC_COLLATE      (1 << 0)
34 #define LC_CTYPE        (1 << 1)
35 #define LC_MONETARY     (1 << 2)
36 #define LC_NUMERIC      (1 << 3)
37 #define LC_TIME         (1 << 4)
38 #define LC_RESPONSE     (1 << 5)
39 #define LC_ALL          (LC_COLLATE|LC_CTYPE|LC_MONETARY|LC_NUMERIC|LC_TIME|\
40                          LC_RESPONSE)
41
42
43 /* Structure giving information about numeric and monetary notation.  */
44 struct lconv
45 {
46   /* Numeric (non-monetary) information.  */
47
48   char *decimal_point;          /* Decimal point character.  */
49   char *thousands_sep;          /* Thousands separator.  */
50   /* Each element is the number of digits in each group;
51      elements with higher indices are farther left.
52      An element with value CHAR_MAX means that no further grouping is done.
53      An element with value 0 means that the previous element is used
54      for all groups farther left.  */
55   char *grouping;
56
57   /* Monetary information.  */
58
59   /* First three chars are a currency symbol from ISO 4217.
60      Fourth char is the separator.  Fifth char is '\0'.  */
61   char *int_curr_symbol;
62   char *currency_symbol;        /* Local currency symbol.  */
63   char *mon_decimal_point;      /* Decimal point character.  */
64   char *mon_thousands_sep;      /* Thousands separator.  */
65   char *mon_grouping;           /* Like `grouping' element (above).  */
66   char *positive_sign;          /* Sign for positive values.  */
67   char *negative_sign;          /* Sign for negative values.  */
68   char int_frac_digits;         /* Int'l fractional digits.  */
69   char frac_digits;             /* Local fractional digits.  */
70   /* 1 if currency_symbol precedes a positive value, 0 if succeeds.  */
71   char p_cs_precedes;
72   /* 1 iff a space separates currency_symbol from a positive value.  */
73   char p_sep_by_space;
74   /* 1 if currency_symbol precedes a negative value, 0 if succeeds.  */
75   char n_cs_precedes;
76   /* 1 iff a space separates currency_symbol from a negative value.  */
77   char n_sep_by_space;
78   /* Positive and negative sign positions:
79      0 Parentheses surround the quantity and currency_symbol.
80      1 The sign string precedes the quantity and currency_symbol.
81      2 The sign string succedes the quantity and currency_symbol.
82      3 The sign string immediately precedes the currency_symbol.
83      4 The sign string immediately succedes the currency_symbol.  */
84   char p_sign_posn;
85   char n_sign_posn;
86 };
87
88
89 /* Set and/or return the current locale.  */
90 extern char *setlocale __P ((int __category, __const char *__locale));
91
92 /* Return the numeric/monetary information for the current locale.  */
93 extern struct lconv *localeconv __P ((void));
94
95 __END_DECLS
96
97 #endif /* locale.h  */