code wiki / _hdl_build / nx_eco_graph_build.nx

nx_eco_graph_build.nx

buildroot/runtime/_hdl_build/nx_eco_graph_build.nx

10886 B224 linesdepth 5pulls 6 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 3 imports · 0 importers

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

imports: nx_syscalls.nxnx_eco_graph.nxnx_import_scan.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 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 eg_find eg_name_eq bslen bw ↻ bq ↻ bn sys_mmap ↻ sys_write ↻ eg_ca eg_ce sys_mmap ↻ eg_ancestors eg_ancestors ↻ egb_jname

structs

none

consts

10const EGB_MAGIC_3900: i64 = 3900
11const EGB_MAGIC_131072: i64 = 131072
12const EGB_MAGIC_1024: i64 = 1024
13const EGB_MAGIC_4096: i64 = 4096
15const EGB_MAXNODE: i64 = 24000
16const EGB_MAXEDGE: i64 = 300000
17const EGB_ARENA: i64 = 4194304
18const EGB_HASH: i64 = 65536
19const EGB_FILECAP: i64 = 262144

functions

21func 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
22func 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 }
23func bslen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
25func egb_is_nx(nm: *u8, n: i64) -> i64
called by 1: egb_walk
33func egb_join(path: *u8, base_n: i64, nm: *u8) -> i64
called by 1: egb_walk
40func egb_read(path: *u8, buf: *u8, cap: i64) -> i64
52func egb_isdotdot(nm: *u8) -> i64
called by 1: egb_walk
57func egb_walk(g: *EcoGraph, path: *u8, path_n: i64, filebuf: *u8, aoff: *i64, alen: *i64, st: *i64) -> i64
113func egb_printname(g: *EcoGraph, idx: i64) -> i64
called by 2: egb_jnamemain calls 1: sys_write
121func bq() -> i64 { let c: *u8 = sys_mmap(1); c[0] = 34 as u8; sys_write(1, c, 1); return 0 }
122func 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
124func egb_json_query(g: *EcoGraph, q: *u8) -> i64
called by 1: main calls 11: eg_findbslenbwbqbneg_ca+5
155func main(argc: i64, argv: *i64) -> i64