d72fcb09715fd7bbcbbcb3e8c5ca71fe52637b03
1 #include <crtdll/stdio.h>
2 #include <crtdll/locale.h>
3 #include <crtdll/string.h>
7 int _current_category
; /* used by setlocale */
8 const char *_current_locale
;
9 int __mb_cur_max_dll
= 1;
11 int parse_locale(char *locale
, char *lang
, char *country
, char *code_page
);
13 char *setlocale(int category
, const char *locale
)
18 parse_locale((char *)locale
,lang
,country
,code_page
);
20 //printf("%s %s %s %s\n",locale,lang,country,code_page);
47 locale "lang[_country[.code_page]]"
53 int parse_locale(char *locale
, char *lang
, char *country
, char *code_page
)
55 while ( *locale
!= 0 && *locale
!= '.' && *locale
!= '_' )
62 if ( *locale
== '_' ) {
64 while ( *locale
!= 0 && *locale
!= '.' )
74 if ( *locale
== '.' ) {
76 while ( *locale
!= 0 && *locale
!= '.' )
88 const struct map_lcid2str
{
93 {0x0409,"English", "United States"},
94 {0x0809,"English", "United Kingdom"},
95 {0x0000,"Unknown", "Unknown"}
99 const struct map_cntr
{
103 {"britain", "united kingdom"},
104 {"england", "united kingdom"},
105 {"gbr", "united kingdom"},
106 {"great britain", "united kingdom"},
107 {"uk", "united kingdom"},
108 {"united kingdom", "united kingdom"},
109 {"united-kingdom", "united kingdom"},
110 {"america", "united states" },
111 {"united states", "united states"},
112 {"united-states", "united states"},
113 {"us", "united states"},
114 {"usa" "united states"}
118 struct lconv _lconv
= {
119 ".", // decimal_point
120 ",", // thousands_sep
122 "DOL", // int_curr_symbol
123 "$", // currency_symbol
124 ".", // mon_decimal_point
125 ",", // mon_thousands_sep
127 "+", // positive_sign
128 "-", // negative_sign
129 127, // int_frac_digits
131 127, // p_cs_precedes
132 127, // p_sep_by_space
133 127, // n_cs_precedes
134 127, // n_sep_by_space
139 struct lconv
*localeconv(void)
141 return (struct lconv
*) &_lconv
;