code wiki / _hdl_build / nx_epub_fixture_build.nx

nx_epub_fixture_build.nx

buildroot/runtime/_hdl_build/nx_epub_fixture_build.nx

9230 B51 linesdepth 7pulls 10 transitivereach 0 importersview sourcekind tooltopic epub
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_opc.nx nx_epub_fixture_build.nx

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

main ensure_dir sys_mmap

structs

none

consts

none

functions

13func 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
14func fb_p(s: *u8) -> i64 { sys_write(1, s, fb_slen(s)); return 0 }
15func 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 }
16func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
called by 1: main
18func main() -> i64