code wiki / (root) / nx_swcompare_hub.nx

nx_swcompare_hub.nx

buildroot/runtime/nx_swcompare_hub.nx

22856 B274 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic swcompare
docsdependenciesstructsconstsfunctions

about

nx_swcompare_hub.nx -- GENERATOR for the /compare hub. Reads knowledge/compare/registry (data, one line per comparison: title|kind|href|radar-href-or-dash|stat) and emits the SoftwareCompare landing HTML. This RETIRES the hand-authored hub -> the surface is self-assembling: a workstream that ships a comparison just appends a registry line + reruns this. Kills the multi-session hub-clobber problem (the registry is the SSOT; the hub is always regenerated from it). Modes: no-arg = console + liar-kill (gate); "html" = emit /compare/index.html. NOTE: no '#'/'!' in string literals (nx_cc trap) -> rgb() + emit '!' byte. license_tier: ORIGINAL expect_exit:0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_swcompare_hub.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main streq sys_mmap c_read sys_openat_rd sys_read sys_close w2 wc sys_mmap ↻ sys_write wn w sys_write ↻ sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real w ↻ wc ↻ split5 sys_exit

structs

none

consts

8const K_MAGIC_65536: i64 = 65536
9const K_MAGIC_4096: i64 = 4096
10const K_MAGIC_1024: i64 = 1024
11const K_MAGIC_1536: i64 = 1536
12const K_MAGIC_2048: i64 = 2048
13const K_MAGIC_20480: i64 = 20480
14const K_MAGIC_20479: i64 = 20479

functions

16func w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 5: wnkv_skv_nwrefmain calls 1: sys_write
17func wc(fd: i64, code: i64) -> i64 { let t: *u8 = sys_mmap(2); t[0] = code as u8; sys_write(fd, t, 1); return 0 }
called by 7: wjwqkv_skv_nw2wref+1 calls 2: sys_mmapsys_write
18func wn(fd: i64, v: i64) -> i64
called by 2: kv_nmain calls 3: wsys_mmapsys_write
24func 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 }
called by 1: main
25func c_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
32func split5(buf: *u8, ls: i64, le: i64, fbuf: *u8) -> i64
called by 1: main
43func scopy(dst: *u8, doff: i64, src: *u8) -> i64 { var i: i64 = 0; while src[i] != (0 as u8) { dst[doff+i] = src[i]; i = i + 1 } return doff + i }
called by 1: data_exists
44func c_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: data_exists calls 2: sys_openat_rdsys_close
45func wj(fd: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c == 34 { wc(fd, 92); wc(fd, 34) } else { if c == 92 { wc(fd, 92); wc(fd, 92) } else { if c < 32 { wc(fd, 32) } else { wc(fd, c) } } } i = i + 1 } return 0 }
called by 1: kv_s calls 1: wc
46func wq(fd: i64) -> i64 { wc(fd, 34); return 0 }
called by 2: kv_skv_n calls 1: wc
47func kv_s(fd: i64, key: *u8, val: *u8) -> i64 { wq(fd); w(fd, key); wq(fd); wc(fd, 58); wq(fd); wj(fd, val); wq(fd); return 0 }
calls 4: wqwwcwj
48func kv_n(fd: i64, key: *u8, v: i64) -> i64 { wq(fd); w(fd, key); wq(fd); wc(fd, 58); wn(fd, v); return 0 }
calls 4: wqwwcwn
49func dom_of(href: *u8, out: *u8) -> i64 { let pfx: *u8 = "/compare/" as *u8; var p: i64 = 0; while pfx[p] != (0 as u8) { if href[p] != pfx[p] { out[0] = 0 as u8; return 0 } p = p + 1 } var o: i64 = 0; while href[p] != (0 as u8) { if href[p] == (47 as u8) { break } out[o] = href[p]; o = o + 1; p = p + 1 } out[o] = 0 as u8; return o }
52func w2(fd: i64, s: *u8) -> i64
called by 2: wrefmain calls 1: wc
58func wref(fd: i64, nm: *u8) -> i64
calls 3: w2wcw
65func data_exists(dbuf: *u8, pbuf: *u8) -> i64
calls 2: scopyc_exists
72func main(argc: i64, argv: *i64) -> i64