102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
locale.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
9#include <intrin.h>
10#include <math.h>
11#include <stdarg.h>
12#include <string.h>
13/* alloca must execute in the caller's frame. Arm the parent scope for the
14 allocation alone, including any page probes emitted by the compiler. */
15#define CRT_GUARDED_ALLOCA(guard, level, size) \
16 ({ \
17 (guard)->tryLevel = (level); \
18 __asm__ volatile("" ::: "memory"); \
19 void *storage = __builtin_alloca(size); \
20 __asm__ volatile("" : : "r"(storage) : "memory"); \
21 (guard)->tryLevel = CRT_SEH_TRY_NONE; \
22 storage; \
23 })
24#define nullptr 0
25
26// Original pcdogs.exe: no direct counterpart (decomp helper)
27// Classifies an ANSI string through the available Windows character-type API, converting through a temporary wide buffer when required. The allocation path uses the reconstructed parent-frame SEH guard.
28int32_t CRT_GetStringTypeAWithSEHGuard(DWORD info_type, LPCSTR src, int32_t src_count, uint16_t *char_types, UINT code_page, LCID locale, int32_t strict, volatile struct CRT_SEHRegistration3 *guard)
29{
30 int32_t string_type_api_mode = g_crtStartupInfo;
31
32 if (!string_type_api_mode)
33 {
34 uint16_t char_type;
35
36 if (!GetStringTypeW(CT_CTYPE1, &CRT_LocaleProbeWide, 1, &char_type))
37 {
38 if (GetStringTypeA(0, CT_CTYPE1, &CRT_LocaleProbeAnsi, 1, &char_type))
39 {
40 string_type_api_mode = CRT_API_ANSI;
41 }
42 else
43 return 0;
44 }
45 else
46 string_type_api_mode = CRT_API_WIDE;
47
48 g_crtStartupInfo = string_type_api_mode;
49 }
50
51 BOOL result;
52
53 if (string_type_api_mode == CRT_API_ANSI)
54 {
55 LCID effective_locale = locale;
56
57 if (!effective_locale)
58 effective_locale = g_crtLocaleFlags;
59
60 result = GetStringTypeA(effective_locale, info_type, src, src_count, char_types);
61 }
62 else if (string_type_api_mode != CRT_API_WIDE)
63 result = 0;
64 else
65 {
66 if (!code_page)
67 code_page = g_crtWideCharFlags;
68
69 int32_t cch_wide_char =
70 MultiByteToWideChar(code_page, ((strict) ? (MB_PRECOMPOSED | MB_ERR_INVALID_CHARS) : MB_PRECOMPOSED), src, src_count, NULL, 0);
71
72 if (!cch_wide_char)
73 result = 0;
74 else
75 {
76 int32_t count = cch_wide_char * 2;
77 uint32_t size = count + 3;
78
80 WCHAR *wide_source = CRT_GUARDED_ALLOCA(guard, CRT_SEH_TRY_PROTECTED, size);
81 _memset(wide_source, 0, count);
82
83 if (!wide_source)
84 result = 0;
85 else
86 {
87 int32_t cch_src = MultiByteToWideChar(code_page, MB_PRECOMPOSED, src, src_count,
88 wide_source, cch_wide_char);
89
90 if (!cch_src)
91 result = 0;
92 else
93 result = GetStringTypeW(info_type, wide_source, cch_src, char_types);
94 }
95 }
96 }
97
98 return result;
99}
100
101// Original pcdogs.exe: no direct counterpart (decomp helper)
102// Maps an ANSI string through the available Windows locale API, using guarded temporary wide buffers when required. Sort-key output bypasses conversion back to ANSI, and bounded source-length handling retains its boundary read.
103int32_t CRT_MapStringAWithSEHGuard(LCID locale, DWORD map_flags, LPCSTR src, int32_t src_count, LPSTR dest, int32_t dest_count, UINT code_page, int32_t strict, volatile struct CRT_SEHRegistration3 *guard)
104{
106 {
107 if (!LCMapStringW(0, LCMAP_LOWERCASE, &CRT_LocaleProbeWide, 1, NULL, 0))
108 {
109 if (LCMapStringA(0, LCMAP_LOWERCASE, &CRT_LocaleProbeAnsi, 1, NULL, 0))
110 {
112 }
113 else
114 return 0;
115 }
116 else
118 }
119
120 if (src_count > 0)
121 src_count = CRT_strnlen(src, src_count);
122
123 int32_t mapping_api_mode = g_crtExceptionList;
124 int32_t result;
125
126 if (mapping_api_mode == CRT_API_ANSI)
127 result = LCMapStringA(locale, map_flags, src, src_count, dest, dest_count);
128 else if (mapping_api_mode != CRT_API_WIDE)
129 result = 0;
130 else
131 {
132 if (!code_page)
133 code_page = g_crtWideCharFlags;
134
135 int32_t wide_source_count =
136 MultiByteToWideChar(code_page, ((strict) ? (MB_PRECOMPOSED | MB_ERR_INVALID_CHARS) : MB_PRECOMPOSED), src, src_count, NULL, 0);
137
138 if (!wide_source_count)
139 result = 0;
140 else
141 {
142 uint32_t size = wide_source_count * 2 + 3;
143
145 WCHAR *wide_source = CRT_GUARDED_ALLOCA(guard, CRT_SEH_TRY_PROTECTED, size);
146
147 if (!wide_source)
148 result = 0;
149 else if (!MultiByteToWideChar(code_page, MB_PRECOMPOSED, src, src_count, wide_source, wide_source_count))
150 result = 0;
151 else
152 {
153 int32_t mapped_count = LCMapStringW(locale, map_flags, wide_source, wide_source_count, NULL, 0);
154
155 if (!mapped_count)
156 result = 0;
157 else if (!(map_flags & LCMAP_SORTKEY))
158 {
159 uint32_t mapped_allocation_bytes = mapped_count * 2 + 3;
160
161 mapped_allocation_bytes &= ~CRT_ALLOCATION_ALIGNMENT_MASK;
162 WCHAR *wide_mapped =
163 CRT_GUARDED_ALLOCA(guard, CRT_SEH_TRY_MAPPED_BUFFER, mapped_allocation_bytes);
164
165 if (!wide_mapped)
166 result = 0;
167 else if (!LCMapStringW(locale, map_flags, wide_source, wide_source_count, wide_mapped, mapped_count))
168 result = 0;
169 else
170 {
171 PSTR lp_multi_byte_str;
172
173 int32_t cb_multi_byte;
174
175 if (dest_count)
176 {
177 cb_multi_byte = dest_count;
178 lp_multi_byte_str = dest;
179 }
180 else
181 {
182 cb_multi_byte = 0;
183 lp_multi_byte_str = NULL;
184 }
185
186 mapped_count = WideCharToMultiByte(code_page, (WC_COMPOSITECHECK | WC_SEPCHARS), wide_mapped, mapped_count,
187 lp_multi_byte_str, cb_multi_byte, NULL, NULL);
188
189 result = mapped_count;
190 }
191 }
192 else if (!dest_count)
193 result = mapped_count;
194 else if (mapped_count > dest_count)
195 result = 0;
196 // LCMAP_SORTKEY writes bytes through the wide API destination parameter.
197 else if (LCMapStringW(locale, map_flags, wide_source, wide_source_count, (LPWSTR)dest, dest_count))
198 result = mapped_count;
199 else
200 result = 0;
201 }
202 }
203 }
204
205 return result;
206}
207
208// Original pcdogs.exe: 0x4473f4
209// Returns the requested character-class bits from the CRT table or the multibyte classification path.
210int32_t CRT_isctype(int32_t ch, int32_t char_type_mask)
211{
212 if ((uint32_t)(ch + 1) <= 0x100)
213 return (uint32_t)((uint16_t *)g_pCharTypeTable)[ch] & char_type_mask;
214
215 uint8_t lead_byte = (uint8_t)(ch >> 8);
216 uint8_t encoded_character[4] = {0};
217 int32_t encoded_length;
218
219 if (!(((struct CRT_CharacterClass *)g_pCharTypeTable)[lead_byte].multibyte_flags & (CRT_CTYPE_LEAD_BYTE >> 8)))
220 {
221 encoded_character[0] = (uint8_t)ch;
222 encoded_length = 1;
223 }
224 else
225 {
226 encoded_character[0] = lead_byte;
227 encoded_character[1] = (uint8_t)ch;
228 encoded_length = 2;
229 }
230
231 uint16_t character_type;
232
233 if (!__crtGetStringTypeA(CT_CTYPE1, (LPCSTR)encoded_character, encoded_length, &character_type, 0, 0, 1))
234 return 0;
235
236 return character_type & char_type_mask;
237}
238
239// Original pcdogs.exe: 0x44a442
240// Converts a character to lowercase using ASCII rules in the C locale and locale mapping otherwise.
241int32_t CRT_tolower(int32_t ch)
242{
243 uint8_t mapped_character[4];
244 uint8_t encoded_character[4];
245
246 if (!g_crtLocaleFlags)
247 {
248 int32_t ascii_character = ch;
249
250 if (ascii_character >= 'A' && ascii_character <= 'Z')
251 return ascii_character + 0x20;
252
253 return ascii_character;
254 }
255
256 int32_t original_character = ch;
257 int32_t is_uppercase;
258
259 if (original_character < 0x100)
260 {
261 if (g_crtLcCodepage <= 1)
262 {
263 is_uppercase = ((struct CRT_CharacterClass *)g_pCharTypeTable)[original_character].classification_flags & CRT_CTYPE_UPPER;
264 }
265 else
266 is_uppercase = CRT_isctype(original_character, CRT_CTYPE_UPPER);
267 }
268
269 if (original_character < 0x100 && !is_uppercase)
270 return original_character;
271
272 uint8_t lead_byte = (uint8_t)(original_character >> 8);
273 int32_t src_count;
274
275 if (!(((struct CRT_CharacterClass *)g_pCharTypeTable)[lead_byte].multibyte_flags & (CRT_CTYPE_LEAD_BYTE >> 8)))
276 {
277 encoded_character[1] = 0;
278 encoded_character[0] = (uint8_t)original_character;
279 src_count = 1;
280 }
281 else
282 {
283 encoded_character[2] = 0;
284 encoded_character[0] = lead_byte;
285 encoded_character[1] = (uint8_t)original_character;
286 src_count = 2;
287 }
288
289 int32_t mapped_byte_count = __crtLCMapStringA(g_crtLocaleFlags, LCMAP_LOWERCASE, (char const *)encoded_character, src_count, (char *)mapped_character, 3, 0, 1);
290
291 if (!mapped_byte_count)
292 return original_character;
293
294 if (mapped_byte_count != 1)
295 return (uint32_t)mapped_character[1] << 8 | mapped_character[0];
296
297 return mapped_character[0];
298}
299
300// Original pcdogs.exe: 0x44b798
301// Reports whether the low byte of a character is marked as a multibyte lead byte.
302int32_t CRT_ismbblead(uint32_t character)
303{
304 return __chvalidator((uint8_t)character, 0, 4);
305}
306
307// Original pcdogs.exe: 0x44b7a9
308// Tests a character against the requested class using multibyte table flags or the character-classification fallback.
309int32_t __chvalidator(uint8_t character, int32_t fallback_mask, uint8_t multibyte_mask)
310{
311 uint32_t character_index = (uint32_t)character;
312
313 if (g_crtMultibyteClassTable[1 + character_index] & multibyte_mask)
314 return 1;
315
316 int32_t result;
317
318 if (!fallback_mask)
319 result = 0;
320 else
321 result = (uint32_t)g_CRT_WideCharValidatorTable[character_index] & fallback_mask;
322
323 return result != 0;
324}
325
326// Original pcdogs.exe: 0x44b7da
327// Selects the multibyte code page, builds its lead-byte and case-mapping tables, and updates the associated locale state. Supported special code-page selectors are resolved before table construction.
328int32_t __setmbcp(int32_t requested_code_page)
329{
330 uint32_t code_page = CRT_ResolveRequestedCodePage(requested_code_page);
331
332 if (code_page == (uint32_t)g_crtMultibyteTablePtr)
333 return 0;
334
335 if (!code_page)
336 {
337 __resetmbcp();
339
340 return 0;
341 }
342
343 int32_t codepage_index = 0;
344 struct CRT_CodepageRecord *codepage_record = g_crtCodepageRecords;
345
346 while (codepage_record->code_page != code_page)
347 {
348 codepage_record = &codepage_record[1];
349 codepage_index += 1;
350
351 if (codepage_record >= &g_crtCodepageRecords[5])
352 {
353 CPINFO c_p_info;
354
355 if (GetCPInfo(code_page, &c_p_info) != 1)
356 {
357 if (!g_crtNewMode)
358 return 0xffffffff;
359
360 __resetmbcp();
362
363 return 0;
364 }
365
366 bool single_byte_codepage = c_p_info.MaxCharSize <= 1;
367
369 __builtin_memset(&g_crtMultibyteClassTable, 0, 0x100);
370 g_crtMultibyteClassTable[0x100] = 0;
372
373 if (single_byte_codepage)
375 else
376 {
377 if (c_p_info.LeadByte[0])
378 {
379 uint8_t *lead_range_end_pointer = &c_p_info.LeadByte[1];
380
381 do
382 {
383 uint8_t lead_range_end = *(uint8_t *)lead_range_end_pointer;
384
385 if (!lead_range_end)
386 break;
387
388 for (uint32_t lead_character = (uint32_t)lead_range_end_pointer[-1]; lead_character <= (uint32_t)lead_range_end; lead_character += 1)
389 g_crtMultibyteClassTable[1 + lead_character] |= CRT_MBC_LEAD;
390
391 lead_range_end_pointer = &lead_range_end_pointer[2];
392 } while (lead_range_end_pointer[-1]);
393 }
394
395 for (int32_t trail_character = 1; trail_character < 0xff; trail_character += 1)
396 g_crtMultibyteClassTable[1 + trail_character] |= CRT_MBC_TRAIL;
397
400 }
401
403
404 int32_t *case_metadata_words = (int32_t *)(&g_crtMultibyteCP_ACP);
405
406 *(uint32_t *)case_metadata_words = 0;
407 case_metadata_words[1] = 0;
409
410 return 0;
411 }
412 }
413
414 uint32_t class_index = 0;
415 struct CRT_CodepageRecord *selected_codepage = &g_crtCodepageRecords[codepage_index];
416
417 __builtin_memset(&g_crtMultibyteClassTable, 0, 0x100);
418 g_crtMultibyteClassTable[0x100] = 0;
419
420 char *class_ranges = (char *)selected_codepage->class_ranges[0];
421
422 do
423 {
424 char *range_cursor = class_ranges;
425
426 if (*(uint8_t *)class_ranges)
427 {
428 do
429 {
430 uint8_t range_end_byte = range_cursor[1];
431
432 if (!range_end_byte)
433 break;
434
435 uint32_t class_character = (uint32_t)*(uint8_t *)range_cursor;
436 uint32_t range_end = (uint32_t)range_end_byte;
437
438 if (class_character <= range_end)
439 {
440 char class_mask = g_crtMultibyteClassMasks[class_index];
441
442 do
443 {
444 g_crtMultibyteClassTable[1 + class_character] |= class_mask;
445 class_character += 1;
446 } while (class_character <= range_end);
447 }
448
449 range_cursor = &range_cursor[2];
450 } while (*(uint8_t *)range_cursor);
451 }
452
453 class_index += 1;
455 } while (class_index < 4);
456
459
460 uint32_t locale_id = CRT_MapCodePageToLocaleId(code_page);
461
462 g_crtMultibyteCodepage = selected_codepage->case_mapping_words[0];
463
464 int32_t *case_metadata_destination = (int32_t *)(&g_crtMultibyteCP_ACP);
465 int32_t *case_metadata_source = (int32_t *)&selected_codepage->case_mapping_words[1];
466
467 *(uint32_t *)case_metadata_destination = *(uint32_t *)case_metadata_source;
468 g_crtMultibyteCodepageInfo = locale_id;
469 case_metadata_destination[1] = case_metadata_source[1];
471
472 return 0;
473}
474
475// Original pcdogs.exe: 0x44b973
476// Resolves the CRT's OEM, ANSI, and current-code-page selectors and records when the result came from a system default. Other code-page values pass through unchanged.
477uint32_t CRT_ResolveRequestedCodePage(int32_t requested_code_page)
478{
479 int32_t resolved_code_page = requested_code_page;
480
481 g_crtNewMode = 0;
482
483 if (resolved_code_page == CRT_CODEPAGE_OEM)
484 {
485 g_crtNewMode = 1;
486
487 /* tailcall */
488 return GetOEMCP();
489 }
490
491 if (resolved_code_page == CRT_CODEPAGE_ANSI)
492 {
493 g_crtNewMode = 1;
494
495 /* tailcall */
496 return GetACP();
497 }
498
499 if (resolved_code_page == CRT_CODEPAGE_LOCALE)
500 {
501 resolved_code_page = g_crtWideCharFlags;
502 g_crtNewMode = 1;
503 }
504
505 return resolved_code_page;
506}
507
508// Original pcdogs.exe: 0x44b9bd
509// Maps the supported Japanese, simplified Chinese, Korean, and traditional Chinese code pages to their locale identifiers, returning zero for other code pages.
526
527// Original pcdogs.exe: 0x44b9f0
528// Resets the 257-byte multibyte classification table and its code-page, locale, and case-mapping metadata.
530{
531 __builtin_memset(&g_crtMultibyteClassTable, 0, 0x100);
532 g_crtMultibyteClassTable[0x100] = 0;
537
538 int32_t *case_metadata_words = (int32_t *)(&g_crtMultibyteCP_ACP);
539
540 *(uint32_t *)case_metadata_words = 0;
541 case_metadata_words[1] = 0;
542}
543
544// Original pcdogs.exe: 0x44ba19
545// Rebuilds the byte classification and case-folding tables from the active locale APIs, using ASCII fallback mappings when necessary.
547{
548 CPINFO info;
549
550 unsigned char *fold = g_crtMultibyteCaseFold;
551
552 if (GetCPInfo(g_crtMultibyteTablePtr, &info) != 1)
553 {
554 for (unsigned i = 0; i < 256; ++i)
555 {
556 if (i >= 'A' && i <= 'Z')
557 {
559 fold[i] = i + 32;
560 }
561 else if (i >= 'a' && i <= 'z')
562 {
564 fold[i] = i - 32;
565 }
566 else
567 fold[i] = 0;
568 }
569
570 return;
571 }
572
573 char chars[256], lower[256], upper[256];
574 uint16_t types[256];
575
576 for (unsigned i = 0; i < 256; ++i)
577 chars[i] = (char)i;
578
579 chars[0] = ' ';
580
581 for (unsigned k = 0; info.LeadByte[k]; k += 2)
582 for (unsigned i = info.LeadByte[k]; i <= info.LeadByte[k + 1]; ++i)
583 chars[i] = ' ';
584
586 __crtLCMapStringA(g_crtMultibyteCodepageInfo, LCMAP_LOWERCASE, chars, 256, lower, 256, g_crtMultibyteTablePtr, 0);
587 __crtLCMapStringA(g_crtMultibyteCodepageInfo, LCMAP_UPPERCASE, chars, 256, upper, 256, g_crtMultibyteTablePtr, 0);
588
589 for (unsigned i = 0; i < 256; ++i)
590 {
591 if (types[i] & CRT_CTYPE_UPPER)
592 {
594 fold[i] = lower[i];
595 }
596 else if (types[i] & CRT_CTYPE_LOWER)
597 {
599 fold[i] = upper[i];
600 }
601 else
602 fold[i] = 0;
603 }
604}
605
606// Original pcdogs.exe: 0x44bb9e
607// Initializes the multibyte tables once using the current ANSI code page and records that initialization was attempted.
609{
610 if (!g_crtInitialized)
611 {
614 }
615}
616
617// Original pcdogs.exe: 0x44b167
618// Converts one wide character to the current multibyte encoding, using direct byte conversion in the C locale. A NULL destination returns zero, and an unrepresentable character reports an encoding error.
619int32_t String_ConvertCRTWideCharToMultiByte(char *buffer, uint16_t wide_char)
620{
621 if (!buffer)
622 return 0;
623
625 {
626 BOOL used_default_character = FALSE;
627 int32_t converted_bytes = WideCharToMultiByte(g_crtWideCharFlags, (WC_COMPOSITECHECK | WC_SEPCHARS), &wide_char, 1,
628 buffer, g_crtLcCodepage, nullptr, &used_default_character);
629
630 if (converted_bytes && !used_default_character)
631 return converted_bytes;
632 }
633 else
634 {
635 uint16_t character_copy = wide_char;
636
637 if (character_copy <= 0xff)
638 {
639 *(uint8_t *)buffer = (uint8_t)character_copy;
640
641 return 1;
642 }
643 }
644
646
647 return 0xffffffff;
648}
uint32_t CRT_MapCodePageToLocaleId(uint32_t code_page)
Definition locale.c:510
uint32_t CRT_ResolveRequestedCodePage(int32_t requested_code_page)
Definition locale.c:477
int32_t __setmbcp(int32_t requested_code_page)
Definition locale.c:328
int32_t CRT_tolower(int32_t ch)
Definition locale.c:241
void __initmbctable()
Definition locale.c:608
int32_t String_ConvertCRTWideCharToMultiByte(char *buffer, uint16_t wide_char)
Definition locale.c:619
#define CRT_GUARDED_ALLOCA(guard, level, size)
Definition locale.c:15
int32_t CRT_GetStringTypeAWithSEHGuard(DWORD info_type, LPCSTR src, int32_t src_count, uint16_t *char_types, UINT code_page, LCID locale, int32_t strict, volatile struct CRT_SEHRegistration3 *guard)
Definition locale.c:28
void __setmbcp_updatetables()
Definition locale.c:546
int32_t CRT_MapStringAWithSEHGuard(LCID locale, DWORD map_flags, LPCSTR src, int32_t src_count, LPSTR dest, int32_t dest_count, UINT code_page, int32_t strict, volatile struct CRT_SEHRegistration3 *guard)
Definition locale.c:103
int32_t CRT_ismbblead(uint32_t character)
Definition locale.c:302
void __resetmbcp()
Definition locale.c:529
int32_t __chvalidator(uint8_t character, int32_t fallback_mask, uint8_t multibyte_mask)
Definition locale.c:309
int32_t CRT_isctype(int32_t ch, int32_t char_type_mask)
Definition locale.c:210
#define CRT_LocaleProbeWide
Definition opaque_data.h:30
#define CRT_LocaleProbeAnsi
Definition opaque_data.h:27
@ CRT_SEH_TRY_MAPPED_BUFFER
Definition constants.h:177
@ CRT_SEH_TRY_PROTECTED
Definition constants.h:176
#define CRT_CTYPE_UPPER
Definition constants.h:56
@ CRT_API_WIDE
Definition constants.h:116
@ CRT_API_ANSI
Definition constants.h:117
@ CRT_CODEPAGE_SIMPLIFIED_CHINESE
Definition constants.h:213
@ CRT_CODEPAGE_JAPANESE
Definition constants.h:212
@ CRT_CODEPAGE_TRADITIONAL_CHINESE
Definition constants.h:215
@ CRT_CODEPAGE_KOREAN
Definition constants.h:214
@ CRT_ERROR_INVALID_MULTIBYTE
Definition constants.h:251
#define CRT_MBC_LEAD
Definition constants.h:62
#define CRT_ALLOCATION_ALIGNMENT_MASK
Definition constants.h:171
#define CRT_CTYPE_LOWER
Definition constants.h:57
#define CRT_MBC_LOWER
Definition constants.h:65
@ CRT_LOCALE_TRADITIONAL_CHINESE
Definition constants.h:223
@ CRT_LOCALE_JAPANESE
Definition constants.h:220
@ CRT_LOCALE_SIMPLIFIED_CHINESE
Definition constants.h:221
@ CRT_LOCALE_KOREAN
Definition constants.h:222
#define CRT_MBC_TRAIL
Definition constants.h:63
#define CRT_MBC_UPPER
Definition constants.h:64
@ CRT_CODEPAGE_LOCALE
Definition constants.h:207
@ CRT_CODEPAGE_OEM
Definition constants.h:205
@ CRT_CODEPAGE_ANSI
Definition constants.h:206
#define CRT_CTYPE_LEAD_BYTE
Definition constants.h:60
int32_t __crtLCMapStringA(LCID locale, DWORD map_flags, LPCSTR src, int32_t src_count, LPSTR dest, int32_t dest_count, UINT code_page, int32_t strict)
int32_t __crtGetStringTypeA(DWORD info_type, LPCSTR src, int32_t src_count, uint16_t *char_types, UINT code_page, LCID locale, int32_t strict)
void * _memset(void *dest, int32_t value, uint32_t count)
Definition strings.c:189
uint32_t CRT_strnlen(char const *str, uint32_t max_count)
Definition strings.c:255
#define g_crtLocaleFlags
Definition globals.h:244
#define g_crtMultibyteCaseFold
Definition globals.h:335
#define g_crtMultibyteCodepageInfo
Definition globals.h:271
#define g_crtLastError
Definition globals.h:163
#define g_crtMultibyteCP_ACP
Definition globals.h:262
#define g_crtMultibyteState
Definition globals.h:265
#define g_crtExceptionList
Definition globals.h:241
#define g_crtMultibyteClassTable
Definition globals.h:268
#define g_crtLcCodepage
Definition globals.h:112
#define g_crtMultibyteCodepage
Definition globals.h:259
#define g_crtInitialized
Definition globals.h:298
#define g_crtMultibyteClassMasks
Definition globals.h:341
#define g_CRT_WideCharValidatorTable
Definition globals.h:109
#define g_crtMultibyteTablePtr
Definition globals.h:253
#define g_crtWideCharFlags
Definition globals.h:247
#define g_crtStartupInfo
Definition globals.h:232
#define g_crtNewMode
Definition globals.h:238
#define g_crtCodepageRecords
Definition globals.h:340
uint8_t classification_flags
Definition types.h:294
uint8_t multibyte_flags
Definition types.h:295
uint32_t case_mapping_words[3]
Definition types.h:329
uint8_t class_ranges[4][8]
Definition types.h:330
uint32_t code_page
Definition types.h:328
#define g_pCharTypeTable
Definition values.h:135
#define MB_PRECOMPOSED
Definition win32_text.h:15
#define MB_ERR_INVALID_CHARS
Definition win32_text.h:12