code wiki / _hdl_build / nx_audio_render.nx
nx_audio_render.nx
buildroot/runtime/_hdl_build/nx_audio_render.nx
about
nx_audio_render.nx -- SOVEREIGN ZERO-JS audiobook player PAGE (rung 1 of SC33-37). Operator's correction: the
player features are NISHI CODE, not browser JS -- the player BRAIN is a server-side Nishi audio daemon
(nx_audio_serve, next rung) + our own DSP pre-rendering; the browser is a dumb NATIVE <audio> client. So
"browser runs ZERO code" holds (same doctrine as the zero-JS text reader). This emits the static player HTML from
reader/<slug>/audio.json: native <audio controls> (SC33 basic playback + the browsers' native speed menu) +
chapters + the daemon-API affordances (speed-variant / sleep-timer / bookmark links+forms that target the Nishi
daemon -- the "APIs" that do the work server-side). FAIL-CLOSED: scans its OWN bytes for <script and REFUSES to
emit any (sovereign zero-JS, like nx_reader_render). Usage: nx_audio_render <slug>. expect_exit: 0 ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.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
| 11 | const K_MAGIC_1024: i64 = 1024 |
| 12 | const K_MAGIC_65536: i64 = 65536 |
functions
| 14 | func ar_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 15 | func ar_p(s: *u8) -> i64 { sys_write(1, s, ar_slen(s)); return 0 } |
| 20 | func ar_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 21 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } |
| 22 | func cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+i } called by 1: main |
| 23 | func aw(o: *u8, p: *i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ o[p[0]]=s[i]; p[0]=p[0]+1; i=i+1 } return 0 } |
| 25 | func awh(o: *u8, p: *i64, s: *u8) -> i64 |
| 32 | func jfrom(hay: *u8, hl: i64, start: i64, needle: *u8) -> i64 |
| 39 | func jval(hay: *u8, hl: i64, key: *u8, out: *u8, cap: i64) -> i64 |
| 47 | func contains(hay: *u8, hl: i64, needle: *u8) -> i64 |
| 54 | func main(argc: i64, argv: *i64) -> i64 |