lz4: Start of implementation.

This commit is contained in:
Jeroen van Rijn
2021-09-19 12:51:07 +02:00
parent 2b77f5b72f
commit e760535dba
3 changed files with 444 additions and 2 deletions
+23 -2
View File
@@ -56,9 +56,11 @@ Error :: union {
as it may involve an I/O error, a Deflate error, etc.
*/
image.Error,
io.Error,
}
General_Error :: enum {
None = 0,
File_Not_Found,
Cannot_Open_File,
File_Too_Short,
@@ -69,7 +71,6 @@ General_Error :: enum {
Incompatible_Options,
Unimplemented,
/*
Memory errors
*/
@@ -98,7 +99,28 @@ GZIP_Error :: enum {
You can tweak this setting using `-define:COMPRESS_OUTPUT_ALLOCATE_MAX=size_in_bytes`
*/
Output_Exceeds_COMPRESS_OUTPUT_ALLOCATE_MAX,
}
LZ4_Error :: enum {
Generic,
Max_Block_Size_Invalid,
Block_Mode_Invalid,
Content_Checksum_Invalid,
Compression_Level_Invalid,
Header_Version_Wrong,
Block_Checksum_Invalid,
Reserved_Flag_Set,
Allocation_Failed,
Source_Size_Too_Large,
Output_Buffer_Too_Small,
Frame_Header_Incomplete,
Frame_Type_Unknown,
Frame_Type_Wrong,
Frame_Size_Wrong,
Source_Input_Wrong,
Decompression_Failed,
Header_Checksum_Invalid,
Frame_Decoding_Already_Started,
}
ZIP_Error :: enum {
@@ -125,7 +147,6 @@ Deflate_Error :: enum {
BType_3,
}
// General I/O context for ZLIB, LZW, etc.
Context_Memory_Input :: struct #packed {
input_data: []u8,