code wiki / _hdl_build / nx_nmz_index.nx
nx_nmz_index.nx
buildroot/runtime/_hdl_build/nx_nmz_index.nx
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
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
structs
| none |
consts
| 11 | const K_MAGIC_65536: i64 = 65536 |
| 12 | const K_MAGIC_1024: i64 = 1024 |
| 13 | const K_MAGIC_16384: i64 = 16384 |
functions
| 15 | func ix_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 16 | func ix_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, ix_slen(s)); return 0 } |
| 17 | func ix_p(s: *u8) -> i64 { ix_w(1, s); return 0 } |
| 18 | func 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 } |
| 19 | func ix_pn(v: i64) -> i64 { ix_wn(1, v); return 0 } |
| 20 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } |
| 21 | func 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 |
| 22 | func wjson(fd: i64, s: *u8, n: i64) -> i64 |
| 28 | func man_title(m: *u8, n: i64, out: *u8, cap: i64) -> i64 |
| 39 | func main() -> i64 |