ReactOS 0.4.16-dev-321-g63bb46a
locale.c
Go to the documentation of this file.
1/*
2 * LOCALE.C - locale handling.
3 *
4 *
5 * History:
6 *
7 * 09-Jan-1999 (Eric Kohl)
8 * Started.
9 *
10 * 20-Jan-1999 (Eric Kohl)
11 * Unicode safe!
12 */
13
14#include "precomp.h"
15
23
24
26{
27 TCHAR szBuffer[256];
28
29 /* date settings */
31 cDateSeparator = szBuffer[0];
32 GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDATE | LOCALE_RETURN_NUMBER, (LPTSTR)&nDateFormat, sizeof(nDateFormat) / sizeof(TCHAR));
33
34 /* time settings */
36 cTimeSeparator = szBuffer[0];
37 GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ITIME | LOCALE_RETURN_NUMBER, (LPTSTR)&nTimeFormat, sizeof(nTimeFormat) / sizeof(TCHAR));
38
39 /* number settings */
41 cThousandSeparator = szBuffer[0];
43 cDecimalSeparator = szBuffer[0];
45 nNumberGroups = _ttoi(szBuffer);
46#if 0
47 /* days of week */
48 for (i = 0; i < 7; i++)
49 {
51 _tcscpy(aszDayNames[(i+1)%7], szBuffer); /* little hack */
52 }
53#endif
54}
55
56/* Return date string without weekday. Used for $D in prompt and %DATE% */
59{
60 static TCHAR szDate[32];
62
65 return szDate;
66}
67
68/* Return time in H:mm:ss.SS format. Used for $T in prompt and %TIME% */
71{
72 static TCHAR szTime[12];
75 _stprintf(szTime, _T("%2d%c%02d%c%02d%c%02d"),
76 t.wHour, cTimeSeparator, t.wMinute, cTimeSeparator,
77 t.wSecond, cDecimalSeparator, t.wMilliseconds / 10);
78 return szTime;
79}
TCHAR cDateSeparator
Definition: locale.c:16
INT nTimeFormat
Definition: locale.c:21
INT nDateFormat
Definition: locale.c:20
TCHAR cTimeSeparator
Definition: locale.c:17
VOID InitLocale(VOID)
Definition: locale.c:25
INT nNumberGroups
Definition: locale.c:22
LPTSTR GetTimeString(VOID)
Definition: locale.c:70
TCHAR cThousandSeparator
Definition: locale.c:18
TCHAR cDecimalSeparator
Definition: locale.c:19
LPTSTR GetDateString(VOID)
Definition: locale.c:58
#define NULL
Definition: types.h:112
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
GLdouble GLdouble t
Definition: gl.h:2047
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 _tcscpy
Definition: tchar.h:623
#define _stprintf
Definition: utility.h:124
#define LOCALE_USER_DEFAULT
TCHAR szTime[64]
Definition: solitaire.cpp:20
int32_t INT
Definition: typedefs.h:58
#define _T(x)
Definition: vfdio.h:22
#define LOCALE_SDATE
Definition: winnls.h:60
#define LOCALE_SGROUPING
Definition: winnls.h:46
#define LOCALE_SDECIMAL
Definition: winnls.h:44
#define LOCALE_IDATE
Definition: winnls.h:65
#define GetLocaleInfo
Definition: winnls.h:1242
#define LOCALE_ITIME
Definition: winnls.h:67
#define LOCALE_STHOUSAND
Definition: winnls.h:45
#define LOCALE_SABBREVDAYNAME1
Definition: winnls.h:86
#define LOCALE_STIME
Definition: winnls.h:61
#define GetDateFormat
Definition: winnls.h:1240
#define DATE_SHORTDATE
Definition: winnls.h:198
char TCHAR
Definition: xmlstorage.h:189
#define _ttoi
Definition: xmlstorage.h:195
CHAR * LPTSTR
Definition: xmlstorage.h:192