code wiki / _hdl_build / nx_dr_incremental.nx
nx_dr_incremental.nx
buildroot/runtime/_hdl_build/nx_dr_incremental.nx
about
nx_dr_incremental.nx -- CAP-DR-INCREMENTAL: only re-copy CHANGED files (incremental backup, rsync/restic-style).
Reads the prior ARCHIVE_RECEIPT.tsv (name<TAB>sha256), and for each manifest source computes sha256; if the
receipt already has that name with the SAME hash -> SKIP (unchanged); else copy + verify + record. Writes a fresh
receipt covering all current files. Turns an O(all-bytes) re-archive into O(changed-bytes) -- the difference
between backing up 957 B and backing up 40 GB of galx every run. argv: [1]=manifest [2]=archive-dir.
Additive-safe (reads sources, writes only the archive dir). license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_site_lock_lib.nxnx_sha256.nxnx_seg_store.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
| 11 | const IN_MAGIC_1536: i64 = 1536 |
| 12 | const IN_MAGIC_262144: i64 = 262144 |
| 13 | const IN_MAGIC_1024: i64 = 1024 |
| 15 | const IN_CAP: i64 = 67108864 |
functions
| 17 | func in_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 18 | func in_wn(v: i64) -> i64 { var t: i64=v; if t<0{sys_write(1,"-" as *u8,1);t=0-t} let tm:*u8=sys_mmap(24); var k:i64=0; if t==0{tm[0]=48 as u8;k=1} while t>0{tm[k]=(48+(t%10)) as u8;t=t/10;k=k+1} let b:*u8=sys_mmap(24); var j:i64=0; while j<k{b[j]=tm[k-1-j];j=j+1} sys_write(1,b,k); return 0 } |
| 19 | func in_read(path: *u8, out: *u8, cap: i64) -> i64 |
| 25 | func in_write(path: *u8, buf: *u8, n: i64) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd < 0 { return 0 - 1 } sys_write(fd, buf, n); sys_close(fd); return n } |
| 26 | func in_join(out: *u8, dir: *u8, name: *u8) -> i64 { var o: i64=0; var i: i64=0; while dir[i]!=(0 as u8){out[o]=dir[i];o=o+1;i=i+1} out[o]=47 as u8; o=o+1; i=0; while name[i]!=(0 as u8){out[o]=name[i];o=o+1;i=i+1} out[o]=0 as u8; return o } called by 1: main |
| 27 | func in_field(reg: *u8, ls: i64, le: i64, f: i64, out: *u8, cap: i64) -> i64 |
| 32 | func in_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8) { if a[i]!=b[i] { return 0 } i=i+1 } if b[i]!=(0 as u8) { return 0 } return 1 } |
| 33 | func in_hex(buf: *u8, n: i64, out: *u8) -> i64 |
| 40 | func in_prior_hash(rprefix: *u8, name: *u8, out: *u8) -> i64 |
| 46 | func main(argc: i64, argv: *i64) -> i64 |