1#define __lc_time_data_LEN 303 2#define __lc_time_rows_LEN 100 3#define __lc_time_item_offsets_LEN 50 4#define __lc_time_item_idx_LEN 53 5#define __lc_numeric_data_LEN 7 6#define __lc_numeric_rows_LEN 6 7#define __lc_numeric_item_offsets_LEN 3 8#define __lc_numeric_item_idx_LEN 5 9#define __lc_monetary_data_LEN 25 10#define __lc_monetary_rows_LEN 44 11#define __lc_monetary_item_offsets_LEN 22 12#define __lc_monetary_item_idx_LEN 43 13#define __lc_messages_data_LEN 29 14#define __lc_messages_rows_LEN 8 15#define __lc_messages_item_offsets_LEN 4 16#define __lc_messages_item_idx_LEN 6 17#define __lc_ctype_data_LEN 21 18#define __lc_ctype_rows_LEN 10 19#define __lc_ctype_item_offsets_LEN 10 20#define __lc_ctype_item_idx_LEN 10 21#define __CTYPE_HAS_UTF_8_LOCALES 1 22#define __LOCALE_DATA_CATEGORIES 6 23#define __LOCALE_DATA_WIDTH_LOCALES 9 24#define __LOCALE_DATA_NUM_LOCALES 3 25#define __LOCALE_DATA_NUM_LOCALE_NAMES 2 26#define __LOCALE_DATA_AT_MODIFIERS_LENGTH 7 27#define __lc_names_LEN 69 28#define __lc_collate_data_LEN 7370 29#define __CTYPE_HAS_8_BIT_LOCALES 1 30 31#define __LOCALE_DATA_Cctype_IDX_SHIFT 3 32#define __LOCALE_DATA_Cctype_IDX_LEN 16 33#define __LOCALE_DATA_Cctype_ROW_LEN 4 34#define __LOCALE_DATA_Cctype_PACKED 1 35 36#define __LOCALE_DATA_Cuplow_IDX_SHIFT 3 37#define __LOCALE_DATA_Cuplow_IDX_LEN 16 38#define __LOCALE_DATA_Cuplow_ROW_LEN 8 39 40#define __LOCALE_DATA_Cc2wc_IDX_LEN 16 41#define __LOCALE_DATA_Cc2wc_IDX_SHIFT 3 42#define __LOCALE_DATA_Cc2wc_ROW_LEN 8 43 44typedef struct { 45 unsigned char idx8ctype[16]; 46 unsigned char idx8uplow[16]; 47 unsigned char idx8c2wc[16]; 48 unsigned char idx8wc2c[38]; 49} __codeset_8_bit_t; 50 51 52#define __LOCALE_DATA_Cwc2c_DOMAIN_MAX 0x25ff 53#define __LOCALE_DATA_Cwc2c_TI_SHIFT 4 54#define __LOCALE_DATA_Cwc2c_TT_SHIFT 4 55#define __LOCALE_DATA_Cwc2c_II_LEN 38 56#define __LOCALE_DATA_Cwc2c_TI_LEN 32 57#define __LOCALE_DATA_Cwc2c_TT_LEN 144 58 59 60#define __LOCALE_DATA_Cwc2c_TBL_LEN 176 61 62#define __LOCALE_DATA_Cuplow_TBL_LEN 24 63 64 65#define __LOCALE_DATA_Cctype_TBL_LEN 40 66 67 68#define __LOCALE_DATA_Cc2wc_TBL_LEN 136 69 70 71 72#define __LOCALE_DATA_NUM_CODESETS 2 73#define __LOCALE_DATA_CODESET_LIST \ 74 "\x03\x09" \ 75 "\0" \ 76 "ASCII\0" \ 77 "ISO-8859-1\0" 78 79#define __CTYPE_HAS_CODESET_ASCII 80#define __CTYPE_HAS_CODESET_ISO_8859_1 81#define __CTYPE_HAS_CODESET_UTF_8 82#define __LOCALE_DATA_WC_TABLE_DOMAIN_MAX 0x2ffff 83 84#define __LOCALE_DATA_WCctype_II_LEN 768 85#define __LOCALE_DATA_WCctype_TI_LEN 1888 86#define __LOCALE_DATA_WCctype_UT_LEN 948 87#define __LOCALE_DATA_WCctype_II_SHIFT 5 88#define __LOCALE_DATA_WCctype_TI_SHIFT 3 89 90 91#define __LOCALE_DATA_WCuplow_II_LEN 384 92#define __LOCALE_DATA_WCuplow_TI_LEN 576 93#define __LOCALE_DATA_WCuplow_UT_LEN 720 94#define __LOCALE_DATA_WCuplow_II_SHIFT 6 95#define __LOCALE_DATA_WCuplow_TI_SHIFT 3 96 97 98#define __LOCALE_DATA_WCuplow_diffs 98 99 100 101/* #define __LOCALE_DATA_MAGIC_SIZE 64 */ 102#ifndef __WCHAR_ENABLED 103#if 0 104#warning WHOA!!! __WCHAR_ENABLED is not defined! defining it now... 105#endif 106#define __WCHAR_ENABLED 107#endif 108 109/* TODO - fix */ 110#ifdef __WCHAR_ENABLED 111#define __LOCALE_DATA_WCctype_TBL_LEN (__LOCALE_DATA_WCctype_II_LEN + __LOCALE_DATA_WCctype_TI_LEN + __LOCALE_DATA_WCctype_UT_LEN) 112#define __LOCALE_DATA_WCuplow_TBL_LEN (__LOCALE_DATA_WCuplow_II_LEN + __LOCALE_DATA_WCuplow_TI_LEN + __LOCALE_DATA_WCuplow_UT_LEN) 113#define __LOCALE_DATA_WCuplow_diff_TBL_LEN (2 * __LOCALE_DATA_WCuplow_diffs) 114/* #define WCcomb_TBL_LEN (WCcomb_II_LEN + WCcomb_TI_LEN + WCcomb_UT_LEN) */ 115#endif 116 117#undef __PASTE2 118#define __PASTE2(A,B) A ## B 119#undef __PASTE3 120#define __PASTE3(A,B,C) A ## B ## C 121 122#define __LOCALE_DATA_COMMON_MMAP(X) \ 123 unsigned char __PASTE3(lc_,X,_data)[__PASTE3(__lc_,X,_data_LEN)]; 124 125#define __LOCALE_DATA_COMMON_MMIDX(X) \ 126 unsigned char __PASTE3(lc_,X,_rows)[__PASTE3(__lc_,X,_rows_LEN)]; \ 127 uint16_t __PASTE3(lc_,X,_item_offsets)[__PASTE3(__lc_,X,_item_offsets_LEN)]; \ 128 uint16_t __PASTE3(lc_,X,_item_idx)[__PASTE3(__lc_,X,_item_idx_LEN)]; \ 129 130 131typedef struct { 132#ifdef __LOCALE_DATA_MAGIC_SIZE 133 unsigned char magic[__LOCALE_DATA_MAGIC_SIZE]; 134#endif 135 136#ifdef __CTYPE_HAS_8_BIT_LOCALES 137 const unsigned char tbl8ctype[__LOCALE_DATA_Cctype_TBL_LEN]; 138 const unsigned char tbl8uplow[__LOCALE_DATA_Cuplow_TBL_LEN]; 139#ifdef __WCHAR_ENABLED 140 const uint16_t tbl8c2wc[__LOCALE_DATA_Cc2wc_TBL_LEN]; /* char > 0x7f to wide char */ 141 const unsigned char tbl8wc2c[__LOCALE_DATA_Cwc2c_TBL_LEN]; 142 /* translit */ 143#endif /* __WCHAR_ENABLED */ 144#endif /* __CTYPE_HAS_8_BIT_LOCALES */ 145#ifdef __WCHAR_ENABLED 146 const unsigned char tblwctype[__LOCALE_DATA_WCctype_TBL_LEN]; 147 const unsigned char tblwuplow[__LOCALE_DATA_WCuplow_TBL_LEN]; 148 const int16_t tblwuplow_diff[__LOCALE_DATA_WCuplow_diff_TBL_LEN]; 149/* const unsigned char tblwcomb[WCcomb_TBL_LEN]; */ 150 /* width?? */ 151#endif 152 153 __LOCALE_DATA_COMMON_MMAP(ctype) 154 __LOCALE_DATA_COMMON_MMAP(numeric) 155 __LOCALE_DATA_COMMON_MMAP(monetary) 156 __LOCALE_DATA_COMMON_MMAP(time) 157 /* collate is different */ 158 __LOCALE_DATA_COMMON_MMAP(messages) 159 160 161#ifdef __CTYPE_HAS_8_BIT_LOCALES 162 const __codeset_8_bit_t codeset_8_bit[__LOCALE_DATA_NUM_CODESETS]; 163#endif 164 165 __LOCALE_DATA_COMMON_MMIDX(ctype) 166 __LOCALE_DATA_COMMON_MMIDX(numeric) 167 __LOCALE_DATA_COMMON_MMIDX(monetary) 168 __LOCALE_DATA_COMMON_MMIDX(time) 169 /* collate is different */ 170 __LOCALE_DATA_COMMON_MMIDX(messages) 171 172 const uint16_t collate_data[__lc_collate_data_LEN]; 173 174 unsigned char lc_common_item_offsets_LEN[__LOCALE_DATA_CATEGORIES]; 175 size_t lc_common_tbl_offsets[__LOCALE_DATA_CATEGORIES * 4]; 176 /* offsets from start of locale_mmap_t */ 177 /* rows, item_offsets, item_idx, data */ 178 179#ifdef __LOCALE_DATA_NUM_LOCALES 180 unsigned char locales[__LOCALE_DATA_NUM_LOCALES * __LOCALE_DATA_WIDTH_LOCALES]; 181 unsigned char locale_names5[5*__LOCALE_DATA_NUM_LOCALE_NAMES]; 182 unsigned char locale_at_modifiers[__LOCALE_DATA_AT_MODIFIERS_LENGTH]; 183#endif 184 185 unsigned char lc_names[__lc_names_LEN]; 186#ifdef __CTYPE_HAS_8_BIT_LOCALES 187 unsigned char codeset_list[sizeof(__LOCALE_DATA_CODESET_LIST)]; /* TODO - fix */ 188#endif 189} __locale_mmap_t; 190 191extern const __locale_mmap_t *__locale_mmap; 192