code wiki / (root) / nx_sovgit_obj.nx

nx_sovgit_obj.nx

buildroot/runtime/nx_sovgit_obj.nx

8430 B219 linesdepth 7pulls 12 transitivereach 10 importersview sourcekind tooltopic sovgit
docsdependenciesstructsconstsfunctions

about

nx_sovgit_obj.nx -- SOVEREIGN GIT OBJECT STORE (roadmap rung X0). Content-addressed blob/tree/commit: frame = "<type> <len>\0<content>" id = SHA-256(frame) [git object-format=sha256, 64 lowercase hex] loose = zlib(frame) at <objroot>/<id[0:2]>/<id[2:64]> Reuses the sovereign substrate, no reinvention: sha256_digest (nx_sha256), dfe_compress (nx_deflate_enc, raw deflate -> we wrap 0x78 0x01 + adler32), nx_zlib_inflate + adler32 (nx_zlib_wrap/nx_adler32). Proven byte-exact against STOCK git 2.39 sha256 ids in nx_sovgit_obj_gate.nx. license_tier: ORIGINAL

dependencies 5 imports · 10 importers

nx_syscalls.nx nx_sha256.nx nx_deflate_enc.nx nx_zlib_wrap.nx nx_adler32.nx nx_sovgit_obj.nx nx_sovgit_git.nx nx_sovgit_obj_gate.nx nx_sovgit_pack_gate.nx nx_sovgit_packprobe.nx nx_sovgit_push.nx nx_sovgit_repo_gate.nx nx_sovgit_rtprobe.nx nx_sovgit_serve.nx nx_sovgit_unpack_gate.nx nx_sovgit_zlibprobe.nx

imports: nx_syscalls.nxnx_sha256.nxnx_deflate_enc.nxnx_zlib_wrap.nxnx_adler32.nx

imported by: nx_sovgit_git.nxnx_sovgit_obj_gate.nxnx_sovgit_pack_gate.nxnx_sovgit_packprobe.nxnx_sovgit_push.nxnx_sovgit_repo_gate.nxnx_sovgit_rtprobe.nxnx_sovgit_serve.nxnx_sovgit_unpack_gate.nxnx_sovgit_zlibprobe.nx

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

main sys_mmap sg_oid_hex sys_mmap ↻ sg_oid_raw sys_mmap ↻ sg_frame sg_cpy sg_slen sg_dec 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 blk_word sha256_final blk_set_byte ↻ sha256_compress ↻ sys_munmap sg_hex

structs

none

consts

14const K_MAGIC_1040: i64 = 1040
15const K_MAGIC_65536: i64 = 65536
16const K_MAGIC_4096: i64 = 4096

functions

19func sg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
21func sg_cpy(dst: *u8, dsto: i64, src: *u8, srco: i64, n: i64) -> i64
28func sg_dec(out: *u8, at: i64, v: i64) -> i64
called by 1: sg_frame calls 1: sys_mmap
41func sg_hex(dig: *u8, out: *u8) -> i64
called by 2: serve_uisg_oid_hex
59func sg_be32(out: *u8, at: i64, v: i64) -> i64
called by 1: sg_zwrap
69func sg_frame(typ: *u8, content: *u8, clen: i64, out: *u8) -> i64
82func sg_oid_raw(typ: *u8, content: *u8, clen: i64, out32: *u8) -> i64
91func sg_oid_hex(typ: *u8, content: *u8, clen: i64, outhex: *u8) -> i64
104func sg_zwrap(frame: *u8, flen: i64, zout: *u8) -> i64
116func sg_loose_path(objroot: *u8, hex: *u8, pbuf: *u8) -> i64
131func sg_write_loose(objroot: *u8, typ: *u8, content: *u8, clen: i64, outhex: *u8) -> i64
168func sg_read_loose(objroot: *u8, hex: *u8, out: *u8, typ_out: *u8) -> i64
203func sg_tree_entry(out: *u8, at: i64, mode: *u8, name: *u8, rawhash: *u8) -> i64
213func main() -> i64