# perry280/generic_data_structures architecture

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

- Interactive diagram: https://gitdiagram.com/perry280/generic_data_structures
- Repository: https://github.com/perry280/generic_data_structures

## Overview

This is a small C library of generic container data structures, not an end-user application. A caller creates and operates on a vector, singly linked list, or hash map; each stores fixed-size values and can use shared comparison, cleanup, and hashing callbacks. The excerpts show the implementations and the hash map’s default hash call. No README or usage example was supplied, so caller links represent the declared APIs rather than a documented application workflow.

Main entry points: [`generic_hashmap/generic_hashmap.c`](https://github.com/perry280/generic_data_structures/blob/main/generic_hashmap/generic_hashmap.c) (Hash map), [`generic_types.h`](https://github.com/perry280/generic_data_structures/blob/main/generic_types.h) (Callback contract), [`generic_vector/generic_vector.c`](https://github.com/perry280/generic_data_structures/blob/main/generic_vector/generic_vector.c) (Dynamic vector), [`generic_singly_linked_list/generic_singly_linked_list.c`](https://github.com/perry280/generic_data_structures/blob/main/generic_singly_linked_list/generic_singly_linked_list.c) (Singly linked list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_containers["Generic containers"]
  node_vector["Dynamic vector<br/>[generic_vector.c]"]
  node_list["Singly linked list"]
  node_hashmap["Hash map<br/>[generic_hashmap.c]"]
end

subgraph group_shared["Shared utilities"]
  node_callbacks["Callback contract<br/>[generic_types.h]"]
  node_hashing["FNV-1a hashing<br/>[hash.c]"]
end

node_caller(("Library caller"))

node_caller -.->|"uses API"| node_vector
node_caller -.->|"uses API"| node_list
node_caller -.->|"uses API"| node_hashmap
node_vector -->|"uses callbacks"| node_callbacks
node_list -->|"uses callbacks"| node_callbacks
node_hashmap -->|"uses callbacks"| node_callbacks
node_hashmap -->|"hashes keys"| node_hashing

click node_vector "https://github.com/perry280/generic_data_structures/blob/main/generic_vector/generic_vector.c"
click node_list "https://github.com/perry280/generic_data_structures/blob/main/generic_singly_linked_list/generic_singly_linked_list.c"
click node_hashmap "https://github.com/perry280/generic_data_structures/blob/main/generic_hashmap/generic_hashmap.c"
click node_callbacks "https://github.com/perry280/generic_data_structures/blob/main/generic_types.h"
click node_hashing "https://github.com/perry280/generic_data_structures/blob/main/generic_hashmap/hash.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_vector,node_list,node_hashmap toneBlue
class node_callbacks,node_hashing toneAmber
class node_caller toneIndigo
```

## Components

### Generic containers

- [Dynamic vector](https://github.com/perry280/generic_data_structures/blob/main/generic_vector/generic_vector.c): `generic_vector/generic_vector.c`
- [Singly linked list](https://github.com/perry280/generic_data_structures/blob/main/generic_singly_linked_list/generic_singly_linked_list.c): `generic_singly_linked_list/generic_singly_linked_list.c`
- [Hash map](https://github.com/perry280/generic_data_structures/blob/main/generic_hashmap/generic_hashmap.c): `generic_hashmap/generic_hashmap.c`

### Shared utilities

- [Callback contract](https://github.com/perry280/generic_data_structures/blob/main/generic_types.h): `generic_types.h`
- [FNV-1a hashing](https://github.com/perry280/generic_data_structures/blob/main/generic_hashmap/hash.c): `generic_hashmap/hash.c`

### Other components

- **Library caller**

## Connections

- Library caller → Dynamic vector: uses API
- Library caller → Singly linked list: uses API
- Library caller → Hash map: uses API
- Dynamic vector → Callback contract: uses callbacks
- Singly linked list → Callback contract: uses callbacks
- Hash map → Callback contract: uses callbacks
- Hash map → FNV-1a hashing: hashes keys (evidence: `generic_hashmap/generic_hashmap.c`)
