12static wchar_t*
_ToWChar(
const char*
buf,
wchar_t *wbuf,
size_t wbufSize) {
14 wchar_t *wend = wbuf + wbufSize - 1;
15 for (; wcur != wend && *
buf != 0; ++
buf, ++wcur)
47struct _Locale_messages
68 if (nm[0] ==
'C' && nm[1] == 0)
100 return (
struct _Locale_messages*)newlocale(LC_MESSAGES_MASK, nm,
NULL);
162 return ((locale_t)__loc)->__names[
LC_CTYPE];
172 return ((locale_t)__loc)->__names[
LC_NUMERIC];
177 return ((locale_t)__loc)->__names[
LC_TIME];
182 return ((locale_t)__loc)->__names[
LC_COLLATE];
192 return ((locale_t)__loc)->__names[LC_MESSAGES];
196{ freelocale((locale_t)__loc); }
202{ freelocale((locale_t)__loc); }
205{ freelocale((locale_t)__loc); }
208{ freelocale((locale_t)__loc); }
211{ freelocale((locale_t)__loc); }
214{ freelocale((locale_t)__loc); }
227 if( loc[0]==
'L' && loc[1]==
'C' && loc[2]==
'_') {
284 return ((locale_t)__loc)->__ctype_b;
288{
return ((locale_t)__loc)->__ctype_toupper[
c]; }
291{
return ((locale_t)__loc)->__ctype_tolower[
c]; }
293#if !defined (_STLP_NO_WCHAR_T)
297 if ((__mask &
_Locale_ALPHA) != 0 && iswalpha_l(wc, (locale_t)__loc))
300 if ((__mask &
_Locale_CNTRL) != 0 && iswcntrl_l(wc, (locale_t)__loc))
303 if ((__mask &
_Locale_DIGIT) != 0 && iswdigit_l(wc, (locale_t)__loc))
306 if ((__mask &
_Locale_PRINT) != 0 && iswprint_l(wc, (locale_t)__loc))
309 if ((__mask &
_Locale_PUNCT) != 0 && iswpunct_l(wc, (locale_t)__loc))
312 if ((__mask &
_Locale_SPACE) != 0 && iswspace_l(wc, (locale_t)__loc))
315 if ((__mask &
_Locale_XDIGIT) != 0 && iswxdigit_l(wc, (locale_t)__loc))
318 if ((__mask &
_Locale_UPPER) != 0 && iswupper_l(wc, (locale_t)__loc))
321 if ((__mask &
_Locale_LOWER) != 0 && iswlower_l(wc, (locale_t)__loc))
329 return towlower_l(
c, ((locale_t)__loc) );
334 return towupper_l(
c, ((locale_t)__loc) );
342#if !defined (_STLP_NO_WCHAR_T)
345 const char *
from,
size_t n,
347{ *to = *
from;
return 1; }
353{ *to = (
char)
c;
return 1; }
363 const char *
s1,
size_t n1,
364 const char *
s2,
size_t n2) {
366 char buf1[64], buf2[64];
367 while (
n1 > 0 ||
n2 > 0) {
368 size_t bufsize1 =
n1 < 63 ?
n1 : 63;
369 size_t bufsize2 =
n2 < 63 ?
n2 : 63;
370 strncpy(buf1,
s1, bufsize1); buf1[bufsize1] = 0;
371 strncpy(buf2,
s2, bufsize2); buf2[bufsize2] = 0;
373 ret = strcoll_l(buf1, buf2, (locale_t)__loc);
375 s1 += bufsize1;
n1 -= bufsize1;
376 s2 += bufsize2;
n2 -= bufsize2;
381#if !defined (_STLP_NO_WCHAR_T)
383 const wchar_t *
s1,
size_t n1,
384 const wchar_t *
s2,
size_t n2) {
386 wchar_t buf1[64], buf2[64];
387 while (
n1 > 0 ||
n2 > 0) {
388 size_t bufsize1 =
n1 < 63 ?
n1 : 63;
389 size_t bufsize2 =
n2 < 63 ?
n2 : 63;
390 wcsncpy(buf1,
s1, bufsize1); buf1[bufsize1] = 0;
391 wcsncpy(buf2,
s2, bufsize2); buf2[bufsize2] = 0;
393 ret = wcscoll_l(buf1, buf2, (locale_t)__loc);
395 s1 += bufsize1;
n1 -= bufsize1;
396 s2 += bufsize2;
n2 -= bufsize2;
404 char *
dest,
size_t dest_n,
405 const char *
src,
size_t src_n )
407 const char *real_src;
416 if (
src[src_n] != 0) {
424 result = strxfrm_l(
dest, real_src, dest_n, (locale_t)__loc);
429# ifndef _STLP_NO_WCHAR_T
432 wchar_t *
dest,
size_t dest_n,
433 const wchar_t *
src,
size_t src_n )
435 const wchar_t *real_src;
444 if (
src[src_n] != 0) {
445 buf =
malloc((src_n + 1) *
sizeof(
wchar_t));
452 result = wcsxfrm_l(
dest, real_src, dest_n, (locale_t)__loc);
463 return *(nl_langinfo_l(RADIXCHAR, (locale_t)__loc));
468 return *(nl_langinfo_l(THOUSEP, (locale_t)__loc));
478 return nl_langinfo_l(YESSTR, (locale_t)__loc);
483 return nl_langinfo_l(NOSTR, (locale_t)__loc);
486#ifndef _STLP_NO_WCHAR_T
501 return nl_langinfo_l(INT_CURR_SYMBOL, (locale_t)__loc);
506 return nl_langinfo_l(CURRENCY_SYMBOL, (locale_t)__loc);
511 return *(nl_langinfo_l(MON_DECIMAL_POINT,(locale_t)__loc));
516 return *(nl_langinfo_l(MON_THOUSANDS_SEP, (locale_t)__loc));
519#ifndef _STLP_NO_WCHAR_T
541 return nl_langinfo_l(POSITIVE_SIGN, (locale_t)__loc);
546 return nl_langinfo_l(NEGATIVE_SIGN, (locale_t)__loc);
553 const char* lname = ((locale_t)__loc)->__names[
LC_MONETARY];
554 if (lname[0] ==
'C' && lname[1] == 0)
556 return *(nl_langinfo_l(INT_FRAC_DIGITS, (locale_t)__loc));
563 const char* lname = ((locale_t)__loc)->__names[
LC_MONETARY];
564 if (lname[0] ==
'C' && lname[1] == 0)
566 return *(nl_langinfo_l(FRAC_DIGITS, (locale_t)__loc));
572 return *(nl_langinfo_l(P_CS_PRECEDES, (locale_t)__loc));
578 return *(nl_langinfo_l(P_SEP_BY_SPACE, (locale_t)__loc));
590 return *(nl_langinfo_l(P_SIGN_POSN, (locale_t)__loc));
596 return *(nl_langinfo_l(N_CS_PRECEDES, (locale_t)__loc));
602 return *(nl_langinfo_l(N_SEP_BY_SPACE, (locale_t)__loc));
614 return *(nl_langinfo_l(N_SIGN_POSN, (locale_t)__loc));
621 return nl_langinfo_l(MON_1 + _m, (locale_t)__loc);
626 return nl_langinfo_l(ABMON_1 + _m, (locale_t)__loc);
631 return nl_langinfo_l(DAY_1 + _d, (locale_t)__loc);
636 return nl_langinfo_l(ABDAY_1 + _d, (locale_t)__loc);
641 return nl_langinfo_l(D_T_FMT, (locale_t)__loc);
646 return nl_langinfo_l(D_FMT, (locale_t)__loc);
651 return nl_langinfo_l(T_FMT, (locale_t)__loc);
656 return nl_langinfo_l(ERA_D_T_FMT, (locale_t)__loc);
661 return nl_langinfo_l(ERA_D_FMT, (locale_t)__loc);
666 return nl_langinfo_l(AM_STR, (locale_t)__loc);
671 return nl_langinfo_l(PM_STR, (locale_t)__loc);
674#ifndef _STLP_NO_WCHAR_T
693 return catopen( __cat_name, NL_CAT_LOCALE );
702 int __setid,
int __msgid,
const char *dfault)
704 return catgets( __cat, __setid, __msgid, dfault );
char * strstr(char *String1, char *String2)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
char const * _Locale_extract_numeric_name(const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
const char * _Locale_collate_default(char *nm)
struct _Locale_name_hint * _Locale_get_collate_hint(struct _Locale_collate *collate)
const wchar_t * _WLocale_full_dayofweek(struct _Locale_time *__loc, int _d, wchar_t *buf, size_t bufSize)
void _Locale_codecvt_destroy(struct _Locale_codecvt *__loc)
const char * _Locale_am_str(struct _Locale_time *__loc)
wchar_t _WLocale_mon_thousands_sep(struct _Locale_monetary *__loc)
char _Locale_int_frac_digits(struct _Locale_monetary *__loc)
wint_t _WLocale_tolower(struct _Locale_ctype *__loc, wint_t c)
const char * _Locale_mon_grouping(struct _Locale_monetary *__loc)
const char * _Locale_long_d_fmt(struct _Locale_time *__loc)
const char * _Locale_full_dayofweek(struct _Locale_time *__loc, int _d)
const char * _Locale_int_curr_symbol(struct _Locale_monetary *__loc)
int _Locale_tolower(struct _Locale_ctype *__loc, int c)
char const * _Locale_messages_name(const struct _Locale_messages *__loc, char *buf)
const wchar_t * _WLocale_full_monthname(struct _Locale_time *__loc, int _m, wchar_t *buf, size_t bufSize)
const char * _Locale_long_d_t_fmt(struct _Locale_time *__loc)
wint_t _WLocale_toupper(struct _Locale_ctype *__loc, wint_t c)
char const * _Locale_extract_messages_name(const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
int _Locale_n_cs_precedes(struct _Locale_monetary *__loc)
char _Locale_mon_thousands_sep(struct _Locale_monetary *__loc)
struct _Locale_name_hint * _Locale_get_ctype_hint(struct _Locale_ctype *ctype)
const wchar_t * _WLocale_currency_symbol(struct _Locale_monetary *__loc, wchar_t *buf, size_t bufSize)
const char * _Locale_false(struct _Locale_numeric *__loc)
void _Locale_catclose(struct _Locale_messages *__loc, nl_catd_type __cat)
struct _Locale_name_hint * _Locale_get_numeric_hint(struct _Locale_numeric *numeric)
wchar_t _WLocale_decimal_point(struct _Locale_numeric *__loc)
const char * _Locale_grouping(struct _Locale_numeric *__loc)
const char * _Locale_messages_default(char *nm)
static const char * _empty_str
int _WLocale_mb_cur_max(struct _Locale_codecvt *lcodecvt)
struct _Locale_ctype * _Locale_ctype_create(const char *nm, struct _Locale_name_hint *hint, int *__err_code)
struct _Locale_name_hint * _Locale_get_messages_hint(struct _Locale_messages *messages)
char _Locale_frac_digits(struct _Locale_monetary *__loc)
char const * _Locale_collate_name(const struct _Locale_collate *__loc, char *buf)
struct _Locale_codecvt * _Locale_codecvt_create(const char *nm, struct _Locale_name_hint *hint, int *__err_code)
char const * _Locale_extract_time_name(const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
const wchar_t * _WLocale_abbrev_dayofweek(struct _Locale_time *__loc, int _d, wchar_t *buf, size_t bufSize)
struct _Locale_messages * _Locale_messages_create(const char *nm, struct _Locale_name_hint *hint, int *__err_code)
const wchar_t * _WLocale_am_str(struct _Locale_time *__loc, wchar_t *buf, size_t bufSize)
char const * _Locale_extract_ctype_name(const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
const char * _Locale_positive_sign(struct _Locale_monetary *__loc)
struct _Locale_name_hint * _Locale_get_time_hint(struct _Locale_time *time)
const wchar_t * _WLocale_true(struct _Locale_numeric *__loc, wchar_t *buf, size_t bufSize)
const wchar_t * _WLocale_int_curr_symbol(struct _Locale_monetary *__loc, wchar_t *buf, size_t bufSize)
const char * _Locale_numeric_default(char *nm)
const char * _Locale_d_t_fmt(struct _Locale_time *__loc)
const char * _Locale_monetary_default(char *nm)
void _Locale_collate_destroy(struct _Locale_collate *__loc)
void _Locale_numeric_destroy(struct _Locale_numeric *__loc)
char _Locale_mon_decimal_point(struct _Locale_monetary *__loc)
char const * _Locale_numeric_name(const struct _Locale_numeric *__loc, char *buf)
const wchar_t * _WLocale_false(struct _Locale_numeric *__loc, wchar_t *buf, size_t bufSize)
_Locale_mask_t _WLocale_ctype(struct _Locale_ctype *__loc, wint_t wc, _Locale_mask_t __mask)
struct _Locale_numeric * _Locale_numeric_create(const char *nm, struct _Locale_name_hint *hint, int *__err_code)
const char * _Locale_abbrev_dayofweek(struct _Locale_time *__loc, int _d)
size_t _WLocale_unshift(struct _Locale_codecvt *lcodecvt, mbstate_t *st, char *buf, size_t n, char **next)
char const * _Locale_codecvt_name(const struct _Locale_codecvt *__loc, char *buf)
int _Locale_p_sign_posn(struct _Locale_monetary *__loc)
void _Locale_messages_destroy(struct _Locale_messages *__loc)
struct _Locale_collate * _Locale_collate_create(const char *nm, struct _Locale_name_hint *hint, int *__err_code)
const char * _Locale_ctype_default(char *nm)
int _WLocale_strcmp(struct _Locale_collate *__loc, const wchar_t *s1, size_t n1, const wchar_t *s2, size_t n2)
int _Locale_strcmp(struct _Locale_collate *__loc, const char *s1, size_t n1, const char *s2, size_t n2)
struct _Locale_time * _Locale_time_create(const char *nm, struct _Locale_name_hint *hint, int *__err_code)
wchar_t _WLocale_thousands_sep(struct _Locale_numeric *__loc)
const char * _Locale_d_fmt(struct _Locale_time *__loc)
char _Locale_thousands_sep(struct _Locale_numeric *__loc)
static const char * _Locale_aux_default(const char *LC, char *nm)
char const * _Locale_extract_collate_name(const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
int _Locale_toupper(struct _Locale_ctype *__loc, int c)
char _Locale_decimal_point(struct _Locale_numeric *__loc)
char const * _Locale_ctype_name(const struct _Locale_ctype *__loc, char *buf)
int _Locale_n_sep_by_space(struct _Locale_monetary *__loc)
const char * _Locale_t_fmt(struct _Locale_time *__loc)
const char * _Locale_catgets(struct _Locale_messages *__loc, nl_catd_type __cat, int __setid, int __msgid, const char *dfault)
const char * _Locale_currency_symbol(struct _Locale_monetary *__loc)
nl_catd_type _Locale_catopen(struct _Locale_messages *__loc, const char *__cat_name)
wchar_t _WLocale_mon_decimal_point(struct _Locale_monetary *__loc)
void _Locale_ctype_destroy(struct _Locale_ctype *__loc)
int _Locale_p_sep_by_space(struct _Locale_monetary *__loc)
void _Locale_time_destroy(struct _Locale_time *__loc)
size_t _Locale_strxfrm(struct _Locale_collate *__loc, char *dest, size_t dest_n, const char *src, size_t src_n)
const char * _Locale_true(struct _Locale_numeric *__loc)
size_t _WLocale_strxfrm(struct _Locale_collate *__loc, wchar_t *dest, size_t dest_n, const wchar_t *src, size_t src_n)
const char * _Locale_full_monthname(struct _Locale_time *__loc, int _m)
struct _Locale_name_hint * _Locale_get_monetary_hint(struct _Locale_monetary *monetary)
const wchar_t * _WLocale_negative_sign(struct _Locale_monetary *__loc, wchar_t *buf, size_t bufSize)
const char * _Locale_pm_str(struct _Locale_time *__loc)
const wchar_t * _WLocale_abbrev_monthname(struct _Locale_time *__loc, int _m, wchar_t *buf, size_t bufSize)
void _Locale_monetary_destroy(struct _Locale_monetary *__loc)
size_t _WLocale_mbtowc(struct _Locale_codecvt *lcodecvt, wchar_t *to, const char *from, size_t n, mbstate_t *st)
const _Locale_mask_t * _Locale_ctype_table(struct _Locale_ctype *__loc)
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
const wchar_t * _WLocale_positive_sign(struct _Locale_monetary *__loc, wchar_t *buf, size_t bufSize)
int _Locale_n_sign_posn(struct _Locale_monetary *__loc)
const wchar_t * _WLocale_pm_str(struct _Locale_time *__loc, wchar_t *buf, size_t bufSize)
char const * _Locale_extract_monetary_name(const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
char const * _Locale_monetary_name(const struct _Locale_monetary *__loc, char *buf)
const char * _Locale_time_default(char *nm)
static const char * _C_name
int _WLocale_mb_cur_min(struct _Locale_codecvt *lcodecvt)
const char * _Locale_negative_sign(struct _Locale_monetary *__loc)
struct _Locale_monetary * _Locale_monetary_create(const char *nm, struct _Locale_name_hint *hint, int *__err_code)
const char * _Locale_abbrev_monthname(struct _Locale_time *__loc, int _m)
int _Locale_p_cs_precedes(struct _Locale_monetary *__loc)
char const * _Locale_time_name(const struct _Locale_time *__loc, char *buf)
size_t _WLocale_wctomb(struct _Locale_codecvt *lcodecvt, char *to, size_t n, const wchar_t c, mbstate_t *st)
static char const * __Extract_locale_name(const char *loc, const char *category, char *buf)
int _WLocale_is_stateless(struct _Locale_codecvt *lcodecvt)
#define _STLP_STATIC_ASSERT(expr)
GLenum GLuint GLenum GLsizei const GLchar * buf
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
#define _Locale_MAX_SIMPLE_NAME
unsigned short int _Locale_mask_t
#define _STLP_LOC_UNKNOWN_NAME
#define _STLP_LOC_NO_PLATFORM_SUPPORT
static unsigned __int64 next
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
_Check_return_ _CRTIMP size_t __cdecl strcspn(_In_z_ const char *_Str, _In_z_ const char *_Control)