code wiki / _hdl_build / nx_route_gate.nx

nx_route_gate.nx

buildroot/runtime/_hdl_build/nx_route_gate.nx

4886 B77 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic route
docsdependenciesstructsconstsfunctions

about

nx_route_gate.nx -- exhaustive proof of S-class routing. QUALITATIVE: clean extensionless URLs resolve, every .html / trailing-slash collapses to ONE canonical URL (the /vn-vs-/vn.html mess fixed), assets served exact, traversal blocked, misses 404. QUANTITATIVE: the SAME one engine handles every path uniformly + the canonical round-trip holds for all (route(X)->serve, route(X.html)->301 X). license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_route.nx nx_syscalls.nx nx_route_gate.nx

imports: nx_route.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main w sys_write chk sys_mmap route r_dotdot r_cpy r_len r_cpyn r_ends r_len ↻ r_mem sys_mmap ↻ r_find r_len ↻ sys_mmap ↻ eq w ↻ wn w ↻ sys_mmap ↻ sys_write ↻ sys_mmap ↻ route ↻ eq ↻ wn ↻ sys_exit

structs

none

consts

12const MANIFEST: *u8 = "\n/index.html\n/vn.html\n/games.html\n/wiki/intro.html\n/style.css\n/vn_bg.png\n/blog/index.html\n" as *u8

functions

8func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: wnchkmain calls 1: sys_write
9func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 2: chkmain calls 3: wsys_mmapsys_write
10func eq(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 2: chkmain
15func chk(path: *u8, ec: i64, eo: *u8) -> i64
called by 1: main calls 5: sys_mmaprouteeqwwn
27func main(argc: i64, argv: *i64) -> i64