code wiki / _hdl_build / nx_media_ws_register.nx
nx_media_ws_register.nx
buildroot/runtime/_hdl_build/nx_media_ws_register.nx
about
nx_media_ws_register.nx -- register the SOTA-MEDIA-CONSUMPTION program as a LIVE workstream in the WMS
registry (E-PLATFORM, one of the 12 valid empires -- else nx_ws_board refuses to render). Mirrors
nx_project_ws_register EXACTLY: hold the per-prefix wlock across the ws:ids RMW AND the ws:<id> write
(no nested lock = no self-deadlock); idempotent; code_link=nx_media_inventory_gate (machine-verifiable).
Beats the string-keyed heartbeat so the board shows ALIVE. Verifies by READBACK. NOTE: every id/const is
indexed only via a function PARAM (never a direct global-const index -- that path miscompiles under nx_cc).
expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_ws_cas.nxnx_heartbeat_str.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 MWR_MAGIC_1024: i64 = 1024 |
| 12 | const MWR_ID: *u8 = "SOTA-MEDIA-CONSUMPTION" |
| 13 | const MWR_EMP: *u8 = "E-PLATFORM" |
| 14 | const MWR_MEM: *u8 = "project-nishi-gallery-jellyfin-class-2026-07-11" |
| 15 | const MWR_CODE: *u8 = "nx_media_inventory_gate" |
| 16 | const MWR_HB: *u8 = "knowledge/status/wms_heartbeat.log" |
functions
| 18 | func mwr_puts(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 1: main |
| 19 | func mwr_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var i: i64 = 0; while s[i] != (0 as u8) { dst[o] = s[i]; o = o + 1; i = i + 1 } return o } called by 1: mwr_register |
| 20 | func mwr_n(dst: *u8, off: i64, v: i64) -> i64 { var o: i64 = off; var m: i64 = v; if m < 0 { dst[o] = 45 as u8; o = o + 1; m = 0 - m } let t: *u8 = sys_mmap(28); 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 i: i64 = 0; while i < k { dst[o + i] = t[k - 1 - i]; i = i + 1 } return o + k } called by 1: mwr_register |
| 23 | func mwr_register(id: *u8, emp: *u8, state: *u8, mem: *u8, code: *u8) -> i64 |
| 71 | func main() -> i64 |