|
0
|
1 #ifndef CYGONCE_LIBC_LOCALE_H |
|
|
2 #define CYGONCE_LIBC_LOCALE_H |
|
|
3 //======================================================================== |
|
|
4 // |
|
|
5 // locale.h |
|
|
6 // |
|
|
7 // Standard ISO C internationalisation (i18n) and localisation (i10n) |
|
|
8 // |
|
|
9 //======================================================================== |
|
|
10 //####COPYRIGHTBEGIN#### |
|
|
11 // |
|
|
12 // ------------------------------------------- |
|
|
13 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
14 // Version 1.0 (the "License"); you may not use this file except in |
|
|
15 // compliance with the License. You may obtain a copy of the License at |
|
|
16 // http://sourceware.cygnus.com/ecos |
|
|
17 // |
|
|
18 // Software distributed under the License is distributed on an "AS IS" |
|
|
19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
20 // License for the specific language governing rights and limitations under |
|
|
21 // the License. |
|
|
22 // |
|
|
23 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
24 // September 30, 1998. |
|
|
25 // |
|
|
26 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
|
27 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. |
|
|
28 // ------------------------------------------- |
|
|
29 // |
|
|
30 //####COPYRIGHTEND#### |
|
|
31 //======================================================================== |
|
|
32 //#####DESCRIPTIONBEGIN#### |
|
|
33 // |
|
|
34 // Author(s): jlarmour@cygnus.co.uk |
|
|
35 // Contributors: jlarmour@cygnus.co.uk |
|
|
36 // Date: 1998-08-31 |
|
|
37 // Purpose: |
|
|
38 // Description: This implementation is designed to implement the contents |
|
|
39 // of ISO C section 7.4 |
|
|
40 // Usage: #include <locale.h> |
|
|
41 // |
|
|
42 //####DESCRIPTIONEND#### |
|
|
43 // |
|
|
44 //======================================================================== |
|
|
45 |
|
|
46 // CONFIGURATION |
|
|
47 |
|
|
48 #include <pkgconf/libc.h> // Configuration header |
|
|
49 |
|
|
50 // Include the C library? |
|
|
51 #ifdef CYGPKG_LIBC |
|
|
52 |
|
|
53 // INCLUDES |
|
|
54 |
|
|
55 #include <cyg/infra/cyg_type.h> // Common type definitions and support |
|
|
56 #include <stddef.h> // locale.h must provide NULL |
|
|
57 |
|
|
58 // TYPE DEFINITIONS |
|
|
59 |
|
|
60 // struct lconv contains information about numeric and monetary numbers |
|
|
61 // and is described in the ISO C standard section 7.4 |
|
|
62 |
|
|
63 struct lconv { |
|
|
64 |
|
|
65 // the following affect formatted NONMONETARY QUANTITIES only |
|
|
66 char *decimal_point; // decimal point |
|
|
67 char *thousands_sep; // separates groups of digits before decimal |
|
|
68 // point |
|
|
69 char *grouping; // string whose elements indicate the size |
|
|
70 // of each group of digits |
|
|
71 |
|
|
72 // the following affect formatted MONETARY QUANTITIES only |
|
|
73 char *int_curr_symbol; // international curreny symbol |
|
|
74 char *currency_symbol; // local currency symbol |
|
|
75 char *mon_decimal_point; // decimal point |
|
|
76 char *mon_thousands_sep; // separator for groups of digits |
|
|
77 // before the decimal point |
|
|
78 char *mon_grouping; // string whose elements indicate the size |
|
|
79 // of each group of digits |
|
|
80 char *positive_sign; // string to indicate zero or positive value |
|
|
81 char *negative_sign; // string to indicate negative value |
|
|
82 char int_frac_digits; // number of digits after decimal point for |
|
|
83 // internationally formatted monetary nums |
|
|
84 char frac_digits; // number of digits after decimal point for |
|
|
85 // formatted monetary nums |
|
|
86 char p_cs_precedes; // 1 if currency_symbol precedes non-negative |
|
|
87 // monetary quantity. 0 if succeeds |
|
|
88 char p_sep_by_space; // 1 if currency_symbol separated from value |
|
|
89 // of non-negative monetary quantity by space. |
|
|
90 // Otherwise 0. |
|
|
91 char n_cs_precedes; // 1 if currency_symbol precedes negative |
|
|
92 // monetary quantity. 0 if succeeds |
|
|
93 char n_sep_by_space; // 1 if currency_symbol separated from value |
|
|
94 // of negative monetary quantity by space. |
|
|
95 // Otherwise 0. |
|
|
96 char p_sign_posn; // set according to position of positive_sign |
|
|
97 char n_sign_posn; // set according to position of negative_sign |
|
|
98 }; |
|
|
99 |
|
|
100 // CONSTANTS |
|
|
101 |
|
|
102 #define LC_COLLATE (1<<0) |
|
|
103 #define LC_CTYPE (1<<1) |
|
|
104 #define LC_MONETARY (1<<2) |
|
|
105 #define LC_NUMERIC (1<<3) |
|
|
106 #define LC_TIME (1<<4) |
|
|
107 #define LC_ALL (LC_COLLATE|LC_CTYPE|LC_MONETARY|LC_NUMERIC|LC_TIME) |
|
|
108 |
|
|
109 // FUNCTION PROTOTYPES |
|
|
110 |
|
|
111 externC char * |
|
|
112 setlocale( int /* category */, const char * /* locale */ ); |
|
|
113 |
|
|
114 externC struct lconv * |
|
|
115 localeconv( void ); |
|
|
116 |
|
|
117 |
|
|
118 #endif // ifdef CYGPKG_LIBC |
|
|
119 |
|
|
120 #endif // CYGONCE_LIBC_LOCALE_H multiple inclusion protection |
|
|
121 |
|
|
122 // EOF locale.h |