32#ifndef _RWSTD_LOC_RW_LOCALE_H_INCLUDED
33#define _RWSTD_LOC_RW_LOCALE_H_INCLUDED
60 enum { _C_n_std_facets = __rw_facet::_C_last_type / 2 };
61 enum { _C_namebuf_size = 40 };
72 __rw_facet *_C_std_facets [_C_n_std_facets];
73 __rw_facet **_C_usr_facets;
74 _RWSTD_SIZE_T _C_n_usr_facets;
78 char _C_namebuf [_C_namebuf_size];
86 _RWSTD_SIZE_T _C_std_facet_bits;
92 _RWSTD_SIZE_T _C_byname_facet_bits;
96 friend struct _STD::locale;
102#define _FACET_BIT(name) (1U << (__rw_facet::_C_##name - 1U) / 2U)
121 _C_all = _C_collate | _C_ctype | _C_monetary
122 | _C_numeric | _C_time | _C_messages
129 __rw_locale (
const char*);
132 __rw_locale (
const char *__name,
const __rw_facet *__facet) {
133 __rw_locale __tmp (__name);
134 _C_construct (__tmp, __facet);
138 __rw_locale (
const __rw_locale &__rhs,
const __rw_facet *__facet) {
139 _C_construct (__rhs, __facet);
143 __rw_locale (
const __rw_locale &__rhs,
const char *__name,
int __cat) {
144 __rw_locale __tmp (__name);
145 _C_construct (__rhs, __tmp, __cat);
149 __rw_locale (
const __rw_locale &__l1,
const __rw_locale &__l2,
int __cat) {
150 _C_construct (__l1, __l2, __cat);
156 const char* _C_get_name ()
const {
160 static _RWSTD_SIZE_T _C_add_ref (__rw_facet &__facet) {
164 static _RWSTD_SIZE_T _C_remove_ref (__rw_facet &__facet) {
168 _RWSTD_SIZE_T _C_add_ref () {
172 _RWSTD_SIZE_T _C_remove_ref () {
177 static const char* _C_get_cat_name (
const __rw_facet &__facet) {
178 return __facet._C_name;
183 char* _C_get_cat_names (
char*, _RWSTD_SIZE_T)
const;
191 bool _C_is_managed (
int)
const;
194 static int _C_LC2category (
int);
197 static int _C_LC2facet_bits (
int);
199 static bool _C_check_category (
int);
203 static __rw_facet::_C_facet_type _C_get_facet_type (
const __rw_facet&);
209 static __rw_locale* _C_manage (__rw_locale*,
const char*);
215 _C_get_body (__rw_locale*, __rw_locale*,
216 const char*,
int,
const __rw_facet*);
219 void _C_construct (
const __rw_locale&,
const __rw_facet*);
220 void _C_construct (
const __rw_locale&,
const __rw_locale&,
int);
223 __rw_locale* _C_combine (
const __rw_facet*)
const;
226 __rw_locale* _C_combine (
const __rw_locale&,
int);
233 _RWSTD_SIZE_T _C_get_facet_inx (_RWSTD_SIZE_T)
const;
237 inline bool __rw_locale::_C_check_category (
int cat)
242 return __rw_cat_none == cat || !(cat & ~__rw_cat_all);
246 inline __rw_facet::_C_facet_type
247__rw_locale::_C_get_facet_type (
const __rw_facet &__facet)
253 const _RWSTD_SIZE_T __numtype =
254 *__facet._C_pid * 2 - 1 + (0 != __facet._C_name);
257 return __numtype > __rw_facet::_C_last_type ?
258 __rw_facet::_C_unknown : __rw_facet::_C_facet_type (__numtype);
263#ifndef _RWSTD_CAT_SEP
264# define _RWSTD_CAT_SEP ""
269extern const struct __rw_cats_t
276static const _RWSTD_SIZE_T __rw_n_cats = 6;
281inline int __rw_get_cat (
int id)
283#if _RWSTD_LC_MIN >= 0 && _RWSTD_LC_MAX < _RWSTD_UCHAR_MAX
284 typedef unsigned char LC_type;
289 const LC_type lc_cats[] = {
292 _RWSTD_LC_CTYPE, _RWSTD_LC_CTYPE,
294 _RWSTD_LC_MONETARY, _RWSTD_LC_MONETARY,
295 _RWSTD_LC_MONETARY, _RWSTD_LC_MONETARY,
297 _RWSTD_LC_NUMERIC, _RWSTD_LC_NUMERIC, _RWSTD_LC_NUMERIC,
299 _RWSTD_LC_TIME, _RWSTD_LC_TIME,
300#ifdef _RWSTD_LC_MESSAGES
308 return id > 0 &&
id <= __rw_locale::_C_n_std_facets ?
309 lc_cats [((
id - 1) % (
sizeof lc_cats /
sizeof *lc_cats))]
314#ifndef _RWSTD_NO_CONDENSED_NAME
316static const char __rw_C_locale_name[] =
"C";
320static const char __rw_C_locale_name[] = {
329static inline bool __rw_is_C (
const char *
name)
333 return 'C' ==
name [0] &&
'\0' ==
name [1]
335#ifdef _RWSTD_NO_CONDENSED_NAME
337 || !strcmp (__rw_C_locale_name,
name)
#define _RWSTD_CLASS_EXPORT
#define _RWSTD_ATOMIC_PREINCREMENT(x, ignore)
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_ATOMIC_PREDECREMENT(x, ignore)
#define _RWSTD_ASSERT(ignore)