54{
55
56 unsigned short *newctype1 = nullptr;
57 unsigned char *newclmap = nullptr;
58 unsigned char *newcumap = nullptr;
59
60
61
62 unsigned char *cbuffer = nullptr;
63
67 int mb_cur_max;
69
72
73
74
75
77 {
78 long* refcount = nullptr;
79
81 {
86 goto error_cleanup;
87 }
88
89
90 refcount = _calloc_crt_t(long, 1).detach();
91
92
96 cbuffer = _calloc_crt_t(
unsigned char,
_CTABSIZE).detach();
97
98 if (!refcount || !newctype1 || !cbuffer || !newclmap || !newcumap)
99 goto error_cleanup;
100
101
103 *
cp++ = (
unsigned char)
i;
104
106 goto error_cleanup;
107
109 goto error_cleanup;
110
112
113
114
116 {
118 {
119
120
121 for (
i = 0x80;
i <= 0xff;
i++)
122 {
123
125 }
126 }
127 else
128 {
129
131 {
132 for (
i =
cp[0];
i <=
cp[1];
i++)
134 }
135 }
136 }
137
138
139
140
141
145 reinterpret_cast<char*>(cbuffer + 1),
147 reinterpret_cast<char*
>(newclmap + 2 +
_COFFSET),
151 goto error_cleanup;
152
156 reinterpret_cast<char*>(cbuffer + 1),
158 reinterpret_cast<char*
>(newcumap + 2 +
_COFFSET),
162 goto error_cleanup;
163
164
166 reinterpret_cast<char*>(cbuffer),
171 goto error_cleanup;
172
178
179
180
181
182
183 if (mb_cur_max > 1)
184 {
186 {
187
188
189
190
191 for (
i = 0x80;
i <= 0xff;
i++)
192 {
194 newclmap[
_COFFSET +
i + 1] =
static_cast<unsigned char>(
i);
195 newcumap[
_COFFSET +
i + 1] =
static_cast<unsigned char>(
i);
196 }
197 }
198 else
199 {
201 {
202 for (
i =
cp[0];
i <=
cp[1];
i++)
203 {
205 newclmap[
_COFFSET +
i + 1] =
static_cast<unsigned char>(
i);
206 newcumap[
_COFFSET +
i + 1] =
static_cast<unsigned char>(
i);
207 }
208 }
209 }
210 }
211
212
213
217
218
221 {
227 }
228 (*refcount) = 1;
230
235 ploci->
_public._locale_mb_cur_max = mb_cur_max;
236
237
239 return 0;
240
241error_cleanup:
247 return 1;
248
249 } else {
250
253 {
255 }
261 ploci->
_public._locale_mb_cur_max = 1;
262
263 return 0;
264 }
265}
BOOL __cdecl __acrt_GetStringTypeA(_locale_t const locale, DWORD const info_type, LPCSTR const string, int const string_size_in_bytes, unsigned short *const char_type, int const code_page, BOOL const error)
int __cdecl __acrt_LCMapStringA(_locale_t const plocinfo, PCWSTR const LocaleName, DWORD const dwMapFlags, PCCH const lpSrcStr, int const cchSrc, PCH const lpDestStr, int const cchDest, int const code_page, BOOL const bError)
#define InterlockedDecrement
int __cdecl __acrt_GetLocaleInfoA(_In_opt_ _locale_t _Locale, _In_ int _LCType, _In_ LPCWSTR _LocaleName, _In_ LCTYPE _FieldType, _Out_ void *_Address)
unsigned short const __newctype[]
BOOL WINAPI GetCPInfo(UINT codepage, LPCPINFO cpinfo)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
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
const unsigned char __newcumap[]
const unsigned char __newclmap[]
#define memcpy(s1, s2, n)
unsigned short const * _locale_pctype
unsigned char const * pcumap
unsigned char const * pclmap
BYTE LeadByte[MAX_LEADBYTES]
#define LOCALE_IDEFAULTANSICODEPAGE