code wiki / _hdl_build / nx_cms_snapshot.nx
nx_cms_snapshot.nx
buildroot/runtime/_hdl_build/nx_cms_snapshot.nx
about
nx_cms_snapshot.nx -- CMS W4: a binary-safe site SNAPSHOT/RESTORE archive (the UpdraftPlus class).
One file packs N named files length-prefixed so ANY bytes survive (newlines, high bytes, NULs):
"NXSNAP1\n" then per entry: "N"<namelen-dec>"\n"<name> "D"<datalen-dec>"\n"<data> then "END\n"
Restore is BYTE-EXACT (the additive-history law: a restore brings back exactly what was archived).
Zero interpretation of the payload -> images, binary stores, anything round-trips. Reusable.
license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_cms_admin.nxnx_cms_snapshot_test.nx
structs
| none |
consts
| 8 | const K_MAGIC_8388608: i64 = 8388608 |
| 9 | const K_MAGIC_1024: i64 = 1024 |
functions
| 11 | func snap_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: snap_pack |
| 12 | func snap_emit_num(out: *u8, o: i64, v: i64) -> i64 |
| 25 | func snap_read_file(path: *u8, out: *u8, cap: i64) -> i64 |
| 38 | func snap_join(out: *u8, dir: *u8, name: *u8, nlen: i64) -> i64 |
| 51 | func snap_pack(dir: *u8, names: *i64, nn: i64, out: *u8, cap: i64) -> i64 |
| 85 | func snap_num(arc: *u8, n: i64, pp: *i64) -> i64 called by 1: snap_unpack |
| 105 | func snap_unpack(arc: *u8, n: i64, dir: *u8) -> i64 |