code wiki / _hdl_build / nx_domain_forge.nx

nx_domain_forge.nx

buildroot/runtime/_hdl_build/nx_domain_forge.nx

6573 B116 linesdepth 3pulls 4 transitivereach 1 importersview sourcekind tooltopic domain
docsdependenciesstructsconstsfunctions

about

nx_domain_forge.nx -- APPEND-DRIVEN, DATA-DRIVEN domain/site AUTO-BUILDER (operator 2026-06-29: "we should be able to append new domains and sites and have the site builders EMIT them using the auto-building capabilities to put together PIECES like LEGOS"). Reads a domain REGISTRY (domains.conf, one row per domain) and for EACH domain COMPOSES the site from reusable Lego pieces (the nx_hub_template block emitter: header/blog/video/ calendar/friends) AND emits the standalone-domain wiring: the docroot index.html + the sites.conf host->docroot VHOST line + a per-domain CERT-REGISTRY row (host -> wildcard chain/key). APPEND A DOMAIN = add ONE registry row + re-run (IDEMPOTENT: the emitted configs are rewritten from the registry every run -> the registry is the SSOT, no hand-editing). Composes nx_hub_template. domains.conf row (space-delim): <domain> <docroot_dir> <hub_config>. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_hub_template.nx nx_itoa_lib.nx nx_domain_forge.nx nx_domain_forge_gate.nx

imports: nx_hub_template.nxnx_itoa_lib.nx

imported by: nx_domain_forge_gate.nx

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

main df_forge sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close sys_openat_wr df_eol df_split df_copyz df_emit sys_read_file ↻ ht_emit_hub ht_put ht_emit_first sys_mmap ↻ ht_eol ht_line_field ht_tageq ht_slen ht_esc ht_put ↻ ht_render_posts sys_mmap ↻ ht_eol ↻ ht_line_field ↻ ht_tageq ↻ ht_put ↻ ht_esc ↻ ht_render_videos sys_mmap ↻ ht_eol ↻ ht_line_field ↻ ht_tageq ↻ ht_put ↻ ht_esc ↻ ht_render_events sys_mmap ↻

structs

none

consts

12const K_MAGIC_1048576: i64 = 1048576
13const K_MAGIC_2048: i64 = 2048
14const K_MAGIC_4096: i64 = 4096
15const K_MAGIC_1024: i64 = 1024

functions

17func df_cat(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i];o=o+1;i=i+1} return o }
called by 1: df_emit
18func df_catb(dst: *u8, o: i64, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n {dst[o]=b[i];o=o+1;i=i+1} return o }
called by 1: df_emit
20func df_eol(b: *u8, n: i64, st: i64) -> i64
called by 1: df_forge
25func df_split(b: *u8, ls: i64, le: i64, offs: *i64, lens: *i64, maxf: i64) -> i64
called by 1: df_forge
38func df_copyz(dst: *u8, src: *u8, off: i64, len: i64) -> i64 { var i: i64=0; while i<len { dst[i]=src[off+i]; i=i+1 } dst[len]=0 as u8; return len }
called by 1: df_forge
41func df_emit(domain: *u8, dl: i64, docroot: *u8, drl: i64, hubcfg: *u8, scfd: i64, crfd: i64) -> i64
64func df_forge(reg: *u8, sitesconf: *u8, certreg: *u8) -> i64
98func df_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
103func df_wn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
105func main(argc: i64, argv: *i64) -> i64