code wiki / (root) / nx_galx_vidindex.nx

nx_galx_vidindex.nx

buildroot/runtime/nx_galx_vidindex.nx

8544 B181 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic galx
docsdependenciesstructsconstsfunctions

about

nx_galx_vidindex.nx -- SOVEREIGN recordings index. Recursively scans the cam-recording archive (sys_getdents64, no bash/find) and writes knowledge/status/galx_vid_paths.tsv = one video path per line. Each cam recording is <model>_<date>_<time>.ts with a sibling <...>-poster.jpg the daemon serves as the thumbnail (so recordings show instantly with NO video decode). Skips #recycle and .trickplay dirs. Usage: nx_galx_vidindex (no args = full scan). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_galx_vidindex.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_openat_wr vi_p sys_write sys_exit vi_copy_nontorrent sys_openat_rd sys_mmap ↻ sys_read vi_contains vi_len sys_write ↻ sys_close vi_walk sys_openat_rd ↻ sys_mmap ↻ vi_len ↻ sys_getdents64 dirent_reclen dirent_type dirent_name vi_is_vid vi_len ↻ sys_write ↻ vi_is_trick vi_len ↻ vi_walk ↻ sys_close ↻ sys_close ↻ sys_renameat vi_vidoff_build sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read ↻ sys_close ↻ vi_wb64

structs

none

consts

8const VI_MAGIC_8192: i64 = 8192
9const VI_MAGIC_8191: i64 = 8191
10const VI_MAGIC_2048: i64 = 2048
12const GBUF: i64 = 65536
13const VI_OUT: *u8 = "/volume1/ai/galx/knowledge/status/galx_vid_paths.tsv" as *u8 // the LIVE catalog nx_gallery_serve opens (NAS-native; the old /mnt/c path failed to write on the NAS)
14const VI_TMP: *u8 = "/volume1/ai/galx/knowledge/status/galx_vid_paths.tsv.reidx" as *u8 // build here, atomic-rename onto VI_OUT so the gallery never reads a half-written catalog
15const VI_OFF: *u8 = "/volume1/ai/galx/knowledge/status/galx_vid_off.bin" as *u8
16const VI_OFF_TMP: *u8 = "/volume1/ai/galx/knowledge/status/galx_vid_off.bin.reidx" as *u8

functions

18func vi_p(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
23func vi_n(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
24func vi_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
26func vi_is_vid(name: *u8) -> i64
called by 1: vi_walk calls 1: vi_len
37func vi_is_trick(name: *u8) -> i64
called by 1: vi_walk calls 1: vi_len
45func vi_walk(dir: *u8, depth: i64, outfd: i64, cntp: *i64) -> i64
85func vi_contains(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: vi_copy_nontorrent calls 1: vi_len
98func vi_copy_nontorrent(srcpath: *u8, dstfd: i64, cntp: *i64) -> i64
125func vi_wb64(b: *u8, o: i64, v: i64) -> i64 { b[o]=((v>>56)&0xff) as u8; b[o+1]=((v>>48)&0xff) as u8; b[o+2]=((v>>40)&0xff) as u8; b[o+3]=((v>>32)&0xff) as u8; b[o+4]=((v>>24)&0xff) as u8; b[o+5]=((v>>16)&0xff) as u8; b[o+6]=((v>>8)&0xff) as u8; b[o+7]=(v&0xff) as u8; return o+8 }
called by 1: vi_vidoff_build
126func vi_vidoff_build(pidsuf: *u8) -> i64
152func main(argc: i64, argv: *i64) -> i64