# atemur/printf architecture

> Architecture diagram of the GitHub repository atemur/printf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/atemur/printf
- Repository: https://github.com/atemur/printf

## Overview

ft_printf is a small C formatting library: callers pass a format string and variadic values, the implementation scans the string, dispatches supported specifiers, and writes output while accumulating a character count. The header declares the public entry point; formatting and output helpers are implemented in two source files. The README documents the supported conversions. The excerpts show the main dispatch and helper calls; no separate modules are needed to represent this runtime.

Main entry points: [`ft_printf.c`](https://github.com/atemur/printf/blob/main/ft_printf.c) (Format Scanner), [`tool.c`](https://github.com/atemur/printf/blob/main/tool.c) (Output Helpers), [`ft_printf.h`](https://github.com/atemur/printf/blob/main/ft_printf.h) (Public Declaration)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_caller(("Caller"))
node_public_declaration["Public Declaration<br/>[ft_printf.h]"]
node_formatter["Format Scanner<br/>[ft_printf.c]"]
node_specifier_dispatch["Specifier Dispatch<br/>[ft_printf.c]"]
node_output_helpers["Output Helpers<br/>[tool.c]"]

node_public_declaration -->|"declares"| node_formatter
node_caller -->|"calls"| node_formatter
node_formatter -->|"dispatches"| node_specifier_dispatch
node_formatter -->|"writes literals"| node_output_helpers
node_specifier_dispatch -->|"emits values"| node_output_helpers

click node_public_declaration "https://github.com/atemur/printf/blob/main/ft_printf.h"
click node_formatter "https://github.com/atemur/printf/blob/main/ft_printf.c"
click node_specifier_dispatch "https://github.com/atemur/printf/blob/main/ft_printf.c"
click node_output_helpers "https://github.com/atemur/printf/blob/main/tool.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_caller toneIndigo
class node_public_declaration,node_formatter,node_specifier_dispatch,node_output_helpers toneTeal
```

## Components

### Other components

- **Caller**
- [Public Declaration](https://github.com/atemur/printf/blob/main/ft_printf.h): `ft_printf.h`
- [Format Scanner](https://github.com/atemur/printf/blob/main/ft_printf.c): `ft_printf.c`
- [Specifier Dispatch](https://github.com/atemur/printf/blob/main/ft_printf.c): `ft_printf.c`
- [Output Helpers](https://github.com/atemur/printf/blob/main/tool.c): `tool.c`

## Connections

- Public Declaration → Format Scanner: declares (evidence: `ft_printf.h`)
- Caller → Format Scanner: calls (evidence: `ft_printf.c`)
- Format Scanner → Specifier Dispatch: dispatches (evidence: `ft_printf.c`)
- Format Scanner → Output Helpers: writes literals (evidence: `ft_printf.c`)
- Specifier Dispatch → Output Helpers: emits values (evidence: `ft_printf.c`)
