code wiki / _hdl_build / nx_nmz_index.nx

nx_nmz_index.nx

buildroot/runtime/_hdl_build/nx_nmz_index.nx

7018 B102 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind tooltopic nmz
docsdependenciesstructsconstsfunctions

about

nx_nmz_index.nx -- the CONTENT-ADDRESSED CATALOGUE of all liberated media. The convergence capstone of the format-liberation arc: every lock-in format (EPUB/MOBI/HUFF/KF8/FB2/CBZ/MP3/M4B) was migrated into the owned .nmz; this enumerates every .nmz under knowledge/staging/media/nmz/ and emits a catalogue (nmz_index.json) with, per file: the sha256 content CID (uxf_cid_profiled, the substrate's address), the @kind (book/comic/audio), the title (from the packed manifest), and byte size. Content-addressing => dedup + provenance for free. Feeds the library workstream's nx_library (coordinate to register these CIDs as library objects); does NOT duplicate the substrate -- it reads via nx_canon_bin + nx_uxf_cid. Usage: nx_nmz_index. expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_canon_bin.nx nx_uxf_cid.nx nx_nmz_index.nx

imports: nx_syscalls.nxnx_canon_bin.nxnx_uxf_cid.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_openat_wr ix_p ix_w sys_write ix_slen sys_exit ix_w ↻ sys_mmap cat sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close uxf_cid_profiled sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word blk_byte sha256_final blk_set_byte ↻ sha256_compress ↻ uxf_nib_hex canon_get_bin cb_be32 cb_slen man_title ix_slen ↻ wjson

structs

none

consts

11const K_MAGIC_65536: i64 = 65536
12const K_MAGIC_1024: i64 = 1024
13const K_MAGIC_16384: i64 = 16384

functions

15func ix_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 3: ix_wman_titlemain
16func ix_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, ix_slen(s)); return 0 }
called by 2: ix_pmain calls 2: sys_writeix_slen
17func ix_p(s: *u8) -> i64 { ix_w(1, s); return 0 }
called by 1: main calls 1: ix_w
18func ix_wn(fd: i64, v0: i64) -> i64 { var v: i64=v0; if v<0 { sys_write(fd,"-" 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(fd,o,k); return 0 }
called by 2: ix_pnmain calls 2: sys_writesys_mmap
19func ix_pn(v: i64) -> i64 { ix_wn(1, v); return 0 }
called by 1: main calls 1: ix_wn
20func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
21func cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){d[o+i]=s[i];i=i+1} return o+i }
called by 1: main
22func wjson(fd: i64, s: *u8, n: i64) -> i64
called by 1: main calls 1: sys_write
28func man_title(m: *u8, n: i64, out: *u8, cap: i64) -> i64
called by 1: main calls 1: ix_slen
39func main() -> i64