code wiki / _hdl_build / nx_ciaaw_ingest.nx
nx_ciaaw_ingest.nx
buildroot/runtime/_hdl_build/nx_ciaaw_ingest.nx
about
nx_ciaaw_ingest.nx -- ingest the FOUNDATIONED IUPAC/CIAAW abridged standard atomic weights, accessed
PROPERLY through the sovereign HTML table extractor nx_html_table (rows x cells, entity-decoded) -- NOT
grep. For each element row: Z (cell 0), abridged atomic weight (cell 3) parsed to milli-AMU (x1000, matching
our periodic table's mass_q3). Elements without a standard atomic weight (CIAAW shows "[mass number]") are
SKIPPED (honestly no standard weight). Writes content-addressed records to the sovereign seg_store
(knowledge/store/ciaaw-atw-, key "atw:<Z>"). Self-test: H->1008, C->12011. license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.nxnx_uxf_decode.nxnx_html_table.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const CW_MAGIC_131072: i64 = 131072 |
| 14 | const CW_RAW: *u8 = "knowledge/fetched/ciaaw/abridged_atomic_weights.html" |
| 15 | const CW_STORE: *u8 = "knowledge/store/ciaaw-atw-" |
functions
| 17 | func cw_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 18 | func cw_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 } called by 1: main |
| 19 | func cw_itoa(v: i64, dst: *u8) -> i64 { var m: i64=v; let t: *u8=sys_mmap(24); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{dst[i]=t[k-1-i];i=i+1} dst[k]=0 as u8; return k } |
| 20 | func cw_atoi(s: *u8) -> i64 { var v: i64=0; var any: i64=0; var i: i64=0; while s[i]!=(0 as u8){ if s[i]>=(48 as u8){ if s[i]<=(57 as u8){ v=v*10+(s[i]-48); any=1 } } i=i+1 } if any==0 { return 0 - 1 } return v } called by 1: main |
| 22 | func cw_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 33 | func cw_q3(s: *u8) -> i64 called by 1: main |
| 58 | func cw_unc(s: *u8) -> i64 called by 1: main |
| 75 | func main() -> i64 |