code wiki / _hdl_build / nx_book_links_gate.nx
nx_book_links_gate.nx
buildroot/runtime/_hdl_build/nx_book_links_gate.nx
about
nx_book_links_gate.nx -- liar-kill gate for ISSUE-3 server side: nx_epub_book must (1) EMIT in-book <a href>
as inline link markers (STX 0x02 url SOH 0x01 text ETX 0x03) the reader renders as clickable <a>, (2) expose
each chapter's source basename as chapters[].src so the reader resolves an internal href -> chapter idx, and
(3) keep capturing footnotes (chapters[].fn[]). Builds a real EPUB w/ an external link, an internal link, and a
footnote; runs the REAL nx_epub_book (self-rebuilt); asserts the emitted bytes + JSON. expect_exit: 0 license_tier: ORIGINAL
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
| 9 | func tg_p(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 tg_n(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 tg_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: hassub |
| 12 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: main |
| 13 | func hassub(buf: *u8, n: i64, needle: *u8) -> i64 |
| 19 | func has1(buf: *u8, n: i64, a: i64) -> i64 { var i: i64=0; while i < n { if (buf[i]&0xff)==a { return 1 } i=i+1 } return 0 } |
| 20 | func run2(path: *u8, a0: *u8, a1: *u8, redir: *u8) -> i64 |
| 34 | func chk(label: *u8, cond: i64, pf: *i64) -> i64 |
| 40 | func main() -> i64 |