code wiki / _hdl_build / nx_extract.nx
nx_extract.nx
buildroot/runtime/_hdl_build/nx_extract.nx
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
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
structs
| none |
consts
| 12 | const K_MAGIC_1000000: i64 = 1000000 |
functions
| 14 | func 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 } |
| 15 | func 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 } |
| 16 | func 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 } |
| 19 | func ex_findfrom(buf: *u8, n: i64, start: i64, needle: *u8) -> i64 called by 1: ex_stl |
| 33 | func ex_pint(buf: *u8, n: i64, p: i64, res: *i64) -> i64 called by 1: ex_stl |
| 47 | func ex_stl(buf: *u8, n: i64, dims3: *i64) -> i64 |
| 78 | func ex_gif(buf: *u8, n: i64, wh2: *i64) -> i64 called by 1: main |
| 93 | func ex_text(buf: *u8, n: i64, wc2: *i64) -> i64 called by 1: main |
| 104 | func main() -> i64 |