27#define MAX_ELEM_LEN 64
28#define MAX_LOCALE_LENGTH 256
31#error _pctype should not be defined
43#define LOCK_LOCALE _mlock(_SETLOCALE_LOCK);
44#define UNLOCK_LOCALE _munlock(_SETLOCALE_LOCK);
46#define MSVCRT_LEADBYTE 0x8000
47#define MSVCRT_C1_DEFINED 0x200
53 "american english",
"enu",
54 "american-english",
"enu",
55 "english-american",
"enu",
63 "french-belgian",
"frb",
66 "french-canadian",
"frc",
68 "chinese-simplified",
"chs",
69 "chinese-traditional",
"cht",
70 "dutch-belgian",
"nlb",
74 "french-swiss",
"frs",
76 "german-swiss",
"des",
77 "italian-swiss",
"its",
78 "german-austrian",
"dea",
80 "portuguese-brazil",
"ptb",
81 "spanish-mexican",
"esm",
82 "norwegian-bokmal",
"nor",
83 "norwegian-nynorsk",
"non",
84 "spanish-modern",
"esn"
103#define FOUND_LANGUAGE 0x4
104#define FOUND_COUNTRY 0x2
105#define FOUND_CODEPAGE 0x1
116#define CONTINUE_LOOKING TRUE
117#define STOP_LOOKING FALSE
146 unsigned int flags = 0;
156 TRACE(
":Found language: %s->%s\n",
res->search_language,
buff);
169 TRACE(
"Found country:%s->%s\n",
res->search_country,
buff);
181 TRACE(
"Found codepage:%s->%s\n",
res->search_codepage,
buff);
199 TRACE(
":found exact locale match\n");
212 const char *
cp, *region;
225 search.search_country[0] =
'\0';
230 search.search_country[
cp-region-1] =
'\0';
234 search.search_codepage[0] =
'\0';
236 if(!
search.search_country[0] && !
search.search_codepage[0])
256 if (
search.search_codepage[0]) {
360 return data->locinfo;
370 return data->mbcinfo;
389 "LC_COLLATE=%s;LC_CTYPE=%s;LC_MONETARY=%s;LC_NUMERIC=%s;LC_TIME=%s",
396 return current_lc_all;
405 static wchar_t fake[] = {
406 'E',
'n',
'g',
'l',
'i',
's',
'h',
'_',
'U',
'n',
'i',
't',
'e',
'd',
' ',
407 'S',
't',
'a',
't',
'e',
's',
'.',
'1',
'2',
'5',
'2',0 };
425 size =
cur->str.names.short_mon[0]-
cur->str.names.short_wday[0];
458 size =
cur->str.names.am-
cur->str.names.short_mon[0];
464 for(
i=0;
i<12;
i++) {
490 for(
i=0;
i<
sizeof(
cur->str.str)/
sizeof(
cur->str.str[0]);
i++)
499 for(
i=0;
i<
sizeof(
cur->str.str)/
sizeof(
cur->str.str[0]);
i++) {
514 FIXME(
"(lcid %x, flags %x, %s(%d), %p(%d), %x, %d), partial stub!\n",
528 FIXME(
"(lcid %x, flags %x, %s(%d), %p(%d), %x, %d), partial stub!\n",
538 const char *src2,
int len2 )
540 FIXME(
"(lcid %x, flags %x, %s(%d), %s(%d), partial stub\n",
550 const wchar_t *src2,
int len2 )
552 FIXME(
"(lcid %x, flags %x, %s(%d), %s(%d), partial stub\n",
573 unsigned char letter =
c;
592 FIXME(
"(unk %x, type %x, wstr %p(%d), %p) partial stub\n",
724 static const DWORD time_data[] = {
741 static const char collate[] =
"COLLATE=";
742 static const char ctype[] =
"CTYPE=";
743 static const char monetary[] =
"MONETARY=";
744 static const char numeric[] =
"NUMERIC=";
745 static const char time[] =
"TIME=";
746 static const char cloc_short_date[] =
"MM/dd/yy";
747 static const wchar_t cloc_short_dateW[] = {
'M',
'M',
'/',
'd',
'd',
'/',
'y',
'y',0};
748 static const char cloc_long_date[] =
"dddd, MMMM dd, yyyy";
749 static const wchar_t cloc_long_dateW[] = {
'd',
'd',
'd',
'd',
',',
' ',
'M',
'M',
'M',
'M',
' ',
'd',
'd',
',',
' ',
'y',
'y',
'y',
'y',0};
750 static const char cloc_time[] =
"HH:mm:ss";
751 static const wchar_t cloc_timeW[] = {
'H',
'H',
':',
'm',
'm',
':',
's',
's',0};
754 LCID lcid[6] = { 0 }, lcid_tmp;
755 unsigned short cp[6] = { 0 };
788 }
else if(!
memcmp(
locale, monetary,
sizeof(monetary)-1)) {
790 locale +=
sizeof(monetary)-1;
791 }
else if(!
memcmp(
locale, numeric,
sizeof(numeric)-1)) {
793 locale +=
sizeof(numeric)-1;
814 if(!
p || *(
p+1)!=
'L' || *(
p+2)!=
'C' || *(
p+3)!=
'_')
904 for(
i=1;
i<257;
i++) {
924 for(
i=0;
i<256;
i++) {
938 for(
i=0;
i<256;
i++) {
1001 i =
i/2 + (
buf[
i-2]==
'0'?0:1);
1003 for(
i=0;
buf[
i+1]==
';';
i+=2)
1168 i =
i/2 + (
buf[
i-2]==
'0'?0:1);
1170 for(
i=0;
buf[
i+1]==
';';
i+=2)
1207 for(
i=0;
i<
sizeof(time_data)/
sizeof(time_data[0]);
i++) {
1209 size +=
sizeof(cloc_short_date) +
sizeof(cloc_short_dateW);
1211 size +=
sizeof(cloc_long_date) +
sizeof(cloc_long_dateW);
1238 for(
i=0;
i<
sizeof(time_data)/
sizeof(time_data[0]);
i++) {
1242 ret +=
sizeof(cloc_short_date);
1245 ret +=
sizeof(cloc_long_date);
1248 ret +=
sizeof(cloc_time);
1254 for(
i=0;
i<
sizeof(time_data)/
sizeof(time_data[0]);
i++) {
1258 ret +=
sizeof(cloc_short_dateW);
1261 ret +=
sizeof(cloc_long_dateW);
1263 ret +=
sizeof(cloc_timeW);
1436 if(!
data->have_locale) {
1452 if(
data->have_locale) {
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
char * strchr(const char *String, int ch)
#define InterlockedIncrement
#define InterlockedDecrement
#define MultiByteToWideChar
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
BOOL WINAPI EnumResourceLanguagesA(HMODULE hmod, LPCSTR type, LPCSTR name, ENUMRESLANGPROCA lpfun, LONG_PTR lparam)
BOOL WINAPI GetCPInfo(UINT CodePage, LPCPINFO CodePageInfo)
BOOL WINAPI IsValidCodePage(UINT CodePage)
static unsigned char buff[32768]
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define _DISABLE_PER_THREAD_LOCALE
#define _ENABLE_PER_THREAD_LOCALE
INT WINAPI LCMapStringA(LCID lcid, DWORD flags, LPCSTR src, INT srclen, LPSTR dst, INT dstlen)
BOOL WINAPI GetStringTypeA(LCID locale, DWORD type, LPCSTR src, INT count, LPWORD chartype)
INT WINAPI CompareStringA(LCID lcid, DWORD flags, LPCSTR str1, INT len1, LPCSTR str2, INT len2)
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
LCID WINAPI GetSystemDefaultLCID(void)
INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
void *__cdecl _Gettnames(void)
int __cdecl _setmbcp(int)
#define MSVCRT_LC_MONETARY
#define MSVCRT_LC_NUMERIC
int _setmbcp_l(int, LCID, MSVCRT_pthreadmbcinfo)
#define MSVCRT_LC_COLLATE
thread_data_t * msvcrt_get_thread_data(void)
static DWORD LPDWORD LPCSTR DWORD srclen
#define cmp(status, error)
#define _Analysis_assume_(expr)
static short search(int val, const short *table, int size)
#define MAKELCID(lgid, srtid)
const unsigned short _ctype[257]
static const char *const _country_synonyms[]
void CDECL MSVCRT__free_locale(MSVCRT__locale_t locale)
static char * construct_lc_all(MSVCRT_pthreadlocinfo locinfo)
int CDECL __crtLCMapStringA(LCID lcid, DWORD mapflags, const char *src, int srclen, char *dst, int dstlen, unsigned int codepage, int xflag)
int CDECL __lconv_init(void)
LCID *CDECL ___lc_handle_func(void)
static void remap_synonym(char *name)
MSVCRT_pthreadmbcinfo get_mbcinfo(void)
int MSVCRT___lc_collate_cp
unsigned char _mbctype[257]
MSVCRT_pthreadlocinfo get_locinfo(void)
MSVCRT__locale_t global_locale
unsigned int CDECL ___lc_collate_cp_func(void)
wint_t CDECL MSVCRT_btowc(int c)
int CDECL __crtGetLocaleInfoW(LCID lcid, LCTYPE type, wchar_t *buffer, int len)
void free_locinfo(MSVCRT_pthreadlocinfo locinfo)
unsigned int __unguarded_readlc_active
char *CDECL _Getdays(void)
int CDECL _configthreadlocale(int type)
static void swap_pointers(void **p1, void **p2)
static int compare_info(LCID lcid, DWORD flags, char *buff, const char *cmp, BOOL exact)
void free_mbcinfo(MSVCRT_pthreadmbcinfo mbcinfo)
char *CDECL _Getmonths(void)
int CDECL __crtCompareStringA(LCID lcid, DWORD flags, const char *src1, int len1, const char *src2, int len2)
BOOL CDECL __crtGetStringTypeW(DWORD unk, DWORD type, wchar_t *buffer, int len, WORD *out)
unsigned int CDECL ___setlc_active_func(void)
wchar_t *CDECL _wsetlocale(int category, const wchar_t *locale)
LCID MSVCRT___lc_handle[LC_MAX - LC_MIN+1]
unsigned int __lc_codepage
const unsigned short ** __p__pctype(void)
static BOOL update_threadlocinfo_category(LCID lcid, unsigned short cp, MSVCRT__locale_t loc, int category)
LCID MSVCRT_locale_to_LCID(const char *locale, unsigned short *codepage)
#define MAX_LOCALE_LENGTH
MSVCRT__locale_t CDECL MSVCRT__create_locale(int category, const char *locale)
unsigned int *CDECL ___unguarded_readlc_active_add_func(void)
int CDECL __crtLCMapStringW(LCID lcid, DWORD mapflags, const wchar_t *src, int srclen, wchar_t *dst, int dstlen, unsigned int codepage, int xflag)
static BOOL CALLBACK find_best_locale_proc(HMODULE hModule, LPCSTR type, LPCSTR name, WORD LangID, LONG_PTR lParam)
static unsigned char charmax
void __init_global_locale()
unsigned int __setlc_active
const unsigned short *__cdecl __pctype_func(void)
unsigned int CDECL ___lc_codepage_func(void)
int CDECL __crtCompareStringW(LCID lcid, DWORD flags, const wchar_t *src1, int len1, const wchar_t *src2, int len2)
MSVCRT__locale_t CDECL MSVCRT__get_current_locale(void)
struct lconv *CDECL localeconv(void)
MSVCRT_pthreadmbcinfo mbcinfo
MSVCRT_pthreadlocinfo locinfo
struct MSVCRT_lconv * lconv
int * lconv_intl_refcount
struct MSVCRT_threadlocaleinfostruct::@1658 lc_category[6]
struct MSVCRT___lc_time_data * lc_time_curr
unsigned int lc_collate_cp
MSVCRT_ulong lc_handle[6]
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
#define LOCALE_SABBREVMONTHNAME10
#define LOCALE_SMONTHNAME12
#define LOCALE_ICURRDIGITS
#define LOCALE_IDEFAULTCODEPAGE
#define LOCALE_SMONTHNAME5
#define LOCALE_SABBREVMONTHNAME9
#define LOCALE_SABBREVMONTHNAME11
#define LOCALE_SABBREVDAYNAME5
#define LOCALE_SABBREVDAYNAME2
#define LOCALE_INEGSEPBYSPACE
#define LOCALE_SABBREVMONTHNAME2
#define LOCALE_INEGSIGNPOSN
#define LOCALE_SMONTHNAME3
#define LOCALE_SMONTHNAME11
#define LOCALE_SMONTHNAME8
#define LOCALE_SMONTHNAME4
#define LOCALE_SENGLANGUAGE
#define LOCALE_SMONTHNAME7
#define LOCALE_IINTLCURRDIGITS
#define LOCALE_SSHORTDATE
#define LOCALE_IPOSSYMPRECEDES
#define LOCALE_SABBREVMONTHNAME4
#define LOCALE_SPOSITIVESIGN
#define LOCALE_SABBREVDAYNAME4
#define LOCALE_SMONDECIMALSEP
#define LOCALE_SISO639LANGNAME
#define LOCALE_SMONTHNAME1
#define LOCALE_SABBREVMONTHNAME3
#define LOCALE_INEGSYMPRECEDES
#define LOCALE_SMONTHOUSANDSEP
#define LOCALE_IPOSSIGNPOSN
#define LOCALE_SABBREVMONTHNAME1
#define LOCALE_NOUSEROVERRIDE
#define LOCALE_IDEFAULTANSICODEPAGE
#define LOCALE_SISO3166CTRYNAME
#define LOCALE_SABBREVDAYNAME6
#define LOCALE_SMONTHNAME2
#define LOCALE_STIMEFORMAT
#define LOCALE_SABBREVDAYNAME1
#define LOCALE_SABBREVMONTHNAME6
#define LOCALE_SMONTHNAME6
#define LOCALE_SABBREVLANGNAME
#define LOCALE_SENGCOUNTRY
#define LOCALE_SABBREVCTRYNAME
#define LOCALE_SNEGATIVESIGN
#define LOCALE_SABBREVDAYNAME3
#define LOCALE_SABBREVMONTHNAME5
#define LOCALE_SABBREVMONTHNAME7
#define LOCALE_SINTLSYMBOL
#define LOCALE_SABBREVMONTHNAME8
#define LOCALE_SMONGROUPING
#define LOCALE_SMONTHNAME10
#define LOCALE_SMONTHNAME9
#define LOCALE_IPOSSEPBYSPACE
#define LOCALE_SABBREVMONTHNAME12
#define LOCALE_SABBREVDAYNAME7