code wiki / _hdl_build / nx_m4b_fixture.nx

nx_m4b_fixture.nx

buildroot/runtime/_hdl_build/nx_m4b_fixture.nx

4170 B70 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_m4b_fixture.nx -- build a tiny sovereign DRM-free M4B (MP4/ISOBMFF audiobook) so the M4B->.nmz rung can be gated. MP4 = a tree of atoms (size:u32be + type:4 + payload). iTunes/audiobook metadata lives at moov/udta/meta/ilst/<©nam|©ART|©alb>/data (meta is a FULLBOX: 4 version/flags bytes before its children). Structure: ftyp + moov(udta(meta+vf(ilst(©nam,©ART,©alb)))) + mdat. expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_m4b_fixture.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 ensure_dir sys_mmap puts put32 emit_meta type4 puts ↻ put32 ↻ sys_openat_wr mf_p sys_write mf_slen sys_exit sys_write ↻ sys_close mf_n sys_mmap ↻ sys_write ↻

structs

none

consts

6const K_MAGIC_8192: i64 = 8192

functions

8func mf_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: mf_p
9func mf_p(s: *u8) -> i64 { sys_write(1, s, mf_slen(s)); return 0 }
called by 1: main calls 2: sys_writemf_slen
10func mf_n(v: i64) -> i64 { let b: *u8=sys_mmap(24); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(24); 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{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
11func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
called by 1: main
12func put32(m: *u8, o: i64, v: i64) -> i64 { m[o]=((v>>24)&0xff) as u8; m[o+1]=((v>>16)&0xff) as u8; m[o+2]=((v>>8)&0xff) as u8; m[o+3]=(v&0xff) as u8; return o+4 }
called by 2: emit_metamain
13func puts(m: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ m[o+i]=s[i]; i=i+1 } return o+i }
called by 2: emit_metamain
15func type4(m: *u8, o: i64, t: *u8) -> i64 { m[o]=t[0]; m[o+1]=t[1]; m[o+2]=t[2]; m[o+3]=t[3]; return o+4 }
called by 1: emit_meta
18func emit_meta(m: *u8, o0: i64, t: *u8, value: *u8) -> i64
called by 1: main calls 3: type4putsput32
33func main() -> i64