code wiki / _hdl_build / nx_adnet_gate.nx

nx_adnet_gate.nx

buildroot/runtime/_hdl_build/nx_adnet_gate.nx

4161 B50 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic adnet
docsdependenciesstructsconstsfunctions

about

nx_adnet_gate.nx -- proves the sovereign 4chan-style banner ad server: contextual rotation by section, first-party render (click via our tracker, no cookies), per-ad impression/click counters (no user tracking), click redirect. expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_adnet.nx nx_g_puts_lib.nx nx_syscalls.nx nx_adnet_gate.nx

imports: nx_adnet.nxnx_g_puts_lib.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 g_puts sys_write sys_mmap g_ck g_puts ↻ g_contains ad_slen ad_event ad_cat ad_event_count ad_slen ↻ ad_eol ad_click_target sys_mmap ↻ ad_eol ↻ ad_field ad_tab ad_streq ad_streq ↻

structs

none

consts

none

functions

8func g_ck(name: *u8, cond: i64, st: *i64) -> i64 { st[1]=st[1]+1; if cond==1 { st[0]=st[0]+1; g_puts(" [OK] " as *u8) } else { g_puts(" [FAIL] " as *u8) } g_puts(name); g_puts("\n" as *u8); return 0 }
called by 1: main calls 1: g_puts
9func g_contains(hay: *u8, needle: *u8) -> i64 { let hl: i64=ad_slen(hay); let nl: i64=ad_slen(needle); if nl==0 { return 1 } var i: i64=0; while i+nl<=hl { var ok: i64=1; var j: i64=0; while j<nl { if hay[i+j]!=needle[j] { ok=0 } j=j+1 } if ok==1 { return 1 } i=i+1 } return 0 }
called by 1: main calls 1: ad_slen
10func picked_id(inv: *u8, ilen: i64, section: *u8, rot: i64, out_id: *u8) -> i64 { let row: *u8=sys_mmap(1024); if ad_pick(inv,ilen,section,rot,row)==0 { out_id[0]=0 as u8; return 0 } ad_field(row, ad_slen(row), 0, out_id); return 1 }
12func main() -> i64