code wiki / (root) / nx_ini_writer.nx

nx_ini_writer.nx

buildroot/runtime/nx_ini_writer.nx

3499 B110 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic ini
docsdependenciesstructsconstsfunctions

about

ini_writer.nx -- serialise INI-style config. Companion to ini.nx (reader). Stream builder emits files that ini.nx round-trips exactly: [section] key = value ; comment We always use \" = \" (space-equals-space) separator and LF line endings. This matches typical Unix convention; Windows tools tolerate LF. Invariants: IW1 Keys and values emitted verbatim -- no escaping. INI has no standard escape form; values with newlines are inherently unsafe in INI, caller pre-sanitises. IW2 ini_writer_section groups the next keys under that name until another section is opened. IW3 Round-trip: ini.nx parsing our output yields the original (section, key, value) tuples.

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_ini_writer.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap ini_writer_comment iw_put ini_writer_section iw_put ↻ ini_writer_kv iw_put ↻ ini_writer_blank iw_put ↻

structs

none

consts

30const IW_ERR_SHORT: i64 = -1

functions

32func iw_put(out: *u8, cap: i64, off: i64, src: *u8, n: i64) -> i64
43func ini_writer_section(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: iw_put
55func ini_writer_kv(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: iw_put
70func ini_writer_comment(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: iw_put
82func ini_writer_blank(out: *u8, cap: i64, off: i64) -> i64
called by 1: main calls 1: iw_put
87func main() -> i64