New test.
[mono.git] / mono / metadata / culture-info.h
1
2 #ifndef _MONO_METADATA_CULTURE_INFO_H_
3 #define _MONO_METADATA_CULTURE_INFO_H_ 1
4
5 #include <glib.h>
6
7 #define NUM_DAYS 7
8 #define NUM_MONTHS 13
9 #define GROUP_SIZE 5
10 #define NUM_OPT_CALS 5
11
12 #define NUM_SHORT_DATE_PATTERNS 14
13 #define NUM_LONG_DATE_PATTERNS 8
14 #define NUM_SHORT_TIME_PATTERNS 11
15 #define NUM_LONG_TIME_PATTERNS 10
16
17 #define idx2string(idx) (locale_strings + (idx))
18
19 /* need to change this if the string data ends up to not fit in a 64KB array. */
20 typedef guint16 stridx_t;
21
22 typedef struct {
23         const stridx_t full_date_time_pattern;
24         const stridx_t long_date_pattern;
25         const stridx_t short_date_pattern;
26         const stridx_t long_time_pattern;
27         const stridx_t short_time_pattern;
28         const stridx_t year_month_pattern;
29         const stridx_t month_day_pattern;
30
31         const stridx_t am_designator;
32         const stridx_t pm_designator;
33
34         const stridx_t day_names [NUM_DAYS]; 
35         const stridx_t abbreviated_day_names [NUM_DAYS];
36         const stridx_t month_names [NUM_MONTHS];
37         const stridx_t abbreviated_month_names [NUM_MONTHS];
38
39         gint8 calendar_week_rule;
40         gint8 first_day_of_week;
41
42         const stridx_t date_separator;
43         const stridx_t time_separator;  
44
45         const stridx_t short_date_patterns [NUM_SHORT_DATE_PATTERNS];
46         const stridx_t long_date_patterns [NUM_LONG_DATE_PATTERNS];
47         const stridx_t short_time_patterns [NUM_SHORT_TIME_PATTERNS];
48         const stridx_t long_time_patterns [NUM_LONG_TIME_PATTERNS];
49 } DateTimeFormatEntry;
50
51 typedef struct {
52         const stridx_t currency_decimal_separator;
53         const stridx_t currency_group_separator;
54         const stridx_t percent_decimal_separator;
55         const stridx_t percent_group_separator;
56         const stridx_t number_decimal_separator;
57         const stridx_t number_group_separator;
58
59         const stridx_t currency_symbol;
60         const stridx_t percent_symbol;
61         const stridx_t nan_symbol;
62         const stridx_t per_mille_symbol;
63         const stridx_t negative_infinity_symbol;
64         const stridx_t positive_infinity_symbol;
65
66         const stridx_t negative_sign;
67         const stridx_t positive_sign;
68
69         gint8 currency_negative_pattern;
70         gint8 currency_positive_pattern;
71         gint8 percent_negative_pattern;
72         gint8 percent_positive_pattern;
73         gint8 number_negative_pattern;
74
75         gint8 currency_decimal_digits;
76         gint8 percent_decimal_digits;
77         gint8 number_decimal_digits;
78
79         const gint currency_group_sizes [GROUP_SIZE];
80         const gint percent_group_sizes [GROUP_SIZE];
81         const gint number_group_sizes [GROUP_SIZE];     
82 } NumberFormatEntry;
83
84 typedef struct {
85         const gint ansi;
86         const gint ebcdic;
87         const gint mac;
88         const gint oem;
89         const char list_sep;
90 } TextInfoEntry;
91
92 typedef struct {
93         gint16 lcid;
94         gint16 parent_lcid;
95         gint16 specific_lcid;
96         gint16 region_entry_index;
97         const stridx_t name;
98         const stridx_t icu_name;
99         const stridx_t englishname;
100         const stridx_t displayname;
101         const stridx_t nativename;
102         const stridx_t win3lang;
103         const stridx_t iso3lang;
104         const stridx_t iso2lang;
105
106         gint calendar_data [NUM_OPT_CALS];
107
108         gint16 datetime_format_index;
109         gint16 number_format_index;
110         
111         TextInfoEntry text_info;
112 } CultureInfoEntry;
113
114 typedef struct {
115         const stridx_t name;
116         gint16 culture_entry_index;
117 } CultureInfoNameEntry;
118
119 typedef struct {
120         gint16 region_id;
121         /* gint8 measurement_system; // 0:metric 1:US 2:UK */
122         /* gint16 geo_id; */
123         const stridx_t iso2name;
124         const stridx_t iso3name;
125         const stridx_t win3name;
126         const stridx_t english_name;
127         const stridx_t currency_symbol;
128         const stridx_t iso_currency_symbol;
129         const stridx_t currency_english_name;
130 } RegionInfoEntry;
131
132 typedef struct {
133         const stridx_t name;
134         gint16 region_entry_index;
135 } RegionInfoNameEntry;
136
137 #endif
138