# avrdudes/avr-libc architecture

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

- Interactive diagram: https://gitdiagram.com/avrdudes/avr-libc
- Repository: https://github.com/avrdudes/avr-libc

## Overview

AVR-LibC is the C standard library and AVR-specific support library for AVR-GCC applications. The typical workflow is an AVR application calling library APIs, with the library providing formatted I/O, conversion and utility functions, time handling, math, and device-specific support. The graph groups those runtime capabilities and highlights sampled implementation dependencies; many broader subsystem links are documented only at the product level because their implementation files were not sampled.

Main entry points: [`include`](https://github.com/avrdudes/avr-libc/tree/main/include) (C API headers), [`libc/stdio/vfprintf.c`](https://github.com/avrdudes/avr-libc/blob/main/libc/stdio/vfprintf.c) (Formatted output), [`libc/stdlib/strtold.c`](https://github.com/avrdudes/avr-libc/blob/main/libc/stdlib/strtold.c) (Long-double parsing), [`libc/stdio`](https://github.com/avrdudes/avr-libc/tree/main/libc/stdio) (Stream I/O)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["C and AVR APIs"]
  node_headers["C API headers"]
end

subgraph group_io["Formatted I/O"]
  node_stdio["Stream I/O"]
  node_printf["Formatted output<br/>[vfprintf.c]"]
  node_scanf["Formatted input<br/>[vfscanf.c]"]
  node_stdio_private["stdio internals<br/>[stdio_private.h]"]
  node_xtoa["Integer formatting<br/>[xtoa_fast.h]"]
  node_ftoa["Float formatting engine<br/>[ftoa_engine.h]"]
end

subgraph group_core["Runtime services"]
  node_stdlib["General utilities"]
  node_strtold["Long-double parsing<br/>[strtold.c]"]
  node_libf7["F7 math support<br/>[libf7.h]"]
  node_f7renames["F7 symbol aliases<br/>[f7-renames.h]"]
  node_string["String operations"]
  node_time["Time services"]
  node_strftime["Time formatting<br/>[strftime.c]"]
  node_time_private["Time internals<br/>[time-private.h]"]
  node_math["Math functions"]
end

subgraph group_target["AVR support"]
  node_avr_headers["AVR device headers"]
  node_avr_util["AVR utilities"]
  node_asmdefs["AVR assembly helpers<br/>[asmdef.h]"]
  node_sectionnames["Library section macros<br/>[sectionname.h]"]
  node_best_as["Type selection helper<br/>[best_as.h]"]
  node_ntz["Bit-count helper<br/>[ntz.h]"]
  node_alias["Symbol alias helper<br/>[alias.h]"]
end

node_application(("AVR application"))

node_application -->|"calls APIs"| node_headers
node_headers -.->|"declares APIs"| node_stdio
node_headers -.->|"declares APIs"| node_stdlib
node_headers -.->|"declares APIs"| node_string
node_headers -.->|"declares APIs"| node_time
node_headers -.->|"declares APIs"| node_math
node_headers -.->|"declares device APIs"| node_avr_headers
node_headers -.->|"declares utilities"| node_avr_util
node_stdio -.->|"formats output"| node_printf
node_stdio -.->|"parses input"| node_scanf
node_printf -->|"uses"| node_stdio_private
node_printf -->|"uses"| node_ftoa
node_printf -->|"uses"| node_xtoa
node_scanf -->|"uses"| node_stdio_private
node_strtold -->|"uses"| node_libf7
node_libf7 -->|"includes"| node_f7renames
node_strftime -->|"uses"| node_time_private
node_strftime -->|"uses"| node_best_as
node_strtold -->|"uses"| node_best_as
node_strtold -->|"uses"| node_alias
node_asmdefs -->|"includes"| node_sectionnames

click node_headers "https://github.com/avrdudes/avr-libc/tree/main/include"
click node_stdio "https://github.com/avrdudes/avr-libc/tree/main/libc/stdio"
click node_printf "https://github.com/avrdudes/avr-libc/blob/main/libc/stdio/vfprintf.c"
click node_scanf "https://github.com/avrdudes/avr-libc/blob/main/libc/stdio/vfscanf.c"
click node_stdio_private "https://github.com/avrdudes/avr-libc/blob/main/libc/stdio/stdio_private.h"
click node_xtoa "https://github.com/avrdudes/avr-libc/blob/main/libc/stdio/xtoa_fast.h"
click node_ftoa "https://github.com/avrdudes/avr-libc/blob/main/common/ftoa_engine.h"
click node_stdlib "https://github.com/avrdudes/avr-libc/tree/main/libc/stdlib"
click node_strtold "https://github.com/avrdudes/avr-libc/blob/main/libc/stdlib/strtold.c"
click node_libf7 "https://github.com/avrdudes/avr-libc/blob/main/common/f7/libf7.h"
click node_f7renames "https://github.com/avrdudes/avr-libc/blob/main/common/f7/f7-renames.h"
click node_string "https://github.com/avrdudes/avr-libc/tree/main/libc/string"
click node_time "https://github.com/avrdudes/avr-libc/tree/main/libc/time"
click node_strftime "https://github.com/avrdudes/avr-libc/blob/main/libc/time/strftime.c"
click node_time_private "https://github.com/avrdudes/avr-libc/blob/main/libc/time/time-private.h"
click node_math "https://github.com/avrdudes/avr-libc/tree/main/libm"
click node_avr_headers "https://github.com/avrdudes/avr-libc/tree/main/include/avr"
click node_avr_util "https://github.com/avrdudes/avr-libc/tree/main/include/util"
click node_asmdefs "https://github.com/avrdudes/avr-libc/blob/main/common/asmdef.h"
click node_sectionnames "https://github.com/avrdudes/avr-libc/blob/main/common/sectionname.h"
click node_best_as "https://github.com/avrdudes/avr-libc/blob/main/common/best_as.h"
click node_ntz "https://github.com/avrdudes/avr-libc/blob/main/common/ntz.h"
click node_alias "https://github.com/avrdudes/avr-libc/blob/main/common/alias.h"

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_headers toneBlue
class node_stdio,node_printf,node_scanf,node_stdio_private,node_xtoa,node_ftoa toneAmber
class node_stdlib,node_strtold,node_libf7,node_f7renames,node_string,node_time,node_strftime,node_time_private,node_math toneMint
class node_avr_headers,node_avr_util,node_asmdefs,node_sectionnames,node_best_as,node_ntz,node_alias toneRose
class node_application toneIndigo
```

## Components

### C and AVR APIs

- [C API headers](https://github.com/avrdudes/avr-libc/tree/main/include): `include`

### Formatted I/O

- [Stream I/O](https://github.com/avrdudes/avr-libc/tree/main/libc/stdio): `libc/stdio`
- [Formatted output](https://github.com/avrdudes/avr-libc/blob/main/libc/stdio/vfprintf.c): `libc/stdio/vfprintf.c`
- [Formatted input](https://github.com/avrdudes/avr-libc/blob/main/libc/stdio/vfscanf.c): `libc/stdio/vfscanf.c`
- [stdio internals](https://github.com/avrdudes/avr-libc/blob/main/libc/stdio/stdio_private.h): `libc/stdio/stdio_private.h`
- [Integer formatting](https://github.com/avrdudes/avr-libc/blob/main/libc/stdio/xtoa_fast.h): `libc/stdio/xtoa_fast.h`
- [Float formatting engine](https://github.com/avrdudes/avr-libc/blob/main/common/ftoa_engine.h): `common/ftoa_engine.h`

### Runtime services

- [General utilities](https://github.com/avrdudes/avr-libc/tree/main/libc/stdlib): `libc/stdlib`
- [Long-double parsing](https://github.com/avrdudes/avr-libc/blob/main/libc/stdlib/strtold.c): `libc/stdlib/strtold.c`
- [F7 math support](https://github.com/avrdudes/avr-libc/blob/main/common/f7/libf7.h): `common/f7/libf7.h`
- [F7 symbol aliases](https://github.com/avrdudes/avr-libc/blob/main/common/f7/f7-renames.h): `common/f7/f7-renames.h`
- [String operations](https://github.com/avrdudes/avr-libc/tree/main/libc/string): `libc/string`
- [Time services](https://github.com/avrdudes/avr-libc/tree/main/libc/time): `libc/time`
- [Time formatting](https://github.com/avrdudes/avr-libc/blob/main/libc/time/strftime.c): `libc/time/strftime.c`
- [Time internals](https://github.com/avrdudes/avr-libc/blob/main/libc/time/time-private.h): `libc/time/time-private.h`
- [Math functions](https://github.com/avrdudes/avr-libc/tree/main/libm): `libm`

### AVR support

- [AVR device headers](https://github.com/avrdudes/avr-libc/tree/main/include/avr): `include/avr`
- [AVR utilities](https://github.com/avrdudes/avr-libc/tree/main/include/util): `include/util`
- [AVR assembly helpers](https://github.com/avrdudes/avr-libc/blob/main/common/asmdef.h): `common/asmdef.h`
- [Library section macros](https://github.com/avrdudes/avr-libc/blob/main/common/sectionname.h): `common/sectionname.h`
- [Type selection helper](https://github.com/avrdudes/avr-libc/blob/main/common/best_as.h): `common/best_as.h`
- [Bit-count helper](https://github.com/avrdudes/avr-libc/blob/main/common/ntz.h): `common/ntz.h`
- [Symbol alias helper](https://github.com/avrdudes/avr-libc/blob/main/common/alias.h): `common/alias.h`

### Other components

- **AVR application**

## Connections

- AVR application → C API headers: calls APIs
- C API headers → Stream I/O: declares APIs
- C API headers → General utilities: declares APIs
- C API headers → String operations: declares APIs
- C API headers → Time services: declares APIs
- C API headers → Math functions: declares APIs
- C API headers → AVR device headers: declares device APIs
- C API headers → AVR utilities: declares utilities
- Stream I/O → Formatted output: formats output (evidence: `libc/stdio/vfprintf.c`)
- Stream I/O → Formatted input: parses input (evidence: `libc/stdio/vfscanf.c`)
- Formatted output → stdio internals: uses (evidence: `libc/stdio/vfprintf.c`)
- Formatted output → Float formatting engine: uses (evidence: `libc/stdio/vfprintf.c`)
- Formatted output → Integer formatting: uses (evidence: `libc/stdio/vfprintf.c`)
- Formatted input → stdio internals: uses (evidence: `libc/stdio/vfscanf.c`)
- Long-double parsing → F7 math support: uses (evidence: `libc/stdlib/strtold.c`)
- F7 math support → F7 symbol aliases: includes (evidence: `common/f7/libf7.h`)
- Time formatting → Time internals: uses (evidence: `libc/time/strftime.c`)
- Time formatting → Type selection helper: uses (evidence: `libc/time/strftime.c`)
- Long-double parsing → Type selection helper: uses (evidence: `libc/stdlib/strtold.c`)
- Long-double parsing → Symbol alias helper: uses (evidence: `libc/stdlib/strtold.c`)
- AVR assembly helpers → Library section macros: includes (evidence: `common/asmdef.h`)
