|
|
|
1 |
|
/*** |
2 |
|
*locale.h - definitions/declarations for localization routines |
3 |
|
* |
4 |
|
* Copyright (c) Microsoft Corporation. All rights reserved. |
5 |
|
* |
6 |
|
*Purpose: |
7 |
|
* This file defines the structures, values, macros, and functions |
8 |
|
* used by the localization routines. |
9 |
|
* |
10 |
|
* [Public] |
11 |
|
* |
12 |
|
****/ |
13 |
|
|
14 |
|
#if _MSC_VER > 1000 |
15 |
|
#pragma once |
16 |
|
#endif |
17 |
|
|
18 |
|
#ifndef _INC_LOCALE |
19 |
|
#define _INC_LOCALE |
20 |
|
|
21 |
|
#include <crtdefs.h> |
22 |
|
|
23 |
|
#ifdef _MSC_VER |
24 |
|
/* |
25 |
|
* Currently, all MS C compilers for Win32 platforms default to 8 byte |
26 |
|
* alignment. |
27 |
|
*/ |
28 |
|
#pragma pack(push,_CRT_PACKING) |
29 |
|
#endif /* _MSC_VER */ |
30 |
|
|
31 |
|
#ifdef __cplusplus |
32 |
|
extern "C" { |
33 |
|
#endif |
34 |
|
|
35 |
|
/* define NULL pointer value */ |
36 |
|
#ifndef NULL |
37 |
|
#ifdef __cplusplus |
38 |
|
#define NULL 0 |
39 |
|
#else |
40 |
|
#define NULL ((void *)0) |
41 |
|
#endif |
42 |
|
#endif |
43 |
|
|
44 |
|
/* Locale categories */ |
45 |
|
|
46 |
|
#define LC_ALL 0 |
47 |
|
#define LC_COLLATE 1 |
48 |
|
#define LC_CTYPE 2 |
49 |
|
#define LC_MONETARY 3 |
50 |
|
#define LC_NUMERIC 4 |
51 |
|
#define LC_TIME 5 |
52 |
|
|
53 |
|
#define LC_MIN LC_ALL |
54 |
|
#define LC_MAX LC_TIME |
55 |
|
|
56 |
|
/* Locale convention structure */ |
57 |
|
|
58 |
|
#ifndef _LCONV_DEFINED |
59 |
|
struct lconv { |
60 |
|
char *decimal_point; |
61 |
|
char *thousands_sep; |
62 |
|
char *grouping; |
63 |
|
char *int_curr_symbol; |
74 |
|
char n_cs_precedes; |
75 |
|
char n_sep_by_space; |
76 |
|
char p_sign_posn; |
77 |
|
char n_sign_posn; |
78 |
|
}; |
79 |
|
#define _LCONV_DEFINED |
80 |
|
#endif |
81 |
|
|
82 |
|
/* ANSI: char lconv members default is CHAR_MAX which is compile time |
83 |
|
dependent. Defining and using _charmax here causes CRT startup code |
84 |
|
to initialize lconv members properly */ |
85 |
|
|
86 |
|
#ifdef _CHAR_UNSIGNED |
87 |
|
extern int _charmax; |
88 |
|
extern __inline int __dummy(void) { return _charmax; } |
89 |
|
#endif |
90 |
|
|
91 |
|
/* function prototypes */ |
92 |
|
|
93 |
|
#ifndef _CONFIG_LOCALE_SWT |
94 |
|
#define _ENABLE_PER_THREAD_LOCALE 0x1 |
95 |
|
#define _DISABLE_PER_THREAD_LOCALE 0x2 |
96 |
|
#define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x10 |
97 |
|
#define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x20 |
98 |
|
#define _ENABLE_PER_THREAD_LOCALE_NEW 0x100 |
99 |
|
#define _DISABLE_PER_THREAD_LOCALE_NEW 0x200 |
100 |
|
#define _CONFIG_LOCALE_SWT |
101 |
|
#endif |
102 |
|
|
103 |
|
_Check_return_opt_ _CRTIMP int __cdecl _configthreadlocale(_In_ int _Flag); |
104 |
|
_Check_return_opt_ _CRTIMP char * __cdecl setlocale(_In_ int _Category, _In_opt_z_ const char * _Locale); |
105 |
|
_Check_return_opt_ _CRTIMP struct lconv * __cdecl localeconv(void); |
106 |
|
_Check_return_opt_ _CRTIMP _locale_t __cdecl _get_current_locale(void); |
107 |
|
_Check_return_opt_ _CRTIMP _locale_t __cdecl _create_locale(_In_ int _Category, _In_z_ const char * _Locale); |
108 |
|
_CRTIMP void __cdecl _free_locale(_In_opt_ _locale_t _Locale); |
109 |
|
|
110 |
|
/* use _get_current_locale, _create_locale and _free_locale, instead of these functions with double leading underscore */ |
111 |
|
_Check_return_ _CRT_OBSOLETE(_get_current_locale) _CRTIMP _locale_t __cdecl __get_current_locale(void); |
112 |
|
_Check_return_ _CRT_OBSOLETE(_create_locale) _CRTIMP _locale_t __cdecl __create_locale(_In_ int _Category, _In_z_ const char * _Locale); |
113 |
|
_CRT_OBSOLETE(_free_locale) _CRTIMP void __cdecl __free_locale(_In_opt_ _locale_t _Locale); |
114 |
|
|
115 |
|
#ifndef _WLOCALE_DEFINED |
116 |
|
|
117 |
|
/* wide function prototypes, also declared in wchar.h */ |
118 |
|
|
119 |
|
_Check_return_opt_ _CRTIMP wchar_t * __cdecl _wsetlocale(_In_ int _Category, _In_opt_z_ const wchar_t * _Locale); |
120 |
|
|
121 |
|
#define _WLOCALE_DEFINED |
122 |
|
#endif |
123 |
|
|
124 |
|
#ifdef __cplusplus |
125 |
|
} |
126 |
|
#endif |
127 |
|
|
128 |
|
#ifdef _MSC_VER |
129 |
|
#pragma pack(pop) |
130 |
|
#endif /* _MSC_VER */ |
131 |
|
|
132 |
|
#endif /* _INC_LOCALE */ |
133 |
|
|
|
|
|