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