code wiki / _hdl_build / nx_eco_graph_build.nx

nx_eco_graph_build.nx

buildroot/runtime/_hdl_build/nx_eco_graph_build.nx

12074 B237 linesdepth 8pulls 18 transitivereach 0 importersview sourcekind tooltopic eco
docsdependenciesstructsconstsfunctions

about

nx_eco_graph_build.nx -- R0 brick-3: the LIVE whole-tree walk that POPULATES the ecosystem graph from real organs, then answers the operator's query. Composes nx_dr_tree's getdents recursion + nx_import_scan (accurate edges) + nx_eco_graph (queries). Usage: nx_eco_graph_build <root-dir> [query-basename] no query -> summary (nodes, edges, files, top hub, orphan count) query X.nx -> its ROOTS-TO-GOD (transitive imports/ancestors), CHILDREN (transitive importers), Ca/Ce. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_eco_graph.nx nx_import_scan.nx nx_heavyio_lib.nx nx_eco_graph_build.nx

imports: nx_syscalls.nxnx_eco_graph.nxnx_import_scan.nxnx_heavyio_lib.nx

imported by: nobody (leaf or entry point)

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

main bw sys_write eg_load sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sov_get_ints sys_mmap ↻ ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ss_readall ss_r32 sov_get_copy sys_mmap ↻ ss_get ↻ bq sys_mmap ↻ sys_write ↻ egb_json_query

structs

none

consts

11const EGB_MAGIC_3900: i64 = 3900
12const EGB_MAGIC_131072: i64 = 131072
13const EGB_MAGIC_1024: i64 = 1024
14const EGB_MAGIC_4096: i64 = 4096
16const EGB_MAXNODE: i64 = 24000
17const EGB_MAXEDGE: i64 = 300000
18const EGB_ARENA: i64 = 4194304
19const EGB_HASH: i64 = 65536
20const EGB_FILECAP: i64 = 262144
156const EGB_EXIT_DEFER: i64 = 4 // the estate's deferred/refused code (nx_memvel, nx_plan_run): the clock requeues on it

functions

22func bw(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 2: egb_json_querymain calls 1: sys_write
23func bn(v: i64) -> i64 { let b: *u8=sys_mmap(24); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} 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 j: i64=0; while j<k{b[j]=t[k-1-j];j=j+1} sys_write(1,b,k); return 0 }
24func bslen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
26func egb_is_nx(nm: *u8, n: i64) -> i64
called by 1: egb_walk
34func egb_join(path: *u8, base_n: i64, nm: *u8) -> i64
called by 1: egb_walk
41func egb_read(path: *u8, buf: *u8, cap: i64) -> i64
53func egb_isdotdot(nm: *u8) -> i64
called by 1: egb_walk
58func egb_walk(g: *EcoGraph, path: *u8, path_n: i64, filebuf: *u8, aoff: *i64, alen: *i64, st: *i64) -> i64
114func egb_printname(g: *EcoGraph, idx: i64) -> i64
called by 2: egb_jnamemain calls 1: sys_write
122func bq() -> i64 { let c: *u8 = sys_mmap(1); c[0] = 34 as u8; sys_write(1, c, 1); return 0 }
123func egb_jname(g: *EcoGraph, idx: i64) -> i64 { bq(); egb_printname(g, idx); bq(); return 0 }
called by 1: egb_json_query calls 2: bqegb_printname
125func egb_json_query(g: *EcoGraph, q: *u8) -> i64
called by 1: main calls 11: eg_findbslenbwbqbneg_ca+5
158func main(argc: i64, argv: *i64) -> i64