ReactOS 0.4.16-dev-303-g11d5cb8
xlocinfo.h File Reference
#include <ctype.h>
#include <locale.h>
#include <wchar.h>
#include <yvals.h>
Include dependency graph for xlocinfo.h:

Go to the source code of this file.

Classes

struct  _Collvec
 
struct  _Ctypevec
 
struct  _Cvtvec
 

Macros

#define _XA   0x100
 
#define _XS   0x000
 
#define _BB   _CONTROL
 
#define _CN   _SPACE
 
#define _DI   _DIGIT
 
#define _LO   _LOWER
 
#define _PU   _PUNCT
 
#define _SP   _BLANK
 
#define _UP   _UPPER
 
#define _XD   _HEX
 
#define _X_ALL   LC_ALL
 
#define _X_COLLATE   LC_COLLATE
 
#define _X_CTYPE   LC_CTYPE
 
#define _X_MONETARY   LC_MONETARY
 
#define _X_NUMERIC   LC_NUMERIC
 
#define _X_TIME   LC_TIME
 
#define _X_MAX   LC_MAX
 
#define _X_MESSAGES   6
 
#define _NCAT   7
 
#define _CATMASK(n)   ((1 << (n)) >> 1)
 
#define _M_COLLATE   _CATMASK(_X_COLLATE)
 
#define _M_CTYPE   _CATMASK(_X_CTYPE)
 
#define _M_MONETARY   _CATMASK(_X_MONETARY)
 
#define _M_NUMERIC   _CATMASK(_X_NUMERIC)
 
#define _M_TIME   _CATMASK(_X_TIME)
 
#define _M_MESSAGES   _CATMASK(_X_MESSAGES)
 
#define _M_ALL   (_CATMASK(_NCAT) - 1)
 

Typedefs

typedef struct _Collvec _Collvec
 
typedef struct _Ctypevec _Ctypevec
 
typedef struct _Cvtvec _Cvtvec
 

Functions

_CRTIMP _Collvec __cdecl _Getcoll (void)
 
_CRTIMP _Ctypevec __cdecl _Getctype (void)
 
_CRTIMP _Cvtvec __cdecl _Getcvt (void)
 
_CRTIMP int __cdecl _Getdateorder (void)
 
_CRTIMP int __cdecl _Mbrtowc (wchar_t *, const char *, size_t, mbstate_t *, const _Cvtvec *)
 
_CRTIMP float __cdecl _Stof (const char *, char **, long)
 
_CRTIMP double __cdecl _Stod (const char *, char **, long)
 
_CRTIMP long double __cdecl _Stold (const char *, char **, long)
 
_CRTIMP int __cdecl _Strcoll (const char *, const char *, const char *, const char *, const _Collvec *)
 
_CRTIMP size_t __cdecl _Strxfrm (char *_String1, char *_End1, const char *, const char *, const _Collvec *)
 
_CRTIMP int __cdecl _Tolower (int, const _Ctypevec *)
 
_CRTIMP int __cdecl _Toupper (int, const _Ctypevec *)
 
_CRTIMP int __cdecl _Wcrtomb (char *, wchar_t, mbstate_t *, const _Cvtvec *)
 
_CRTIMP int __cdecl _Wcscoll (const wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *, const _Collvec *)
 
_CRTIMP size_t __cdecl _Wcsxfrm (wchar_t *_String1, wchar_t *_End1, const wchar_t *, const wchar_t *, const _Collvec *)
 
_CRTIMP short __cdecl _Getwctype (wchar_t, const _Ctypevec *)
 
_CRTIMP const wchar_t *__cdecl _Getwctypes (const wchar_t *, const wchar_t *, short *, const _Ctypevec *)
 
_CRTIMP wchar_t __cdecl _Towlower (wchar_t, const _Ctypevec *)
 
_CRTIMP wchar_t __cdecl _Towupper (wchar_t, const _Ctypevec *)
 
_END_C_LIB_DECL _C_STD_END _C_LIB_DECL _CRTIMP void *__cdecl _Gettnames (void)
 
_CRTIMP char *__cdecl _Getdays (void)
 
_CRTIMP char *__cdecl _Getmonths (void)
 
_CRTIMP size_t __cdecl _Strftime (char *, size_t _Maxsize, const char *, const struct tm *, void *)
 
_END_C_LIB_DECL _C_LIB_DECL _locale_t __cdecl _GetLocaleForCP (unsigned int)
 

Macro Definition Documentation

◆ _BB

#define _BB   _CONTROL

Definition at line 20 of file xlocinfo.h.

◆ _CATMASK

#define _CATMASK (   n)    ((1 << (n)) >> 1)

Definition at line 39 of file xlocinfo.h.

◆ _CN

#define _CN   _SPACE

Definition at line 21 of file xlocinfo.h.

◆ _DI

#define _DI   _DIGIT

Definition at line 22 of file xlocinfo.h.

◆ _LO

#define _LO   _LOWER

Definition at line 23 of file xlocinfo.h.

◆ _M_ALL

#define _M_ALL   (_CATMASK(_NCAT) - 1)

Definition at line 46 of file xlocinfo.h.

◆ _M_COLLATE

#define _M_COLLATE   _CATMASK(_X_COLLATE)

Definition at line 40 of file xlocinfo.h.

◆ _M_CTYPE

#define _M_CTYPE   _CATMASK(_X_CTYPE)

Definition at line 41 of file xlocinfo.h.

◆ _M_MESSAGES

#define _M_MESSAGES   _CATMASK(_X_MESSAGES)

Definition at line 45 of file xlocinfo.h.

◆ _M_MONETARY

#define _M_MONETARY   _CATMASK(_X_MONETARY)

Definition at line 42 of file xlocinfo.h.

◆ _M_NUMERIC

#define _M_NUMERIC   _CATMASK(_X_NUMERIC)

Definition at line 43 of file xlocinfo.h.

◆ _M_TIME

#define _M_TIME   _CATMASK(_X_TIME)

Definition at line 44 of file xlocinfo.h.

◆ _NCAT

#define _NCAT   7

Definition at line 37 of file xlocinfo.h.

◆ _PU

#define _PU   _PUNCT

Definition at line 24 of file xlocinfo.h.

◆ _SP

#define _SP   _BLANK

Definition at line 25 of file xlocinfo.h.

◆ _UP

#define _UP   _UPPER

Definition at line 26 of file xlocinfo.h.

◆ _X_ALL

#define _X_ALL   LC_ALL

Definition at line 29 of file xlocinfo.h.

◆ _X_COLLATE

#define _X_COLLATE   LC_COLLATE

Definition at line 30 of file xlocinfo.h.

◆ _X_CTYPE

#define _X_CTYPE   LC_CTYPE

Definition at line 31 of file xlocinfo.h.

◆ _X_MAX

#define _X_MAX   LC_MAX

Definition at line 35 of file xlocinfo.h.

◆ _X_MESSAGES

#define _X_MESSAGES   6

Definition at line 36 of file xlocinfo.h.

◆ _X_MONETARY

#define _X_MONETARY   LC_MONETARY

Definition at line 32 of file xlocinfo.h.

◆ _X_NUMERIC

#define _X_NUMERIC   LC_NUMERIC

Definition at line 33 of file xlocinfo.h.

◆ _X_TIME

#define _X_TIME   LC_TIME

Definition at line 34 of file xlocinfo.h.

◆ _XA

#define _XA   0x100

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER within this package.

Definition at line 18 of file xlocinfo.h.

◆ _XD

#define _XD   _HEX

Definition at line 27 of file xlocinfo.h.

◆ _XS

#define _XS   0x000

Definition at line 19 of file xlocinfo.h.

Typedef Documentation

◆ _Collvec

◆ _Ctypevec

◆ _Cvtvec

Function Documentation

◆ _Getcoll()

_CRTIMP _Collvec __cdecl _Getcoll ( void  )

◆ _Getctype()

_CRTIMP _Ctypevec __cdecl _Getctype ( void  )

◆ _Getcvt()

_CRTIMP _Cvtvec __cdecl _Getcvt ( void  )

◆ _Getdateorder()

_CRTIMP int __cdecl _Getdateorder ( void  )

◆ _Getdays()

_CRTIMP char *__cdecl _Getdays ( void  )

Definition at line 419 of file locale.c.

420{
422 int i, len, size;
423 char *out;
424
425 TRACE("\n");
426
427 size = cur->str.names.short_mon[0]-cur->str.names.short_wday[0];
429 if(!out)
430 return NULL;
431
432 size = 0;
433 for(i=0; i<7; i++) {
434 out[size++] = ':';
435 len = strlen(cur->str.names.short_wday[i]);
436 memcpy(&out[size], cur->str.names.short_wday[i], len);
437 size += len;
438
439 out[size++] = ':';
440 len = strlen(cur->str.names.wday[i]);
441 memcpy(&out[size], cur->str.names.wday[i], len);
442 size += len;
443 }
444 out[size] = '\0';
445
446 return out;
447}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define NULL
Definition: types.h:112
FxCollectionEntry * cur
GLsizeiptr size
Definition: glext.h:5919
GLenum GLsizei len
Definition: glext.h:6722
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
Definition: glfuncs.h:248
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static FILE * out
Definition: regtests2xml.c:44
#define MSVCRT_malloc
Definition: msvcrt.h:151
MSVCRT_pthreadlocinfo get_locinfo(void)
Definition: locale.c:356
#define TRACE(s)
Definition: solgame.cpp:4
struct MSVCRT___lc_time_data * lc_time_curr
Definition: msvcrt.h:134

◆ _GetLocaleForCP()

◆ _Getmonths()

_CRTIMP char *__cdecl _Getmonths ( void  )

Definition at line 452 of file locale.c.

453{
455 int i, len, size;
456 char *out;
457
458 TRACE("\n");
459
460 size = cur->str.names.am-cur->str.names.short_mon[0];
462 if(!out)
463 return NULL;
464
465 size = 0;
466 for(i=0; i<12; i++) {
467 out[size++] = ':';
468 len = strlen(cur->str.names.short_mon[i]);
469 memcpy(&out[size], cur->str.names.short_mon[i], len);
470 size += len;
471
472 out[size++] = ':';
473 len = strlen(cur->str.names.mon[i]);
474 memcpy(&out[size], cur->str.names.mon[i], len);
475 size += len;
476 }
477 out[size] = '\0';
478
479 return out;
480}

◆ _Gettnames()

Definition at line 485 of file locale.c.

486{
488 unsigned int i, size = sizeof(MSVCRT___lc_time_data);
489
490 TRACE("\n");
491
492 for(i=0; i<sizeof(cur->str.str)/sizeof(cur->str.str[0]); i++)
493 size += strlen(cur->str.str[i])+1;
494
496 if(!ret)
497 return NULL;
498 memcpy(ret, cur, size);
499
500 size = 0;
501 for(i=0; i<sizeof(cur->str.str)/sizeof(cur->str.str[0]); i++) {
502 ret->str.str[i] = &ret->data[size];
503 size += strlen(&ret->data[size])+1;
504 }
505
506 return ret;
507}
struct __lc_time_data MSVCRT___lc_time_data
int ret

◆ _Getwctype()

_CRTIMP short __cdecl _Getwctype ( wchar_t  ,
const _Ctypevec  
)

◆ _Getwctypes()

_CRTIMP const wchar_t *__cdecl _Getwctypes ( const wchar_t ,
const wchar_t ,
short ,
const _Ctypevec  
)

◆ _Mbrtowc()

_CRTIMP int __cdecl _Mbrtowc ( wchar_t ,
const char ,
size_t  ,
mbstate_t ,
const _Cvtvec  
)

◆ _Stod()

_CRTIMP double __cdecl _Stod ( const char ,
char **  ,
long   
)

◆ _Stof()

_CRTIMP float __cdecl _Stof ( const char ,
char **  ,
long   
)

◆ _Stold()

_CRTIMP long double __cdecl _Stold ( const char ,
char **  ,
long   
)

◆ _Strcoll()

_CRTIMP int __cdecl _Strcoll ( const char ,
const char ,
const char ,
const char ,
const _Collvec  
)

◆ _Strftime()

_CRTIMP size_t __cdecl _Strftime ( char str,
size_t  _Maxsize,
const char format,
const struct tm mstm,
void _Lc_time_arg 
)

Definition at line 114 of file strftime.c.

116{
117 MSVCRT___lc_time_data *time_data = (MSVCRT___lc_time_data*)_Lc_time_arg;
118 size_t ret, tmp;
119 BOOL alternate;
120
121 TRACE("(%p %ld %s %p %p)\n", str, max, format, mstm, time_data);
122
123 if(!str || !format) {
124 if(str && max)
125 *str = 0;
126 *_errno() = EINVAL;
127 return 0;
128 }
129
130 if(!time_data)
131 time_data = get_locinfo()->lc_time_curr;
132
133 for(ret=0; *format && ret<max; format++) {
134 if(*format != '%') {
135 str[ret++] = *format;
136 continue;
137 }
138
139 format++;
140 if(*format == '#') {
141 alternate = TRUE;
142 format++;
143 }else {
144 alternate = FALSE;
145 }
146
147 if(!mstm)
148 goto einval_error;
149
150 switch(*format) {
151 case 'c':
152 if(!strftime_date(str, &ret, max, alternate, mstm, time_data))
153 return 0;
154 if(ret < max)
155 str[ret++] = ' ';
156 if(!strftime_time(str, &ret, max, mstm, time_data))
157 return 0;
158 break;
159 case 'x':
160 if(!strftime_date(str, &ret, max, alternate, mstm, time_data))
161 return 0;
162 break;
163 case 'X':
164 if(!strftime_time(str, &ret, max, mstm, time_data))
165 return 0;
166 break;
167 case 'a':
168 if(mstm->tm_wday<0 || mstm->tm_wday>6)
169 goto einval_error;
170 if(!strftime_str(str, &ret, max, time_data->str.names.short_wday[mstm->tm_wday]))
171 return 0;
172 break;
173 case 'A':
174 if(mstm->tm_wday<0 || mstm->tm_wday>6)
175 goto einval_error;
176 if(!strftime_str(str, &ret, max, time_data->str.names.wday[mstm->tm_wday]))
177 return 0;
178 break;
179 case 'b':
180 if(mstm->tm_mon<0 || mstm->tm_mon>11)
181 goto einval_error;
182 if(!strftime_str(str, &ret, max, time_data->str.names.short_mon[mstm->tm_mon]))
183 return 0;
184 break;
185 case 'B':
186 if(mstm->tm_mon<0 || mstm->tm_mon>11)
187 goto einval_error;
188 if(!strftime_str(str, &ret, max, time_data->str.names.mon[mstm->tm_mon]))
189 return 0;
190 break;
191 case 'd':
192 if(!strftime_int(str, &ret, max, mstm->tm_mday, alternate ? 0 : 2, 0, 31))
193 return 0;
194 break;
195 case 'H':
196 if(!strftime_int(str, &ret, max, mstm->tm_hour, alternate ? 0 : 2, 0, 23))
197 return 0;
198 break;
199 case 'I':
200 tmp = mstm->tm_hour;
201 if(tmp > 12)
202 tmp -= 12;
203 else if(!tmp)
204 tmp = 12;
205 if(!strftime_int(str, &ret, max, tmp, alternate ? 0 : 2, 1, 12))
206 return 0;
207 break;
208 case 'j':
209 if(!strftime_int(str, &ret, max, mstm->tm_yday+1, alternate ? 0 : 3, 1, 366))
210 return 0;
211 break;
212 case 'm':
213 if(!strftime_int(str, &ret, max, mstm->tm_mon+1, alternate ? 0 : 2, 1, 12))
214 return 0;
215 break;
216 case 'M':
217 if(!strftime_int(str, &ret, max, mstm->tm_min, alternate ? 0 : 2, 0, 59))
218 return 0;
219 break;
220 case 'p':
221 if(mstm->tm_hour<0 || mstm->tm_hour>23)
222 goto einval_error;
223 if(!strftime_str(str, &ret, max, mstm->tm_hour<12 ?
224 time_data->str.names.am : time_data->str.names.pm))
225 return 0;
226 break;
227 case 'S':
228 if(!strftime_int(str, &ret, max, mstm->tm_sec, alternate ? 0 : 2, 0, 59))
229 return 0;
230 break;
231 case 'w':
232 if(!strftime_int(str, &ret, max, mstm->tm_wday, 0, 0, 6))
233 return 0;
234 break;
235 case 'y':
236 if(!strftime_int(str, &ret, max, mstm->tm_year%100, alternate ? 0 : 2, 0, 99))
237 return 0;
238 break;
239 case 'Y':
240 tmp = 1900+mstm->tm_year;
241 if(!strftime_int(str, &ret, max, tmp, alternate ? 0 : 4, 0, 9999))
242 return 0;
243 break;
244 case 'z':
245 case 'Z':
246 _tzset();
247 if(_get_tzname(&tmp, str+ret, max-ret, mstm->tm_isdst ? 1 : 0))
248 return 0;
249 ret += tmp;
250 break;
251 case 'U':
252 case 'W':
253 if(mstm->tm_wday<0 || mstm->tm_wday>6 || mstm->tm_yday<0 || mstm->tm_yday>365)
254 goto einval_error;
255 if(*format == 'U')
256 tmp = mstm->tm_wday;
257 else if(!mstm->tm_wday)
258 tmp = 6;
259 else
260 tmp = mstm->tm_wday-1;
261
262 tmp = mstm->tm_yday/7 + (tmp <= ((unsigned)mstm->tm_yday%7));
263 if(!strftime_int(str, &ret, max, tmp, alternate ? 0 : 2, 0, 53))
264 return 0;
265 break;
266 case '%':
267 str[ret++] = '%';
268 break;
269 default:
270 WARN("unknown format %c\n", *format);
271 goto einval_error;
272 }
273 }
274
275 if(ret == max) {
276 if(max)
277 *str = 0;
278 *_errno() = ERANGE;
279 return 0;
280 }
281
282 str[ret] = 0;
283 return ret;
284
285einval_error:
286 *str = 0;
287 *_errno() = EINVAL;
288 return 0;
289}
#define EINVAL
Definition: acclib.h:90
#define ERANGE
Definition: acclib.h:92
#define WARN(fmt,...)
Definition: precomp.h:61
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static unsigned(__cdecl *hash_bstr)(bstr_t s)
const WCHAR * str
_CRTIMP int *__cdecl _errno(void)
Definition: errno.c:17
_CRTIMP errno_t __cdecl _get_tzname(_Out_ size_t *_ReturnValue, _Out_writes_z_(_SizeInBytes) char *_Buffer, _In_ size_t _SizeInBytes, _In_ int _Index)
_CRTIMP void __cdecl _tzset(void)
Definition: timezone.c:92
static BOOL strftime_int(char *str, size_t *pos, size_t max, int src, int prec, int l, int h)
Definition: strftime.c:89
static BOOL strftime_time(char *str, size_t *pos, size_t max, const struct tm *mstm, MSVCRT___lc_time_data *time_data)
Definition: strftime.c:43
static BOOL strftime_str(char *str, size_t *pos, size_t max, char *src)
Definition: strftime.c:75
static BOOL strftime_date(char *str, size_t *pos, size_t max, BOOL alternate, const struct tm *mstm, MSVCRT___lc_time_data *time_data)
Definition: strftime.c:10
char * str[43]
Definition: locale.h:55
Definition: format.c:58
int tm_mon
Definition: time.h:73
int tm_year
Definition: time.h:74
int tm_hour
Definition: time.h:71
int tm_sec
Definition: time.h:69
int tm_isdst
Definition: time.h:77
int tm_yday
Definition: time.h:76
int tm_mday
Definition: time.h:72
int tm_min
Definition: time.h:70
int tm_wday
Definition: time.h:75
#define max(a, b)
Definition: svc.c:63
#define get_locinfo()
Definition: winesup.h:25

Referenced by strftime().

◆ _Strxfrm()

_CRTIMP size_t __cdecl _Strxfrm ( char _String1,
char _End1,
const char ,
const char ,
const _Collvec  
)

◆ _Tolower()

_CRTIMP int __cdecl _Tolower ( int  ,
const _Ctypevec  
)

◆ _Toupper()

_CRTIMP int __cdecl _Toupper ( int  ,
const _Ctypevec  
)

◆ _Towlower()

_CRTIMP wchar_t __cdecl _Towlower ( wchar_t  ,
const _Ctypevec  
)

◆ _Towupper()

_CRTIMP wchar_t __cdecl _Towupper ( wchar_t  ,
const _Ctypevec  
)

◆ _Wcrtomb()

_CRTIMP int __cdecl _Wcrtomb ( char ,
wchar_t  ,
mbstate_t ,
const _Cvtvec  
)

◆ _Wcscoll()

_CRTIMP int __cdecl _Wcscoll ( const wchar_t ,
const wchar_t ,
const wchar_t ,
const wchar_t ,
const _Collvec  
)

◆ _Wcsxfrm()

_CRTIMP size_t __cdecl _Wcsxfrm ( wchar_t _String1,
wchar_t _End1,
const wchar_t ,
const wchar_t ,
const _Collvec  
)