benilla-re systems structs docs

__output

function · crt · primitive

Address
0x742ba5 · 1825 bytes, up to 0x7432c5
Signature
int __cdecl (FILE *stream, const char *format, va_list args)
Meaning
Formats a printf format and its arguments into a FILE; returns the bytes written, or -1 once a write fails
Confidence
verified, proof one
Name from
the community database (idb)
Finding
crt/printf#the-format-state-machine
Test
crt::crt_sprintf_states_difftest, crt::crt_sprintf_difftest, crt::crt_sprintf_float_difftest, crt::crt_vsnprintf_difftest

Finding: The format state machine in crt: formatted output

__output reads the format a byte at a time until its NUL. A byte's class and the state give the next state: 0 normal, 1 percent, 2 flag, 3 width, 4 dot, 5 precision, 6 size, 7 type. Bytes outside 0x20 to 0x78 are of class other. The normal state writes the byte, so %% writes % and a byte of class other ends a conversion by being written. State 1 clears the flags and width and sets the precision to -1. * reads an int: a negative width sets - and is negated, a negative precision is -1. Digits accumulate in 32 bits. I is a size only before 64, else written. F, L and N do nothing.

class01234567
other00000000
%10000001
.04440000
*03305000
002235500
1 to 903335500
space # + -02200000
F I L N h l w06666660
B C E G S X Z c d e f g i n o p s u x07777770

The derivation is in the doc.

Callers 5

Callees 10

Calls and jumps by a bare address, from tables/calls.tsv.