code wiki / _hdl_build / nx_epub_fixture_build.nx
nx_epub_fixture_build.nx
buildroot/runtime/_hdl_build/nx_epub_fixture_build.nx
about
nx_epub_fixture_build.nx -- build a deterministic, real-format EPUB fixture via the sovereign OPC zip writer
(opc_write, STORED + real CRC-32s). The personal NAS library isn't always mounted and a public fetch can fail;
this gives the reader rungs (R-TOC nav-doc parse + R-ART artwork extract) a controlled REAL EPUB to verify
against end-to-end (rule 7), with KNOWN expected values for the liar-kill gates.
Structure exercises every path: manifest item properties="nav" (EPUB3 nav location) + an NCX (EPUB2 fallback) +
a nested TOC (Part Two > 2.1 / Chapter Three) + a cover declared BOTH ways (<meta name=cover> AND
properties="cover-image") + an inline <img> in ch2 (embedded illustration). Image bytes are distinctive
placeholders (extraction/CID is byte-exact regardless; real PNGs come from real books).
expect_exit: 0 license_tier: ORIGINAL (prose = public-domain Alice in Wonderland)
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_opc.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
| none |
functions
| 13 | func fb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: fb_p |
| 14 | func fb_p(s: *u8) -> i64 { sys_write(1, s, fb_slen(s)); return 0 } |
| 15 | func fb_n(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); 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; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 16 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: main |
| 18 | func main() -> i64 |