27#define MAX_ELEM_LEN 64
28#define MAX_LOCALE_LENGTH 256
31#error _pctype should not be defined
34#define strcasecmp _stricmp
35#define strncasecmp _strnicmp
45#define LOCK_LOCALE _mlock(_SETLOCALE_LOCK);
46#define UNLOCK_LOCALE _munlock(_SETLOCALE_LOCK);
48#define MSVCRT_LEADBYTE 0x8000
49#define MSVCRT_C1_DEFINED 0x200
55 "american english",
"enu",
56 "american-english",
"enu",
57 "english-american",
"enu",
65 "french-belgian",
"frb",
68 "french-canadian",
"frc",
70 "chinese-simplified",
"chs",
71 "chinese-traditional",
"cht",
72 "dutch-belgian",
"nlb",
76 "french-swiss",
"frs",
78 "german-swiss",
"des",
79 "italian-swiss",
"its",
80 "german-austrian",
"dea",
82 "portuguese-brazil",
"ptb",
83 "spanish-mexican",
"esm",
84 "norwegian-bokmal",
"nor",
85 "norwegian-nynorsk",
"non",
86 "spanish-modern",
"esn"
105#define FOUND_LANGUAGE 0x4
106#define FOUND_COUNTRY 0x2
107#define FOUND_CODEPAGE 0x1
118#define CONTINUE_LOOKING TRUE
119#define STOP_LOOKING FALSE
148 unsigned int flags = 0;
158 TRACE(
":Found language: %s->%s\n",
res->search_language,
buff);
171 TRACE(
"Found country:%s->%s\n",
res->search_country,
buff);
183 TRACE(
"Found codepage:%s->%s\n",
res->search_codepage,
buff);
201 TRACE(
":found exact locale match\n");
207extern int atoi(
const char *);
214 const char *
cp, *region;
227 search.search_country[0] =
'\0';
232 search.search_country[
cp-region-1] =
'\0';
236 search.search_codepage[0] =
'\0';
238 if(!
search.search_country[0] && !
search.search_codepage[0])
258 if (
search.search_codepage[0]) {
362 return data->locinfo;
372 return data->mbcinfo;
391 "LC_COLLATE=%s;LC_CTYPE=%s;LC_MONETARY=%s;LC_NUMERIC=%s;LC_TIME=%s",
398 return current_lc_all;
407 static wchar_t fake[] = {
408 'E',
'n',
'g',
'l',
'i',
's',
'h',
'_',
'U',
'n',
'i',
't',
'e',
'd',
' ',
409 'S',
't',
'a',
't',
'e',
's',
'.',
'1',
'2',
'5',
'2',0 };
427 size =
cur->str.names.short_mon[0]-
cur->str.names.short_wday[0];
460 size =
cur->str.names.am-
cur->str.names.short_mon[0];
466 for(
i=0;
i<12;
i++) {
492 for(
i=0;
i<
sizeof(
cur->str.str)/
sizeof(
cur->str.str[0]);
i++)
501 for(
i=0;
i<
sizeof(
cur->str.str)/
sizeof(
cur->str.str[0]);
i++) {
516 FIXME(
"(lcid %x, flags %x, %s(%d), %p(%d), %x, %d), partial stub!\n",
530 FIXME(
"(lcid %x, flags %x, %s(%d), %p(%d), %x, %d), partial stub!\n",
540 const char *src2,
int len2 )
542 FIXME(
"(lcid %x, flags %x, %s(%d), %s(%d), partial stub\n",
552 const wchar_t *src2,
int len2 )
554 FIXME(
"(lcid %x, flags %x, %s(%d), %s(%d), partial stub\n",
575 unsigned char letter =
c;
594 FIXME(
"(unk %x, type %x, wstr %p(%d), %p) partial stub\n",
726 static const DWORD time_data[] = {
743 static const char collate[] =
"COLLATE=";
744 static const char ctype[] =
"CTYPE=";
745 static const char monetary[] =
"MONETARY=";
746 static const char numeric[] =
"NUMERIC=";
747 static const char time[] =
"TIME=";
748 static const char cloc_short_date[] =
"MM/dd/yy";
749 static const wchar_t cloc_short_dateW[] = {
'M',
'M',
'/',
'd',
'd',
'/',
'y',
'y',0};
750 static const char cloc_long_date[] =
"dddd, MMMM dd, yyyy";
751 static const wchar_t cloc_long_dateW[] = {
'd',
'd',
'd',
'd',
',',
' ',
'M',
'M',
'M',
'M',
' ',
'd',
'd',
',',
' ',
'y',
'y',
'y',
'y',0};
752 static const char cloc_time[] =
"HH:mm:ss";
753 static const wchar_t cloc_timeW[] = {
'H',
'H',
':',
'm',
'm',
':',
's',
's',0};
756 LCID lcid[6] = { 0 }, lcid_tmp;
757 unsigned short cp[6] = { 0 };
790 }
else if(!
memcmp(
locale, monetary,
sizeof(monetary)-1)) {
792 locale +=
sizeof(monetary)-1;
793 }
else if(!
memcmp(
locale, numeric,
sizeof(numeric)-1)) {
795 locale +=
sizeof(numeric)-1;
816 if(!
p || *(
p+1)!=
'L' || *(
p+2)!=
'C' || *(
p+3)!=
'_')
906 for(
i=1;
i<257;
i++) {
926 for(
i=0;
i<256;
i++) {
940 for(
i=0;
i<256;
i++) {
1003 i =
i/2 + (
buf[
i-2]==
'0'?0:1);
1005 for(
i=0;
buf[
i+1]==
';';
i+=2)
1170 i =
i/2 + (
buf[
i-2]==
'0'?0:1);
1172 for(
i=0;
buf[
i+1]==
';';
i+=2)
1209 for(
i=0;
i<
sizeof(time_data)/
sizeof(time_data[0]);
i++) {
1211 size +=
sizeof(cloc_short_date) +
sizeof(cloc_short_dateW);
1213 size +=
sizeof(cloc_long_date) +
sizeof(cloc_long_dateW);
1240 for(
i=0;
i<
sizeof(time_data)/
sizeof(time_data[0]);
i++) {
1244 ret +=
sizeof(cloc_short_date);
1247 ret +=
sizeof(cloc_long_date);
1250 ret +=
sizeof(cloc_time);
1256 for(
i=0;
i<
sizeof(time_data)/
sizeof(time_data[0]);
i++) {
1260 ret +=
sizeof(cloc_short_dateW);
1263 ret +=
sizeof(cloc_long_dateW);
1265 ret +=
sizeof(cloc_timeW);
1438 if(!
data->have_locale) {
1454 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 * 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)
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)
BOOL WINAPI IsValidCodePage(UINT codepage)
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 GetCPInfo(UINT codepage, LPCPINFO cpinfo)
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)
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
struct __lc_time_data MSVCRT___lc_time_data
#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)
static short search(int val, const short *table, int size)
#define _Analysis_assume_
#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
int * lconv_intl_refcount
struct MSVCRT___lc_time_data * lc_time_curr
struct MSVCRT_lconv * lconv
unsigned int lc_collate_cp
struct MSVCRT_threadlocaleinfostruct::@1691 lc_category[6]
MSVCRT_ulong lc_handle[6]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
_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