sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 1999
|
sl@0
|
3 |
* Silicon Graphics Computer Systems, Inc.
|
sl@0
|
4 |
*
|
sl@0
|
5 |
* Copyright (c) 1999
|
sl@0
|
6 |
* Boris Fomitchev
|
sl@0
|
7 |
*
|
sl@0
|
8 |
* This material is provided "as is", with absolutely no warranty expressed
|
sl@0
|
9 |
* or implied. Any use is at your own risk.
|
sl@0
|
10 |
*
|
sl@0
|
11 |
* Permission to use or copy this software for any purpose is hereby granted
|
sl@0
|
12 |
* without fee, provided the above notices are retained on all copies.
|
sl@0
|
13 |
* Permission to modify the code and to distribute modified code is granted,
|
sl@0
|
14 |
* provided the above notices are retained, and a notice that the code was
|
sl@0
|
15 |
* modified is included with the above copyright notice.
|
sl@0
|
16 |
*
|
sl@0
|
17 |
*/
|
sl@0
|
18 |
|
sl@0
|
19 |
/*
|
sl@0
|
20 |
* It is impossible to write the C++ locale library in terms of locales
|
sl@0
|
21 |
* as defined in the C standard. Instead, we write the C++ locale and I/O
|
sl@0
|
22 |
* library in terms of a low level C-like interface. This file defines
|
sl@0
|
23 |
* that interface.
|
sl@0
|
24 |
*
|
sl@0
|
25 |
* The low-level locale interface can't be written portably; there
|
sl@0
|
26 |
* must be a version of it for each platform that the C++ library
|
sl@0
|
27 |
* is ported to. On many systems this interface may be a thin wrapper
|
sl@0
|
28 |
* for existing functionality.
|
sl@0
|
29 |
*/
|
sl@0
|
30 |
|
sl@0
|
31 |
#ifndef _STLP_C_LOCALE_IMPL_H
|
sl@0
|
32 |
#define _STLP_C_LOCALE_IMPL_H
|
sl@0
|
33 |
|
sl@0
|
34 |
#include "stlport_prefix.h"
|
sl@0
|
35 |
#include <stl/c_locale.h>
|
sl@0
|
36 |
|
sl@0
|
37 |
#ifdef _STLP_REAL_LOCALE_IMPLEMENTED
|
sl@0
|
38 |
# if defined (_STLP_USE_GLIBC) && !defined (__CYGWIN__)
|
sl@0
|
39 |
# include <nl_types.h>
|
sl@0
|
40 |
# endif
|
sl@0
|
41 |
#endif
|
sl@0
|
42 |
|
sl@0
|
43 |
/*
|
sl@0
|
44 |
* A number: the maximum length of a simple locale name.
|
sl@0
|
45 |
* (i.e. a name like like en_US, as opposed to a name like
|
sl@0
|
46 |
* en_US/de_AT/de_AT/es_MX/en_US/en_US) */
|
sl@0
|
47 |
#define _Locale_MAX_SIMPLE_NAME 256
|
sl@0
|
48 |
|
sl@0
|
49 |
/*
|
sl@0
|
50 |
* Maximum length of a composite locale.
|
sl@0
|
51 |
*/
|
sl@0
|
52 |
#define _Locale_MAX_COMPOSITE_NAME 6*(_Locale_MAX_SIMPLE_NAME+3)
|
sl@0
|
53 |
|
sl@0
|
54 |
#ifdef __cplusplus
|
sl@0
|
55 |
extern "C" {
|
sl@0
|
56 |
#endif
|
sl@0
|
57 |
|
sl@0
|
58 |
/*
|
sl@0
|
59 |
* Typedefs:
|
sl@0
|
60 |
*/
|
sl@0
|
61 |
#if ((defined (__GNUC__) && !defined (__MINGW32__)) || defined (_KCC) || defined (__ICC)) && (!defined (__SYMBIAN32__))
|
sl@0
|
62 |
typedef unsigned short int _Locale_mask_t;
|
sl@0
|
63 |
#else
|
sl@0
|
64 |
typedef unsigned int _Locale_mask_t;
|
sl@0
|
65 |
#endif
|
sl@0
|
66 |
|
sl@0
|
67 |
/* Function called during STLport library load phase. Might contain any
|
sl@0
|
68 |
* code necessary to the platform localization layer.
|
sl@0
|
69 |
*/
|
sl@0
|
70 |
void _Locale_init();
|
sl@0
|
71 |
|
sl@0
|
72 |
/* Function called during STLport library unload. Might contain any
|
sl@0
|
73 |
* code necessary to the platform localization layer.
|
sl@0
|
74 |
*/
|
sl@0
|
75 |
void _Locale_final();
|
sl@0
|
76 |
|
sl@0
|
77 |
/* Create a category of the locale with the given name.
|
sl@0
|
78 |
*
|
sl@0
|
79 |
* The char* argument is a simple (not a composite) locale name, which may
|
sl@0
|
80 |
* neither be an empty string nor a null pointer.
|
sl@0
|
81 |
*
|
sl@0
|
82 |
* These functions return NULL to indicate failure.
|
sl@0
|
83 |
*
|
sl@0
|
84 |
* Note These functions return a void* instead of the appropriate
|
sl@0
|
85 |
* _Locale_* struct because they are used with __acquire_category which
|
sl@0
|
86 |
* requires that all functions have the same signature.
|
sl@0
|
87 |
*/
|
sl@0
|
88 |
void * _Locale_ctype_create(const char *, struct _Locale_name_hint*);
|
sl@0
|
89 |
void * _Locale_numeric_create(const char *, struct _Locale_name_hint*);
|
sl@0
|
90 |
void * _Locale_time_create(const char *, struct _Locale_name_hint*);
|
sl@0
|
91 |
void * _Locale_collate_create(const char *, struct _Locale_name_hint*);
|
sl@0
|
92 |
void * _Locale_monetary_create(const char *, struct _Locale_name_hint*);
|
sl@0
|
93 |
void * _Locale_messages_create(const char *, struct _Locale_name_hint*);
|
sl@0
|
94 |
|
sl@0
|
95 |
|
sl@0
|
96 |
/* Release a category of a locale
|
sl@0
|
97 |
*
|
sl@0
|
98 |
* These functions are used to release a category acquired with the
|
sl@0
|
99 |
* according _Locale_*_create() functions.
|
sl@0
|
100 |
*
|
sl@0
|
101 |
* Note: For the same reasons as for the *_create functions, these
|
sl@0
|
102 |
* take void* instead of the correct types so that they can be used
|
sl@0
|
103 |
* with __release_category.
|
sl@0
|
104 |
*/
|
sl@0
|
105 |
void _Locale_ctype_destroy(void *);
|
sl@0
|
106 |
void _Locale_numeric_destroy(void *);
|
sl@0
|
107 |
void _Locale_time_destroy(void *);
|
sl@0
|
108 |
void _Locale_collate_destroy(void *);
|
sl@0
|
109 |
void _Locale_monetary_destroy(void *);
|
sl@0
|
110 |
void _Locale_messages_destroy(void *);
|
sl@0
|
111 |
|
sl@0
|
112 |
|
sl@0
|
113 |
/*
|
sl@0
|
114 |
* Returns the name of the user's default locale in each
|
sl@0
|
115 |
* category, as a null-terminated string. A NULL value
|
sl@0
|
116 |
* means the default "C" locale.
|
sl@0
|
117 |
*/
|
sl@0
|
118 |
const char * _Locale_ctype_default(char * __buf);
|
sl@0
|
119 |
const char * _Locale_numeric_default(char * __buf);
|
sl@0
|
120 |
const char * _Locale_time_default(char * __buf);
|
sl@0
|
121 |
const char * _Locale_collate_default(char * __buf);
|
sl@0
|
122 |
const char * _Locale_monetary_default(char * __buf);
|
sl@0
|
123 |
const char * _Locale_messages_default(char * __buf);
|
sl@0
|
124 |
|
sl@0
|
125 |
|
sl@0
|
126 |
/* Retrieve the name of the given category
|
sl@0
|
127 |
*
|
sl@0
|
128 |
* __buf points to a buffer that can hold at least _Locale_MAX_SIMPLE_NAME
|
sl@0
|
129 |
* characters. These functions store the name, as a null-terminated
|
sl@0
|
130 |
* string, in __buf.
|
sl@0
|
131 |
* TODO: can this fail? How is that signalled then?
|
sl@0
|
132 |
*/
|
sl@0
|
133 |
char const* _Locale_ctype_name(const void *, char* __buf);
|
sl@0
|
134 |
char const* _Locale_numeric_name(const void *, char* __buf);
|
sl@0
|
135 |
char const* _Locale_time_name(const void *, char* __buf);
|
sl@0
|
136 |
char const* _Locale_collate_name(const void *, char* __buf);
|
sl@0
|
137 |
char const* _Locale_monetary_name(const void *, char* __buf);
|
sl@0
|
138 |
char const* _Locale_messages_name(const void *, char* __buf);
|
sl@0
|
139 |
|
sl@0
|
140 |
|
sl@0
|
141 |
/*
|
sl@0
|
142 |
* cname is a (possibly composite) locale name---i.e. a name that can
|
sl@0
|
143 |
* be passed to setlocale. __buf points to an array large enough to
|
sl@0
|
144 |
* store at least _Locale_MAX_SIMPLE_NAME characters, and each of these
|
sl@0
|
145 |
* functions extracts the name of a single category, stores it in buf
|
sl@0
|
146 |
* as a null-terminated string, and returns buf.
|
sl@0
|
147 |
*/
|
sl@0
|
148 |
char const* _Locale_extract_ctype_name(const char *cname, char *__buf, struct _Locale_name_hint* __hint);
|
sl@0
|
149 |
char const* _Locale_extract_numeric_name(const char *cname, char *__buf, struct _Locale_name_hint* __hint);
|
sl@0
|
150 |
char const* _Locale_extract_time_name(const char *cname, char *__buf, struct _Locale_name_hint* __hint);
|
sl@0
|
151 |
char const* _Locale_extract_collate_name(const char *cname, char *__buf, struct _Locale_name_hint* __hint);
|
sl@0
|
152 |
char const* _Locale_extract_monetary_name(const char *cname, char *__buf, struct _Locale_name_hint* __hint);
|
sl@0
|
153 |
char const* _Locale_extract_messages_name(const char *cname, char *__buf, struct _Locale_name_hint* __hint);
|
sl@0
|
154 |
|
sl@0
|
155 |
/*
|
sl@0
|
156 |
* The inputs to this function are six null-terminated strings: the
|
sl@0
|
157 |
* names of a locale's six categories. Locale names for non-standard
|
sl@0
|
158 |
* categories are taken from __DefaultName.
|
sl@0
|
159 |
* __buf is a pointer to an array large enough to store at least
|
sl@0
|
160 |
* _Locale_MAX_COMPOSITE_NAME characters.
|
sl@0
|
161 |
* This function constructs a (possibly composite) name describing the
|
sl@0
|
162 |
* locale as a whole, stores that name in buf as a null-terminated
|
sl@0
|
163 |
* string, and returns buf.
|
sl@0
|
164 |
*/
|
sl@0
|
165 |
char const* _Locale_compose_name(char *__buf,
|
sl@0
|
166 |
const char *__Ctype, const char *__Numeric,
|
sl@0
|
167 |
const char *__Time, const char *__Collate,
|
sl@0
|
168 |
const char *__Monetary, const char *__Messages,
|
sl@0
|
169 |
const char *__DefaultName);
|
sl@0
|
170 |
|
sl@0
|
171 |
/* Funstions to improve locale creation process. For some locale API (Win32)
|
sl@0
|
172 |
* you need to find a locale identification from the name which can be a
|
sl@0
|
173 |
* rather expensive operation especially if you do so for all facets of a
|
sl@0
|
174 |
* locale. Those functions can be used to extract from a API dependent facet
|
sl@0
|
175 |
* struct the information necessary to skip this lookup process for other
|
sl@0
|
176 |
* facets creation. If not supported those function should return NULL.
|
sl@0
|
177 |
*/
|
sl@0
|
178 |
struct _Locale_name_hint* _Locale_get_ctype_hint(struct _Locale_ctype*);
|
sl@0
|
179 |
struct _Locale_name_hint* _Locale_get_numeric_hint(struct _Locale_numeric*);
|
sl@0
|
180 |
struct _Locale_name_hint* _Locale_get_time_hint(struct _Locale_time*);
|
sl@0
|
181 |
struct _Locale_name_hint* _Locale_get_collate_hint(struct _Locale_collate*);
|
sl@0
|
182 |
struct _Locale_name_hint* _Locale_get_monetary_hint(struct _Locale_monetary*);
|
sl@0
|
183 |
struct _Locale_name_hint* _Locale_get_messages_hint(struct _Locale_messages*);
|
sl@0
|
184 |
|
sl@0
|
185 |
/*
|
sl@0
|
186 |
* FUNCTIONS THAT USE CTYPE
|
sl@0
|
187 |
*/
|
sl@0
|
188 |
|
sl@0
|
189 |
/*
|
sl@0
|
190 |
* Narrow character functions:
|
sl@0
|
191 |
*/
|
sl@0
|
192 |
|
sl@0
|
193 |
/*
|
sl@0
|
194 |
* Returns a pointer to the beginning of the ctype table. The table is
|
sl@0
|
195 |
* at least 257 bytes long; if p is the pointer returned by this
|
sl@0
|
196 |
* function, then p[c] is valid if c is EOF or if p is any value of
|
sl@0
|
197 |
* type unsigned char.
|
sl@0
|
198 |
*/
|
sl@0
|
199 |
const _Locale_mask_t * _Locale_ctype_table(struct _Locale_ctype *);
|
sl@0
|
200 |
|
sl@0
|
201 |
/*
|
sl@0
|
202 |
* c is either EOF, or an unsigned char value.
|
sl@0
|
203 |
*/
|
sl@0
|
204 |
int _Locale_toupper(struct _Locale_ctype *, int);
|
sl@0
|
205 |
int _Locale_tolower(struct _Locale_ctype *, int);
|
sl@0
|
206 |
|
sl@0
|
207 |
|
sl@0
|
208 |
# ifndef _STLP_NO_WCHAR_T
|
sl@0
|
209 |
/*
|
sl@0
|
210 |
* Wide character functions:
|
sl@0
|
211 |
*/
|
sl@0
|
212 |
_Locale_mask_t _Locale_wchar_ctype(struct _Locale_ctype *, wint_t,
|
sl@0
|
213 |
_Locale_mask_t);
|
sl@0
|
214 |
wint_t _Locale_wchar_tolower(struct _Locale_ctype *, wint_t);
|
sl@0
|
215 |
wint_t _Locale_wchar_toupper(struct _Locale_ctype *, wint_t);
|
sl@0
|
216 |
# endif
|
sl@0
|
217 |
|
sl@0
|
218 |
# if !defined ( _STLP_NO_MBSTATE_T )
|
sl@0
|
219 |
|
sl@0
|
220 |
/*
|
sl@0
|
221 |
* Multibyte functions:
|
sl@0
|
222 |
*/
|
sl@0
|
223 |
|
sl@0
|
224 |
int _Locale_mb_cur_max (struct _Locale_ctype *);
|
sl@0
|
225 |
/*
|
sl@0
|
226 |
* Returns the number of bytes of the longest allowed multibyte
|
sl@0
|
227 |
* character in the current encoding.
|
sl@0
|
228 |
*/
|
sl@0
|
229 |
|
sl@0
|
230 |
int _Locale_mb_cur_min (struct _Locale_ctype *);
|
sl@0
|
231 |
/*
|
sl@0
|
232 |
* Returns the number of bytes of the shortest allowed multibyte
|
sl@0
|
233 |
* character in the current encoding.
|
sl@0
|
234 |
*/
|
sl@0
|
235 |
|
sl@0
|
236 |
int _Locale_is_stateless (struct _Locale_ctype *);
|
sl@0
|
237 |
/*
|
sl@0
|
238 |
* Returns 1 if the current multibyte encoding is stateless
|
sl@0
|
239 |
* and does not require the use of an mbstate_t value.
|
sl@0
|
240 |
*/
|
sl@0
|
241 |
|
sl@0
|
242 |
# ifndef _STLP_NO_WCHAR_T
|
sl@0
|
243 |
wint_t _Locale_btowc(struct _Locale_ctype *, int);
|
sl@0
|
244 |
int _Locale_wctob(struct _Locale_ctype *, wint_t);
|
sl@0
|
245 |
|
sl@0
|
246 |
/*
|
sl@0
|
247 |
* Just like btowc and wctob, from 4.6.5.1 of the C standard, Normative
|
sl@0
|
248 |
* Addendum 1. (And just like widen/narrow, from clause 22 of the C++
|
sl@0
|
249 |
* standard.)
|
sl@0
|
250 |
*/
|
sl@0
|
251 |
|
sl@0
|
252 |
size_t _Locale_mbtowc(struct _Locale_ctype *,
|
sl@0
|
253 |
wchar_t *,
|
sl@0
|
254 |
const char *, size_t,
|
sl@0
|
255 |
mbstate_t *);
|
sl@0
|
256 |
|
sl@0
|
257 |
/*
|
sl@0
|
258 |
* Almost identical to mbrtowc, from 4.6.5.3.2 of NA1. The only
|
sl@0
|
259 |
* important difference is that mbrtowc treats null wide characters
|
sl@0
|
260 |
* as special, and we don't. Specifically: examines the characters
|
sl@0
|
261 |
* in [from, from + n), extracts a single wide character, and stores
|
sl@0
|
262 |
* it in *to. Modifies shift_state if appropriate. The return value,
|
sl@0
|
263 |
* which is always positive, is the number of characters extracted from
|
sl@0
|
264 |
* the input sequence. Return value is (size_t) -1 if there was an
|
sl@0
|
265 |
* encoding error in the input sequence, and (size_t) -2 if
|
sl@0
|
266 |
* [from, from + n) is correct but not complete. None of the pointer
|
sl@0
|
267 |
* arguments may be null pointers.
|
sl@0
|
268 |
*/
|
sl@0
|
269 |
|
sl@0
|
270 |
size_t _Locale_wctomb(struct _Locale_ctype *,
|
sl@0
|
271 |
char *, size_t,
|
sl@0
|
272 |
const wchar_t,
|
sl@0
|
273 |
mbstate_t *);
|
sl@0
|
274 |
|
sl@0
|
275 |
/*
|
sl@0
|
276 |
* Again, very similar to wcrtomb. The differences are that (1) it
|
sl@0
|
277 |
* doesn't treat null characters as special; and (2) it stores at most
|
sl@0
|
278 |
* n characters. Converts c to a multibyte sequence, stores that
|
sl@0
|
279 |
* sequence in the array 'to', and returns the length of the sequence.
|
sl@0
|
280 |
* Modifies shift_state if appropriate. The return value is (size_t) -1
|
sl@0
|
281 |
* if c is not a valid wide character, and (size_t) -2 if the length of
|
sl@0
|
282 |
* the multibyte character sequence is greater than n.
|
sl@0
|
283 |
*/
|
sl@0
|
284 |
# endif
|
sl@0
|
285 |
|
sl@0
|
286 |
size_t _Locale_unshift(struct _Locale_ctype *,
|
sl@0
|
287 |
mbstate_t *,
|
sl@0
|
288 |
char *, size_t, char **);
|
sl@0
|
289 |
|
sl@0
|
290 |
/*
|
sl@0
|
291 |
* Inserts whatever characters are necessary to restore st to an
|
sl@0
|
292 |
* initial shift state. Sets *next to buf + m, where m is the number
|
sl@0
|
293 |
* of characters inserted. (0 <= m <= n.) Returns m to indicate
|
sl@0
|
294 |
* success, (size_t) -1 to indicate error, (size_t) -2 to indicate
|
sl@0
|
295 |
* partial success (more than n characters needed). For success or partial
|
sl@0
|
296 |
* success, sets *next to buf + m.
|
sl@0
|
297 |
*/
|
sl@0
|
298 |
|
sl@0
|
299 |
# endif /* _STLP_NO_MBSTATE_T */
|
sl@0
|
300 |
|
sl@0
|
301 |
/*
|
sl@0
|
302 |
* FUNCTIONS THAT USE COLLATE
|
sl@0
|
303 |
*/
|
sl@0
|
304 |
|
sl@0
|
305 |
int _Locale_strcmp(struct _Locale_collate *,
|
sl@0
|
306 |
const char *, size_t,
|
sl@0
|
307 |
const char *, size_t);
|
sl@0
|
308 |
# ifndef _STLP_NO_WCHAR_T
|
sl@0
|
309 |
int _Locale_strwcmp(struct _Locale_collate *,
|
sl@0
|
310 |
const wchar_t *, size_t,
|
sl@0
|
311 |
const wchar_t *, size_t);
|
sl@0
|
312 |
# endif
|
sl@0
|
313 |
/*
|
sl@0
|
314 |
* Compares the two sequences [s1, s1 + n1) and [s2, s2 + n2). Neither
|
sl@0
|
315 |
* sequence is assumed to be null-terminated, and null characters
|
sl@0
|
316 |
* aren't special. If the two sequences are the same up through
|
sl@0
|
317 |
* min(n1, n2), then the sequence that compares less is whichever one
|
sl@0
|
318 |
* is shorter.
|
sl@0
|
319 |
*/
|
sl@0
|
320 |
|
sl@0
|
321 |
size_t _Locale_strxfrm(struct _Locale_collate *,
|
sl@0
|
322 |
char *, size_t,
|
sl@0
|
323 |
const char *, size_t);
|
sl@0
|
324 |
|
sl@0
|
325 |
# ifndef _STLP_NO_WCHAR_T
|
sl@0
|
326 |
size_t _Locale_strwxfrm(struct _Locale_collate *,
|
sl@0
|
327 |
wchar_t *, size_t,
|
sl@0
|
328 |
const wchar_t *, size_t);
|
sl@0
|
329 |
# endif
|
sl@0
|
330 |
|
sl@0
|
331 |
/*
|
sl@0
|
332 |
* Creates a transformed version of the string [s2, s2 + n2). The
|
sl@0
|
333 |
* string may contain embedded null characters; nulls aren't special.
|
sl@0
|
334 |
* The transformed string begins at s1, and contains at most n1
|
sl@0
|
335 |
* characters. The return value is the length of the transformed
|
sl@0
|
336 |
* string. If the return value is greater than n1 then this is an
|
sl@0
|
337 |
* error condition: it indicates that there wasn't enough space. In
|
sl@0
|
338 |
* that case, the contents of [s1, s1 + n1) is unspecified.
|
sl@0
|
339 |
*/
|
sl@0
|
340 |
|
sl@0
|
341 |
/*
|
sl@0
|
342 |
* FUNCTIONS THAT USE NUMERIC
|
sl@0
|
343 |
*/
|
sl@0
|
344 |
|
sl@0
|
345 |
/*
|
sl@0
|
346 |
* Equivalent to the first three fields in struct lconv. (C standard,
|
sl@0
|
347 |
* section 7.4.)
|
sl@0
|
348 |
*/
|
sl@0
|
349 |
char _Locale_decimal_point(struct _Locale_numeric *);
|
sl@0
|
350 |
char _Locale_thousands_sep(struct _Locale_numeric *);
|
sl@0
|
351 |
const char * _Locale_grouping(struct _Locale_numeric *);
|
sl@0
|
352 |
|
sl@0
|
353 |
|
sl@0
|
354 |
/*
|
sl@0
|
355 |
* Return "true" and "false" in English locales, and something
|
sl@0
|
356 |
* appropriate in non-English locales.
|
sl@0
|
357 |
*/
|
sl@0
|
358 |
const char * _Locale_true(struct _Locale_numeric *);
|
sl@0
|
359 |
const char * _Locale_false(struct _Locale_numeric *);
|
sl@0
|
360 |
|
sl@0
|
361 |
|
sl@0
|
362 |
/*
|
sl@0
|
363 |
* FUNCTIONS THAT USE MONETARY
|
sl@0
|
364 |
*/
|
sl@0
|
365 |
|
sl@0
|
366 |
/*
|
sl@0
|
367 |
* Return the obvious fields of struct lconv.
|
sl@0
|
368 |
*/
|
sl@0
|
369 |
const char * _Locale_int_curr_symbol(struct _Locale_monetary *);
|
sl@0
|
370 |
const char * _Locale_currency_symbol(struct _Locale_monetary *);
|
sl@0
|
371 |
char _Locale_mon_decimal_point(struct _Locale_monetary *);
|
sl@0
|
372 |
char _Locale_mon_thousands_sep(struct _Locale_monetary *);
|
sl@0
|
373 |
const char * _Locale_mon_grouping(struct _Locale_monetary *);
|
sl@0
|
374 |
const char * _Locale_positive_sign(struct _Locale_monetary *);
|
sl@0
|
375 |
const char * _Locale_negative_sign(struct _Locale_monetary *);
|
sl@0
|
376 |
char _Locale_int_frac_digits(struct _Locale_monetary *);
|
sl@0
|
377 |
char _Locale_frac_digits(struct _Locale_monetary *);
|
sl@0
|
378 |
int _Locale_p_cs_precedes(struct _Locale_monetary *);
|
sl@0
|
379 |
int _Locale_p_sep_by_space(struct _Locale_monetary *);
|
sl@0
|
380 |
int _Locale_p_sign_posn(struct _Locale_monetary *);
|
sl@0
|
381 |
int _Locale_n_cs_precedes(struct _Locale_monetary *);
|
sl@0
|
382 |
int _Locale_n_sep_by_space(struct _Locale_monetary *);
|
sl@0
|
383 |
int _Locale_n_sign_posn(struct _Locale_monetary *);
|
sl@0
|
384 |
|
sl@0
|
385 |
|
sl@0
|
386 |
/*
|
sl@0
|
387 |
* FUNCTIONS THAT USE TIME
|
sl@0
|
388 |
*/
|
sl@0
|
389 |
|
sl@0
|
390 |
/*
|
sl@0
|
391 |
* month is in the range [0, 12).
|
sl@0
|
392 |
*/
|
sl@0
|
393 |
const char * _Locale_full_monthname(struct _Locale_time *, int);
|
sl@0
|
394 |
const char * _Locale_abbrev_monthname(struct _Locale_time *, int);
|
sl@0
|
395 |
|
sl@0
|
396 |
|
sl@0
|
397 |
/*
|
sl@0
|
398 |
* day is in the range [0, 7). Sunday is 0.
|
sl@0
|
399 |
*/
|
sl@0
|
400 |
const char * _Locale_full_dayofweek(struct _Locale_time *, int);
|
sl@0
|
401 |
const char * _Locale_abbrev_dayofweek(struct _Locale_time *, int);
|
sl@0
|
402 |
|
sl@0
|
403 |
|
sl@0
|
404 |
const char * _Locale_d_t_fmt(struct _Locale_time *);
|
sl@0
|
405 |
const char * _Locale_d_fmt(struct _Locale_time *);
|
sl@0
|
406 |
const char * _Locale_t_fmt(struct _Locale_time *);
|
sl@0
|
407 |
const char * _Locale_long_d_t_fmt(struct _Locale_time*);
|
sl@0
|
408 |
const char * _Locale_long_d_fmt(struct _Locale_time*);
|
sl@0
|
409 |
|
sl@0
|
410 |
const char * _Locale_am_str(struct _Locale_time *);
|
sl@0
|
411 |
const char * _Locale_pm_str(struct _Locale_time *);
|
sl@0
|
412 |
const char * _Locale_t_fmt_ampm(struct _Locale_time *);
|
sl@0
|
413 |
|
sl@0
|
414 |
|
sl@0
|
415 |
/*
|
sl@0
|
416 |
* FUNCTIONS THAT USE MESSAGES
|
sl@0
|
417 |
*/
|
sl@0
|
418 |
|
sl@0
|
419 |
# ifdef _STLP_REAL_LOCALE_IMPLEMENTED
|
sl@0
|
420 |
# if defined (WIN32) || defined (_WIN32)
|
sl@0
|
421 |
typedef int nl_catd_type;
|
sl@0
|
422 |
# elif defined (_STLP_USE_GLIBC) && !defined (__CYGWIN__)
|
sl@0
|
423 |
typedef nl_catd nl_catd_type;
|
sl@0
|
424 |
# else
|
sl@0
|
425 |
typedef int nl_catd_type;
|
sl@0
|
426 |
# endif
|
sl@0
|
427 |
# else
|
sl@0
|
428 |
typedef int nl_catd_type;
|
sl@0
|
429 |
# endif /* _STLP_REAL_LOCALE_IMPLEMENTED */
|
sl@0
|
430 |
|
sl@0
|
431 |
|
sl@0
|
432 |
/*
|
sl@0
|
433 |
* Very similar to catopen, except that it uses the given message
|
sl@0
|
434 |
* category to determine which catalog to open.
|
sl@0
|
435 |
*/
|
sl@0
|
436 |
nl_catd_type _Locale_catopen(struct _Locale_messages*, const char*);
|
sl@0
|
437 |
|
sl@0
|
438 |
/* Complementary to _Locale_catopen.
|
sl@0
|
439 |
* The catalog must be a value that was returned by a previous call
|
sl@0
|
440 |
* to _Locale_catopen.
|
sl@0
|
441 |
*/
|
sl@0
|
442 |
void _Locale_catclose(struct _Locale_messages*, nl_catd_type);
|
sl@0
|
443 |
|
sl@0
|
444 |
/*
|
sl@0
|
445 |
* Returns a string, identified by a set index and a message index,
|
sl@0
|
446 |
* from an opened message catalog. Returns the supplied default if
|
sl@0
|
447 |
* no such string exists.
|
sl@0
|
448 |
*/
|
sl@0
|
449 |
const char * _Locale_catgets(struct _Locale_messages *, nl_catd_type,
|
sl@0
|
450 |
int, int,const char *);
|
sl@0
|
451 |
|
sl@0
|
452 |
#ifdef __cplusplus
|
sl@0
|
453 |
}
|
sl@0
|
454 |
#endif
|
sl@0
|
455 |
|
sl@0
|
456 |
#endif /* _STLP_C_LOCALE_IMPL_H */
|