code wiki / _hdl_build / nx_tpl_site.nx

nx_tpl_site.nx

buildroot/runtime/_hdl_build/nx_tpl_site.nx

14231 B345 linesdepth 5pulls 8 transitivereach 1 importersview sourcekind tooltopic tpl
docsdependenciesstructsconstsfunctions

about

nx_tpl_site.nx -- R-WHOLESITE of the SITE FACTORY: ingest a COMPLETE multi-page template/site as ONE site-graph pattern ("pass it along wholesale"). Walks a site directory (root + one subdir level), and for every page keeps the abstract structure (archetype + section sequence, via the R4 scanners) plus the NAV GRAPH (internal href edges between the site's own pages). The whole site collapses to ONE content-addressed `site:<hash>` record (canonical = byte-lex-sorted per-page arch\x1fseq lines + bucketed edge count) in the SAME tplcorpus store -- so the corpus now holds three granularities: section BRICKS (part:), page PATTERNS (pat:), and whole SITE GRAPHS (site:). Budget-guarded (max_pages trap), idempotent, structure-only. usage: nx_tpl_site <site-dir> <corpus-prefix> [max_pages] license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_tpl_ingest.nx nx_tpl_site.nx nx_tpl_site_gate.nx

imports: nx_tpl_ingest.nx

imported by: nx_tpl_site_gate.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ti_puts ti_len ti_atoi ts_ingest ts_collect sys_getdents64 dirent_type dirent_name dirent_reclen ti_suffix ti_len ↻ ti_lc ti_cat ti_puts ↻ ts_sort ti_cat ↻ ss_readall sys_openat_rd sys_lseek sys_mmap sys_read sys_close ti_classify ti_has ti_find_ci ti_len ↻ ti_lc ↻ ti_count_ci ti_len ↻ ti_lc ↻ ti_seq ti_find_ci ↻ ti_cta_off ti_find_ci ↻ ti_cat ↻ ts_edges ti_find_ci ↻ ts_page_idx ts_nameeq

structs

none

consts

11const TS_MAGIC_131072: i64 = 131072
12const TS_MAGIC_1024: i64 = 1024
14const TS_MAXPG: i64 = 64
15const TS_NAMEW: i64 = 96
16const TS_SEQW: i64 = 200
17const TS_RECCAP: i64 = 8192
18const TS_MAXE: i64 = 96

functions

21func ts_collect(dir: *u8, names: *u8, maxn: i64) -> i64
99func ts_sort(names: *u8, n: i64) -> i64
called by 1: ts_ingest
133func ts_nameeq(a: *u8, b: *u8) -> i64 { var i: i64=0; while 1==1 { if (a[i] as i64)!=(b[i] as i64) { return 0 } if a[i]==(0 as u8) { return 1 } i=i+1 } return 1 }
called by 1: ts_page_idx
135func ts_page_idx(t: *u8, names: *u8, npg: i64) -> i64
called by 1: ts_edges calls 1: ts_nameeq
141func ts_edges(h: *u8, n: i64, from: i64, names: *u8, npg: i64, ef: *i64, et: *i64, ecnt: *i64) -> i64
called by 1: ts_ingest calls 2: ti_find_cits_page_idx
189func tp_bucket_site(v: i64) -> i64
called by 1: ts_ingest
197func ts_ingest(dir: *u8, prefix: *u8, max_pages: i64, counts: *i64, keyout: *u8) -> i64
325func main(argc: i64, argv: *i64) -> i64