# ciubotaru/hashmap architecture

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

- Interactive diagram: https://gitdiagram.com/ciubotaru/hashmap
- Repository: https://github.com/ciubotaru/hashmap

## Overview

This is a small C library for binary-key/value storage, not a standalone application. A client calls the public API to create or mutate a map and search for entries; the implementation owns copied data and manages chained buckets, including incremental resizing and runtime options. The README documents the library’s broader API behavior. The source excerpts are partial, so internal links are limited to relationships shown there or explicitly documented.

Main entry points: [`hashmap.c`](https://github.com/ciubotaru/hashmap/blob/stable/hashmap.c) (Map Operations), [`hashmap.h`](https://github.com/ciubotaru/hashmap/blob/stable/hashmap.h) (Hashmap API), [`hashmap-internals.h`](https://github.com/ciubotaru/hashmap/blob/stable/hashmap-internals.h) (Map Structures)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_api["Hashmap API<br/>[hashmap.h]"]
end

subgraph group_runtime["Hashmap Runtime"]
  node_core["Map Operations<br/>[hashmap.c]"]
  node_state["Map Structures"]
  node_migration["Resize Migration<br/>[hashmap.c]"]
  node_configuration["Runtime Options<br/>[hashmap.c]"]
end

node_client(("C Client"))

node_client -->|"calls"| node_api
node_api -->|"implemented by"| node_core
node_core -->|"uses structures"| node_state
node_core -->|"advances migration"| node_migration
node_core -->|"applies options"| node_configuration

click node_api "https://github.com/ciubotaru/hashmap/blob/stable/hashmap.h"
click node_core "https://github.com/ciubotaru/hashmap/blob/stable/hashmap.c"
click node_state "https://github.com/ciubotaru/hashmap/blob/stable/hashmap-internals.h"
click node_migration "https://github.com/ciubotaru/hashmap/blob/stable/hashmap.c"
click node_configuration "https://github.com/ciubotaru/hashmap/blob/stable/hashmap.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_api,node_client toneBlue
class node_core,node_state,node_migration,node_configuration toneAmber
```

## Components

### Public API

- [Hashmap API](https://github.com/ciubotaru/hashmap/blob/stable/hashmap.h): `hashmap.h`

### Hashmap Runtime

- [Map Operations](https://github.com/ciubotaru/hashmap/blob/stable/hashmap.c): `hashmap.c`
- [Map Structures](https://github.com/ciubotaru/hashmap/blob/stable/hashmap-internals.h): `hashmap-internals.h`
- [Resize Migration](https://github.com/ciubotaru/hashmap/blob/stable/hashmap.c): `hashmap.c`
- [Runtime Options](https://github.com/ciubotaru/hashmap/blob/stable/hashmap.c): `hashmap.c`

### Other components

- **C Client**

## Connections

- C Client → Hashmap API: calls (evidence: `README`)
- Hashmap API → Map Operations: implemented by (evidence: `hashmap.c`)
- Map Operations → Map Structures: uses structures (evidence: `hashmap.c`)
- Map Operations → Resize Migration: advances migration (evidence: `hashmap.c`)
- Map Operations → Runtime Options: applies options (evidence: `README`)
