code wiki / (root) / nx_bundle_ingest_lib.nx

nx_bundle_ingest_lib.nx

buildroot/runtime/nx_bundle_ingest_lib.nx

15343 B337 linesdepth 6pulls 8 transitivereach 13 importersview sourcekind librarytopic bundle
docsdependenciesstructsconstsfunctions

about

nx_bundle_ingest_lib.nx -- THE COMMUNITY BUNDLE WALKER (/compare/modding MD1 bundle_ingest, 2026-09-06): a ZIP from a rip page or a mod host is walked by CONTENT TYPE, never by filename. Composes the incumbents and adds no second ruler: nx_zip.nx the central-directory reader (EOCD -> CD -> local header), the reflected CRC-32 nx_deflate.nx RFC 1951 INFLATE for method-8 members, sized from the member's DECLARED usize nx_assetprobe_lib.nx the ONE identify / classify / claim ruler (the CLI probe and this walker share it) Every member gets a row: method, sizes, the magic the bytes carry, the category that magic implies, the extension's claim, the probe verdict, the inflate outcome, and -- for a texture -- which model or material member REFERENCES it by basename inside its own bytes (the mesh's material slots, read from the mesh, not guessed from a folder). A member the ruler cannot type is REPORTED as unknown, never dropped; a method the walker cannot open is REPORTED as unsupported. The partition (model material texture motion audio video bundle unknown) is asserted to SUM to the member count. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 4 imports · 4 importers

nx_syscalls.nx nx_zip.nx nx_deflate.nx nx_assetprobe_lib.nx nx_bundle_ingest_lib.nx nx_bundle_ingest.nx nx_bundle_ingest_gate.nx nx_sevenz_gate.nx nx_sevenz_lib.nx

imports: nx_syscalls.nxnx_zip.nxnx_deflate.nxnx_assetprobe_lib.nx

imported by: nx_bundle_ingest.nxnx_bundle_ingest_gate.nxnx_sevenz_gate.nxnx_sevenz_lib.nx

structs

none

consts

17const BI_METHOD_STORE: i64 = 0
18const BI_METHOD_DEFLATE: i64 = 8
20const BI_INF_STORED: i64 = 0 // method 0: bytes read in place, CRC verified
21const BI_INF_OK: i64 = 1 // method 8: inflated to exactly usize, CRC verified
22const BI_INF_FAILED: i64 = 2 // the stream or the CRC refused
23const BI_INF_UNSUPPORTED: i64 = 3 // a method this walker does not open (reported by number)
24const BI_INF_NOT_READ: i64 = 5
25const BI_INF_SIZE_MISMATCH: i64 = 6
26const BI_INF_CRC_MISMATCH: i64 = 7
27const BI_INF_LIMIT: i64 = 8
28const BI_INF_BADLOCAL: i64 = 4 // local header missing or outside the file
30const BI_V_UNIDENTIFIED: i64 = 0
31const BI_V_UNCLAIMED: i64 = 1
32const BI_V_AGREE: i64 = 2
33const BI_V_DISAGREE: i64 = 3
34const BI_V_UNREAD: i64 = 4 // no bytes to probe (inflate failed or unsupported)
36const BI_BIND_NA: i64 = 0
37const BI_BIND_BOUND: i64 = 1
38const BI_BIND_UNBOUND: i64 = 2
40const BI_F_METHOD: i64 = 0
41const BI_F_CSIZE: i64 = 1
42const BI_F_USIZE: i64 = 2
43const BI_F_MAGIC: i64 = 3
44const BI_F_CAT: i64 = 4
45const BI_F_CLAIM: i64 = 5
46const BI_F_VERDICT: i64 = 6
47const BI_F_INFLATE: i64 = 7
48const BI_F_BIND: i64 = 8
49const BI_F_BOUND_TO: i64 = 9
50const BI_F_NAMEOFF: i64 = 10
51const BI_F_NAMELEN: i64 = 11
52const BI_F_DATA: i64 = 12
53const BI_F_DLEN: i64 = 13
54const BI_F_CRC: i64 = 14
55const BI_F_CRC_ACTUAL: i64 = 15
56const BI_F_N: i64 = 16
58const BI_P_MODEL: i64 = 0
59const BI_P_MATERIAL: i64 = 1
60const BI_P_TEXTURE: i64 = 2
61const BI_P_MOTION: i64 = 3
62const BI_P_AUDIO: i64 = 4
63const BI_P_VIDEO: i64 = 5
64const BI_P_BUNDLE: i64 = 6
65const BI_P_UNKNOWN: i64 = 7
66const BI_P_STORED: i64 = 8
67const BI_P_INFLATED: i64 = 9
68const BI_P_FAILED: i64 = 10
69const BI_P_UNSUPPORTED: i64 = 11
70const BI_P_BOUND: i64 = 12
71const BI_P_UNBOUND: i64 = 13
72const BI_P_N: i64 = 16
73const BI_ZIP_FLD_N: i64 = 8
74const BI_NAME_CAP: i64 = 1024

functions

76func bi_rec(tbl: *i64, i: i64) -> *i64 { return ((tbl as i64) + i * BI_F_N * 8) as *i64 }
77func bi_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c }
80func bi_count(b: *u8, n: i64) -> i64 { return nxzip_count(b, n) }
called by 3: bix_mainmainmain
84func bi_local_data(b: *u8, n: i64, fld: *i64) -> i64
125func bi_decode_member(b: *u8, n: i64, fld: *i64, r: *i64, limit: i64) -> i64
155func bi_basename(names: *u8, off: i64, len: i64, out: *u8, cap: i64) -> i64
called by 1: bi_bind_textures calls 1: bi_lc
167func bi_contains_ci(hay: *u8, hn: i64, needle: *u8, nn: i64) -> i64
called by 1: bi_bind_textures calls 1: bi_lc
186func bi_walk_selected(b: *u8, n: i64, tbl: *i64, names: *u8, ncap: i64, options: *i64) -> i64
246func bi_walk(b: *u8, n: i64, tbl: *i64, maxm: i64, names: *u8, ncap: i64) -> i64
259func bi_bind_textures(tbl: *i64, m: i64, names: *u8) -> i64
286func bi_partition(tbl: *i64, m: i64, p: *i64) -> i64
called by 3: mainmainmain calls 1: bi_rec
315func bi_verdict_name(v: i64) -> *u8
called by 1: bic_row
322func bi_inflate_name(f: i64) -> *u8
333func bi_bind_name(v: i64) -> *u8
called by 1: bic_row