code wiki / _hdl_build / nx_nmz_pack.nx

nx_nmz_pack.nx

buildroot/runtime/_hdl_build/nx_nmz_pack.nx

6044 B119 linesdepth 7pulls 9 transitivereach 0 importersview sourcekind tooltopic nmz
docsdependenciesstructsconstsfunctions

about

nx_nmz_pack.nx -- pack a decoded book/media (reader/<slug>/) into the OMNI Nishi Media container <slug>.nmz, on the EXISTING sovereign substrate (NXR1 canonical record + nx_uxf_cid multicodec CID -- NOT a new format, the audit fix). @kind tags the media KIND (default "book" => the .nbk profile). EPUB + MOBI decoders both emit the same reader/<slug>/ layout, so this is the convergence point. Usage: nx_nmz_pack <slug> [kind]. expect_exit:0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_canon_bin.nx nx_uxf_cid.nx nx_nmz_pack.nx

imports: nx_syscalls.nxnx_itoa_lib.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_mmap cat sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close pk_p sys_write pk_slen sys_exit pk_slen ↻ jfrom pk_slen ↻ jstr add_file sys_mmap ↻ cat ↻ sys_read_file ↻ canon_encode_bin sys_mmap ↻ cb_cmp cb_w32 cb_slen 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

structs

none

consts

9const K_MAGIC_2048: i64 = 2048
10const K_MAGIC_1024: i64 = 1024
11const K_MAGIC_67108864: i64 = 67108864
38const ECAP: i64 = 1024

functions

13func pk_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 3: pk_pjfrommain
14func pk_p(s: *u8) -> i64 { sys_write(1, s, pk_slen(s)); return 0 }
called by 1: main calls 2: sys_writepk_slen
19func pk_n(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
20func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
called by 1: main
21func 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 2: add_filemain
23func jfrom(hay: *u8, hl: i64, start: i64, needle: *u8) -> i64
called by 1: main calls 1: pk_slen
29func jstr(hay: *u8, hl: i64, pos: i64, out: *u8, cap: i64) -> i64
called by 1: main
40func add_file(dir: *u8, name: *u8, keys: *i64, vals: *i64, vlens: *i64, idx: i64) -> i64
called by 1: main calls 3: sys_mmapcatsys_read_file
52func main(argc: i64, argv: *i64) -> i64