code wiki / _hdl_build / nx_nbk_pack.nx
nx_nbk_pack.nx
buildroot/runtime/_hdl_build/nx_nbk_pack.nx
about
nx_nbk_pack.nx -- migrate a decoded book (reader/<slug>/ : book.json + chap*.txt + assets + xray.json) INTO the
sovereign Nishi container <slug>.nbk. EPUB (nx_epub_book) and MOBI (nx_mobi_book) both emit that same reader/<slug>/
layout, so this is the single convergence point: any lock-in format -> one owned, content-addressed file.
Usage: nx_nbk_pack <slug>. expect_exit: 0 license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_nbk.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
| 8 | const K_MAGIC_2048: i64 = 2048 |
| 9 | const K_MAGIC_1024: i64 = 1024 |
| 41 | const ECAP: i64 = 1024 |
functions
| 11 | func pk_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 12 | func pk_p(s: *u8) -> i64 { sys_write(1, s, pk_slen(s)); return 0 } |
| 17 | func pk_n(v: i64) -> i64 { nxi_out(v); return 0 } |
| 18 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: main |
| 19 | func 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 } |
| 21 | func jfrom(hay: *u8, hl: i64, start: i64, needle: *u8) -> i64 |
| 28 | func jstr(hay: *u8, hl: i64, pos: i64, out: *u8, cap: i64) -> i64 called by 1: main |
| 44 | func add_file(dir: *u8, name: *u8, names: *i64, datas: *i64, lens: *i64, idx: i64) -> i64 |
| 56 | func main(argc: i64, argv: *i64) -> i64 |