Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / culture-info.h
1 /**
2  * \file
3  */
4
5 #ifndef _MONO_METADATA_CULTURE_INFO_H_
6 #define _MONO_METADATA_CULTURE_INFO_H_ 1
7
8 #include <glib.h>
9 #include <mono/metadata/object.h>
10
11 #define NUM_DAYS 7
12 #define NUM_MONTHS 13
13 #define GROUP_SIZE 2
14 #define NUM_CALENDARS 4
15
16 #define NUM_SHORT_DATE_PATTERNS 14
17 #define NUM_LONG_DATE_PATTERNS 10
18 #define NUM_SHORT_TIME_PATTERNS 12
19 #define NUM_LONG_TIME_PATTERNS 9
20 #define NUM_YEAR_MONTH_PATTERNS 8
21
22 #define idx2string(idx) (locale_strings + (idx))
23 #define pattern2string(idx) (patterns + (idx))
24 #define dtidx2string(idx) (datetime_strings + (idx))
25
26 /* need to change this if the string data ends up to not fit in a 64KB array. */
27 typedef guint16 stridx_t;
28
29 typedef struct {
30         const stridx_t month_day_pattern;
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 shortest_day_names [NUM_DAYS];
37         const stridx_t month_names [NUM_MONTHS];
38         const stridx_t month_genitive_names [NUM_MONTHS];
39         const stridx_t abbreviated_month_names [NUM_MONTHS];
40         const stridx_t abbreviated_month_genitive_names [NUM_MONTHS];
41
42         const gint8 calendar_week_rule;
43         const gint8 first_day_of_week;
44
45         const stridx_t date_separator;
46         const stridx_t time_separator;  
47
48         const stridx_t short_date_patterns [NUM_SHORT_DATE_PATTERNS];
49         const stridx_t long_date_patterns [NUM_LONG_DATE_PATTERNS];
50         const stridx_t short_time_patterns [NUM_SHORT_TIME_PATTERNS];
51         const stridx_t long_time_patterns [NUM_LONG_TIME_PATTERNS];
52         const stridx_t year_month_patterns [NUM_YEAR_MONTH_PATTERNS];
53 } DateTimeFormatEntry;
54
55 typedef struct {
56         const stridx_t currency_decimal_separator;
57         const stridx_t currency_group_separator;
58         const stridx_t number_decimal_separator;
59         const stridx_t number_group_separator;
60
61         const stridx_t currency_symbol;
62         const stridx_t percent_symbol;
63         const stridx_t nan_symbol;
64         const stridx_t per_mille_symbol;
65         const stridx_t negative_infinity_symbol;
66         const stridx_t positive_infinity_symbol;
67
68         const stridx_t negative_sign;
69         const stridx_t positive_sign;
70
71         const gint8 currency_negative_pattern;
72         const gint8 currency_positive_pattern;
73         const gint8 percent_negative_pattern;
74         const gint8 percent_positive_pattern;
75         const gint8 number_negative_pattern;
76
77         const gint8 currency_decimal_digits;
78         const gint8 number_decimal_digits;
79
80         const gint currency_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 MonoBoolean is_right_to_left;
90         const char list_sep;
91 } TextInfoEntry;
92
93 typedef struct {
94         const gint16 lcid;
95         const gint16 parent_lcid;
96         const gint16 calendar_type;
97         const gint16 region_entry_index;
98         const stridx_t name;
99         const stridx_t englishname;
100         const stridx_t nativename;
101         const stridx_t win3lang;
102         const stridx_t iso3lang;
103         const stridx_t iso2lang;
104         const stridx_t territory;
105         const stridx_t native_calendar_names [NUM_CALENDARS];
106
107         const gint16 datetime_format_index;
108         const gint16 number_format_index;
109         
110         const TextInfoEntry text_info;
111 } CultureInfoEntry;
112
113 typedef struct {
114         const stridx_t name;
115         const gint16 culture_entry_index;
116 } CultureInfoNameEntry;
117
118 typedef struct {
119         const gint16 geo_id;
120         const stridx_t iso2name;
121         const stridx_t iso3name;
122         const stridx_t win3name;
123         const stridx_t english_name;
124         const stridx_t native_name;
125         const stridx_t currency_symbol;
126         const stridx_t iso_currency_symbol;
127         const stridx_t currency_english_name;
128         const stridx_t currency_native_name;
129 } RegionInfoEntry;
130
131 typedef struct {
132         const stridx_t name;
133         const gint16 region_entry_index;
134 } RegionInfoNameEntry;
135
136 #endif
137