code wiki / (root) / ini_writer.nx

ini_writer.nx

buildroot/runtime/ini_writer.nx

3349 B104 linesdepth 3pulls 3 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

syscalls.nx ini_writer.nx

imports: syscalls.nx

imported by: nobody (leaf or entry point)

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

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

structs

none

consts

24const IW_ERR_SHORT: i64 = -1

functions

26func iw_put(out: *u8, cap: i64, off: i64, src: *u8, n: i64) -> i64 {
37func ini_writer_section(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: iw_put
49func ini_writer_kv(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: iw_put
64func ini_writer_comment(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: iw_put
76func ini_writer_blank(out: *u8, cap: i64, off: i64) -> i64 {
called by 1: main calls 1: iw_put
81func main() -> i64 {