ReactOS  0.4.15-dev-1152-g6c94e4f
c_locale_glibc2.c File Reference
#include <locale.h>
#include <langinfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <wctype.h>
#include <string.h>
#include <stdint.h>
Include dependency graph for c_locale_glibc2.c:

Go to the source code of this file.

Functions

static wchar_t_ToWChar (const char *buf, wchar_t *wbuf, size_t wbufSize)
 
void _Locale_init ()
 
void _Locale_final ()
 
struct _Locale_ctype_Locale_ctype_create (const char *nm, struct _Locale_name_hint *hint, int *__err_code)
 
struct _Locale_codecvt_Locale_codecvt_create (const char *nm, struct _Locale_name_hint *hint, int *__err_code)
 
struct _Locale_numeric_Locale_numeric_create (const char *nm, struct _Locale_name_hint *hint, int *__err_code)
 
struct _Locale_time_Locale_time_create (const char *nm, struct _Locale_name_hint *hint, int *__err_code)
 
struct _Locale_collate_Locale_collate_create (const char *nm, struct _Locale_name_hint *hint, int *__err_code)
 
struct _Locale_monetary_Locale_monetary_create (const char *nm, struct _Locale_name_hint *hint, int *__err_code)
 
struct _Locale_messages * _Locale_messages_create (const char *nm, struct _Locale_name_hint *hint, int *__err_code)
 
static const char_Locale_aux_default (const char *LC, char *nm)
 
const char_Locale_ctype_default (char *nm)
 
const char_Locale_numeric_default (char *nm)
 
const char_Locale_time_default (char *nm)
 
const char_Locale_collate_default (char *nm)
 
const char_Locale_monetary_default (char *nm)
 
const char_Locale_messages_default (char *nm)
 
char const_Locale_ctype_name (const struct _Locale_ctype *__loc, char *buf)
 
char const_Locale_codecvt_name (const struct _Locale_codecvt *__loc, char *buf)
 
char const_Locale_numeric_name (const struct _Locale_numeric *__loc, char *buf)
 
char const_Locale_time_name (const struct _Locale_time *__loc, char *buf)
 
char const_Locale_collate_name (const struct _Locale_collate *__loc, char *buf)
 
char const_Locale_monetary_name (const struct _Locale_monetary *__loc, char *buf)
 
char const_Locale_messages_name (const struct _Locale_messages *__loc, char *buf)
 
void _Locale_ctype_destroy (struct _Locale_ctype *__loc)
 
void _Locale_codecvt_destroy (struct _Locale_codecvt *__loc)
 
void _Locale_numeric_destroy (struct _Locale_numeric *__loc)
 
void _Locale_time_destroy (struct _Locale_time *__loc)
 
void _Locale_collate_destroy (struct _Locale_collate *__loc)
 
void _Locale_monetary_destroy (struct _Locale_monetary *__loc)
 
void _Locale_messages_destroy (struct _Locale_messages *__loc)
 
static char const__Extract_locale_name (const char *loc, const char *category, char *buf)
 
char const_Locale_extract_ctype_name (const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
 
char const_Locale_extract_numeric_name (const char *loc, char *buf, 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)
 
char const_Locale_extract_collate_name (const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
 
char const_Locale_extract_monetary_name (const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
 
char const_Locale_extract_messages_name (const char *loc, char *buf, struct _Locale_name_hint *hint, int *__err_code)
 
struct _Locale_name_hint_Locale_get_ctype_hint (struct _Locale_ctype *ctype)
 
struct _Locale_name_hint_Locale_get_numeric_hint (struct _Locale_numeric *numeric)
 
struct _Locale_name_hint_Locale_get_time_hint (struct _Locale_time *time)
 
struct _Locale_name_hint_Locale_get_collate_hint (struct _Locale_collate *collate)
 
struct _Locale_name_hint_Locale_get_monetary_hint (struct _Locale_monetary *monetary)
 
struct _Locale_name_hint_Locale_get_messages_hint (struct _Locale_messages *messages)
 
const _Locale_mask_t_Locale_ctype_table (struct _Locale_ctype *__loc)
 
int _Locale_toupper (struct _Locale_ctype *__loc, int c)
 
int _Locale_tolower (struct _Locale_ctype *__loc, int c)
 
_Locale_mask_t _WLocale_ctype (struct _Locale_ctype *__loc, wint_t wc, _Locale_mask_t __mask)
 
wint_t _WLocale_tolower (struct _Locale_ctype *__loc, wint_t c)
 
wint_t _WLocale_toupper (struct _Locale_ctype *__loc, wint_t c)
 
int _WLocale_mb_cur_max (struct _Locale_codecvt *lcodecvt)
 
int _WLocale_mb_cur_min (struct _Locale_codecvt *lcodecvt)
 
int _WLocale_is_stateless (struct _Locale_codecvt *lcodecvt)
 
size_t _WLocale_mbtowc (struct _Locale_codecvt *lcodecvt, wchar_t *to, const char *from, size_t n, mbstate_t *st)
 
size_t _WLocale_wctomb (struct _Locale_codecvt *lcodecvt, char *to, size_t n, const wchar_t c, mbstate_t *st)
 
size_t _WLocale_unshift (struct _Locale_codecvt *lcodecvt, mbstate_t *st, char *buf, size_t n, char **next)
 
int _Locale_strcmp (struct _Locale_collate *__loc, const char *s1, size_t n1, const char *s2, size_t n2)
 
int _WLocale_strcmp (struct _Locale_collate *__loc, const wchar_t *s1, size_t n1, const wchar_t *s2, size_t n2)
 
size_t _Locale_strxfrm (struct _Locale_collate *__loc, char *dest, size_t dest_n, const char *src, size_t src_n)
 
size_t _WLocale_strxfrm (struct _Locale_collate *__loc, wchar_t *dest, size_t dest_n, const wchar_t *src, size_t src_n)
 
char _Locale_decimal_point (struct _Locale_numeric *__loc)
 
char _Locale_thousands_sep (struct _Locale_numeric *__loc)
 
const char_Locale_grouping (struct _Locale_numeric *__loc)
 
const char_Locale_true (struct _Locale_numeric *__loc)
 
const char_Locale_false (struct _Locale_numeric *__loc)
 
wchar_t _WLocale_decimal_point (struct _Locale_numeric *__loc)
 
wchar_t _WLocale_thousands_sep (struct _Locale_numeric *__loc)
 
const wchar_t_WLocale_true (struct _Locale_numeric *__loc, wchar_t *buf, size_t bufSize)
 
const wchar_t_WLocale_false (struct _Locale_numeric *__loc, wchar_t *buf, size_t bufSize)
 
const char_Locale_int_curr_symbol (struct _Locale_monetary *__loc)
 
const char_Locale_currency_symbol (struct _Locale_monetary *__loc)
 
char _Locale_mon_decimal_point (struct _Locale_monetary *__loc)
 
char _Locale_mon_thousands_sep (struct _Locale_monetary *__loc)
 
const wchar_t_WLocale_int_curr_symbol (struct _Locale_monetary *__loc, wchar_t *buf, size_t bufSize)
 
const wchar_t_WLocale_currency_symbol (struct _Locale_monetary *__loc, wchar_t *buf, size_t bufSize)
 
wchar_t _WLocale_mon_decimal_point (struct _Locale_monetary *__loc)
 
wchar_t _WLocale_mon_thousands_sep (struct _Locale_monetary *__loc)
 
const wchar_t_WLocale_positive_sign (struct _Locale_monetary *__loc, wchar_t *buf, size_t bufSize)
 
const wchar_t_WLocale_negative_sign (struct _Locale_monetary *__loc, wchar_t *buf, size_t bufSize)
 
const char_Locale_mon_grouping (struct _Locale_monetary *__loc)
 
const char_Locale_positive_sign (struct _Locale_monetary *__loc)
 
const char_Locale_negative_sign (struct _Locale_monetary *__loc)
 
char _Locale_int_frac_digits (struct _Locale_monetary *__loc)
 
char _Locale_frac_digits (struct _Locale_monetary *__loc)
 
int _Locale_p_cs_precedes (struct _Locale_monetary *__loc)
 
int _Locale_p_sep_by_space (struct _Locale_monetary *__loc)
 
int _Locale_p_sign_posn (struct _Locale_monetary *__loc)
 
int _Locale_n_cs_precedes (struct _Locale_monetary *__loc)
 
int _Locale_n_sep_by_space (struct _Locale_monetary *__loc)
 
int _Locale_n_sign_posn (struct _Locale_monetary *__loc)
 
const char_Locale_full_monthname (struct _Locale_time *__loc, int _m)
 
const char_Locale_abbrev_monthname (struct _Locale_time *__loc, int _m)
 
const char_Locale_full_dayofweek (struct _Locale_time *__loc, int _d)
 
const char_Locale_abbrev_dayofweek (struct _Locale_time *__loc, int _d)
 
const char_Locale_d_t_fmt (struct _Locale_time *__loc)
 
const char_Locale_d_fmt (struct _Locale_time *__loc)
 
const char_Locale_t_fmt (struct _Locale_time *__loc)
 
const char_Locale_long_d_t_fmt (struct _Locale_time *__loc)
 
const char_Locale_long_d_fmt (struct _Locale_time *__loc)
 
const char_Locale_am_str (struct _Locale_time *__loc)
 
const char_Locale_pm_str (struct _Locale_time *__loc)
 
const wchar_t_WLocale_full_monthname (struct _Locale_time *__loc, int _m, wchar_t *buf, size_t bufSize)
 
const wchar_t_WLocale_abbrev_monthname (struct _Locale_time *__loc, int _m, wchar_t *buf, size_t bufSize)
 
const wchar_t_WLocale_full_dayofweek (struct _Locale_time *__loc, int _d, wchar_t *buf, size_t bufSize)
 
const wchar_t_WLocale_abbrev_dayofweek (struct _Locale_time *__loc, int _d, wchar_t *buf, size_t bufSize)
 
const wchar_t_WLocale_am_str (struct _Locale_time *__loc, wchar_t *buf, size_t bufSize)
 
const wchar_t_WLocale_pm_str (struct _Locale_time *__loc, wchar_t *buf, size_t bufSize)
 
nl_catd_type _Locale_catopen (struct _Locale_messages *__loc, const char *__cat_name)
 
void _Locale_catclose (struct _Locale_messages *__loc, nl_catd_type __cat)
 
const char_Locale_catgets (struct _Locale_messages *__loc, nl_catd_type __cat, int __setid, int __msgid, const char *dfault)
 

Variables

static const char_empty_str = ""
 
static const char_C_name = "C"
 

Function Documentation

◆ __Extract_locale_name()

static char const* __Extract_locale_name ( const char loc,
const char category,
char buf 
)
static

Definition at line 222 of file c_locale_glibc2.c.

223 {
224  char *expr;
225  size_t len_name;
226 
227  if( loc[0]=='L' && loc[1]=='C' && loc[2]=='_') {
228  expr = strstr( (char*)loc, category );
229  if ( expr == NULL )
230  return NULL; /* Category not found. */
231  ++expr;
232  len_name = strcspn( expr, ";" );
233  len_name = len_name >= _Locale_MAX_SIMPLE_NAME ? _Locale_MAX_SIMPLE_NAME - 1 : len_name;
234  strncpy( buf, expr, len_name );
235  buf[len_name] = 0;
236  return buf;
237  }
238  return loc;
239 }
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
_Check_return_ _CRTIMP size_t __cdecl strcspn(_In_z_ const char *_Str, _In_z_ const char *_Control)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
Definition: query.h:86
smooth NULL
Definition: ftsmooth.c:416
#define _Locale_MAX_SIMPLE_NAME
Definition: c_locale.h:54

Referenced by _Locale_extract_collate_name(), _Locale_extract_ctype_name(), _Locale_extract_messages_name(), _Locale_extract_monetary_name(), _Locale_extract_numeric_name(), and _Locale_extract_time_name().

◆ _Locale_abbrev_dayofweek()

const char* _Locale_abbrev_dayofweek ( struct _Locale_time __loc,
int  _d 
)

Definition at line 634 of file c_locale_glibc2.c.

635 {
636  return nl_langinfo_l(ABDAY_1 + _d, (locale_t)__loc);
637 }

Referenced by _WLocale_abbrev_dayofweek().

◆ _Locale_abbrev_monthname()

const char* _Locale_abbrev_monthname ( struct _Locale_time __loc,
int  _m 
)

Definition at line 624 of file c_locale_glibc2.c.

625 {
626  return nl_langinfo_l(ABMON_1 + _m, (locale_t)__loc);
627 }

Referenced by _WLocale_abbrev_monthname().

◆ _Locale_am_str()

const char* _Locale_am_str ( struct _Locale_time __loc)

Definition at line 664 of file c_locale_glibc2.c.

665 {
666  return nl_langinfo_l(AM_STR, (locale_t)__loc);
667 }

Referenced by _WLocale_am_str().

◆ _Locale_aux_default()

static const char* _Locale_aux_default ( const char LC,
char nm 
)
static

Definition at line 111 of file c_locale_glibc2.c.

112 {
113  char *name = getenv( "LC_ALL" );
114 
115  if ( name != NULL && *name != 0 ) {
116  return name;
117  }
118  name = getenv( LC );
119  if ( name != NULL && *name != 0 ) {
120  return name;
121  }
122  name = getenv( "LANG" );
123  if ( name != NULL && *name != 0 ) {
124  return name;
125  }
126 
127  return _C_name;
128 }
static const char * _C_name
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
Definition: name.c:38
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by _Locale_collate_default(), _Locale_ctype_default(), _Locale_messages_default(), _Locale_monetary_default(), _Locale_numeric_default(), and _Locale_time_default().

◆ _Locale_catclose()

void _Locale_catclose ( struct _Locale_messages *  __loc,
nl_catd_type  __cat 
)

Definition at line 696 of file c_locale_glibc2.c.

697 {
698  catclose( __cat );
699 }

◆ _Locale_catgets()

const char* _Locale_catgets ( struct _Locale_messages *  __loc,
nl_catd_type  __cat,
int  __setid,
int  __msgid,
const char dfault 
)

Definition at line 701 of file c_locale_glibc2.c.

703 {
704  return catgets( __cat, __setid, __msgid, dfault );
705 }

◆ _Locale_catopen()

nl_catd_type _Locale_catopen ( struct _Locale_messages *  __loc,
const char __cat_name 
)

Definition at line 691 of file c_locale_glibc2.c.

692 {
693  return catopen( __cat_name, NL_CAT_LOCALE );
694 }

◆ _Locale_codecvt_create()

struct _Locale_codecvt* _Locale_codecvt_create ( const char nm,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 65 of file c_locale_glibc2.c.

66  {
67  // Glibc do not support multibyte manipulation for the moment, it simply implements "C".
68  if (nm[0] == 'C' && nm[1] == 0)
69  { return (struct _Locale_codecvt*)0x01; }
70  *__err_code = _STLP_LOC_NO_PLATFORM_SUPPORT; return 0;
71 }
#define _STLP_LOC_NO_PLATFORM_SUPPORT
Definition: c_locale.h:102

◆ _Locale_codecvt_destroy()

void _Locale_codecvt_destroy ( struct _Locale_codecvt __loc)

Definition at line 198 of file c_locale_glibc2.c.

199 {}

◆ _Locale_codecvt_name()

char const* _Locale_codecvt_name ( const struct _Locale_codecvt __loc,
char buf 
)

Definition at line 165 of file c_locale_glibc2.c.

166 {
167  return _C_name;
168 }
static const char * _C_name

Referenced by _Loc_codecvt_name().

◆ _Locale_collate_create()

struct _Locale_collate* _Locale_collate_create ( const char nm,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 85 of file c_locale_glibc2.c.

86  {
87  *__err_code = _STLP_LOC_UNKNOWN_NAME;
88  return (struct _Locale_collate*)newlocale(LC_COLLATE_MASK, nm, NULL);
89 }
smooth NULL
Definition: ftsmooth.c:416
#define _STLP_LOC_UNKNOWN_NAME
Definition: c_locale.h:101

◆ _Locale_collate_default()

const char* _Locale_collate_default ( char nm)

Definition at line 145 of file c_locale_glibc2.c.

146 {
147  return _Locale_aux_default( "LC_COLLATE", nm );
148 }
static const char * _Locale_aux_default(const char *LC, char *nm)

◆ _Locale_collate_destroy()

void _Locale_collate_destroy ( struct _Locale_collate __loc)

Definition at line 207 of file c_locale_glibc2.c.

208 { freelocale((locale_t)__loc); }

◆ _Locale_collate_name()

char const* _Locale_collate_name ( const struct _Locale_collate __loc,
char buf 
)

Definition at line 180 of file c_locale_glibc2.c.

181 {
182  return ((locale_t)__loc)->__names[LC_COLLATE];
183 }
#define LC_COLLATE
Definition: locale.h:26

Referenced by _Loc_collate_name().

◆ _Locale_ctype_create()

struct _Locale_ctype* _Locale_ctype_create ( const char nm,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 59 of file c_locale_glibc2.c.

60  {
61  *__err_code = _STLP_LOC_UNKNOWN_NAME;
62  return (struct _Locale_ctype*)newlocale(LC_CTYPE_MASK, nm, NULL);
63 }
smooth NULL
Definition: ftsmooth.c:416
#define _STLP_LOC_UNKNOWN_NAME
Definition: c_locale.h:101

◆ _Locale_ctype_default()

const char* _Locale_ctype_default ( char nm)

Definition at line 130 of file c_locale_glibc2.c.

131 {
132  return _Locale_aux_default( "LC_CTYPE", nm );
133 }
static const char * _Locale_aux_default(const char *LC, char *nm)

◆ _Locale_ctype_destroy()

void _Locale_ctype_destroy ( struct _Locale_ctype __loc)

Definition at line 195 of file c_locale_glibc2.c.

196 { freelocale((locale_t)__loc); }

◆ _Locale_ctype_name()

char const* _Locale_ctype_name ( const struct _Locale_ctype __loc,
char buf 
)

Definition at line 160 of file c_locale_glibc2.c.

161 {
162  return ((locale_t)__loc)->__names[LC_CTYPE];
163 }
#define LC_CTYPE
Definition: locale.h:27

Referenced by _Loc_ctype_name().

◆ _Locale_ctype_table()

const _Locale_mask_t* _Locale_ctype_table ( struct _Locale_ctype __loc)

Definition at line 280 of file c_locale_glibc2.c.

281 {
282  /* return table with masks (upper, lower, alpha, etc.) */
283  _STLP_STATIC_ASSERT( sizeof(_Locale_mask_t) == sizeof(((locale_t)__loc)->__ctype_b[0]) )
284  return ((locale_t)__loc)->__ctype_b;
285 }
unsigned short int _Locale_mask_t
Definition: c_locale.h:63
_STLP_STATIC_ASSERT(sizeof(nl_catd_type)<=sizeof(int)) class _STLP_CLASS_DECLSPEC _Catalog_nl_catd_map

◆ _Locale_currency_symbol()

const char* _Locale_currency_symbol ( struct _Locale_monetary __loc)

Definition at line 504 of file c_locale_glibc2.c.

505 {
506  return nl_langinfo_l(CURRENCY_SYMBOL, (locale_t)__loc);
507 }

Referenced by _WLocale_currency_symbol().

◆ _Locale_d_fmt()

const char* _Locale_d_fmt ( struct _Locale_time __loc)

Definition at line 644 of file c_locale_glibc2.c.

645 {
646  return nl_langinfo_l(D_FMT, (locale_t)__loc);
647 }

◆ _Locale_d_t_fmt()

const char* _Locale_d_t_fmt ( struct _Locale_time __loc)

Definition at line 639 of file c_locale_glibc2.c.

640 {
641  return nl_langinfo_l(D_T_FMT, (locale_t)__loc);
642 }

◆ _Locale_decimal_point()

char _Locale_decimal_point ( struct _Locale_numeric __loc)

Definition at line 461 of file c_locale_glibc2.c.

462 {
463  return *(nl_langinfo_l(RADIXCHAR, (locale_t)__loc));
464 }

Referenced by _WLocale_decimal_point().

◆ _Locale_extract_collate_name()

char const* _Locale_extract_collate_name ( const char loc,
char buf,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 253 of file c_locale_glibc2.c.

255 { return __Extract_locale_name( loc, "LC_COLLATE=", buf ); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static char const * __Extract_locale_name(const char *loc, const char *category, char *buf)

◆ _Locale_extract_ctype_name()

char const* _Locale_extract_ctype_name ( const char loc,
char buf,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 241 of file c_locale_glibc2.c.

243 { return __Extract_locale_name( loc, "LC_CTYPE=", buf ); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static char const * __Extract_locale_name(const char *loc, const char *category, char *buf)

◆ _Locale_extract_messages_name()

char const* _Locale_extract_messages_name ( const char loc,
char buf,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 261 of file c_locale_glibc2.c.

263 { return __Extract_locale_name( loc, "LC_MESSAGES=", buf ); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static char const * __Extract_locale_name(const char *loc, const char *category, char *buf)

◆ _Locale_extract_monetary_name()

char const* _Locale_extract_monetary_name ( const char loc,
char buf,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 257 of file c_locale_glibc2.c.

259 { return __Extract_locale_name( loc, "LC_MONETARY=", buf ); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static char const * __Extract_locale_name(const char *loc, const char *category, char *buf)

◆ _Locale_extract_numeric_name()

char const* _Locale_extract_numeric_name ( const char loc,
char buf,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 245 of file c_locale_glibc2.c.

247 { return __Extract_locale_name( loc, "LC_NUMERIC=", buf ); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static char const * __Extract_locale_name(const char *loc, const char *category, char *buf)

◆ _Locale_extract_time_name()

char const* _Locale_extract_time_name ( const char loc,
char buf,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 249 of file c_locale_glibc2.c.

251 { return __Extract_locale_name( loc, "LC_TIME=", buf ); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static char const * __Extract_locale_name(const char *loc, const char *category, char *buf)

◆ _Locale_false()

const char* _Locale_false ( struct _Locale_numeric __loc)

Definition at line 481 of file c_locale_glibc2.c.

482 {
483  return nl_langinfo_l(NOSTR, (locale_t)__loc);
484 }

Referenced by _WLocale_false().

◆ _Locale_final()

void _Locale_final ( void  )

Definition at line 56 of file c_locale_glibc2.c.

57 {}

◆ _Locale_frac_digits()

char _Locale_frac_digits ( struct _Locale_monetary __loc)

Definition at line 559 of file c_locale_glibc2.c.

560 {
561  /* We are forced to manually handled the "C" locale for consistency with
562  * the default implementation in STLport. */
563  const char* lname = ((locale_t)__loc)->__names[LC_MONETARY];
564  if (lname[0] == 'C' && lname[1] == 0)
565  return 0;
566  return *(nl_langinfo_l(FRAC_DIGITS, (locale_t)__loc));
567 }
#define LC_MONETARY
Definition: locale.h:28

◆ _Locale_full_dayofweek()

const char* _Locale_full_dayofweek ( struct _Locale_time __loc,
int  _d 
)

Definition at line 629 of file c_locale_glibc2.c.

630 {
631  return nl_langinfo_l(DAY_1 + _d, (locale_t)__loc);
632 }

Referenced by _WLocale_full_dayofweek().

◆ _Locale_full_monthname()

const char* _Locale_full_monthname ( struct _Locale_time __loc,
int  _m 
)

Definition at line 619 of file c_locale_glibc2.c.

620 {
621  return nl_langinfo_l(MON_1 + _m, (locale_t)__loc);
622 }

Referenced by _WLocale_full_monthname().

◆ _Locale_get_collate_hint()

struct _Locale_name_hint* _Locale_get_collate_hint ( struct _Locale_collate collate)

Definition at line 271 of file c_locale_glibc2.c.

272 { return 0; }

◆ _Locale_get_ctype_hint()

struct _Locale_name_hint* _Locale_get_ctype_hint ( struct _Locale_ctype ctype)

Definition at line 265 of file c_locale_glibc2.c.

266 { return 0; }

◆ _Locale_get_messages_hint()

struct _Locale_name_hint* _Locale_get_messages_hint ( struct _Locale_messages *  messages)

Definition at line 275 of file c_locale_glibc2.c.

276 { return 0; }

◆ _Locale_get_monetary_hint()

struct _Locale_name_hint* _Locale_get_monetary_hint ( struct _Locale_monetary monetary)

Definition at line 273 of file c_locale_glibc2.c.

274 { return 0; }

◆ _Locale_get_numeric_hint()

struct _Locale_name_hint* _Locale_get_numeric_hint ( struct _Locale_numeric numeric)

Definition at line 267 of file c_locale_glibc2.c.

268 { return 0; }

◆ _Locale_get_time_hint()

struct _Locale_name_hint* _Locale_get_time_hint ( struct _Locale_time time)

Definition at line 269 of file c_locale_glibc2.c.

270 { return 0; }

◆ _Locale_grouping()

const char* _Locale_grouping ( struct _Locale_numeric __loc)

Definition at line 471 of file c_locale_glibc2.c.

472 {
473  return (_Locale_thousands_sep(__loc) != 0 ) ? (nl_langinfo_l(GROUPING, (locale_t)__loc)) : _empty_str;
474 }
static const char * _empty_str
char _Locale_thousands_sep(struct _Locale_numeric *__loc)

◆ _Locale_init()

void _Locale_init ( void  )

Definition at line 53 of file c_locale_glibc2.c.

54 {}

◆ _Locale_int_curr_symbol()

const char* _Locale_int_curr_symbol ( struct _Locale_monetary __loc)

Definition at line 499 of file c_locale_glibc2.c.

500 {
501  return nl_langinfo_l(INT_CURR_SYMBOL, (locale_t)__loc);
502 }

Referenced by _WLocale_int_curr_symbol().

◆ _Locale_int_frac_digits()

char _Locale_int_frac_digits ( struct _Locale_monetary __loc)

Definition at line 549 of file c_locale_glibc2.c.

550 {
551  /* We are forced to manually handled the "C" locale for consistency with
552  * the default implementation in STLport. */
553  const char* lname = ((locale_t)__loc)->__names[LC_MONETARY];
554  if (lname[0] == 'C' && lname[1] == 0)
555  return 0;
556  return *(nl_langinfo_l(INT_FRAC_DIGITS, (locale_t)__loc));
557 }
#define LC_MONETARY
Definition: locale.h:28

◆ _Locale_long_d_fmt()

const char* _Locale_long_d_fmt ( struct _Locale_time __loc)

Definition at line 659 of file c_locale_glibc2.c.

660 {
661  return nl_langinfo_l(ERA_D_FMT, (locale_t)__loc);
662 }

◆ _Locale_long_d_t_fmt()

const char* _Locale_long_d_t_fmt ( struct _Locale_time __loc)

Definition at line 654 of file c_locale_glibc2.c.

655 {
656  return nl_langinfo_l(ERA_D_T_FMT, (locale_t)__loc);
657 }

◆ _Locale_messages_create()

struct _Locale_messages* _Locale_messages_create ( const char nm,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 97 of file c_locale_glibc2.c.

98  {
99  *__err_code = _STLP_LOC_UNKNOWN_NAME;
100  return (struct _Locale_messages*)newlocale(LC_MESSAGES_MASK, nm, NULL);
101 }
smooth NULL
Definition: ftsmooth.c:416
#define _STLP_LOC_UNKNOWN_NAME
Definition: c_locale.h:101

◆ _Locale_messages_default()

const char* _Locale_messages_default ( char nm)

Definition at line 155 of file c_locale_glibc2.c.

156 {
157  return _Locale_aux_default( "LC_MESSAGES", nm );
158 }
static const char * _Locale_aux_default(const char *LC, char *nm)

◆ _Locale_messages_destroy()

void _Locale_messages_destroy ( struct _Locale_messages *  __loc)

Definition at line 213 of file c_locale_glibc2.c.

214 { freelocale((locale_t)__loc); }

◆ _Locale_messages_name()

char const* _Locale_messages_name ( const struct _Locale_messages *  __loc,
char buf 
)

Definition at line 190 of file c_locale_glibc2.c.

191 {
192  return ((locale_t)__loc)->__names[LC_MESSAGES];
193 }

◆ _Locale_mon_decimal_point()

char _Locale_mon_decimal_point ( struct _Locale_monetary __loc)

Definition at line 509 of file c_locale_glibc2.c.

510 {
511  return *(nl_langinfo_l(MON_DECIMAL_POINT,(locale_t)__loc));
512 }

Referenced by _WLocale_mon_decimal_point().

◆ _Locale_mon_grouping()

const char* _Locale_mon_grouping ( struct _Locale_monetary __loc)

Definition at line 534 of file c_locale_glibc2.c.

535 {
536  return (_Locale_mon_thousands_sep( __loc ) != 0 ) ? nl_langinfo_l(MON_GROUPING, (locale_t)__loc) : _empty_str;
537 }
char _Locale_mon_thousands_sep(struct _Locale_monetary *__loc)
static const char * _empty_str

◆ _Locale_mon_thousands_sep()

char _Locale_mon_thousands_sep ( struct _Locale_monetary __loc)

Definition at line 514 of file c_locale_glibc2.c.

515 {
516  return *(nl_langinfo_l(MON_THOUSANDS_SEP, (locale_t)__loc));
517 }

Referenced by _Locale_mon_grouping(), and _WLocale_mon_thousands_sep().

◆ _Locale_monetary_create()

struct _Locale_monetary* _Locale_monetary_create ( const char nm,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 91 of file c_locale_glibc2.c.

92  {
93  *__err_code = _STLP_LOC_UNKNOWN_NAME;
94  return (struct _Locale_monetary*)newlocale(LC_MONETARY_MASK, nm, NULL);
95 }
smooth NULL
Definition: ftsmooth.c:416
#define _STLP_LOC_UNKNOWN_NAME
Definition: c_locale.h:101

◆ _Locale_monetary_default()

const char* _Locale_monetary_default ( char nm)

Definition at line 150 of file c_locale_glibc2.c.

151 {
152  return _Locale_aux_default( "LC_MONETARY", nm );
153 }
static const char * _Locale_aux_default(const char *LC, char *nm)

◆ _Locale_monetary_destroy()

void _Locale_monetary_destroy ( struct _Locale_monetary __loc)

Definition at line 210 of file c_locale_glibc2.c.

211 { freelocale((locale_t)__loc); }

◆ _Locale_monetary_name()

char const* _Locale_monetary_name ( const struct _Locale_monetary __loc,
char buf 
)

Definition at line 185 of file c_locale_glibc2.c.

186 {
187  return ((locale_t)__loc)->__names[LC_MONETARY];
188 }
#define LC_MONETARY
Definition: locale.h:28

Referenced by _Loc_monetary_name().

◆ _Locale_n_cs_precedes()

int _Locale_n_cs_precedes ( struct _Locale_monetary __loc)

Definition at line 594 of file c_locale_glibc2.c.

595 {
596  return *(nl_langinfo_l(N_CS_PRECEDES, (locale_t)__loc));
597 }

◆ _Locale_n_sep_by_space()

int _Locale_n_sep_by_space ( struct _Locale_monetary __loc)

Definition at line 600 of file c_locale_glibc2.c.

601 {
602  return *(nl_langinfo_l(N_SEP_BY_SPACE, (locale_t)__loc));
603 }

◆ _Locale_n_sign_posn()

int _Locale_n_sign_posn ( struct _Locale_monetary __loc)

Definition at line 612 of file c_locale_glibc2.c.

613 {
614  return *(nl_langinfo_l(N_SIGN_POSN, (locale_t)__loc));
615 }

◆ _Locale_negative_sign()

const char* _Locale_negative_sign ( struct _Locale_monetary __loc)

Definition at line 544 of file c_locale_glibc2.c.

545 {
546  return nl_langinfo_l(NEGATIVE_SIGN, (locale_t)__loc);
547 }

Referenced by _WLocale_negative_sign().

◆ _Locale_numeric_create()

struct _Locale_numeric* _Locale_numeric_create ( const char nm,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 73 of file c_locale_glibc2.c.

74  {
75  *__err_code = _STLP_LOC_UNKNOWN_NAME;
76  return (struct _Locale_numeric*)newlocale(LC_NUMERIC_MASK, nm, NULL);
77 }
smooth NULL
Definition: ftsmooth.c:416
#define _STLP_LOC_UNKNOWN_NAME
Definition: c_locale.h:101

◆ _Locale_numeric_default()

const char* _Locale_numeric_default ( char nm)

Definition at line 135 of file c_locale_glibc2.c.

136 {
137  return _Locale_aux_default( "LC_NUMERIC", nm );
138 }
static const char * _Locale_aux_default(const char *LC, char *nm)

◆ _Locale_numeric_destroy()

void _Locale_numeric_destroy ( struct _Locale_numeric __loc)

Definition at line 201 of file c_locale_glibc2.c.

202 { freelocale((locale_t)__loc); }

◆ _Locale_numeric_name()

char const* _Locale_numeric_name ( const struct _Locale_numeric __loc,
char buf 
)

Definition at line 170 of file c_locale_glibc2.c.

171 {
172  return ((locale_t)__loc)->__names[LC_NUMERIC];
173 }
#define LC_NUMERIC
Definition: locale.h:29

Referenced by _Loc_numeric_name().

◆ _Locale_p_cs_precedes()

int _Locale_p_cs_precedes ( struct _Locale_monetary __loc)

Definition at line 570 of file c_locale_glibc2.c.

571 {
572  return *(nl_langinfo_l(P_CS_PRECEDES, (locale_t)__loc));
573 }

◆ _Locale_p_sep_by_space()

int _Locale_p_sep_by_space ( struct _Locale_monetary __loc)

Definition at line 576 of file c_locale_glibc2.c.

577 {
578  return *(nl_langinfo_l(P_SEP_BY_SPACE, (locale_t)__loc));
579 }

◆ _Locale_p_sign_posn()

int _Locale_p_sign_posn ( struct _Locale_monetary __loc)

Definition at line 588 of file c_locale_glibc2.c.

589 {
590  return *(nl_langinfo_l(P_SIGN_POSN, (locale_t)__loc));
591 }

◆ _Locale_pm_str()

const char* _Locale_pm_str ( struct _Locale_time __loc)

Definition at line 669 of file c_locale_glibc2.c.

670 {
671  return nl_langinfo_l(PM_STR, (locale_t)__loc);
672 }

Referenced by _WLocale_pm_str().

◆ _Locale_positive_sign()

const char* _Locale_positive_sign ( struct _Locale_monetary __loc)

Definition at line 539 of file c_locale_glibc2.c.

540 {
541  return nl_langinfo_l(POSITIVE_SIGN, (locale_t)__loc);
542 }

Referenced by _WLocale_positive_sign().

◆ _Locale_strcmp()

int _Locale_strcmp ( struct _Locale_collate __loc,
const char s1,
size_t  n1,
const char s2,
size_t  n2 
)

Definition at line 362 of file c_locale_glibc2.c.

364  {
365  int ret = 0;
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;
372 
373  ret = strcoll_l(buf1, buf2, (locale_t)__loc);
374  if (ret != 0) return ret;
375  s1 += bufsize1; n1 -= bufsize1;
376  s2 += bufsize2; n2 -= bufsize2;
377  }
378  return ret;
379 }
struct S2 s2
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
struct S1 s1
int n1
Definition: dwarfget.c:148
int ret
int n2
Definition: dwarfget.c:148

◆ _Locale_strxfrm()

size_t _Locale_strxfrm ( struct _Locale_collate __loc,
char dest,
size_t  dest_n,
const char src,
size_t  src_n 
)

Definition at line 403 of file c_locale_glibc2.c.

406 {
407  const char *real_src;
408  char *buf = NULL;
409  size_t result;
410 
411  if (src_n == 0)
412  {
413  if (dest != NULL) dest[0] = 0;
414  return 0;
415  }
416  if (src[src_n] != 0) {
417  buf = malloc(src_n + 1);
418  strncpy(buf, src, src_n);
419  buf[src_n] = 0;
420  real_src = buf;
421  }
422  else
423  real_src = src;
424  result = strxfrm_l(dest, real_src, dest_n, (locale_t)__loc);
425  if (buf != NULL) free(buf);
426  return result;
427 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define free
Definition: debug_ros.c:5
smooth NULL
Definition: ftsmooth.c:416
GLenum src
Definition: glext.h:6340
#define malloc
Definition: debug_ros.c:4
static char * dest
Definition: rtl.c:135
GLuint64EXT * result
Definition: glext.h:11304

◆ _Locale_t_fmt()

const char* _Locale_t_fmt ( struct _Locale_time __loc)

Definition at line 649 of file c_locale_glibc2.c.

650 {
651  return nl_langinfo_l(T_FMT, (locale_t)__loc);
652 }

◆ _Locale_thousands_sep()

char _Locale_thousands_sep ( struct _Locale_numeric __loc)

Definition at line 466 of file c_locale_glibc2.c.

467 {
468  return *(nl_langinfo_l(THOUSEP, (locale_t)__loc));
469 }

Referenced by _Locale_grouping(), and _WLocale_thousands_sep().

◆ _Locale_time_create()

struct _Locale_time* _Locale_time_create ( const char nm,
struct _Locale_name_hint hint,
int __err_code 
)

Definition at line 79 of file c_locale_glibc2.c.

80  {
81  *__err_code = _STLP_LOC_UNKNOWN_NAME;
82  return (struct _Locale_time*)newlocale(LC_TIME_MASK, nm, NULL);
83 }
smooth NULL
Definition: ftsmooth.c:416
#define _STLP_LOC_UNKNOWN_NAME
Definition: c_locale.h:101

◆ _Locale_time_default()

const char* _Locale_time_default ( char nm)

Definition at line 140 of file c_locale_glibc2.c.

141 {
142  return _Locale_aux_default( "LC_TIME", nm );
143 }
static const char * _Locale_aux_default(const char *LC, char *nm)

◆ _Locale_time_destroy()

void _Locale_time_destroy ( struct _Locale_time __loc)

Definition at line 204 of file c_locale_glibc2.c.

205 { freelocale((locale_t)__loc); }

◆ _Locale_time_name()

char const* _Locale_time_name ( const struct _Locale_time __loc,
char buf 
)

Definition at line 175 of file c_locale_glibc2.c.

176 {
177  return ((locale_t)__loc)->__names[LC_TIME];
178 }
#define LC_TIME
Definition: locale.h:30

Referenced by _Loc_time_name().

◆ _Locale_tolower()

int _Locale_tolower ( struct _Locale_ctype __loc,
int  c 
)

Definition at line 290 of file c_locale_glibc2.c.

291 { return ((locale_t)__loc)->__ctype_tolower[c]; }
#define c
Definition: ke_i.h:80

◆ _Locale_toupper()

int _Locale_toupper ( struct _Locale_ctype __loc,
int  c 
)

Definition at line 287 of file c_locale_glibc2.c.

288 { return ((locale_t)__loc)->__ctype_toupper[c]; }
#define c
Definition: ke_i.h:80

◆ _Locale_true()

const char* _Locale_true ( struct _Locale_numeric __loc)

Definition at line 476 of file c_locale_glibc2.c.

477 {
478  return nl_langinfo_l(YESSTR, (locale_t)__loc);
479 }

Referenced by _WLocale_true().

◆ _ToWChar()

static wchar_t* _ToWChar ( const char buf,
wchar_t wbuf,
size_t  wbufSize 
)
static

Definition at line 12 of file c_locale_glibc2.c.

12  {
13  wchar_t *wcur = wbuf;
14  wchar_t *wend = wbuf + wbufSize - 1;
15  for (; wcur != wend && *buf != 0; ++buf, ++wcur)
16  *wcur = *buf;
17  *wcur = 0;
18  return wbuf;
19 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751

Referenced by _WLocale_abbrev_dayofweek(), _WLocale_abbrev_monthname(), _WLocale_am_str(), _WLocale_currency_symbol(), _WLocale_false(), _WLocale_full_dayofweek(), _WLocale_full_monthname(), _WLocale_int_curr_symbol(), _WLocale_negative_sign(), _WLocale_pm_str(), _WLocale_positive_sign(), and _WLocale_true().

◆ _WLocale_abbrev_dayofweek()

const wchar_t* _WLocale_abbrev_dayofweek ( struct _Locale_time __loc,
int  _d,
wchar_t buf,
size_t  bufSize 
)

Definition at line 681 of file c_locale_glibc2.c.

682 { return _ToWChar(_Locale_abbrev_dayofweek(__loc, _d), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_abbrev_dayofweek(struct _Locale_time *__loc, int _d)

◆ _WLocale_abbrev_monthname()

const wchar_t* _WLocale_abbrev_monthname ( struct _Locale_time __loc,
int  _m,
wchar_t buf,
size_t  bufSize 
)

Definition at line 677 of file c_locale_glibc2.c.

678 { return _ToWChar(_Locale_abbrev_monthname(__loc, _m), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_abbrev_monthname(struct _Locale_time *__loc, int _m)

◆ _WLocale_am_str()

const wchar_t* _WLocale_am_str ( struct _Locale_time __loc,
wchar_t buf,
size_t  bufSize 
)

Definition at line 683 of file c_locale_glibc2.c.

684 { return _ToWChar(_Locale_am_str(__loc), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_am_str(struct _Locale_time *__loc)

◆ _WLocale_ctype()

_Locale_mask_t _WLocale_ctype ( struct _Locale_ctype __loc,
wint_t  wc,
_Locale_mask_t  __mask 
)

Definition at line 294 of file c_locale_glibc2.c.

295 {
296  _Locale_mask_t ret = 0;
297  if ((__mask & _Locale_ALPHA) != 0 && iswalpha_l(wc, (locale_t)__loc))
298  ret |= _Locale_ALPHA;
299 
300  if ((__mask & _Locale_CNTRL) != 0 && iswcntrl_l(wc, (locale_t)__loc))
301  ret |= _Locale_CNTRL;
302 
303  if ((__mask & _Locale_DIGIT) != 0 && iswdigit_l(wc, (locale_t)__loc))
304  ret |= _Locale_DIGIT;
305 
306  if ((__mask & _Locale_PRINT) != 0 && iswprint_l(wc, (locale_t)__loc))
307  ret |= _Locale_PRINT;
308 
309  if ((__mask & _Locale_PUNCT) != 0 && iswpunct_l(wc, (locale_t)__loc))
310  ret |= _Locale_PUNCT;
311 
312  if ((__mask & _Locale_SPACE) != 0 && iswspace_l(wc, (locale_t)__loc))
313  ret |= _Locale_SPACE;
314 
315  if ((__mask & _Locale_XDIGIT) != 0 && iswxdigit_l(wc, (locale_t)__loc))
316  ret |= _Locale_XDIGIT;
317 
318  if ((__mask & _Locale_UPPER) != 0 && iswupper_l(wc, (locale_t)__loc))
319  ret |= _Locale_UPPER;
320 
321  if ((__mask & _Locale_LOWER) != 0 && iswlower_l(wc, (locale_t)__loc))
322  ret |= _Locale_LOWER;
323 
324  return ret;
325 }
unsigned short int _Locale_mask_t
Definition: c_locale.h:63
#define _Locale_ALPHA
Definition: c_locale.h:125
#define _Locale_XDIGIT
Definition: c_locale.h:128
#define _Locale_PRINT
Definition: c_locale.h:121
#define _Locale_SPACE
Definition: c_locale.h:120
#define _Locale_UPPER
Definition: c_locale.h:123
int ret
#define _Locale_PUNCT
Definition: c_locale.h:127
#define _Locale_LOWER
Definition: c_locale.h:124
#define _Locale_DIGIT
Definition: c_locale.h:126
#define _Locale_CNTRL
Definition: c_locale.h:122

◆ _WLocale_currency_symbol()

const wchar_t* _WLocale_currency_symbol ( struct _Locale_monetary __loc,
wchar_t buf,
size_t  bufSize 
)

Definition at line 522 of file c_locale_glibc2.c.

523 { return _ToWChar(_Locale_currency_symbol(__loc), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_currency_symbol(struct _Locale_monetary *__loc)

◆ _WLocale_decimal_point()

wchar_t _WLocale_decimal_point ( struct _Locale_numeric __loc)

Definition at line 487 of file c_locale_glibc2.c.

488 { return (wchar_t)_Locale_decimal_point(__loc); }
char _Locale_decimal_point(struct _Locale_numeric *__loc)

◆ _WLocale_false()

const wchar_t* _WLocale_false ( struct _Locale_numeric __loc,
wchar_t buf,
size_t  bufSize 
)

Definition at line 493 of file c_locale_glibc2.c.

494 { return _ToWChar(_Locale_false(__loc), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_false(struct _Locale_numeric *__loc)

◆ _WLocale_full_dayofweek()

const wchar_t* _WLocale_full_dayofweek ( struct _Locale_time __loc,
int  _d,
wchar_t buf,
size_t  bufSize 
)

Definition at line 679 of file c_locale_glibc2.c.

680 { return _ToWChar(_Locale_full_dayofweek(__loc, _d), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
const char * _Locale_full_dayofweek(struct _Locale_time *__loc, int _d)
GLuint GLsizei bufSize
Definition: glext.h:6040

◆ _WLocale_full_monthname()

const wchar_t* _WLocale_full_monthname ( struct _Locale_time __loc,
int  _m,
wchar_t buf,
size_t  bufSize 
)

Definition at line 675 of file c_locale_glibc2.c.

676 { return _ToWChar(_Locale_full_monthname(__loc, _m), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_full_monthname(struct _Locale_time *__loc, int _m)

◆ _WLocale_int_curr_symbol()

const wchar_t* _WLocale_int_curr_symbol ( struct _Locale_monetary __loc,
wchar_t buf,
size_t  bufSize 
)

Definition at line 520 of file c_locale_glibc2.c.

521 { return _ToWChar(_Locale_int_curr_symbol(__loc), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_int_curr_symbol(struct _Locale_monetary *__loc)

◆ _WLocale_is_stateless()

int _WLocale_is_stateless ( struct _Locale_codecvt lcodecvt)

Definition at line 340 of file c_locale_glibc2.c.

340 { return 1; }

◆ _WLocale_mb_cur_max()

int _WLocale_mb_cur_max ( struct _Locale_codecvt lcodecvt)

Definition at line 338 of file c_locale_glibc2.c.

338 { return 1; }

◆ _WLocale_mb_cur_min()

int _WLocale_mb_cur_min ( struct _Locale_codecvt lcodecvt)

Definition at line 339 of file c_locale_glibc2.c.

339 { return 1; }

◆ _WLocale_mbtowc()

size_t _WLocale_mbtowc ( struct _Locale_codecvt lcodecvt,
wchar_t to,
const char from,
size_t  n,
mbstate_t st 
)

Definition at line 343 of file c_locale_glibc2.c.

347 { *to = *from; return 1; }
CardRegion * from
Definition: spigame.cpp:19

◆ _WLocale_mon_decimal_point()

wchar_t _WLocale_mon_decimal_point ( struct _Locale_monetary __loc)

Definition at line 524 of file c_locale_glibc2.c.

525 { return (wchar_t)_Locale_mon_decimal_point(__loc); }
char _Locale_mon_decimal_point(struct _Locale_monetary *__loc)

◆ _WLocale_mon_thousands_sep()

wchar_t _WLocale_mon_thousands_sep ( struct _Locale_monetary __loc)

Definition at line 526 of file c_locale_glibc2.c.

527 { return (wchar_t)_Locale_mon_thousands_sep(__loc); }
char _Locale_mon_thousands_sep(struct _Locale_monetary *__loc)

◆ _WLocale_negative_sign()

const wchar_t* _WLocale_negative_sign ( struct _Locale_monetary __loc,
wchar_t buf,
size_t  bufSize 
)

Definition at line 530 of file c_locale_glibc2.c.

531 { return _ToWChar(_Locale_negative_sign(__loc), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_negative_sign(struct _Locale_monetary *__loc)

◆ _WLocale_pm_str()

const wchar_t* _WLocale_pm_str ( struct _Locale_time __loc,
wchar_t buf,
size_t  bufSize 
)

Definition at line 685 of file c_locale_glibc2.c.

686 { return _ToWChar(_Locale_pm_str(__loc), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_pm_str(struct _Locale_time *__loc)

◆ _WLocale_positive_sign()

const wchar_t* _WLocale_positive_sign ( struct _Locale_monetary __loc,
wchar_t buf,
size_t  bufSize 
)

Definition at line 528 of file c_locale_glibc2.c.

529 { return _ToWChar(_Locale_positive_sign(__loc), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_positive_sign(struct _Locale_monetary *__loc)

◆ _WLocale_strcmp()

int _WLocale_strcmp ( struct _Locale_collate __loc,
const wchar_t s1,
size_t  n1,
const wchar_t s2,
size_t  n2 
)

Definition at line 382 of file c_locale_glibc2.c.

384  {
385  int ret = 0;
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;
392 
393  ret = wcscoll_l(buf1, buf2, (locale_t)__loc);
394  if (ret != 0) return ret;
395  s1 += bufsize1; n1 -= bufsize1;
396  s2 += bufsize2; n2 -= bufsize2;
397  }
398  return ret;
399 }
struct S2 s2
struct S1 s1
int n1
Definition: dwarfget.c:148
int ret
int n2
Definition: dwarfget.c:148
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)

◆ _WLocale_strxfrm()

size_t _WLocale_strxfrm ( struct _Locale_collate __loc,
wchar_t dest,
size_t  dest_n,
const wchar_t src,
size_t  src_n 
)

Definition at line 431 of file c_locale_glibc2.c.

434 {
435  const wchar_t *real_src;
436  wchar_t *buf = NULL;
437  size_t result;
438 
439  if (src_n == 0)
440  {
441  if (dest != NULL) dest[0] = 0;
442  return 0;
443  }
444  if (src[src_n] != 0) {
445  buf = malloc((src_n + 1) * sizeof(wchar_t));
446  wcsncpy(buf, src, src_n);
447  buf[src_n] = 0;
448  real_src = buf;
449  }
450  else
451  real_src = src;
452  result = wcsxfrm_l(dest, real_src, dest_n, (locale_t)__loc);
453  if (buf != NULL) free(buf);
454  return result;
455 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define free
Definition: debug_ros.c:5
smooth NULL
Definition: ftsmooth.c:416
GLenum src
Definition: glext.h:6340
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
#define malloc
Definition: debug_ros.c:4
static char * dest
Definition: rtl.c:135
GLuint64EXT * result
Definition: glext.h:11304

◆ _WLocale_thousands_sep()

wchar_t _WLocale_thousands_sep ( struct _Locale_numeric __loc)

Definition at line 489 of file c_locale_glibc2.c.

490 { return (wchar_t)_Locale_thousands_sep(__loc); }
char _Locale_thousands_sep(struct _Locale_numeric *__loc)

◆ _WLocale_tolower()

wint_t _WLocale_tolower ( struct _Locale_ctype __loc,
wint_t  c 
)

Definition at line 327 of file c_locale_glibc2.c.

328 {
329  return towlower_l( c, ((locale_t)__loc) );
330 }
const GLubyte * c
Definition: glext.h:8905

◆ _WLocale_toupper()

wint_t _WLocale_toupper ( struct _Locale_ctype __loc,
wint_t  c 
)

Definition at line 332 of file c_locale_glibc2.c.

333 {
334  return towupper_l( c, ((locale_t)__loc) );
335 }
const GLubyte * c
Definition: glext.h:8905

◆ _WLocale_true()

const wchar_t* _WLocale_true ( struct _Locale_numeric __loc,
wchar_t buf,
size_t  bufSize 
)

Definition at line 491 of file c_locale_glibc2.c.

492 { return _ToWChar(_Locale_true(__loc), buf, bufSize); }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static wchar_t * _ToWChar(const char *buf, wchar_t *wbuf, size_t wbufSize)
GLuint GLsizei bufSize
Definition: glext.h:6040
const char * _Locale_true(struct _Locale_numeric *__loc)

◆ _WLocale_unshift()

size_t _WLocale_unshift ( struct _Locale_codecvt lcodecvt,
mbstate_t st,
char buf,
size_t  n,
char **  next 
)

Definition at line 356 of file c_locale_glibc2.c.

359 { *next = buf; return 0; }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static unsigned __int64 next
Definition: rand_nt.c:6

◆ _WLocale_wctomb()

size_t _WLocale_wctomb ( struct _Locale_codecvt lcodecvt,
char to,
size_t  n,
const wchar_t  c,
mbstate_t st 
)

Definition at line 349 of file c_locale_glibc2.c.

353 { *to = (char)c; return 1; }
unsigned char
Definition: typeof.h:29
const GLubyte * c
Definition: glext.h:8905

Variable Documentation

◆ _C_name

const char* _C_name = "C"
static

Definition at line 10 of file c_locale_glibc2.c.

Referenced by _Locale_aux_default(), and _Locale_codecvt_name().

◆ _empty_str

const char* _empty_str = ""
static

Definition at line 9 of file c_locale_glibc2.c.

Referenced by _Locale_grouping(), and _Locale_mon_grouping().