1 /* #define __LOCALE_DATA_MAGIC_SIZE 64 */ 2 #ifndef __WCHAR_ENABLED 3 #if 0 4 #warning WHOA!!! __WCHAR_ENABLED is not defined! defining it now... 5 #endif 6 #define __WCHAR_ENABLED 7 #endif 8 9 /* TODO - fix */ 10 #ifdef __WCHAR_ENABLED 11 #define __LOCALE_DATA_WCctype_TBL_LEN (__LOCALE_DATA_WCctype_II_LEN + __LOCALE_DATA_WCctype_TI_LEN + __LOCALE_DATA_WCctype_UT_LEN) 12 #define __LOCALE_DATA_WCuplow_TBL_LEN (__LOCALE_DATA_WCuplow_II_LEN + __LOCALE_DATA_WCuplow_TI_LEN + __LOCALE_DATA_WCuplow_UT_LEN) 13 #define __LOCALE_DATA_WCuplow_diff_TBL_LEN (2 * __LOCALE_DATA_WCuplow_diffs) 14 /* #define WCcomb_TBL_LEN (WCcomb_II_LEN + WCcomb_TI_LEN + WCcomb_UT_LEN) */ 15 #endif 16 17 #undef __PASTE2 18 #define __PASTE2(A,B) A ## B 19 #undef __PASTE3 20 #define __PASTE3(A,B,C) A ## B ## C 21 22 #define __LOCALE_DATA_COMMON_MMAP(X) \ 23 unsigned char __PASTE3(lc_,X,_data)[__PASTE3(__lc_,X,_data_LEN)]; 24 25 #define __LOCALE_DATA_COMMON_MMIDX(X) \ 26 unsigned char __PASTE3(lc_,X,_rows)[__PASTE3(__lc_,X,_rows_LEN)]; \ 27 uint16_t __PASTE3(lc_,X,_item_offsets)[__PASTE3(__lc_,X,_item_offsets_LEN)]; \ 28 uint16_t __PASTE3(lc_,X,_item_idx)[__PASTE3(__lc_,X,_item_idx_LEN)]; \ 29 30 31 typedef struct { 32 #ifdef __LOCALE_DATA_MAGIC_SIZE 33 unsigned char magic[__LOCALE_DATA_MAGIC_SIZE]; 34 #endif 35 36 #ifdef __CTYPE_HAS_8_BIT_LOCALES 37 const unsigned char tbl8ctype[__LOCALE_DATA_Cctype_TBL_LEN]; 38 const unsigned char tbl8uplow[__LOCALE_DATA_Cuplow_TBL_LEN]; 39 #ifdef __WCHAR_ENABLED 40 const uint16_t tbl8c2wc[__LOCALE_DATA_Cc2wc_TBL_LEN]; /* char > 0x7f to wide char */ 41 const unsigned char tbl8wc2c[__LOCALE_DATA_Cwc2c_TBL_LEN]; 42 /* translit */ 43 #endif /* __WCHAR_ENABLED */ 44 #endif /* __CTYPE_HAS_8_BIT_LOCALES */ 45 #ifdef __WCHAR_ENABLED 46 const unsigned char tblwctype[__LOCALE_DATA_WCctype_TBL_LEN]; 47 const unsigned char tblwuplow[__LOCALE_DATA_WCuplow_TBL_LEN]; 48 const int16_t tblwuplow_diff[__LOCALE_DATA_WCuplow_diff_TBL_LEN]; 49 /* const unsigned char tblwcomb[WCcomb_TBL_LEN]; */ 50 /* width?? */ 51 #endif 52 53 __LOCALE_DATA_COMMON_MMAP(ctype) 54 __LOCALE_DATA_COMMON_MMAP(numeric) 55 __LOCALE_DATA_COMMON_MMAP(monetary) 56 __LOCALE_DATA_COMMON_MMAP(time) 57 /* collate is different */ 58 __LOCALE_DATA_COMMON_MMAP(messages) 59 60 61 #ifdef __CTYPE_HAS_8_BIT_LOCALES 62 const __codeset_8_bit_t codeset_8_bit[__LOCALE_DATA_NUM_CODESETS]; 63 #endif 64 65 __LOCALE_DATA_COMMON_MMIDX(ctype) 66 __LOCALE_DATA_COMMON_MMIDX(numeric) 67 __LOCALE_DATA_COMMON_MMIDX(monetary) 68 __LOCALE_DATA_COMMON_MMIDX(time) 69 /* collate is different */ 70 __LOCALE_DATA_COMMON_MMIDX(messages) 71 72 const uint16_t collate_data[__lc_collate_data_LEN]; 73 74 unsigned char lc_common_item_offsets_LEN[__LOCALE_DATA_CATEGORIES]; 75 size_t lc_common_tbl_offsets[__LOCALE_DATA_CATEGORIES * 4]; 76 /* offsets from start of locale_mmap_t */ 77 /* rows, item_offsets, item_idx, data */ 78 79 #ifdef __LOCALE_DATA_NUM_LOCALES 80 unsigned char locales[__LOCALE_DATA_NUM_LOCALES * __LOCALE_DATA_WIDTH_LOCALES]; 81 unsigned char locale_names5[5*__LOCALE_DATA_NUM_LOCALE_NAMES]; 82 unsigned char locale_at_modifiers[__LOCALE_DATA_AT_MODIFIERS_LENGTH]; 83 #endif 84 85 unsigned char lc_names[__lc_names_LEN]; 86 #ifdef __CTYPE_HAS_8_BIT_LOCALES 87 unsigned char codeset_list[sizeof(__LOCALE_DATA_CODESET_LIST)]; /* TODO - fix */ 88 #endif 89 } __locale_mmap_t; 90 91 extern const __locale_mmap_t *__locale_mmap; 92