Files
iKv/README.md
GigabiteStudios f1a1c9f1ae
All checks were successful
Build / build-script (push) Successful in 10s
Build / cmake-build (push) Successful in 25s
Build / unit-tests (push) Successful in 24s
chore(repo): remove obsolete windows build helper
2026-06-14 22:39:58 -05:00

1.2 KiB

iKv

Standalone iKv C library.

Build:

  • CMake: cmake -S . -B build && cmake --build build
  • Scripted local build on Linux runners: ./demo/build.sh

Layout:

  • include/ikv.h: public API only.
  • src/ikv.c: shared implementation and loader dispatch.
  • src/loaders/ikv1.c: iKv1 loader.
  • src/loaders/ikv2.c: iKv2 loader.
  • src/internal/ikv_internal.h: private node layout and loader interface.

Behavior:

  • The generic parse APIs auto-detect iKv1 vs iKv2 and choose the correct loader.
  • The generic write APIs emit the current format version, which is iKv2.
  • Public callers do not depend on loader-specific headers or internal structs.
  • iKv2 binary files now use an indexed root layout with a key table and payload offsets.
  • Parsing an iKv2 binary file reads the root index first and loads individual top-level values on demand.
  • iKv1 binary files still use the legacy full-tree format for compatibility.

Adding a new version:

  1. Add src/loaders/ikv3.h and src/loaders/ikv3.c exporting an ikv_loader_t.
  2. Implement that loader using the shared internal helpers or custom logic.
  3. Register the loader in src/ikv.c.
  4. Add the new version constant to include/ikv.h if it is part of the public API.