Files
iKv/README.md
GigabiteStudios c614e0b8e0
All checks were successful
Build / linux-build-and-test (push) Successful in 46s
feat(core): split library layout and add tests
2026-06-14 21:19:16 -05:00

1.1 KiB

iKv

Standalone iKv C library.

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.