# spaceinventor/libparam architecture

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

- Interactive diagram: https://gitdiagram.com/spaceinventor/libparam
- Repository: https://github.com/spaceinventor/libparam
- Video tour (about a minute): https://gitdiagram.com/spaceinventor/libparam/video

## Overview

This is a C library for defining, querying, serializing, and remotely exchanging parameters, alongside a virtual-memory abstraction with local storage backends and network access. A typical collection workflow periodically polls configured remote nodes, while the parameter list tracks definitions and remote metadata. VMEM provides address-based reads and writes over registered regions, including block-device caching. The excerpts establish only a few cross-module calls; other subsystem connections are left out rather than inferred from names or co-location.

Main entry points: [`src/param/collector/param_collector.c`](https://github.com/spaceinventor/libparam/blob/develop/src/param/collector/param_collector.c) (Polling collector), [`src/vmem/vmem.c`](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem.c) (VMEM access), [`src/param/list/param_list_store_vmem.c`](https://github.com/spaceinventor/libparam/blob/develop/src/param/list/param_list_store_vmem.c) (VMEM list store), [`src/vmem/vmem_server.c`](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_server.c) (VMEM server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_param["Parameter management"]
  node_param_core["Parameter core<br/>[param.c]"]
  node_param_list["Parameter registry<br/>[param_list.c]"]
  node_param_client["Remote client<br/>[param_client.c]"]
  node_param_server["Remote server<br/>[param_server.c]"]
  node_param_collector["Polling collector<br/>[param_collector.c]"]
  node_collector_config["Collector config"]
  node_param_queue["Parameter queue<br/>[param_queue.c]"]
  node_param_serializer["Parameter serializer<br/>[param_serializer.c]"]
  node_param_string["Parameter strings<br/>[param_string.c]"]
  node_param_wildcard["Wildcard matching<br/>[param_wildcard.c]"]
  node_param_store["VMEM list store"]
end

subgraph group_vmem["Virtual memory"]
  node_vmem_core["VMEM access<br/>[vmem.c]"]
  node_vmem_client["VMEM client<br/>[vmem_client.c]"]
  node_vmem_server["VMEM server<br/>[vmem_server.c]"]
  node_vmem_block["Block access<br/>[vmem_block.c]"]
  node_vmem_file["File backend<br/>[vmem_file.c]"]
  node_vmem_ram["RAM backend<br/>[vmem_ram.h]"]
  node_vmem_fram["FRAM backend<br/>[vmem_fram.c]"]
  node_vmem_fram_cache["FRAM cache<br/>[vmem_fram_cache.c]"]
  node_vmem_mmap["Mapped backend<br/>[vmem_mmap.c]"]
  node_vmem_crc["VMEM checksum<br/>[vmem_crc32.c]"]
end

subgraph group_codec["MessagePack codec"]
  node_mpack["MessagePack API<br/>[mpack.c]"]
end

node_user(("Application"))

node_user -->|"starts polling"| node_param_collector
node_param_collector -->|"initializes config"| node_collector_config
node_param_collector -->|"pulls remote params"| node_param_client
node_param_store -->|"loads and saves"| node_param_list
node_param_store -->|"copies stored bytes"| node_vmem_core
node_vmem_server -->|"iterates regions"| node_vmem_core
node_vmem_server -->|"serves parameter list"| node_param_list
node_vmem_block -->|"reads and writes device blocks"| node_vmem_block
node_param_core -.->|"uses VMEM internals"| node_vmem_core

click node_param_core "https://github.com/spaceinventor/libparam/blob/develop/src/param/param.c"
click node_param_list "https://github.com/spaceinventor/libparam/blob/develop/src/param/list/param_list.c"
click node_param_client "https://github.com/spaceinventor/libparam/blob/develop/src/param/param_client.c"
click node_param_server "https://github.com/spaceinventor/libparam/blob/develop/src/param/param_server.c"
click node_param_collector "https://github.com/spaceinventor/libparam/blob/develop/src/param/collector/param_collector.c"
click node_collector_config "https://github.com/spaceinventor/libparam/blob/develop/src/param/collector/param_collector_config.c"
click node_param_queue "https://github.com/spaceinventor/libparam/blob/develop/src/param/param_queue.c"
click node_param_serializer "https://github.com/spaceinventor/libparam/blob/develop/src/param/param_serializer.c"
click node_param_string "https://github.com/spaceinventor/libparam/blob/develop/src/param/param_string.c"
click node_param_wildcard "https://github.com/spaceinventor/libparam/blob/develop/src/param/param_wildcard.c"
click node_param_store "https://github.com/spaceinventor/libparam/blob/develop/src/param/list/param_list_store_vmem.c"
click node_vmem_core "https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem.c"
click node_vmem_client "https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_client.c"
click node_vmem_server "https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_server.c"
click node_vmem_block "https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_block.c"
click node_vmem_file "https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_file.c"
click node_vmem_ram "https://github.com/spaceinventor/libparam/blob/develop/include/vmem/vmem_ram.h"
click node_vmem_fram "https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_fram.c"
click node_vmem_fram_cache "https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_fram_cache.c"
click node_vmem_mmap "https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_mmap.c"
click node_vmem_crc "https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_crc32.c"
click node_mpack "https://github.com/spaceinventor/libparam/blob/develop/src/mpack/mpack.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_param_core,node_param_list,node_param_client,node_param_server,node_param_collector,node_collector_config,node_param_queue,node_param_serializer,node_param_string,node_param_wildcard,node_param_store toneBlue
class node_vmem_core,node_vmem_client,node_vmem_server,node_vmem_block,node_vmem_file,node_vmem_ram,node_vmem_fram,node_vmem_fram_cache,node_vmem_mmap,node_vmem_crc toneAmber
class node_mpack toneMint
class node_user toneIndigo
```

## Components

### Parameter management

- [Parameter core](https://github.com/spaceinventor/libparam/blob/develop/src/param/param.c): `src/param/param.c`
- [Parameter registry](https://github.com/spaceinventor/libparam/blob/develop/src/param/list/param_list.c): `src/param/list/param_list.c`
- [Remote client](https://github.com/spaceinventor/libparam/blob/develop/src/param/param_client.c): `src/param/param_client.c`
- [Remote server](https://github.com/spaceinventor/libparam/blob/develop/src/param/param_server.c): `src/param/param_server.c`
- [Polling collector](https://github.com/spaceinventor/libparam/blob/develop/src/param/collector/param_collector.c): `src/param/collector/param_collector.c`
- [Collector config](https://github.com/spaceinventor/libparam/blob/develop/src/param/collector/param_collector_config.c): `src/param/collector/param_collector_config.c`
- [Parameter queue](https://github.com/spaceinventor/libparam/blob/develop/src/param/param_queue.c): `src/param/param_queue.c`
- [Parameter serializer](https://github.com/spaceinventor/libparam/blob/develop/src/param/param_serializer.c): `src/param/param_serializer.c`
- [Parameter strings](https://github.com/spaceinventor/libparam/blob/develop/src/param/param_string.c): `src/param/param_string.c`
- [Wildcard matching](https://github.com/spaceinventor/libparam/blob/develop/src/param/param_wildcard.c): `src/param/param_wildcard.c`
- [VMEM list store](https://github.com/spaceinventor/libparam/blob/develop/src/param/list/param_list_store_vmem.c): `src/param/list/param_list_store_vmem.c`

### Virtual memory

- [VMEM access](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem.c): `src/vmem/vmem.c`
- [VMEM client](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_client.c): `src/vmem/vmem_client.c`
- [VMEM server](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_server.c): `src/vmem/vmem_server.c`
- [Block access](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_block.c): `src/vmem/vmem_block.c`
- [File backend](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_file.c): `src/vmem/vmem_file.c`
- [RAM backend](https://github.com/spaceinventor/libparam/blob/develop/include/vmem/vmem_ram.h): `include/vmem/vmem_ram.h`
- [FRAM backend](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_fram.c): `src/vmem/vmem_fram.c`
- [FRAM cache](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_fram_cache.c): `src/vmem/vmem_fram_cache.c`
- [Mapped backend](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_mmap.c): `src/vmem/vmem_mmap.c`
- [VMEM checksum](https://github.com/spaceinventor/libparam/blob/develop/src/vmem/vmem_crc32.c): `src/vmem/vmem_crc32.c`

### MessagePack codec

- [MessagePack API](https://github.com/spaceinventor/libparam/blob/develop/src/mpack/mpack.c): `src/mpack/mpack.c`

### Other components

- **Application**

## Connections

- Application → Polling collector: starts polling (evidence: `src/param/collector/param_collector.c`)
- Polling collector → Collector config: initializes config (evidence: `src/param/collector/param_collector.c`)
- Polling collector → Remote client: pulls remote params (evidence: `src/param/collector/param_collector.c`)
- VMEM list store → Parameter registry: loads and saves (evidence: `src/param/list/param_list_store_vmem.c`)
- VMEM list store → VMEM access: copies stored bytes (evidence: `src/param/list/param_list_store_vmem.c`)
- VMEM server → VMEM access: iterates regions (evidence: `src/vmem/vmem_server.c`)
- VMEM server → Parameter registry: serves parameter list (evidence: `src/vmem/vmem_server.c`)
- Block access → Block access: reads and writes device blocks (evidence: `src/vmem/vmem_block.c`)
- Parameter core → VMEM access: uses VMEM internals
