code wiki / _hdl_build / nx_tpl_fetch.nx

nx_tpl_fetch.nx

buildroot/runtime/_hdl_build/nx_tpl_fetch.nx

3144 B63 linesdepth 21pulls 146 transitivereach 0 importersview sourcekind tooltopic tpl
docsdependenciesstructsconstsfunctions

about

nx_tpl_fetch.nx -- hybrid STEP 2 of the SITE FACTORY: fetch OPEN FREE web templates over SOVEREIGN TLS (nx_https_fetch_follow_best: TLS-1.3 -> chrome-JA3 -> TLS-1.2 fallback, Mozilla CA trust) and save each page's RAW HTML into a dir, so nx_tpl_ingest (R4) can extract its STRUCTURE into the pattern corpus. We keep bytes only to extract abstract STRUCTURE/FLOW (uncopyrightable) -- never to redistribute the templates' files. BOUNDED + POLITE by construction: fetches ONLY the explicit URLs passed (no unbounded crawl), each once, byte-capped. usage: nx_tpl_fetch <outdir> <url1> [url2 ...] license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_syscalls.nx nx_tpl_fetch.nx

imports: nx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main tf_w sys_write sys_mkdir nx_trust_store_load_from_c sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻

structs

none

consts

12const TF_MAGIC_4194304: i64 = 4194304
13const TF_MAGIC_1024: i64 = 1024
15const TF_OUTCAP: i64 = 4194304 // 4 MiB max per page

functions

17func tf_w(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
18func tf_catn(d: *u8, o: i64, v: i64) -> i64
called by 2: tf_nummain
27func tf_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); let e: i64=tf_catn(b,0,v); sys_write(1,b,e); return 0 }
called by 1: main calls 3: sys_mmaptf_catnsys_write
28func tf_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){d[o+i]=s[i]; i=i+1} return o+i }
called by 1: main
30func main(argc: i64, argv: *i64) -> i64