nx_bundle_ingest.nx
buildroot/runtime/nx_bundle_ingest.nx
about
nx_bundle_ingest.nx -- COMMUNITY BUNDLE TO A TYPED MANIFEST (/compare/modding MD1 bundle_ingest, 2026-09-06). Walks a ZIP or
a 7z by content type through nx_bundle_ingest_lib (the zip reader, the inflater and the ONE identify ruler are all
incumbents) or nx_sevenz_lib (the 7z container reader over nx_lzma_lib, MD29, same day -- filling the SAME record table, so
the texture binder and the partition run unchanged over both containers) and prints one MEMBER row per entry plus one
BUNDLE row whose partition sums to the entry count. Unknown members are rows, not omissions; a method or coder the walker
cannot open is a row that says so.
PROVENANCE (MD9, same day): the archive's own sha256 is the asset identity. With source=<url> the walk appends a row to the
provenance journal (licence=<id> names a rights-table row; absent, the licence is recorded as unknown, which is NOT a table
row and therefore REFUSES every export and publish door by construction); with or without it the verdict for that sha is
printed from nx_asset_prov_lib -- private use always allowed, the walk's own exit code unchanged.
usage: nx_bundle_ingest <bundle.zip|bundle.7z> [manifest.out] [source=<url>] [licence=<id>] [jrnl=<path>]
exits: 0 walked | 2 usage | 3 REFUSED (unreadable, not a zip or 7z, truncated, a record or the header refused, partition
does not sum)
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 7 imports · 4 importers
imports: nx_syscalls.nxnx_bundle_ingest_lib.nxnx_asset_prov_lib.nxnx_sevenz_lib.nxnx_fsops_lib.nxnx_atomic_rewrite.nxjson_emit.nx
imported by: nx_gltf2mesh.nxnx_gltf2mesh_normal_candidate_t337.nxnx_gltf2mesh_preserve_t145.nxnx_gltf_inventory_candidate_t180.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 23 | const BIC_NAMES_HEADROOM: i64 = 4096 |
| 24 | const BIC_MODE_0644: i64 = 420 |
| 25 | const BIC_EXIT_USAGE: i64 = 2 |
| 26 | const BIC_EXIT_REFUSE: i64 = 3 |
| 27 | const BIC_OUTFD: i64 = 1 |
| 28 | const BIC_SRC_KEY: *u8 = "source=" |
| 29 | const BIC_SRC_KEY_LEN: i64 = 7 |
| 30 | const BIC_LIC_KEY: *u8 = "licence=" |
| 31 | const BIC_LIC_KEY_LEN: i64 = 8 |
| 32 | const BIC_JRNL_KEY: *u8 = "jrnl=" |
| 33 | const BIC_JRNL_KEY_LEN: i64 = 5 |
| 34 | const BIC_LIC_DEFAULT: *u8 = "unknown" // deliberately NOT a rights-table row: the absence is the refusal |
| 35 | const BIC_ORIGIN: *u8 = "nx_bundle_ingest" |
| 36 | const BIC_ST_N: i64 = 8 |
| 37 | const BIC_CONTAINER_ZIP: i64 = 0 |
| 38 | const BIC_CONTAINER_7Z: i64 = 1 |
| 156 | const BIX_LOCK_SUFFIX: *u8 = ".nx-ingest-lock" |
| 157 | const BIX_JSON_ROW_ROOM: i64 = 512 |
| 158 | const BIX_JSON_BASE_ROOM: i64 = 2048 |
| 292 | const BIX_STAT_BYTES: i64 = 256 |
| 293 | const BIX_STAT_DEVICE_WORD: i64 = 0 |
| 294 | const BIX_STAT_INODE_WORD: i64 = 1 |
functions
| 40 | func bic_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 41 | func bic_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, bic_len(s)); return 0 } |
| 42 | func bic_wn(fd: i64, v: i64) -> i64 |
| 56 | func bic_prefix(s: *u8, p: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { if s[i] != p[i] { return 0 } i = i + 1 } return 1 } |
| 57 | func bic_is_kv(s: *u8) -> i64 |
| 64 | func bic_arg(argc: i64, argv: *i64, key: *u8, klen: i64) -> *u8 |
| 73 | func bic_container_name(c: i64) -> *u8 { if c == BIC_CONTAINER_7Z { return "7z" as *u8 } return "zip" as *u8 } called by 1: bic_summary |
| 75 | func bic_method(fd: i64, container: i64, code: i64) -> i64 |
| 81 | func bic_row(fd: i64, tbl: *i64, names: *u8, i: i64, container: i64) -> i64 |
| 99 | func bic_summary(fd: i64, m: i64, p: *i64, sum: i64, verdict: *u8, container: i64, st: *i64) -> i64 |
| 128 | func bic_provenance(argc: i64, argv: *i64, b: *u8, n: i64) -> i64 |
| 159 | func bix_uint(s: *u8) -> i64 |
| 169 | func bix_lock(path: *u8) -> i64 |
| 185 | func bix_same(path: *u8, data: *u8, n: i64) -> i64 |
| 194 | func bix_store(path: *u8, data: *u8, n: i64) -> i64 |
| 224 | func bix_key(w: *JsonWriter, key: *u8, value: *u8) -> i64 called by 15: bix_rowbix_intentbix_mainbix_rungpn_depsgpn_receipt+9 calls 3: json_emit_keybic_lenjson_emit_string |
| 228 | func bix_num(w: *JsonWriter, key: *u8, value: i64) -> i64 called by 14: bix_rowbix_mainbix_rungpn_depsgpn_receiptgli_report+8 calls 3: json_emit_keybic_lenje_sep |
| 235 | func bix_row(w: *JsonWriter, r: *i64, names: *u8, idx: i64) -> i64 |
| 258 | func bix_receipt(path: *u8, w: *JsonWriter) -> i64 |
| 272 | func bix_intent(receipt: *u8, archive: *u8, sha: *u8, output: *u8, member_sha: *u8) -> i64 |
| 295 | func bix_alias(a: *u8, b: *u8) -> i64 called by 8: bix_maingpn_maingli_maingpn_maingli_maingpn_main+2 calls 4: fsx_seqsys_mmapsys_munmapsys_fstatat |
| 312 | func bix_store_state(rc: i64) -> *u8 |
| 321 | func bix_main(argc: i64, argv: *i64) -> i64 |
| 420 | func bix_run(argc: i64, argv: *i64) -> i64 |
| 437 | func main(argc: i64, argv: *i64) -> i64 |