code wiki / (root) / nx_motion_serve.nx

nx_motion_serve.nx

buildroot/runtime/nx_motion_serve.nx

21464 B370 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind servicetopic motion
docsdependenciesstructsconstsfunctions

about

nx_motion_serve.nx -- /motion AS A TOOL, NOT A BROCHURE (2026-09-06): a visitor uploads a mesh, the sovereign auto-rig rigs it, the page shows it from three sides with its own numbers, a library clip retargets onto it, the result exports, and the operator's ACCEPT or REJECT lands from the same page. The mesh2motion-class surface, on the estate's own organs. nx_motion_serve [port] serve on LOOPBACK (default 18132); the edge proxies /motion to it nx_motion_serve emit <out.html> write the static fallback -- THE SAME RENDERER, the empty form, byte-identical SHAPE, and why (the /math pattern): plain GET and POST forms, no script, no fetch, no client runtime, so it works with JavaScript off, every job is a shareable URL, and there is no third party anywhere in the path. Routing is prefix-agnostic on purpose: the edge forwards /motion/upload and a loopback test sends /upload, and both route the same. The daemon never does the work: it types the upload by MAGIC, writes a digit-named job directory, and spawns the job organ DETACHED (double fork), so accept() is never held by a rig. It reads status rows the job writes and shows them. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_http_server.nx nx_motion_lib.nx nx_motion_serve.nx

imports: nx_syscalls.nxnx_http_server.nxnx_motion_lib.nx

imported by: nobody (leaf or entry point)

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

main mo_streq msw sys_write mo_slen ms_emit 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 ↻ ms_render_index sys_mmap ↻ mo_read sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close mo_body_index mo_cat mo_num mo_demo_cards sys_mmap ↻ mo_row_next mo_row_field mo_cat ↻ mo_esc

structs

none

consts

18const MS_PORT_DEFAULT: i64 = 18132
19const MS_BACKLOG: i64 = 64
20const MS_RESP_RESERVE: i64 = 1024
21const MS_METHOD_GET: i64 = 1
22const MS_METHOD_POST: i64 = 2
23const MS_CELLS_MIN: i64 = 48
24const MS_CELLS_MAX: i64 = 256
25const MS_CELLS_DEFAULT: i64 = 192
26const MS_WORDS_CAP: i64 = 200
27const MS_EXIT_USAGE: i64 = 2
28const MS_REFRESH_HEAD: *u8 = "<meta http-equiv=\"refresh\" content=\"4\">"
29const MS_RIG_ELF: *u8 = "_offc/nx_motion_rig.elf"
30const MS_STORE_ELF: *u8 = "_offc/nx_store_put.elf"
31const MS_ACCEPT_PLANE: *u8 = "knowledge/store/accept-"

functions

33func msw(s: *u8) -> i64 { sys_write(1, s, mo_slen(s)); return 0 }
called by 2: ms_emitmain calls 2: sys_writemo_slen
35func ms_send(cfd: i64, status: *u8, ctype: *u8, body: *u8, n: i64) -> i64
49func ms_text(cfd: i64, status: *u8, msg: *u8) -> i64 { return ms_send(cfd, status, "text/plain; charset=utf-8" as *u8, msg, mo_slen(msg)) }
50func ms_redirect(cfd: i64, loc: *u8) -> i64
60func ms_render(out: *u8, cap: i64, head: *u8, body: *u8, bn: i64) -> i64
67func ms_render_index(out: *u8, cap: i64) -> i64
78func ms_page(cfd: i64, head: *u8, body: *u8, bn: i64) -> i64
87func ms_index(cfd: i64) -> i64
96func ms_jobdir(id: *u8) -> *u8 { return mo_join(MO_JOBS_DIR, id) }
98func ms_job(cfd: i64, id: *u8) -> i64
121func ms_ctype(name: *u8) -> *u8
called by 1: ms_file calls 2: mo_slenmo_streq
129func ms_file(cfd: i64, dir: *u8, name: *u8) -> i64
138func ms_art(cfd: i64, path: *u8, plen: i64) -> i64
146func ms_demo(cfd: i64, path: *u8, plen: i64) -> i64
called by 1: main calls 3: sys_mmapmo_last_segms_file
152func ms_upload(cfd: i64, req: *u8, hend: i64, body: *u8, blen: i64) -> i64
211func ms_anim(cfd: i64, path: *u8, plen: i64) -> i64
247func ms_verdict(cfd: i64, body: *u8, blen: i64) -> i64
292func ms_emit(outpath: *u8) -> i64
304func main(argc: i64, argv: *i64) -> i64