code wiki / _hdl_build / nx_cms_store.nx

nx_cms_store.nx

buildroot/runtime/_hdl_build/nx_cms_store.nx

6857 B166 linesdepth 2pulls 2 transitivereach 41 importersview sourcekind librarytopic cms
docsdependenciesstructsconstsfunctions

about

nx_cms_store.nx -- CMS ladder step 10a: the per-site CONTENT STORE (content as DATA, the WordPress content/theme split, sovereign). Record format, line-based and auditable by eye: @key\n value bytes (may span lines)\n @nextkey\n ... A value runs from after its key line to the byte before the next '@'-at-line-start (its trailing newline excluded). Keys ending in _html hold SANITIZED rich text (nx_html_sanitize on write); everything else is plain text, escaped at render. Writes are ATOMIC (temp + sys_renameat) and ADDITIVE (rule 13): the prior store is kept at <path>.prev before every swap = one-deep revision, rollback = swap back. license_tier: ORIGINAL

dependencies 1 imports · 22 importers

nx_syscalls.nx nx_cms_store.nx nx_cms_analytics_gate.nx nx_cms_api.nx nx_cms_api_gate.nx nx_cms_argon_gate.nx nx_cms_blocks_gate.nx nx_cms_booking.nx nx_cms_comments_gate.nx nx_cms_draft_gate.nx nx_cms_forms_gate.nx nx_cms_gate.nx

diagram shows first 10 each side; +0 more imports, +12 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_cms_analytics_gate.nxnx_cms_api.nxnx_cms_api_gate.nxnx_cms_argon_gate.nxnx_cms_blocks_gate.nxnx_cms_booking.nxnx_cms_comments_gate.nxnx_cms_draft_gate.nxnx_cms_forms_gate.nxnx_cms_gate.nxnx_cms_i18n.nxnx_cms_i18n_gate.nxnx_cms_migrate.nxnx_cms_migrate_gate.nxnx_cms_multisite_gate.nxnx_cms_render.nxnx_cms_schedule_gate.nxnx_cms_seo_gate.nxnx_cms_snapshot_gate.nxnx_cms_tls_gate.nxnx_cms_webdev_gate.nxnx_sitegen_game.nx

structs

none

consts

12const K_MAGIC_65536: i64 = 65536

functions

14func cst_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
17func cst_find(buf: *u8, n: i64, key: *u8, vs: *i64) -> i64
called by 3: maincst_getcst_set calls 1: cst_slen
60func cst_get(buf: *u8, n: i64, key: *u8, out: *u8, cap: i64) -> i64
72func cst_set(buf: *u8, n: i64, key: *u8, val: *u8, vl: i64, out: *u8, cap: i64) -> i64
102func cst_read(path: *u8, out: *u8, cap: i64) -> i64
117func cst_copy(src: *u8, dst: *u8) -> i64
134func cst_write_atomic(path: *u8, buf: *u8, n: i64) -> i64
152func cst_rollback(path: *u8) -> i64