nx_svcreg.nx
buildroot/runtime/nx_svcreg.nx
about
nx_svcreg.nx -- DECLARATIVE SERVICE REGISTRY (systemd-unit / s6-service-dir model, sovereign): each service is
declared as DATA -- name / elf / port / health-path -- on the canonical nx_registry (seg_store: additive, history
kept, auditable). nx_runsv supervises a service BY NAME from this registry instead of hardcoded args (R5 of the
supervisor roadmap). Record (tab-separated): name <TAB> elf <TAB> port <TAB> health. Composes nx_registry + nx_tabrec
-- no new storage. license_tier: ORIGINAL
dependencies 3 imports · 2 importers
imports: nx_registry.nxnx_tabrec.nxnx_gate.nx
imported by: nx_runsv.nxnx_svcreg_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 9 | const SVC_MAGIC_2048: i64 = 2048 |
| 10 | const SVC_MAGIC_65536: i64 = 65536 |
| 12 | const SVC_KP: *u8 = "svc:" as *u8 |
| 13 | const SVC_IDX: *u8 = "__svcidx__" as *u8 |
| 14 | const SVC_PREFIX: *u8 = "knowledge/svcreg-" as *u8 |
functions
| 16 | func svc_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8) { if a[i]!=b[i] { return 0 } i=i+1 } if b[i]!=(0 as u8) { return 0 } return 1 } called by 1: main |
| 18 | func svc_register_pfx(prefix: *u8, name: *u8, elf: *u8, port: *u8, health: *u8) -> i64 |
| 23 | func svc_get_pfx(prefix: *u8, name: *u8, ptrout: *i64, lenout: *i64) -> i64 { return reg_get(prefix, SVC_KP, name, ptrout, lenout) } |
| 24 | func svc_list_pfx(prefix: *u8, idxbuf: *u8, cap: i64) -> i64 { return reg_index(prefix, SVC_IDX, idxbuf, cap) } |
| 25 | func svc_register(name: *u8, elf: *u8, port: *u8, health: *u8) -> i64 { return svc_register_pfx(SVC_PREFIX,name,elf,port,health) } |
| 26 | func svc_get(name: *u8, ptrout: *i64, lenout: *i64) -> i64 { return svc_get_pfx(SVC_PREFIX,name,ptrout,lenout) } |
| 27 | func svc_list(idxbuf: *u8, cap: i64) -> i64 { return svc_list_pfx(SVC_PREFIX,idxbuf,cap) } |
| 29 | func main(argc: i64, argv: *i64) -> i64 |