code wiki / _hdl_build / nx_ciaaw_ingest.nx

nx_ciaaw_ingest.nx

buildroot/runtime/_hdl_build/nx_ciaaw_ingest.nx

7445 B131 linesdepth 7pulls 10 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_uxf_decode.nx nx_html_table.nx nx_ciaaw_ingest.nx

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

main sys_mmap cw_read sys_openat_rd sys_read sys_close cw_w sys_write sys_exit ss_begin ss_begin_cap sys_mmap ↻ ht_next_row ht_find_open ht_is_open ht_lc ht_after_gt ht_find_close ht_lc ↻ ht_cell ht_find_open ↻ ht_after_gt ↻ ht_find_close ↻ ht_text sys_mmap ↻ nx_html_decode_entities sys_mmap ↻ nx_html_entity_lookup _ent_utf8 cw_atoi cw_q3 cw_unc cw_itoa sys_mmap ↻ canon_encode sys_mmap ↻ cc_cmp cc_w32 cc_len sys_munmap

structs

none

consts

12const CW_MAGIC_131072: i64 = 131072
14const CW_RAW: *u8 = "knowledge/fetched/ciaaw/abridged_atomic_weights.html"
15const CW_STORE: *u8 = "knowledge/store/ciaaw-atw-"

functions

17func 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 }
called by 1: main calls 1: sys_write
18func 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
19func 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 }
called by 1: main calls 1: sys_mmap
20func 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
22func cw_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
33func cw_q3(s: *u8) -> i64
called by 1: main
58func cw_unc(s: *u8) -> i64
called by 1: main
75func main() -> i64