code wiki / _hdl_build / nx_mobi_book_gate.nx
nx_mobi_book_gate.nx
buildroot/runtime/_hdl_build/nx_mobi_book_gate.nx
about
nx_mobi_book_gate.nx -- liar-kill gate for the sovereign MOBI/AZW reader. Builds the DRM-free fixture +
a DRM-flagged variant, then asserts:
DECODE : a DRM-FREE MOBI -> book.json (title+author from EXTH, format=mobi) + chap0.txt (PalmDOC-decompressed
real prose) -- i.e. a purchased book LIBERATED from the lock-in container into the Nishi format.
DECLINE: a DRM-flagged MOBI -> exit 2 (detected + DECLINED, NOT circumvented -- the legal line).
GREEN = we read DRM-free Kindle books on our own device, and refuse DRM rather than break it. expect_exit: 0
dependencies 1 imports · 0 importers
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
structs
| none |
consts
| none |
functions
| 9 | func xp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 10 | func xn(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 } |
| 11 | func xslen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: xfind |
| 13 | func spawn(path: *u8, a0: *u8, a1: *u8, redir: *u8) -> i64 |
| 34 | func xfind(hay: *u8, hl: i64, needle: *u8) -> i64 |
| 40 | func xhas(hay: *u8, hl: i64, needle: *u8) -> i64 { if xfind(hay, hl, needle) >= 0 { return 1 } return 0 } |
| 42 | func main() -> i64 |