code wiki / _hdl_build / nx_dr_incremental.nx

nx_dr_incremental.nx

buildroot/runtime/_hdl_build/nx_dr_incremental.nx

6383 B94 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tooltopic dr
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_site_lock_lib.nx nx_sha256.nx nx_seg_store.nx nx_dr_incremental.nx

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

main in_w sys_write sys_exit sys_mkdir sys_mmap in_join ss_next_segid sys_mmap ↻ ss_cat ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ss_segid_ok ss_begin ss_begin_cap sys_mmap ↻ in_read sys_openat_rd ↻ sys_read ↻ sys_close ↻ slk_line_end in_field sys_mmap ↻ slk_field in_hex sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni

structs

none

consts

11const IN_MAGIC_1536: i64 = 1536
12const IN_MAGIC_262144: i64 = 262144
13const IN_MAGIC_1024: i64 = 1024
15const IN_CAP: i64 = 67108864

functions

17func 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 }
called by 1: main calls 1: sys_write
18func 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 }
called by 1: main calls 2: sys_writesys_mmap
19func in_read(path: *u8, out: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
25func 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 }
26func 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
27func in_field(reg: *u8, ls: i64, le: i64, f: i64, out: *u8, cap: i64) -> i64
called by 1: main calls 2: sys_mmapslk_field
32func 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 }
33func in_hex(buf: *u8, n: i64, out: *u8) -> i64
called by 1: main calls 2: sys_mmapsha256_digest
40func in_prior_hash(rprefix: *u8, name: *u8, out: *u8) -> i64
called by 1: main calls 2: sys_mmapss_get
46func main(argc: i64, argv: *i64) -> i64