102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
formatting.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
10#include "pcdogs/text/globals.h"
11#include <intrin.h>
12#include <math.h>
13#include <stdarg.h>
14#include <string.h>
15
16// Original pcdogs.exe: 0x445fe5
17// Formats variadic arguments into an unbounded string-backed CRT stream and appends a terminator. The returned count excludes that terminator, and the caller must provide enough destination storage.
18int32_t String_FormatCRTString(char *buffer, char const *format, ...)
19{
20 struct File_Handle string_stream;
21
22 string_stream._base = buffer;
23 string_stream._ptr = buffer;
25 string_stream._cnt = INT32_MAX;
26 va_list argument_cursor;
27 va_start(argument_cursor, format);
28
29 int32_t result = _output(&string_stream, format, (uint8_t *)argument_cursor);
30
31 va_end(argument_cursor);
32
33 int32_t _cnt = string_stream._cnt;
34
35 string_stream._cnt -= 1;
36
37 if (_cnt - 1 < 0)
38 CRT_flsbuf(0, &string_stream);
39 else
40 *(uint8_t *)string_stream._ptr = 0;
41
42 return result;
43}
44
45// Original pcdogs.exe: 0x44626c
46// Formats variadic arguments to the supplied CRT stream, managing a temporary output buffer when needed. It returns the formatted character count or an error result.
47int32_t CRT_fprintf(struct File_Handle *stream, char const *format, ...)
48{
49 int32_t clear_buffer = _stbuf(stream);
50
51 va_list argument_cursor;
52 va_start(argument_cursor, format);
53
54 int32_t result = _output(stream, format, (uint8_t *)argument_cursor);
55
56 _ftbuf(clear_buffer, stream);
57
58 return result;
59}
60
61// Original pcdogs.exe: 0x44629e
62// Formats variadic arguments to standard output, managing a temporary output buffer when needed. It returns the formatted character count or an error result.
63int32_t CRT_printf(char const *format, ...)
64{
65 int32_t clear_buffer = _stbuf(&g_crtStaticStreams[1]);
66
67 va_list argument_cursor;
68 va_start(argument_cursor, format);
69
70 int32_t result = _output(&g_crtStaticStreams[1], format, (uint8_t *)argument_cursor);
71
72 _ftbuf(clear_buffer, &g_crtStaticStreams[1]);
73
74 return result;
75}
76
77// Original pcdogs.exe: 0x446db0
78// Formats an existing argument list into an unbounded string-backed CRT stream and appends a terminator. The returned count excludes that terminator, and the caller must provide enough destination storage.
79int32_t CRT_vsprintf(char *buffer, char const *format, uint8_t *argument_cursor)
80{
81 struct File_Handle string_stream;
82
83 string_stream._base = buffer;
84 string_stream._ptr = buffer;
86 string_stream._cnt = INT32_MAX;
87
88 int32_t result = _output(&string_stream, format, argument_cursor);
89 int32_t _cnt = string_stream._cnt;
90
91 string_stream._cnt -= 1;
92
93 if (_cnt - 1 < 0)
94 CRT_flsbuf(0, &string_stream);
95 else
96 *(uint8_t *)string_stream._ptr = 0;
97
98 return result;
99}
100
101static void *format_pointer_argument(uint8_t **cursor)
102{
103 return (void *)(uintptr_t)CRT_VaArgInt(cursor);
104}
105
106// Original pcdogs.exe: 0x4475b9
107// Parses printf-style flags, widths, precisions, lengths, and conversions and writes their results to a CRT stream. Count conversions retain their memory-write side effects, and 64-bit integer conversions consume eight-byte argument slots.
108int32_t _output(struct File_Handle *output_context, char const *format, uint8_t *argument_cursor)
109{
110 enum CRT_PrintfParserState parser_state = CRT_PRINTF_LITERAL;
111 char format_char = *(uint8_t *)format;
112 const char *format_cursor = &format[1];
113 int32_t text_length = 0;
114 int32_t written_count = 0;
115
116 format = format_cursor;
117
118 if (!format_char)
119 return written_count;
120
121 int32_t precision = -1;
122 int32_t uppercase_exponent = 0;
123 int32_t suppress_output = 0;
124 int32_t wide_text = 0;
125 int32_t field_width = 0;
126 int32_t prefix_length = 0;
127 uint32_t format_flags = 0;
128 char scratch[512];
129 const char *text = scratch;
130
131 while (written_count >= 0)
132 {
133 int32_t character_class;
134
135 if (format_char < ' ' || format_char > 'x')
136 character_class = 0;
137 else
138 {
139 int32_t class_lookup_bits = (int32_t)format_char;
140
141 character_class = g_crtPrintfStateTable[class_lookup_bits - ' '] & CRT_PRINTF_CLASS_MASK;
142 }
143
144 int32_t next_state_code = (int32_t)g_crtPrintfStateTable[parser_state + character_class * CRT_PRINTF_STATE_COUNT] >> 4;
145 enum CRT_PrintfParserState next_state = next_state_code;
146
147 switch (next_state_code)
148 {
150 {
151 wide_text = 0;
152
153 if (((struct CRT_CharacterClass *)g_pCharTypeTable)[(uint8_t)format_char].multibyte_flags & (CRT_CTYPE_LEAD_BYTE >> 8))
154 {
155 CRT_write_char((int32_t)format_char, output_context, &written_count);
156 format_char = *(uint8_t *)format_cursor;
157 format = &format_cursor[1];
158 }
159
160 CRT_write_char((int32_t)format_char, output_context, &written_count);
161
162 break;
163 }
164
165 case CRT_PRINTF_BEGIN:
166 {
167 precision = 0xffffffff;
168 uppercase_exponent = 0;
169 suppress_output = 0;
170 field_width = 0;
171 prefix_length = 0;
172 format_flags = 0;
173 wide_text = 0;
174
175 break;
176 }
177
178 case CRT_PRINTF_FLAGS:
179 {
180 int32_t flag_character = (int32_t)format_char;
181
182 if (flag_character == ' ')
183 format_flags |= CRT_FORMAT_SPACE;
184 else if (flag_character == '#')
185 format_flags |= CRT_FORMAT_ALTERNATE;
186 else if (flag_character == '+')
187 format_flags |= CRT_FORMAT_SIGN;
188 else if (flag_character == '-')
189 format_flags |= CRT_FORMAT_LEFT;
190 else if (flag_character == '0')
191 format_flags |= CRT_FORMAT_ZERO;
192
193 break;
194 }
195
196 case CRT_PRINTF_WIDTH:
197 {
198 if (format_char != '*')
199 field_width = (int32_t)format_char + field_width * 0xa - '0';
200 else
201 {
202 int32_t argument_width = CRT_VaArgInt(&argument_cursor);
203
204 field_width = argument_width;
205
206 if (argument_width < 0)
207 {
208 format_flags |= CRT_FORMAT_LEFT;
209 field_width = -(argument_width);
210 }
211 }
212
213 break;
214 }
215
216 case CRT_PRINTF_DOT:
217 {
218 precision = 0;
219
220 break;
221 }
222
224 {
225 if (format_char != '*')
226 precision = (int32_t)format_char + precision * 0xa - '0';
227 else
228 {
229 int32_t argument_precision = CRT_VaArgInt(&argument_cursor);
230
231 precision = argument_precision;
232
233 if (argument_precision < 0)
234 precision = 0xffffffff;
235 }
236
237 break;
238 }
239
241 {
242 if (format_char == 'I')
243 {
244 if (*(uint8_t *)format_cursor != '6' || format_cursor[1] != '4')
245 {
246 next_state = CRT_PRINTF_LITERAL;
247
248 wide_text = 0;
249
250 if (((struct CRT_CharacterClass *)g_pCharTypeTable)[(uint8_t)format_char].multibyte_flags & (CRT_CTYPE_LEAD_BYTE >> 8))
251 {
252 CRT_write_char((int32_t)format_char, output_context, &written_count);
253 format_char = *(uint8_t *)format_cursor;
254 format = &format_cursor[1];
255 }
256
257 CRT_write_char((int32_t)format_char, output_context, &written_count);
258 }
259 else
260 {
261 format_flags |= CRT_FORMAT_INT64;
262 format = &format_cursor[2];
263 }
264 }
265 else if (format_char == 'h')
266 format_flags |= CRT_FORMAT_SHORT;
267 else if (format_char == 'l')
268 format_flags |= CRT_FORMAT_LONG;
269 else if (format_char == 'w')
270 format_flags |= CRT_FORMAT_WIDE;
271
272 break;
273 }
274
276 {
277 int32_t conversion_character = (int32_t)format_char;
278 char prefix[0x2];
279
280 switch (conversion_character)
281 {
282 case 'd':
283 case 'i':
284 case 'u':
285 case 'o':
286 case 'p':
287 case 'X':
288 case 'x':
289 {
290 int32_t hex_digit_offset = 0;
291 int32_t radix;
292
293 if (conversion_character == 'd' || conversion_character == 'i')
294 {
295 format_flags |= CRT_FORMAT_SIGNED;
296 radix = 0xa;
297 }
298 else if (conversion_character == 'u')
299 radix = 0xa;
300 else if (conversion_character == 'o')
301 {
302 radix = 8;
303
304 if ((uint8_t)format_flags & CRT_FORMAT_ALTERNATE)
305 format_flags |= CRT_FORMAT_OCTAL_PREFIX;
306 }
307 else
308 {
309 if (conversion_character == 'p')
310 precision = 8;
311
312 hex_digit_offset = conversion_character == 'x' ? ('a' - '0' - 10) : ('A' - '0' - 10);
313 radix = 0x10;
314
315 if ((uint8_t)format_flags & CRT_FORMAT_ALTERNATE)
316 {
317 prefix[0] = '0';
318 prefix_length = 2;
319 prefix[1] = (uint8_t)hex_digit_offset + ('X' - ('A' - '0' - 10));
320 }
321 }
322
323 uint64_t magnitude;
324
325 if (format_flags & CRT_FORMAT_INT64)
326 magnitude = (uint64_t)CRT_VaArgInt64(&argument_cursor);
327 else
328 {
329 int32_t argument = CRT_VaArgInt(&argument_cursor);
330
331 if (format_flags & CRT_FORMAT_SHORT)
332 argument = (format_flags & CRT_FORMAT_SIGNED) ? (int16_t)argument : (uint16_t)argument;
333
334 magnitude = (format_flags & CRT_FORMAT_SIGNED) ? (uint64_t)(int64_t)argument : (uint32_t)argument;
335 }
336
337 if ((format_flags & CRT_FORMAT_SIGNED) && (magnitude & (UINT64_C(1) << 63)))
338 {
339 magnitude = UINT64_C(0) - magnitude;
340 format_flags |= CRT_FORMAT_NEGATIVE;
341 }
342
343 if (!(format_flags & CRT_FORMAT_INT64))
344 magnitude = (uint32_t)magnitude;
345
346 if (precision >= 0)
347 format_flags &= (~(uint32_t)CRT_FORMAT_ZERO);
348 else
349 precision = 1;
350
351 if (!magnitude)
352 prefix_length = 0;
353
354 char *digit_cursor = scratch + sizeof(scratch);
355
356 while (true)
357 {
358 int32_t remaining_digit_precision = precision;
359
360 precision -= 1;
361
362 if (remaining_digit_precision <= 0 && !magnitude)
363 break;
364
365 int32_t digit_character = __aullrem(magnitude, (uint64_t)radix) + '0';
366
367 magnitude = __aulldiv(magnitude, (uint64_t)radix);
368
369 if (digit_character > '9')
370 digit_character += hex_digit_offset;
371
372 *--digit_cursor = (char)digit_character;
373 }
374
375 text_length = (scratch + sizeof(scratch)) - digit_cursor;
376 if ((format_flags & CRT_FORMAT_OCTAL_PREFIX) && (!text_length || *digit_cursor != '0'))
377 {
378 *--digit_cursor = '0';
379 ++text_length;
380 }
381 text = digit_cursor;
382
383 break;
384 }
385
386 case 's':
387 case 'S':
388 {
389 if (conversion_character == 'S' && !((uint16_t)format_flags & (CRT_FORMAT_LONG | CRT_FORMAT_SHORT | CRT_FORMAT_WIDE)))
390 format_flags |= CRT_FORMAT_WIDE;
391
392 int32_t limit = precision == -1 ? INT32_MAX : precision;
393 const void *argument = format_pointer_argument(&argument_cursor);
394 text_length = 0;
395 if (format_flags & (CRT_FORMAT_LONG | CRT_FORMAT_WIDE))
396 {
397 const uint16_t *str = argument ? argument : g_pFormatStringNullWide;
398 text = (const char *)str;
399 wide_text = 1;
400 while (text_length != limit && str[text_length])
401 ++text_length;
402 }
403 else
404 {
405 text = argument ? argument : g_pFormatStringNullByte;
406 while (text_length != limit && text[text_length])
407 ++text_length;
408 }
409
410 break;
411 }
412
413 case 'e':
414 case 'f':
415 case 'g':
416 case 'E':
417 case 'G':
418 {
419 if (conversion_character == 'E' || conversion_character == 'G')
420 {
421 uppercase_exponent = 1;
422 format_char += 'a' - 'A';
423 }
424
425 char *str;
426
427 format_flags |= CRT_FORMAT_SIGNED;
428
429 char *unsigned_float_text = scratch;
430
431 text = scratch;
432
433 if (precision < 0)
434 precision = 6;
435 else if (!precision && format_char == 'g')
436 precision = 1;
437
438 uint8_t *after_double_argument = &argument_cursor[8];
439
440 argument_cursor = after_double_argument;
441
442 double floating_value;
443
444 *(uint32_t *)&floating_value = *(uint32_t *)(after_double_argument - 8);
445 *(uint32_t *)((char *)&floating_value + 4) =
446 *(uint32_t *)(after_double_argument - 4);
447 g_pFloatConvertFunction(&floating_value, scratch, (int32_t)format_char,
448 precision, uppercase_exponent);
449
450 int32_t alternate_format = format_flags & CRT_FORMAT_ALTERNATE;
451
452 if (alternate_format && !precision)
453 g_pFloatCropFunction(scratch);
454
455 if (format_char == 'g' && !alternate_format)
456 g_pFloatOutputFunction(scratch);
457
458 if (scratch[0] == '-')
459 {
460 format_flags |= CRT_FORMAT_NEGATIVE;
461 unsigned_float_text = &scratch[1];
462 text = &scratch[1];
463 }
464
465 str = unsigned_float_text;
466 text_length = _strlen(str);
467
468 break;
469 }
470
471 case 'c':
472 case 'C':
473 {
474 if (conversion_character == 'C' && !((uint16_t)format_flags & (CRT_FORMAT_LONG | CRT_FORMAT_SHORT | CRT_FORMAT_WIDE)))
475 format_flags |= CRT_FORMAT_WIDE;
476
477 uint8_t **character_arguments = &argument_cursor;
478
479 if (!((uint16_t)format_flags & (CRT_FORMAT_LONG | CRT_FORMAT_WIDE)))
480 {
481 scratch[0] = CRT_VaArgInt(character_arguments);
482 text_length = 1;
483 }
484 else
485 {
486 int32_t converted_character_bytes = String_ConvertCRTWideCharToMultiByte(scratch,
487 CRT_VaArgShort(character_arguments));
488
489 text_length = converted_character_bytes;
490
491 if (converted_character_bytes < 0)
492 suppress_output = 1;
493 }
494
495 text = scratch;
496
497 break;
498 }
499
500 case 'Z':
501 {
502 const struct CRT_CountedString *counted_string = format_pointer_argument(&argument_cursor);
503 if (!counted_string || !counted_string->buffer)
504 {
506 text_length = _strlen(text);
507 }
508 else
509 {
510 text = counted_string->buffer;
511 wide_text = (format_flags & CRT_FORMAT_WIDE) != 0;
512 text_length = counted_string->length;
513 if (wide_text)
514 text_length = (uint32_t)text_length >> 1;
515 }
516 break;
517 }
518
519 case 'n':
520 {
521 void *count_output_address = format_pointer_argument(&argument_cursor);
522
523 if (!((uint8_t)format_flags & CRT_FORMAT_SHORT))
524 *(uint32_t *)count_output_address = written_count;
525 else
526 *(uint16_t *)count_output_address = (uint16_t)written_count;
527
528 suppress_output = 1;
529
530 break;
531 }
532
533 case 'B':
534 /* The native parser classifies B as a conversion and reuses
535 * the previous output span without consuming an argument. */
536 break;
537 }
538
539 if (!suppress_output)
540 {
541 if ((uint8_t)format_flags & CRT_FORMAT_SIGNED)
542 {
543 if (format_flags & CRT_FORMAT_NEGATIVE)
544 {
545 prefix[0] = '-';
546 prefix_length = 1;
547 }
548 else if ((uint8_t)format_flags & CRT_FORMAT_SIGN)
549 {
550 prefix[0] = '+';
551 prefix_length = 1;
552 }
553 else if ((uint8_t)format_flags & CRT_FORMAT_SPACE)
554 {
555 prefix[0] = ' ';
556 prefix_length = 1;
557 }
558 }
559
560 int32_t padding_count = field_width - prefix_length - text_length;
561
562 if (!((uint8_t)format_flags & (CRT_FORMAT_LEFT | CRT_FORMAT_ZERO)))
563 CRT_write_multi_char(' ', padding_count, output_context, &written_count);
564
565 CRT_write_string(prefix, prefix_length, output_context, &written_count);
566
567 if ((uint8_t)format_flags & CRT_FORMAT_ZERO && !((uint8_t)format_flags & CRT_FORMAT_LEFT))
568 CRT_write_multi_char('0', padding_count, output_context, &written_count);
569
570 if (!wide_text || text_length <= 0)
571 CRT_write_string(text, text_length, output_context, &written_count);
572 else
573 {
574 uint16_t const *wide_text_cursor = (uint16_t const *)text;
575 int32_t wide_characters_remaining = text_length;
576
577 do
578 {
579 uint16_t wide_character = *wide_text_cursor++;
580 char multibyte_character[0x4];
582 multibyte_character, wide_character);
583
584 if (count <= 0)
585 break;
586
587 CRT_write_string(multibyte_character, count, output_context,
588 &written_count);
589 } while (--wide_characters_remaining);
590 }
591
592 if ((uint8_t)format_flags & CRT_FORMAT_LEFT)
593 CRT_write_multi_char(' ', padding_count, output_context, &written_count);
594 }
595
596 break;
597 }
598 }
599
600 format_char = *(uint8_t *)format;
601 format_cursor = &format[1];
602 format = format_cursor;
603
604 if (!format_char)
605 break;
606
607 parser_state = next_state;
608 }
609
610 return written_count;
611}
612
613// Original pcdogs.exe: 0x447cfa
614// Writes one character through the CRT stream buffer or refill path and updates the running output count. A write failure changes that count to -1.
615void CRT_write_char(int32_t ch, struct File_Handle *stream, int32_t *written_count)
616{
617 int32_t _cnt = stream->_cnt;
618
619 stream->_cnt -= 1;
620
621 uint32_t write_result;
622
623 if (_cnt - 1 < 0)
624 write_result = CRT_flsbuf(ch, stream);
625 else
626 {
627 uint8_t byte_character = (uint8_t)ch;
628
629 *(uint8_t *)stream->_ptr = byte_character;
630 stream->_ptr = &stream->_ptr[1];
631 write_result = (uint32_t)byte_character;
632 }
633
634 if (write_result != 0xffffffff)
635 {
636 *(uint32_t *)written_count += 1;
637
638 return;
639 }
640
641 *(uint32_t *)written_count = 0xffffffff;
642}
643
644// Original pcdogs.exe: 0x447d2f
645// Writes a requested run of repeated characters while the output count remains valid, stopping after a write failure.
646void CRT_write_multi_char(int32_t ch, int32_t count, struct File_Handle *stream, int32_t *written_count)
647{
648 int32_t characters_remaining = count - 1;
649
650 if (count <= 0)
651 return;
652
653 do
654 {
655 CRT_write_char(ch, stream, written_count);
656
657 if (*(uint32_t *)written_count == 0xffffffff)
658 break;
659 } while (characters_remaining-- > 0);
660}
661
662// Original pcdogs.exe: 0x447d60
663// Writes the requested number of string bytes and updates the running output count, stopping after a write failure.
664void CRT_write_string(char const *source, int32_t count, struct File_Handle *stream, int32_t *written_count)
665{
666 int32_t characters_remaining = count - 1;
667
668 if (count <= 0)
669 return;
670
671 char const *source_cursor = source;
672
673 do
674 {
675 int32_t ch = (int32_t)*(uint8_t *)source_cursor;
676
677 source_cursor = &source_cursor[1];
678 CRT_write_char(ch, stream, written_count);
679
680 if (*(uint32_t *)written_count == 0xffffffff)
681 break;
682 } while (characters_remaining-- > 0);
683}
684
685// Original pcdogs.exe: 0x447d98
686// Fetches a 32-bit argument and advances the argument cursor by four bytes.
687int32_t CRT_VaArgInt(uint8_t **argument_cursor)
688{
689 int32_t argument;
690
691 memcpy(&argument, *argument_cursor, 4);
692 *argument_cursor += 4;
693
694 return argument;
695}
696
697// Original pcdogs.exe: 0x447da5
698// Fetches a 64-bit argument and advances the argument cursor by eight bytes.
699int64_t CRT_VaArgInt64(uint8_t **argument_cursor)
700{
701 int64_t argument;
702
703 memcpy(&argument, *argument_cursor, 8);
704 *argument_cursor += 8;
705
706 return argument;
707}
708
709// Original pcdogs.exe: 0x447db5
710// Fetches the signed low 16 bits of a promoted argument and advances the argument cursor by four bytes.
711int16_t CRT_VaArgShort(uint8_t **argument_cursor)
712{
713 uint8_t *argument_address = *argument_cursor;
714
715 *argument_cursor = argument_address + 4;
716
717 return *(int16_t *)argument_address;
718}
int16_t CRT_VaArgShort(uint8_t **argument_cursor)
Definition formatting.c:711
int32_t CRT_printf(char const *format,...)
Definition formatting.c:63
static void * format_pointer_argument(uint8_t **cursor)
Definition formatting.c:101
void CRT_write_string(char const *source, int32_t count, struct File_Handle *stream, int32_t *written_count)
Definition formatting.c:664
int32_t CRT_fprintf(struct File_Handle *stream, char const *format,...)
Definition formatting.c:47
int32_t CRT_vsprintf(char *buffer, char const *format, uint8_t *argument_cursor)
Definition formatting.c:79
int32_t CRT_VaArgInt(uint8_t **argument_cursor)
Definition formatting.c:687
void CRT_write_multi_char(int32_t ch, int32_t count, struct File_Handle *stream, int32_t *written_count)
Definition formatting.c:646
int64_t CRT_VaArgInt64(uint8_t **argument_cursor)
Definition formatting.c:699
int32_t String_FormatCRTString(char *buffer, char const *format,...)
Definition formatting.c:18
void CRT_write_char(int32_t ch, struct File_Handle *stream, int32_t *written_count)
Definition formatting.c:615
int32_t _output(struct File_Handle *output_context, char const *format, uint8_t *argument_cursor)
Definition formatting.c:108
#define g_pFloatOutputFunction
#define g_pFloatConvertFunction
#define g_pFloatCropFunction
#define CRT_FORMAT_WIDE
Definition constants.h:53
#define CRT_FORMAT_LONG
Definition constants.h:47
#define CRT_PRINTF_CLASS_MASK
Definition constants.h:233
#define CRT_PRINTF_STATE_COUNT
Definition constants.h:234
#define CRT_FORMAT_SIGN
Definition constants.h:43
#define CRT_STREAM_STRING
Definition constants.h:21
#define CRT_FORMAT_NEGATIVE
Definition constants.h:51
#define CRT_FORMAT_SPACE
Definition constants.h:44
#define CRT_FORMAT_ZERO
Definition constants.h:46
#define CRT_FORMAT_ALTERNATE
Definition constants.h:50
#define CRT_FORMAT_INT64
Definition constants.h:54
#define CRT_FORMAT_SHORT
Definition constants.h:48
#define CRT_FORMAT_OCTAL_PREFIX
Definition constants.h:52
#define CRT_FORMAT_SIGNED
Definition constants.h:49
#define CRT_STREAM_WRITE
Definition constants.h:16
#define CRT_FORMAT_LEFT
Definition constants.h:45
#define CRT_CTYPE_LEAD_BYTE
Definition constants.h:60
CRT_PrintfParserState
Definition enums.h:7
@ CRT_PRINTF_LENGTH
Definition enums.h:28
@ CRT_PRINTF_WIDTH
Definition enums.h:19
@ CRT_PRINTF_CONVERSION
Definition enums.h:31
@ CRT_PRINTF_DOT
Definition enums.h:22
@ CRT_PRINTF_PRECISION
Definition enums.h:25
@ CRT_PRINTF_FLAGS
Definition enums.h:16
@ CRT_PRINTF_BEGIN
Definition enums.h:13
@ CRT_PRINTF_LITERAL
Definition enums.h:10
void _ftbuf(int32_t clear_buffer, struct File_Handle *stream)
Definition stdio.c:655
int32_t _stbuf(struct File_Handle *stream)
Definition stdio.c:602
uint64_t __aullrem(uint64_t dividend, uint64_t divisor)
Definition integer.c:24
int32_t String_ConvertCRTWideCharToMultiByte(char *buffer, uint16_t wide_char)
Definition locale.c:619
int32_t CRT_flsbuf(int32_t ch, struct File_Handle *stream)
Definition stdio.c:507
uint64_t __aulldiv(uint64_t dividend, uint64_t divisor)
Definition integer.c:17
uint32_t _strlen(char const *str)
Definition strings.c:225
#define g_crtPrintfStateTable
Definition globals.h:337
#define g_crtStaticStreams
Definition globals.h:336
int16_t length
Definition types.h:335
char * buffer
Definition types.h:337
int32_t _flag
Definition types.h:235
char * _base
Definition types.h:231
char * _ptr
Definition types.h:229
int32_t _cnt
Definition types.h:230
#define g_pFormatStringNullByte
Definition globals.h:27
#define g_pFormatStringNullWide
Definition globals.h:30
#define g_pCharTypeTable
Definition values.h:135