nx_gzip_wrap.nx
buildroot/runtime/nx_gzip_wrap.nx
about
nx_gzip_wrap.nx -- RFC 1952 gzip container (DEFLATE + magic + CRC32 + size).
CAPABILITY_COMPLETENESS: FULL
gzip stream layout per RFC 1952:
+---+---+---+---+---+---+---+---+---+---+
|ID1|ID2|CM |FLG| MTIME |XFL|OS | 10-byte fixed header
+---+---+---+---+---+---+---+---+---+---+
[ XLEN | <extra field> ] if FLG.FEXTRA set
[ FNAME (zero-terminated) ] if FLG.FNAME set
[ FCOMMENT (zero-terminated) ] if FLG.FCOMMENT set
[ CRC16-of-header-so-far ] if FLG.FHCRC set
+-----------------------------+
| ... | DEFLATE-compressed data
+-----------------------------+
| CRC32 | 4-byte LE CRC-32 of UNCOMPRESSED
+-----------------------------+
| ISIZE | 4-byte LE uncompressed size mod 2^32
+-----------------------------+
FLG bits:
0 FTEXT -- ASCII hint (advisory)
1 FHCRC -- 2-byte header CRC16 trailer present
2 FEXTRA -- 2-byte XLEN + extra field present
3 FNAME -- zero-terminated filename present
4 FCOMMENT -- zero-terminated comment present
5-7 -- reserved; must be 0 (BAD_FLAGS otherwise)
CM must be 8 (deflate) -- only legal value per spec.
genealogy_id: rfc1952_gzip_1996
lineage_id: nx_gzip_wrap_v1
Composes: nx_deflate + nx_crc32 (already shipped).
dependencies 5 imports · 15 importers
diagram shows first 10 each side; +0 more imports, +5 more importers in the complete lists below.
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_deflate.nxnx_crc32.nx
imported by: nishi.nxnx_bam_file_compose_test.nxnx_barcheck.nxnx_bgzf_test.nxnx_cc_ingest.nxnx_cc_warc_fetch.nxnx_cc_warc_ingest.nxnx_fetchprobeb.nxnx_gzip_inflate_kat_test.nxnx_https_fetch_follow.nxnx_https_get_cli2.nxnx_lib_pow_decomp.nxnx_libdata.nxnx_page_ingest.nxnx_research_engine.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 72 | struct NxGzipResult |
consts
| 48 | const NX_MAGIC_4294967295: i64 = 4294967295 |
| 52 | const NX_GZ_OK: nx_int = 0 |
| 53 | const NX_GZ_ERR_TOO_SHORT: nx_int = 1 |
| 54 | const NX_GZ_ERR_BAD_MAGIC: nx_int = 2 |
| 55 | const NX_GZ_ERR_BAD_METHOD: nx_int = 3 |
| 56 | const NX_GZ_ERR_BAD_FLAGS: nx_int = 4 |
| 57 | const NX_GZ_ERR_FIELD_OVERRUN: nx_int = 5 |
| 58 | const NX_GZ_ERR_DEFLATE: nx_int = 6 |
| 59 | const NX_GZ_ERR_CRC_MISMATCH: nx_int = 7 |
| 60 | const NX_GZ_ERR_SIZE_MISMATCH: nx_int = 8 |
| 63 | const NX_GZ_FTEXT: nx_int = 1 // bit 0 |
| 64 | const NX_GZ_FHCRC: nx_int = 2 // bit 1 |
| 65 | const NX_GZ_FEXTRA: nx_int = 4 // bit 2 |
| 66 | const NX_GZ_FNAME: nx_int = 8 // bit 3 |
| 67 | const NX_GZ_FCOMMENT: nx_int = 16 // bit 4 |
| 68 | const NX_GZ_FRESERVED: nx_int = 224 // bits 5-7 |
| 86 | const NX_GZ_RESULT_BYTES: nx_size = 96 |
functions
| 90 | func _gz_read_u16_le(buf: *u8, off: nx_int) -> nx_int called by 1: nx_gzip_inflate |
| 96 | func _gz_read_u32_le(buf: *u8, off: nx_int) -> nx_int called by 1: nx_gzip_inflate |
| 106 | func _gz_skip_cstring(buf: *u8, off: nx_int, end: nx_int) -> nx_int called by 1: nx_gzip_inflate |
| 117 | func nx_gzip_inflate(input: *u8, input_size: nx_int, |
| 261 | func main() -> nx_int |