code wiki / _hdl_build / nx_cms_multipart.nx

nx_cms_multipart.nx

buildroot/runtime/_hdl_build/nx_cms_multipart.nx

4017 B98 linesdepth 2pulls 2 transitivereach 4 importersview sourcekind librarytopic cms
docsdependenciesstructsconstsfunctions

about

nx_cms_multipart.nx -- CORRECT multipart/form-data part finder for the CMS uploads rung (C11). The shipped runtime/nx_multipart.nx has a closing-delimiter/CRLF-alignment bug (its main() is a compile-only smoke, never gated -- multipart_parse returns -1 on a well-formed 2-part body, proven 2026-06-10 by _cms_mp_probe). Per rule 3 (no patch cascades) this is a clean rewrite with a real KAT, not a patch. Flat i64 output (4 cells/part: headers_off, headers_len, body_off, body_len) so there is zero struct-pointer-arithmetic ambiguity. Zero-copy: cells are offsets into the caller's buffer. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_cms_multipart.nx nx_cms_admin.nx nx_cms_multipart_test.nx

imports: nx_syscalls.nx

imported by: nx_cms_admin.nxnx_cms_multipart_test.nx

structs

none

consts

none

functions

11func cmp_find(buf: *u8, start: i64, n: i64, needle: *u8, nl: i64) -> i64
called by 1: cms_mp_parse
26func cms_mp_parse(buf: *u8, n: i64, boundary: *u8, blen: i64, out: *i64, cap: i64) -> i64
called by 1: main calls 2: sys_mmapcmp_find
76func cms_mp_field(buf: *u8, off: i64, end: i64, key: *u8, out: *u8, cap: i64) -> i64
called by 2: mainmain