code wiki / _hdl_build / nx_eco_graph_build.nx
nx_eco_graph_build.nx
buildroot/runtime/_hdl_build/nx_eco_graph_build.nx
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
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
structs
| none |
consts
| 10 | const EGB_MAGIC_3900: i64 = 3900 |
| 11 | const EGB_MAGIC_131072: i64 = 131072 |
| 12 | const EGB_MAGIC_1024: i64 = 1024 |
| 13 | const EGB_MAGIC_4096: i64 = 4096 |
| 15 | const EGB_MAXNODE: i64 = 24000 |
| 16 | const EGB_MAXEDGE: i64 = 300000 |
| 17 | const EGB_ARENA: i64 = 4194304 |
| 18 | const EGB_HASH: i64 = 65536 |
| 19 | const EGB_FILECAP: i64 = 262144 |
functions
| 21 | func bw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 22 | func 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 } |
| 23 | func bslen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 25 | func egb_is_nx(nm: *u8, n: i64) -> i64 called by 1: egb_walk |
| 33 | func egb_join(path: *u8, base_n: i64, nm: *u8) -> i64 called by 1: egb_walk |
| 40 | func egb_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 52 | func egb_isdotdot(nm: *u8) -> i64 called by 1: egb_walk |
| 57 | func egb_walk(g: *EcoGraph, path: *u8, path_n: i64, filebuf: *u8, aoff: *i64, alen: *i64, st: *i64) -> i64 called by 2: egb_walkmain calls 17: sys_openat_rdsys_mmapsys_getdents64dirent_typedirent_nameegb_isdotdot+11 |
| 113 | func egb_printname(g: *EcoGraph, idx: i64) -> i64 |
| 121 | func bq() -> i64 { let c: *u8 = sys_mmap(1); c[0] = 34 as u8; sys_write(1, c, 1); return 0 } |
| 122 | func egb_jname(g: *EcoGraph, idx: i64) -> i64 { bq(); egb_printname(g, idx); bq(); return 0 } |
| 124 | func egb_json_query(g: *EcoGraph, q: *u8) -> i64 |
| 155 | func main(argc: i64, argv: *i64) -> i64 |