code wiki / _hdl_build / nx_ad_emitter_registry.nx
nx_ad_emitter_registry.nx
buildroot/runtime/_hdl_build/nx_ad_emitter_registry.nx
about
nx_ad_emitter_registry.nx -- LIB: the BUILDER'S LEARNED CATALOG. Every emitter we build (an accent, an
animation, a theme, a size) is TAUGHT to the builder by registering it here as DATA; the builder reads the
catalog to offer those emitters, and a GROW loop (nx_ad_emitter_grow) generates new ones and registers them
-- so the builder keeps growing its own emitters (the emitter-of-emitters loop, in the ad domain).
Data-driven (rule 11), append-only + idempotent (rule 10/13). One row per emitter:
kind<TAB>id<TAB>label<TAB>template kind in {size, theme, accent, animation}.
`template` = the DATA to emit that block (SVG for an accent, a CSS @keyframes+rule for an animation,
pipe-joined colors for a theme, WxH for a size). SAFETY (enforced by the gate): a registered template may
NEVER contain a <script or src= -> the growing library stays sovereign (0 third-party JS / 0 external fetch)
BY CONSTRUCTION. Functions take a `path` so they are hermetically testable; ER_PATH is the live catalog.
(TSV registry for inspectability now; seg-store migration = the doctrine follow-on.) license_tier: ORIGINAL
dependencies 1 imports · 5 importers
imports: nx_syscalls.nx
imported by: nx_ad_emitter_apply.nxnx_ad_emitter_apply_gate.nxnx_ad_emitter_grow.nxnx_ad_emitter_registry_gate.nxnx_ad_nb_fold_gate.nx
structs
| none |
consts
| 15 | const ER_PATH: *u8 = "knowledge/registry/ad_emitters.tsv" |
| 16 | const ER_MAXTPL: i64 = 2048 |
functions
| 18 | func er_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 } |
| 21 | func er_field(line: *u8, linelen: i64, idx: i64, out: *u8) -> i64 |
| 30 | func er_present(path: *u8, kind: *u8, id: *u8) -> i64 |
| 50 | func er_register(path: *u8, kind: *u8, id: *u8, label: *u8, template: *u8) -> i64 |
| 64 | func er_count(path: *u8, kind: *u8) -> i64 |
| 79 | func er_get(path: *u8, kind: *u8, idx: i64, out_id: *u8, out_label: *u8, out_template: *u8) -> i64 |
| 102 | func er_lookup(path: *u8, kind: *u8, id: *u8, out_template: *u8) -> i64 |
| 122 | func er_template_safe(template: *u8) -> i64 called by 1: main |