code wiki / _hdl_build / nx_extract.nx

nx_extract.nx

buildroot/runtime/_hdl_build/nx_extract.nx

7014 B149 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind tooltopic extract
docsdependenciesstructsconstsfunctions

about

nx_extract.nx -- MLIB-006 (CALLOUT-012). Per-type EXTRACTORS: raw media bytes -> typed facts -> a validated meta record (PROFILE of nx_meta_schema, X-CAP-001). v1 ships THREE REAL parsers (no fakes), each KAT'd bit-stable: - STL (ASCII): triangle count ("facet normal") + bounding-box dims from vertices. - GIF (header): GIF89a magic + logical-screen width/height (LE u16). - TEXT : word + char count (searchable-text basis). Each extraction builds a meta record (modality + attr.* facts) validated via ms_valid (consent hard line). Binary EPUB/PDF + JPEG/PNG/video thumbnails + audio (NV-LPC) ride the existing image/audio organs = the next slice. Self-validating gate (EXTRACTGATE). license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_meta_schema.nx nx_extract.nx nx_func_compare.nx

imports: nx_syscalls.nxnx_meta_schema.nx

imported by: nx_func_compare.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap ex_stl ex_findfrom sys_mmap ↻ ex_pint ex_gif ex_text ex_itoa sys_mmap ↻ ms_set ms_valid ms_get ms_streq ms_streq ↻ ex_puts sys_write ex_putn sys_mmap ↻ sys_write ↻

structs

none

consts

12const K_MAGIC_1000000: i64 = 1000000

functions

14func ex_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
15func ex_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=48+(m%10); m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(1, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
16func ex_itoa(v: i64, out: *u8) -> i64 { var m: i64=v; if m<0 {m=0-m}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=48+(m%10); m=m/10; k=k+1}; var i: i64=0; while i<k {out[i]=t[k-1-i]; i=i+1}; out[k]=0 as u8; return k }
called by 1: main calls 1: sys_mmap
19func ex_findfrom(buf: *u8, n: i64, start: i64, needle: *u8) -> i64
called by 1: ex_stl
33func ex_pint(buf: *u8, n: i64, p: i64, res: *i64) -> i64
called by 1: ex_stl
47func ex_stl(buf: *u8, n: i64, dims3: *i64) -> i64
called by 1: main calls 3: ex_findfromsys_mmapex_pint
78func ex_gif(buf: *u8, n: i64, wh2: *i64) -> i64
called by 1: main
93func ex_text(buf: *u8, n: i64, wc2: *i64) -> i64
called by 1: main
104func main() -> i64