Listing for LZNV_Defines Header File
LZNV Header File Contents
LZNV Header File Contents
LZNV Defines.h content:
#pragma once
#ifndef _LZNV_ERROR_DEFINES
#define _LZNV_ERROR_DEFINES
#define _LZNV_ERROR_INVALID_COMPRESSION_METHOD (140)
#define _LZNV_ERROR_INVALID_BUFFER_SIZE (141)
#define _LZNV_ERROR_EXPORTED_MAIN_FUNC_NOT_FOUND (142) // CORRUPTED DLL?
#define _LZNV_ERROR_UNKNOWN_COMMAND_TO_EXECUTE (143)
#define _LZNV_ERROR_NOT_ENOUGH_OUTPUT_SPACE (144)
#define _LZNV_ERROR_BAD_HEADER_INFO_RECORDED (145)
#define _LZNV_ERROR_INVALID_FILE_PATH_PARAMS (146)
#define _LZNV_ERROR_INVALID_INPUT_FILE (147)
#define _LZNV_ERROR_INVALID_INPUT_FILE_SIZE (148)
#define _LZNV_ERROR_INVALID_OUTPUT_FILE (149)
#define _LZNV_ERROR_WRITING_HEADER (150)
#define _LZNV_ERROR_MEMORY_ALLOCATION_ERROR_OR_SIZE (151)
#define _LZNV_ERROR_BAD_HEADER_INFO (152)
#define _LZNV_ERROR_INVALID_READ (153)
#define _LZNV_ERROR_INVALID_PROCESS_SIZE (154)
#endif
#ifndef _LZNV_DEFINES
#define _LZNV_DEFINES
#define _LZNV_MAXPATH_ (320)
#define _LZNV_COMMAND_ENCODE (0x01)
#define _LZNV_COMMAND_DECODE (0x00)
#define _LZNV_COMMAND_TEST (0x02)
//
// LZ Engine Methods
//
#define _LZNV_ULTRAFAST_COMPRESSION 0x00
#define _LZNV_SUPERFAST_COMPRESSION 0x01
#define _LZNV_FAST_COMPRESSION 0x02
#define _LZNV_NORMAL_COMPRESSION 0x03
#define _LZNV_BETTER_COMPRESSION 0x04
#define _LZNV_MAX_LZ_COMPRESSION (_LZNV_BETTER_COMPRESSION)
#define _LZNV_MAX_LZ_ALGORITHMS (_LZNV_BETTER_COMPRESSION + 1)
//
// Entropy Coder Methods
//
#define _LZNV_HUFFMAN_COMPRESSION 0x11 // MAPS to NXT_ENTROPY_CODING_METHOD_HUFF
#define _LZNV_ANS_COMPRESSION 0x12 // MAPS to NXT_ENTROPY_CODING_METHOD_ANS
#define _LZNV_ARITHMETIC_COMPRESSION 0x13 // MAPS to NXT_ENTROPY_CODING_METHOD_ARI
#define _LZNV_RLE8_COMPRESSION 0x14 // MAPS to NXT_ENTROPY_CODING_METHOD_RLE8
#define _LZNV_RLE32_COMPRESSION 0x15 // MAPS to NXT_ENTROPY_CODING_METHOD_RLE32
#define _LZNV_RLE64_COMPRESSION 0x16 // MAPS to NXT_ENTROPY_CODING_METHOD_RLE64
#define _LZNV_MAX_ENTROPY_COMPRESSION (_LZNV_RLE64_COMPRESSION)
#define _LZNV_MAX_ENTROPY_ALGORITHMS (_LZNV_RLE64_COMPRESSION + 1)
//
// Miscellaneous Options
//
#define _LZNV_SET_INTERNAL_VERIFICATION_OFF 0x00
#define _LZNV_SET_INTERNAL_VERIFICATION_ON 0x01
//
// CPU Priority Settings
//
#define _LZNV_BELOW_NORMAL_PRIORITY_CLASS 0x00
#define _LZNV_NORMAL_PRIORITY_CLASS 0x01
#define _LZNV_HIGH_PRIORITY_CLASS 0x02
#define _LZNV_ABOVE_NORMAL_PRIORITY_CLASS 0x03
#define _LZNV_REALTIME_PRIORITY_CLASS 0x04
//
// LZNV Table Size Index
//
#define _LZNV_BUFFER_SIZE_256KB_INDX 0x00
#define _LZNV_BUFFER_SIZE_512KB_INDX 0x01
#define _LZNV_BUFFER_SIZE_1MB_INDX 0x02
#define _LZNV_BUFFER_SIZE_2MB_INDX 0x03
#define _LZNV_BUFFER_SIZE_4MB_INDX 0x04
#define _LZNV_BUFFER_SIZE_8MB_INDX 0x05
#define _LZNV_BUFFER_SIZE_16MB_INDX 0x06
#define _LZNV_MAX_BUFFER_SIZE_INDX (_LZNV_BUFFER_SIZE_16MB_INDX + 1)
#endif
#ifndef LZNV_MAX_OUTPUT_SIZE_TO_ALLOCATE
#define LZNV_MAX_OUTPUT_SIZE_TO_ALLOCATE(_buff_size) ((_buff_size) < 16384 ? ((_buff_size) + 4096) : (((_buff_size) + (_buff_size)/3) + 1)) // prevents expansion
#endif
#pragma pack(push, 8)
typedef struct _LZNV_PARAM_TYPE
{
uint8_t _verbose; // display more info
uint8_t _use_callback; // true/false
uint8_t _cpu_priority_level; // _LZNV_BELOW_NORMAL_PRIORITY_CLASS .. _LZNV_REALTIME_PRIORITY_CLASS
uint8_t _internal_verification; // performs also an internal verification only when compressing. slower.
uint8_t _encoding_method; // _LZNV_ULTRAFAST_COMPRESSION .. _LZNV_BETTER_COMPRESSION
uint8_t _command_to_execute; // _LZNV_COMMAND_ENCODE, _LZNV_COMMAND_DECODE, _LZNV_COMMAND_TEST
uint8_t _memory_level; // 0 = 256KB, 1 = 512KB, 2 = 1MB, 3 = 2MB, 4 = 4MB, 5 = 8MB, 6 = 16MB, 6 = 32MB, 7 = 64MB
uint8_t _reserved8;
uint32_t _file_adler32; // file adler32
uint32_t _reserved32;
uint64_t _reserved64;
int8_t _sz_password[12]; // entropy coder future usage
wchar_t _source_file_path[_LZNV_MAXPATH_ + 1];
wchar_t _target_file_path[_LZNV_MAXPATH_ + 1];
}
LZNV_FILE_COMMAND_PARAMS, * P_LZNV_FILE_COMMAND_PARAMS;
#pragma pack(pop)
#pragma pack(push, 8)
typedef struct _LZNV_PARAM_TYPE_BUFFER_COMPRESSION_
{
uint8_t _verbose; // display more info
uint8_t _use_callback; // true/false
uint8_t _cpu_priority_level; // _LZNV_BELOW_NORMAL_PRIORITY_CLASS .. _LZNV_REALTIME_PRIORITY_CLASS
uint8_t _internal_verification; // performs also an internal verification only when compressing. slower.
uint8_t _encoding_method; // _LZNV_ULTRAFAST_COMPRESSION .. _LZNV_BETTER_COMPRESSION
uint8_t _command_to_execute; // _LZNV_COMMAND_ENCODE, _LZNV_COMMAND_DECODE
uint8_t _memory_level; // 0 = 256KB, 1 = 512KB, 2 = 1MB, 3 = 2MB, 4 = 4MB, 5 = 8MB, 6 = 16MB, 6 = 32MB, 7 = 64MB
uint8_t _reserved8;
uint32_t _block_adler32; // block adler32
uint32_t _reserved32; // upwards compatibility
uint64_t _reserved64;
int8_t _sz_password[12]; // entropy coder usage
uint8_t* _p_source_buffer; // Preallocate and set size to _i_source_buffer_size
uint8_t* _p_destination_buffer; // Preallocate and set size to _i_destination_buffer_size
int32_t _i_source_buffer_size; // Non-Zero value
int32_t _i_destination_buffer_size; // Non-Zero value
}
LZNV_BUFFER_COMMAND_PARAMS, * P_LZNV_BUFFER_COMMAND_PARAMS;
#pragma pack(pop)
#ifdef _WIN64
#define LZNV_DLL_MAIN_FILE_ "LZNV_Main_File_Compress"
#define LZNV_DLL_MAIN_BUFFER_ "LZNV_Main_Buffer_Compress"
#endif
/**
*
* Definitions of LZNV_Main File Compression function prototype
*
* @param _encode_param_struct The LZNV_FILE_COMMAND_PARAMS structure which defines the parameters for LZNV command
*
*/
typedef int32_t(__stdcall* PF_LZNV_DLL_MAIN_FILE)(LZNV_FILE_COMMAND_PARAMS& _command_param_struct);
/**
*
* Definitions of LZNV_Main Buffer Compression function prototype
*
* @param _encode_param_struct The LZNV_BUFFER_COMMAND_PARAMS structure which defines the parameters for LZNV command
*
*/
typedef int32_t(__stdcall* PF_LZNV_DLL_MAIN_BUFFER)(LZNV_BUFFER_COMMAND_PARAMS& _command_param_struct);