How yildirimmmm/ft_printf works
ft_printf is a small printf-style formatting library. A caller supplies a format string and variadic arguments; the entry point emits literal characters and sends each conversion to the format parser, which dispatches supported specifiers to conversion handlers. Handlers format values through output utilities, and the library returns a character count. The README gives no further capability details; links from unsampled handlers are omitted where their calls cannot be confirmed.
Main entry points: parse_format.c Format parser · ft_putchar_fd.c Character output · ft_printf.c ft_printf · handle_pointer.c Pointer handler
Components 18
Format processing
- ft_printf
src/ft_printf.c - Format parser
src/parse_format.c
Conversions
- Character handler
src/handle_char.c - String handler
src/handle_string.c - Pointer handler
src/handle_pointer.c - Decimal handler
src/handle_decimal.c - Unsigned handler
src/handle_unsigned.c - Lower hex handler
src/handle_hex_lower.c - Upper hex handler
src/handle_hex_upper.c - Percent handler
src/handle_percent.c
Output utilities
- Character output
utils/ft_putchar_fd.c - String output
- Signed number output
utils/ft_putnbr_fd.c - Unsigned number output
utils/ft_putnbr_unsigned.c - Lower hex output
utils/ft_puthex_lower.c - Upper hex output
utils/ft_puthex_upper.c
Other components
- Library caller
- Standard output
Connections 22
- Library caller → ft_printf: calls
- ft_printf → Format parser: parses conversions
- ft_printf → Character output: writes literals
- Format parser → Character handler: dispatches %c
- Format parser → String handler: dispatches %s
- Format parser → Pointer handler: dispatches %p
- Format parser → Decimal handler: dispatches %d, %i
- Format parser → Unsigned handler: dispatches %u
- Format parser → Lower hex handler: dispatches %x
- Format parser → Upper hex handler: dispatches %X
- Format parser → Percent handler: dispatches %%
- Format parser → Character output: writes unknown specifier
- Pointer handler → String output: writes nil marker
- Pointer handler → Lower hex output: formats address
- Unsigned handler → Unsigned number output: formats value
- Lower hex handler → Lower hex output: formats value
- Upper hex handler → Upper hex output: formats value
- Signed number output → Character output: writes digits
- Unsigned number output → Character output: writes digits
- Lower hex output → Character output: writes digits
- Upper hex output → Character output: writes digits
- Character output → Standard output: writes bytes