Documentation
¶
Overview ¶
Extracts every SQLCipher codec hook block from ../sqlcipher/src and writes docs/btree/mappings/sqlcipher_codec_blocks.gen.json so mappings_diff can surface any block that has no corresponding row in the hand-edited sqlcipher_codec.json.
A "codec block" is a preprocessor block guarded on SQLITE_HAS_CODEC:
#if defined(SQLITE_HAS_CODEC) | #ifdef SQLITE_HAS_CODEC | #if SQLITE_HAS_CODEC ... body ... #endif
Block boundaries are file:start-end where start = the `#if[def]` line and end = the matching `#endif` line, inclusive. Nested `#if` directives inside the body are tracked so the outermost matching `#endif` closes the block.
Each emitted record also carries a heuristic `context` (the enclosing top-level function name when the block falls inside one, otherwise "(file scope)") so downstream tools and human reviewers can locate the block at a glance without re-reading the source.
Run from the repo root:
go run ./docs/btree/mappings/scripts/extract_codec_blocks \
-src ../sqlcipher/src \
-out docs/btree/mappings/sqlcipher_codec_blocks.gen.json