code wiki / _hdl_build / nx_office_gate.nx

nx_office_gate.nx source

↩ module page · 17 lines · 932 B

1// nx_office_gate.nx -- the OFFLINE gate for Nishi Office v1 (consumes the pure core nx_office_serve, no sockets). 2// Runs the full selftest against a FRESH throwaway root (/tmp, unique by now_us): create doc/sheet/deck through 3// of_handle with real HTTP request bytes, prove additive versioning (v1 bytes untouched after v2), byte-identical 4// downloads, computed spreadsheet formulas in the preview, and LOUD refusals (bad name / kind flip / missing 5// version / cross-origin POST). GREEN = exit 0. Runs the REAL format organs (_offc/nx_docx|nx_xlsx|nx_pptx.elf) 6// via fork+exec, so it must run from the nxc2 root. license_tier: ORIGINAL expect_exit: 0 7import "nx_office_serve.nx" 8 9func main() -> i64 { 10 let root: *u8 = sys_mmap(128) 11 var o: i64 = of_cat(root, 0, "/tmp/officegate_" as *u8) 12 o = of_catn(root, o, sys_now_us()) 13 root[o] = 0 as u8 14 let rc: i64 = of_selftest(root) 15 sys_exit(rc) 16 return rc 17}