nx_swcompare_hub.nx
buildroot/runtime/nx_swcompare_hub.nx
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
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
structs
| none |
consts
| 8 | const K_MAGIC_65536: i64 = 65536 |
| 9 | const K_MAGIC_4096: i64 = 4096 |
| 10 | const K_MAGIC_1024: i64 = 1024 |
| 11 | const K_MAGIC_1536: i64 = 1536 |
| 12 | const K_MAGIC_2048: i64 = 2048 |
| 13 | const K_MAGIC_20480: i64 = 20480 |
| 14 | const K_MAGIC_20479: i64 = 20479 |
functions
| 16 | func 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 } |
| 17 | func wc(fd: i64, code: i64) -> i64 { let t: *u8 = sys_mmap(2); t[0] = code as u8; sys_write(fd, t, 1); return 0 } |
| 18 | func wn(fd: i64, v: i64) -> i64 |
| 24 | func 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 |
| 25 | func c_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 32 | func split5(buf: *u8, ls: i64, le: i64, fbuf: *u8) -> i64 called by 1: main |
| 43 | func 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 |
| 44 | func c_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 45 | func 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 } |
| 46 | func wq(fd: i64) -> i64 { wc(fd, 34); return 0 } |
| 47 | func 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 } |
| 48 | func kv_n(fd: i64, key: *u8, v: i64) -> i64 { wq(fd); w(fd, key); wq(fd); wc(fd, 58); wn(fd, v); return 0 } |
| 49 | func 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 } |
| 52 | func w2(fd: i64, s: *u8) -> i64 |
| 58 | func wref(fd: i64, nm: *u8) -> i64 |
| 65 | func data_exists(dbuf: *u8, pbuf: *u8) -> i64 |
| 72 | func main(argc: i64, argv: *i64) -> i64 |