code wiki / _hdl_build / nx_nmz.nx

nx_nmz.nx

buildroot/runtime/_hdl_build/nx_nmz.nx

4679 B89 linesdepth 7pulls 7 transitivereach 0 importersview sourcekind orphan librarytopic nmz
docsdependenciesstructsconstsfunctions

about

⚠ SUPERSEDED 2026-06-22 -- nmz_emit/nmz_get here were extracted to the shared substrate sibling nx_canon_bin (canon_encode_bin/canon_get_bin), so nx_nmz_pack + nx_nmz_gate now import nx_canon_bin directly (DRY). Nothing imports nx_nmz anymore; kept as the .nmz FORMAT SPEC reference only. The .nmz format = a binary-safe NXR1 record (nx_canon_bin) carrying @kind + entry bytes, content-addressed by nx_uxf_cid.uxf_cid_profiled(UXF_ARCHIVE). nx_nmz.nx -- the NISHI MEDIA container (.nmz): the OMNI media format, built ON the existing sovereign storage substrate (NOT a new format -- audit 2026-06-22, operator: ".nbk is a BOOK format, the omni one would be like .nmz"). A .nmz is a BINARY-SAFE nx_canon_cid NXR1 canonical record (magic "NXR1" | u32be nfields | per field, KEY-SORTED: u32be klen | key | u32be vlen | value) carrying: "@kind" -> book | comic | audio | video | album (the media KIND; codecs specialize, container unifies) "<entry-name>" -> raw bytes (book.json, chap0.txt, cover.png, track.opus, ...) Content address = nx_uxf_cid.uxf_cid_profiled(UXF_ARCHIVE, bytes) = "nxc1-05-"+sha256(codec||canon) (REUSED, the sovereign substrate's sha256 multicodec CID -- NOT a new djb2). ".nbk" = a .nmz with @kind=book (an extension alias, same format). The ONLY new code here is BINARY-SAFE NXR1 emit/get (canon_encode is strlen/string-only, so it can't hold image/audio bytes); same format, candidate to fold back into nx_canon_cid as canon_encode_bin. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_uxf_cid.nx nx_nmz.nx

imports: nx_syscalls.nxnx_uxf_cid.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

20func nmz_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: nmz_emitnmz_get
21func nmz_w32(p: *u8, o: i64, v: i64) -> i64 { p[o]=((v>>24)&0xff) as u8; p[o+1]=((v>>16)&0xff) as u8; p[o+2]=((v>>8)&0xff) as u8; p[o+3]=(v&0xff) as u8; return o+4 }
called by 1: nmz_emit
22func nmz_be32(b: *u8, o: i64) -> i64 { return ((b[o] as i64)<<24)|((b[o+1] as i64)<<16)|((b[o+2] as i64)<<8)|(b[o+3] as i64) }
called by 1: nmz_get
24func nmz_cmp(a: *u8, b: *u8) -> i64
called by 1: nmz_emit
32func nmz_emit(out: *u8, keys: *i64, vals: *i64, vlens: *i64, count: i64) -> i64
66func nmz_get(m: *u8, n: i64, key: *u8, out: *u8, cap: i64) -> i64