code wiki / (root) / nx_assetprobe_lib.nx

nx_assetprobe_lib.nx

buildroot/runtime/nx_assetprobe_lib.nx

10405 B251 linesdepth 2pulls 2 transitivereach 19 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_assetprobe_lib.nx -- THE ONE CONTENT-TYPE RULER FOR INGESTION (extracted 2026-09-06 from nx_assetprobe.nx, byte-for-byte where the functions already existed, so the program and the bundle walker share ONE identify/classify/claim and cannot drift). AN EXTENSION IS A CLAIM. THE MAGIC BYTES ARE THE MEASUREMENT. Binary formats match at an EXACT offset; text formats get a BOUNDED scan of the first AP_TEXTWIN bytes. GROWN in the extraction, each an exact-offset magic or a bounded keyword pair, never a guess: OBJ and MTL (Wavefront text -- the first ingest fixture on /compare/modding MD1 is an OBJ plus its MTL and four maps, and a walker that cannot type them by content would fall back to the filename it exists to distrust), DDS (the texture container every Bethesda mod ships), NIF (the Bethesda mesh container nx_nif_lib already decodes), 7z and RAR (the archives Nexus files usually arrive in, typed as BUNDLE so a walker can REPORT them by name rather than read them as noise -- their readers are owed, not faked). license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_assetprobe_lib.nx nx_assetprobe.nx nx_bundle_ingest_lib.nx nx_bundle_ingest_selected_candidat

imports: nx_syscalls.nx

imported by: nx_assetprobe.nxnx_bundle_ingest_lib.nxnx_bundle_ingest_selected_candidate_t144.nx

structs

none

consts

13const AP_TEXTWIN: i64 = 4096
15const AP_UNKNOWN: i64 = 0
16const AP_PMX: i64 = 1
17const AP_PMD: i64 = 2
18const AP_FBXB: i64 = 3
19const AP_GLB: i64 = 4
20const AP_PNG: i64 = 5
21const AP_JPG: i64 = 6
22const AP_HDR: i64 = 7
23const AP_OGG: i64 = 8
24const AP_MP3: i64 = 9
25const AP_MP4: i64 = 10
26const AP_WAV: i64 = 11
27const AP_ZIP: i64 = 12
28const AP_VMD: i64 = 13
29const AP_BVH: i64 = 14
30const AP_OBJ: i64 = 15
31const AP_MTL: i64 = 16
32const AP_DDS: i64 = 17
33const AP_NIF: i64 = 18
34const AP_7Z: i64 = 19
35const AP_RAR: i64 = 20
37const AP_C_UNKNOWN: i64 = 0
38const AP_C_MODEL: i64 = 1
39const AP_C_MOTION: i64 = 2
40const AP_C_AUDIO: i64 = 3
41const AP_C_VIDEO: i64 = 4
42const AP_C_TEXTURE: i64 = 5
43const AP_C_BUNDLE: i64 = 6
44const AP_C_MATERIAL: i64 = 7

functions

46func ap_slen(s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { i = i + 1 } return i }
48func ap_u16(b: *u8, o: i64) -> i64 { return ((b[o] & 0xff) as i64) | (((b[o+1] & 0xff) as i64) << 8) }
called by 1: ap_zip
49func ap_u32(b: *u8, o: i64) -> i64
called by 1: ap_zip
55func ap_at(b: *u8, len: i64, off: i64, pat: *u8) -> i64
called by 1: ap_identify calls 1: ap_slen
64func ap_scan(b: *u8, len: i64, pat: *u8) -> i64
called by 1: ap_identify calls 1: ap_slen
83func ap_scan_bol(b: *u8, len: i64, pat: *u8) -> i64
called by 1: ap_identify calls 1: ap_slen
105func ap_identify(b: *u8, len: i64) -> i64
153func ap_name(c: i64) -> *u8
177func ap_cat(c: i64) -> i64
201func ap_catname(k: i64) -> *u8
213func ap_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c }
called by 1: ap_ends
214func ap_ends(path: *u8, ext: *u8) -> i64
called by 1: ap_claim calls 2: ap_slenap_lc
227func ap_claim(path: *u8) -> i64