nx_ini_writer.nx
buildroot/runtime/nx_ini_writer.nx
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
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
structs
| none |
consts
| 30 | const IW_ERR_SHORT: i64 = -1 |
functions
| 32 | func iw_put(out: *u8, cap: i64, off: i64, src: *u8, n: i64) -> i64 |
| 43 | func ini_writer_section(out: *u8, cap: i64, off: i64, |
| 55 | func ini_writer_kv(out: *u8, cap: i64, off: i64, |
| 70 | func ini_writer_comment(out: *u8, cap: i64, off: i64, |
| 82 | func ini_writer_blank(out: *u8, cap: i64, off: i64) -> i64 |
| 87 | func main() -> i64 |