code wiki / _hdl_build / nx_kf8_gate.nx

nx_kf8_gate.nx

buildroot/runtime/_hdl_build/nx_kf8_gate.nx

5206 B73 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_kf8_gate.nx -- gate for KF8/AZW3 rung-1 text liberation on a REAL dual MOBI6+KF8 file (the libmobi sample, registered libmobi-sample-huffdic.ref). nx_kf8_book finds the KF8 part via EXTH 121 (boundary record 46), decodes its HUFF/CDIC text records (record refs RELATIVE to the boundary), html_to_text -> book.json -> .nmz. Asserts the KF8 part decodes to GENUINE readable prose (distinctive phrases) + EXTH metadata + the owned .nmz. HONEST: rung 1 = text extraction (the text is all there; minor inline SKEL/FRAG markers remain). Rung 2 = FDST/SKEL/FRAG reassembly for exact structure. Depends on the durable reference. expect_exit: 0 tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_kf8_gate.nx

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

main gp sys_write sys_mmap rd sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_exit spawn sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve sys_exit ↻ sys_wait4 gnum sys_write ↻ sys_mmap ↻ ghas

structs

none

consts

none

functions

9func gp(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 1: main calls 1: sys_write
10func gnum(v0: i64) -> i64 { var v: i64=v0; if v<0 { sys_write(1,"-" as *u8,1); v=0-v } let b: *u8=sys_mmap(24); var k: i64=0; if v==0 {b[0]=48 as u8;k=1} while v>0 {b[k]=(48+(v%10)) as u8; v=v/10; k=k+1} let o: *u8=sys_mmap(24); var j: i64=0; while j<k {o[j]=b[k-1-j];j=j+1} sys_write(1,o,k); return 0 }
called by 1: main calls 2: sys_writesys_mmap
11func ghas(hay: *u8, hl: i64, needle: *u8) -> i64
called by 1: main
18func rd(path: *u8, lenp: *i64) -> *u8 { lenp[0]=0; return sys_read_file(path, lenp) }
called by 1: main calls 1: sys_read_file
19func spawn(path: *u8, a0: *u8, a1: *u8, redir: *u8) -> i64
40func main() -> i64