ReactOS 0.4.15-dev-8127-g6338913
locale.c File Reference
#include "precomp.h"
Include dependency graph for locale.c:

Go to the source code of this file.

Functions

VOID InitLocale (VOID)
 
LPTSTR GetDateString (VOID)
 
LPTSTR GetTimeString (VOID)
 

Variables

TCHAR cDateSeparator
 
TCHAR cTimeSeparator
 
TCHAR cThousandSeparator
 
TCHAR cDecimalSeparator
 
INT nDateFormat
 
INT nTimeFormat
 
INT nNumberGroups
 

Function Documentation

◆ GetDateString()

LPTSTR GetDateString ( VOID  )

Definition at line 58 of file locale.c.

59{
60 static TCHAR szDate[32];
62 INT len;
64
65 len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &t, _T("ddd"), szDate, ARRAYSIZE(szDate));
66 szDate[len - 1] = _T(' ');
67 FormatDate(&szDate[len], &t, TRUE);
68 return szDate;
69}
INT FormatDate(TCHAR *, LPSYSTEMTIME, BOOL)
Definition: dir.c:675
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
GLdouble GLdouble t
Definition: gl.h:2047
GLenum GLsizei len
Definition: glext.h:6722
#define LOCALE_USER_DEFAULT
int32_t INT
Definition: typedefs.h:58
#define _T(x)
Definition: vfdio.h:22
#define GetDateFormat
Definition: winnls.h:1184
char TCHAR
Definition: xmlstorage.h:189

Referenced by cmd_date(), GetEnvVarOrSpecial(), and PrintPrompt().

◆ GetTimeString()

LPTSTR GetTimeString ( VOID  )

Definition at line 73 of file locale.c.

74{
75 static TCHAR szTime[12];
78 _stprintf(szTime, _T("%2d%c%02d%c%02d%c%02d"),
79 t.wHour, cTimeSeparator, t.wMinute, cTimeSeparator,
80 t.wSecond, cDecimalSeparator, t.wMilliseconds / 10);
81 return szTime;
82}
TCHAR cTimeSeparator
Definition: locale.c:17
TCHAR cDecimalSeparator
Definition: locale.c:19
#define _stprintf
Definition: utility.h:124
TCHAR szTime[64]
Definition: solitaire.cpp:20

Referenced by cmd_time(), CommandTimer(), GetEnvVarOrSpecial(), and PrintPrompt().

◆ InitLocale()

VOID InitLocale ( VOID  )

Definition at line 25 of file locale.c.

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}
TCHAR cDateSeparator
Definition: locale.c:16
INT nTimeFormat
Definition: locale.c:21
INT nDateFormat
Definition: locale.c:20
INT nNumberGroups
Definition: locale.c:22
TCHAR cThousandSeparator
Definition: locale.c:18
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 LOCALE_SDATE
Definition: winnls.h:58
#define LOCALE_SGROUPING
Definition: winnls.h:44
#define LOCALE_SDECIMAL
Definition: winnls.h:42
#define LOCALE_IDATE
Definition: winnls.h:63
#define GetLocaleInfo
Definition: winnls.h:1186
#define LOCALE_ITIME
Definition: winnls.h:65
#define LOCALE_STHOUSAND
Definition: winnls.h:43
#define LOCALE_SABBREVDAYNAME1
Definition: winnls.h:84
#define LOCALE_STIME
Definition: winnls.h:59
#define _ttoi
Definition: xmlstorage.h:195
CHAR * LPTSTR
Definition: xmlstorage.h:192

Referenced by cmd_start(), Execute(), and Initialize().

Variable Documentation

◆ cDateSeparator

TCHAR cDateSeparator

Definition at line 16 of file locale.c.

Referenced by FormatDate(), InitLocale(), PromptDateString(), and ReadSeparator().

◆ cDecimalSeparator

TCHAR cDecimalSeparator

Definition at line 19 of file locale.c.

Referenced by CommandTimer(), GetTimeString(), InitLocale(), ParseTime(), and PrintElapsedTime().

◆ cThousandSeparator

TCHAR cThousandSeparator

Definition at line 18 of file locale.c.

Referenced by ConvertULargeInteger(), and InitLocale().

◆ cTimeSeparator

TCHAR cTimeSeparator

◆ nDateFormat

INT nDateFormat

Definition at line 20 of file locale.c.

Referenced by FormatDate(), InitLocale(), ParseDate(), and PromptDateString().

◆ nNumberGroups

INT nNumberGroups

Definition at line 22 of file locale.c.

Referenced by ConvertULargeInteger(), and InitLocale().

◆ nTimeFormat

INT nTimeFormat

Definition at line 21 of file locale.c.

Referenced by FormatTime(), InitLocale(), and ParseTime().