# ton-64/j architecture

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

- Interactive diagram: https://gitdiagram.com/ton-64/j
- Repository: https://github.com/ton-64/j

## Overview

This repository contains two header-only C libraries: `j/j.h`, a base library whose shown runtime feature is allocator-backed vectors, and `utest/utest.h`, a unit-testing framework. A typical testing flow is to define tests and assertions, then enter the framework through its main/runner API; the excerpts show assertion reporting and the `UTEST_MAIN` call. The README is empty, so capabilities and relationships beyond the excerpts are not inferred.

Main entry points: [`j/j.h`](https://github.com/ton-64/j/blob/main/j/j.h) (Dynamic Vectors), [`utest/utest.h`](https://github.com/ton-64/j/blob/main/utest/utest.h) (Test Assertions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_base["C Base Library"]
  node_allocator["Allocator Interface<br/>[j.h]"]
  node_vectors["Dynamic Vectors<br/>[j.h]"]
end

subgraph group_testing["Unit Testing"]
  node_test_macros["Test Assertions<br/>[utest.h]"]
  node_failure_output["Failure Reporting<br/>[utest.h]"]
  node_main_macro["Main Macro<br/>[utest.h]"]
  node_runner["Test Runner<br/>[utest.h]"]
end

node_consumer(("Library User"))

node_vectors -->|"uses for resizing"| node_allocator
node_test_macros -->|"prints failures"| node_failure_output
node_main_macro -->|"calls"| node_runner

click node_allocator "https://github.com/ton-64/j/blob/main/j/j.h"
click node_vectors "https://github.com/ton-64/j/blob/main/j/j.h"
click node_test_macros "https://github.com/ton-64/j/blob/main/utest/utest.h"
click node_failure_output "https://github.com/ton-64/j/blob/main/utest/utest.h"
click node_main_macro "https://github.com/ton-64/j/blob/main/utest/utest.h"
click node_runner "https://github.com/ton-64/j/blob/main/utest/utest.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_allocator,node_vectors,node_consumer toneBlue
class node_test_macros,node_failure_output,node_main_macro,node_runner toneAmber
```

## Components

### C Base Library

- [Allocator Interface](https://github.com/ton-64/j/blob/main/j/j.h): `j/j.h`
- [Dynamic Vectors](https://github.com/ton-64/j/blob/main/j/j.h): `j/j.h`

### Unit Testing

- [Test Assertions](https://github.com/ton-64/j/blob/main/utest/utest.h): `utest/utest.h`
- [Failure Reporting](https://github.com/ton-64/j/blob/main/utest/utest.h): `utest/utest.h`
- [Main Macro](https://github.com/ton-64/j/blob/main/utest/utest.h): `utest/utest.h`
- [Test Runner](https://github.com/ton-64/j/blob/main/utest/utest.h): `utest/utest.h`

### Other components

- **Library User**

## Connections

- Dynamic Vectors → Allocator Interface: uses for resizing (evidence: `j/j.h`)
- Test Assertions → Failure Reporting: prints failures (evidence: `utest/utest.h`)
- Main Macro → Test Runner: calls (evidence: `utest/utest.h`)
