# nicoadresse/nc architecture

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

- Interactive diagram: https://gitdiagram.com/nicoadresse/nc
- Repository: https://github.com/nicoadresse/nc

## Overview

NC is a header-only C library for checked integer and floating-point primitives, including heap-backed pointer wrappers and diagnostic logging. A user includes `src/nc.h`, then constructs and operates on typed values; ordinary checked operations report invalid results and use defaults, while “must” variants can terminate on errors. The graph groups related widths and signedness into subsystem nodes rather than listing every primitive. Relationships are based on the README and SOURCE INDEX references; unsampled modules are represented only where the tree supports them.

Main entry points: [`src/nc/nc_log.h`](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_log.h) (Logging API), [`src/nc/nc_int_types.h`](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int_types.h) (Integer API), [`src/nc/nc_float_types.h`](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float_types.h) (Float API), [`src/nc.h`](https://github.com/nicoadresse/nc/blob/main/src/nc.h) (Umbrella header)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_entry["Umbrella header<br/>[nc.h]"]
  node_int_api["Integer API<br/>[nc_int_types.h]"]
  node_float_api["Float API<br/>[nc_float_types.h]"]
end

subgraph group_integers["Integer primitives"]
  node_int_types["Integer types<br/>[nc_types.h]"]
  node_int_ops["Integer operations<br/>[nc_i64.h]"]
  node_int_helpers["Integer checks<br/>[inc_helper_funcs.h]"]
  node_int_constructors["Integer constructors"]
  node_int_pointers["Integer pointers"]
end

subgraph group_floats["Float primitives"]
  node_float_types["Float types"]
  node_float_ops["Float operations<br/>[nc_f32.h]"]
  node_float_helpers["Float checks<br/>[inc_helper_funcs.h]"]
  node_float_constructors["Float constructors"]
  node_float_pointers["Float pointers<br/>[nc_ptr_f32.h]"]
end

subgraph group_diagnostics["Diagnostics"]
  node_logging["Logging API<br/>[nc_log.h]"]
  node_print["Print statements<br/>[nc_print_stmts.h]"]
  node_debug["Debug statements<br/>[nc_debug_stmts.h]"]
  node_errors["Error statements<br/>[nc_error_stmts.h]"]
end

node_user(("C application"))

node_user -->|"includes"| node_entry
node_entry -->|"includes"| node_int_api
node_entry -->|"includes"| node_float_api
node_entry -->|"includes"| node_logging
node_int_api -->|"imports"| node_int_types
node_int_api -->|"imports"| node_int_ops
node_int_api -->|"imports"| node_int_constructors
node_int_api -->|"imports"| node_int_pointers
node_int_ops -->|"checks with"| node_int_helpers
node_int_ops -->|"imports"| node_int_constructors
node_int_helpers -->|"reports through"| node_logging
node_int_pointers -->|"uses"| node_int_constructors
node_float_api -->|"imports"| node_float_types
node_float_api -->|"imports"| node_float_ops
node_float_api -->|"imports"| node_float_constructors
node_float_api -->|"imports"| node_float_pointers
node_float_ops -->|"checks with"| node_float_helpers
node_float_constructors -->|"validates with"| node_float_helpers
node_float_pointers -->|"uses"| node_float_constructors
node_float_helpers -->|"reports through"| node_logging
node_logging -->|"imports"| node_print
node_logging -->|"imports"| node_debug
node_logging -->|"imports"| node_errors

click node_entry "https://github.com/nicoadresse/nc/blob/main/src/nc.h"
click node_int_api "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int_types.h"
click node_float_api "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float_types.h"
click node_int_types "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int/nc_types.h"
click node_int_ops "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int/nc_i64/nc_i64.h"
click node_int_helpers "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int/inc_helper_funcs.h"
click node_int_constructors "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int/nc_int_constructors.h"
click node_int_pointers "https://github.com/nicoadresse/nc/tree/main/src/nc/nc_int"
click node_float_types "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/nc_float_primitives.h"
click node_float_ops "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/nc_f32/nc_f32.h"
click node_float_helpers "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/inc_helper_funcs.h"
click node_float_constructors "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/nc_float_constructors.h"
click node_float_pointers "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/nc_ptr_f32/nc_ptr_f32.h"
click node_logging "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_log.h"
click node_print "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_log/nc_print_stmts.h"
click node_debug "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_log/nc_debug_stmts.h"
click node_errors "https://github.com/nicoadresse/nc/blob/main/src/nc/nc_log/nc_error_stmts.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_entry,node_int_api,node_float_api toneBlue
class node_int_types,node_int_ops,node_int_helpers,node_int_constructors,node_int_pointers toneAmber
class node_float_types,node_float_ops,node_float_helpers,node_float_constructors,node_float_pointers toneMint
class node_logging,node_print,node_debug,node_errors toneRose
class node_user toneIndigo
```

## Components

### Public API

- [Umbrella header](https://github.com/nicoadresse/nc/blob/main/src/nc.h): `src/nc.h`
- [Integer API](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int_types.h): `src/nc/nc_int_types.h`
- [Float API](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float_types.h): `src/nc/nc_float_types.h`

### Integer primitives

- [Integer types](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int/nc_types.h): `src/nc/nc_int/nc_types.h`
- [Integer operations](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int/nc_i64/nc_i64.h): `src/nc/nc_int/nc_i64/nc_i64.h`
- [Integer checks](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int/inc_helper_funcs.h): `src/nc/nc_int/inc_helper_funcs.h`
- [Integer constructors](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_int/nc_int_constructors.h): `src/nc/nc_int/nc_int_constructors.h`
- [Integer pointers](https://github.com/nicoadresse/nc/tree/main/src/nc/nc_int): `src/nc/nc_int`

### Float primitives

- [Float types](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/nc_float_primitives.h): `src/nc/nc_float/nc_float_primitives.h`
- [Float operations](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/nc_f32/nc_f32.h): `src/nc/nc_float/nc_f32/nc_f32.h`
- [Float checks](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/inc_helper_funcs.h): `src/nc/nc_float/inc_helper_funcs.h`
- [Float constructors](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/nc_float_constructors.h): `src/nc/nc_float/nc_float_constructors.h`
- [Float pointers](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_float/nc_ptr_f32/nc_ptr_f32.h): `src/nc/nc_float/nc_ptr_f32/nc_ptr_f32.h`

### Diagnostics

- [Logging API](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_log.h): `src/nc/nc_log.h`
- [Print statements](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_log/nc_print_stmts.h): `src/nc/nc_log/nc_print_stmts.h`
- [Debug statements](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_log/nc_debug_stmts.h): `src/nc/nc_log/nc_debug_stmts.h`
- [Error statements](https://github.com/nicoadresse/nc/blob/main/src/nc/nc_log/nc_error_stmts.h): `src/nc/nc_log/nc_error_stmts.h`

### Other components

- **C application**

## Connections

- C application → Umbrella header: includes (evidence: `README.md`)
- Umbrella header → Integer API: includes (evidence: `src/nc.h`)
- Umbrella header → Float API: includes (evidence: `src/nc.h`)
- Umbrella header → Logging API: includes (evidence: `src/nc.h`)
- Integer API → Integer types: imports (evidence: `src/nc/nc_int_types.h`)
- Integer API → Integer operations: imports (evidence: `src/nc/nc_int_types.h`)
- Integer API → Integer constructors: imports (evidence: `src/nc/nc_int_types.h`)
- Integer API → Integer pointers: imports (evidence: `src/nc/nc_int_types.h`)
- Integer operations → Integer checks: checks with (evidence: `src/nc/nc_int/nc_i64/nc_i64.h`)
- Integer operations → Integer constructors: imports (evidence: `src/nc/nc_int/nc_i64/nc_i64.h`)
- Integer checks → Logging API: reports through (evidence: `src/nc/nc_int/inc_helper_funcs.h`)
- Integer pointers → Integer constructors: uses (evidence: `src/nc/nc_int/nc_int_constructors.h`)
- Float API → Float types: imports (evidence: `src/nc/nc_float_types.h`)
- Float API → Float operations: imports (evidence: `src/nc/nc_float_types.h`)
- Float API → Float constructors: imports (evidence: `src/nc/nc_float_types.h`)
- Float API → Float pointers: imports (evidence: `src/nc/nc_float_types.h`)
- Float operations → Float checks: checks with (evidence: `src/nc/nc_float/nc_f32/nc_f32.h`)
- Float constructors → Float checks: validates with (evidence: `src/nc/nc_float/nc_float_constructors.h`)
- Float pointers → Float constructors: uses (evidence: `src/nc/nc_float/nc_ptr_f32/nc_ptr_f32.h`)
- Float checks → Logging API: reports through (evidence: `src/nc/nc_float/inc_helper_funcs.h`)
- Logging API → Print statements: imports (evidence: `src/nc/nc_log.h`)
- Logging API → Debug statements: imports (evidence: `src/nc/nc_log.h`)
- Logging API → Error statements: imports (evidence: `src/nc/nc_log.h`)
