Initial project import

This commit is contained in:
Agila Forge Importer committed 2026-07-13 15:20:32 +00:00
commit 23f2d29e32
11957 files changed
+1754577

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
module zlib
import compress.deflate
// compress compresses data using the zlib container format.
pub fn compress(data []u8) ![]u8 {
return deflate.compress_zlib(data)
}
// decompress decompresses zlib-compressed data.
pub fn decompress(data []u8) ![]u8 {
return deflate.decompress_zlib(data)
}
// decompress_with_callback decompresses a zlib stream (RFC 1950) using a callback for chunked delivery.
// The callback receives chunks of decompressed data and should return the chunk length to continue, or 0 to abort.
// Returns the total decompressed length.
pub fn decompress_with_callback(data []u8, cb deflate.ChunkCallback, userdata voidptr) !int {
deflate.validate_zlib_header(data)!
return deflate.decompress_with_callback(data, cb, userdata)
}