DynXX-C
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions | Variables
Zip.h File Reference
#include "Types.h"
#include <stdio.h>

Go to the source code of this file.

Typedefs

typedef address DynXXUnZipHandle
 

Enumerations

enum  DynXXZipCompressMode { DynXXZipCompressModeDefault = -1 , DynXXZipCompressModePreferSpeed = 1 , DynXXZipCompressModePreferSize = 9 }
 
enum  DynXXZFormat { DynXXZFormatZLib = 0 , DynXXZFormatGZip = 1 , DynXXZFormatRaw = 2 }
 

Functions

DynXXZipHandle dynxx_z_zip_init (DynXXZipCompressMode mode, size_t bufferSize, DynXXZFormat format)
 initialize a ZIP process
 
size_t dynxx_z_zip_input (DynXXZipHandle zip, const byte *inBytes, size_t inLen, bool inFinish)
 input data to ZIP process
 
const bytedynxx_z_zip_process_do (DynXXZipHandle zip, DYNXX_OUT size_t *outLen)
 process the ZIP input data
 
bool dynxx_z_zip_process_finished (DynXXZipHandle zip)
 check whether all the ZIP data inputed before are processed
 
void dynxx_z_zip_release (DynXXZipHandle zip)
 release a ZIP process
 
DynXXUnZipHandle dynxx_z_unzip_init (size_t bufferSize, DynXXZFormat format)
 initialize a UNZIP process
 
size_t dynxx_z_unzip_input (DynXXUnZipHandle unzip, const byte *inBytes, size_t inLen, bool inFinish)
 input data to UNZIP process
 
const bytedynxx_z_unzip_process_do (DynXXUnZipHandle unzip, DYNXX_OUT size_t *outLen)
 process the UNZIP input data
 
bool dynxx_z_unzip_process_finished (DynXXUnZipHandle unzip)
 check whether all the ZIP data inputed before are processed
 
void dynxx_z_unzip_release (DynXXUnZipHandle unzip)
 release a unzip process
 
bool dynxx_z_cfile_zip (DynXXZipCompressMode mode, size_t bufferSize, DynXXZFormat format, FILE *cFILEIn, FILE *cFILEOut)
 ZIP for C FILE.
 
bool dynxx_z_cfile_unzip (size_t bufferSize, DynXXZFormat format, FILE *cFILEIn, FILE *cFILEOut)
 UNZIP for C FILE.
 
const bytedynxx_z_bytes_zip (DynXXZipCompressMode mode, size_t bufferSize, DynXXZFormat format, const byte *inBytes, size_t inLen, DYNXX_OUT size_t *outLen)
 ZIP for bytes.
 
const bytedynxx_z_bytes_unzip (size_t bufferSize, DynXXZFormat format, const byte *inBytes, size_t inLen, DYNXX_OUT size_t *outLen)
 UNZIP for bytes.
 

Variables

DYNXX_EXTERN_C_BEGIN typedef address DynXXZipHandle
 

Typedef Documentation

◆ DynXXUnZipHandle

Enumeration Type Documentation

◆ DynXXZFormat

Z header type

Enumerator
DynXXZFormatZLib 
DynXXZFormatGZip 
DynXXZFormatRaw 

◆ DynXXZipCompressMode

ZIP compress mode

Enumerator
DynXXZipCompressModeDefault 
DynXXZipCompressModePreferSpeed 
DynXXZipCompressModePreferSize 

Function Documentation

◆ dynxx_z_bytes_unzip()

const byte * dynxx_z_bytes_unzip ( size_t  bufferSize,
DynXXZFormat  format,
const byte inBytes,
size_t  inLen,
DYNXX_OUT size_t *  outLen 
)

UNZIP for bytes.

Parameters
bufferSizebuffer size,must be positive
formatheader type, see DynXXZFormat
inBytesInput bytes data
inLenInput bytes length
outLenA pointer to read output bytes length
Returns
output bytes data

◆ dynxx_z_bytes_zip()

const byte * dynxx_z_bytes_zip ( DynXXZipCompressMode  mode,
size_t  bufferSize,
DynXXZFormat  format,
const byte inBytes,
size_t  inLen,
DYNXX_OUT size_t *  outLen 
)

ZIP for bytes.

Parameters
modeZIP mode, see DynXXZipCompressMode
bufferSizebuffer size,must be positive
formatheader type, see DynXXZFormat
inBytesInput bytes data
inLenInput bytes length
outLenA pointer to read output bytes length
Returns
output bytes data

◆ dynxx_z_cfile_unzip()

bool dynxx_z_cfile_unzip ( size_t  bufferSize,
DynXXZFormat  format,
FILE *  cFILEIn,
FILE *  cFILEOut 
)

UNZIP for C FILE.

Warning
Not accessible in JS/Lua!
Parameters
bufferSizebuffer size,must be positive
formatheader type, see DynXXZFormat
cFILEInInput C FILE
cFILEOutOutput C FILE
Returns
whether finished or not

◆ dynxx_z_cfile_zip()

bool dynxx_z_cfile_zip ( DynXXZipCompressMode  mode,
size_t  bufferSize,
DynXXZFormat  format,
FILE *  cFILEIn,
FILE *  cFILEOut 
)

ZIP for C FILE.

Warning
Not accessible in JS/Lua!
Parameters
modeZIP mode, see DynXXZipCompressMode
bufferSizebuffer size,must be positive
formatheader type, see DynXXZFormat
cFILEInInput C FILE
cFILEOutOutput C FILE
Returns
whether finished or not

◆ dynxx_z_unzip_init()

DynXXUnZipHandle dynxx_z_unzip_init ( size_t  bufferSize,
DynXXZFormat  format 
)

initialize a UNZIP process

Parameters
bufferSizebuffer size,must be positive
formatheader type, see DynXXZFormat
Returns
a UNZIP handle

◆ dynxx_z_unzip_input()

size_t dynxx_z_unzip_input ( DynXXUnZipHandle  unzip,
const byte inBytes,
size_t  inLen,
bool  inFinish 
)

input data to UNZIP process

Parameters
unzipThe UNZIP handle
inBytesinput data bytes
inLeninput data length
inFinishWhether input is finished or not
Returns
The received data length, return 0 if error occurred

◆ dynxx_z_unzip_process_do()

const byte * dynxx_z_unzip_process_do ( DynXXUnZipHandle  unzip,
DYNXX_OUT size_t *  outLen 
)

process the UNZIP input data

Parameters
unzipThe UNZIP handle
outLena pointer to read the output data length
Returns
output data bytes, return nullptr if error occurred

◆ dynxx_z_unzip_process_finished()

bool dynxx_z_unzip_process_finished ( DynXXUnZipHandle  unzip)

check whether all the ZIP data inputed before are processed

Parameters
unzipThe UNZIP handle
Returns
whether finished or not

◆ dynxx_z_unzip_release()

void dynxx_z_unzip_release ( DynXXUnZipHandle  unzip)

release a unzip process

Parameters
unzipThe unzip handle

◆ dynxx_z_zip_init()

DynXXZipHandle dynxx_z_zip_init ( DynXXZipCompressMode  mode,
size_t  bufferSize,
DynXXZFormat  format 
)

initialize a ZIP process

Parameters
modeZIP mode, see DynXXZipCompressMode
bufferSizebuffer size,must be positive
formatheader type, see DynXXZFormat
Returns
a ZIP handle

◆ dynxx_z_zip_input()

size_t dynxx_z_zip_input ( DynXXZipHandle  zip,
const byte inBytes,
size_t  inLen,
bool  inFinish 
)

input data to ZIP process

Parameters
zipThe ZIP handle
inBytesinput data bytes
inLeninput data length
inFinishWhether input is finished or not
Returns
The received data length, return 0 if error occurred

◆ dynxx_z_zip_process_do()

const byte * dynxx_z_zip_process_do ( DynXXZipHandle  zip,
DYNXX_OUT size_t *  outLen 
)

process the ZIP input data

Parameters
zipThe ZIP handle
outLena pointer to read the output data length
Returns
output data bytes, return nullptr if error occurred

◆ dynxx_z_zip_process_finished()

bool dynxx_z_zip_process_finished ( DynXXZipHandle  zip)

check whether all the ZIP data inputed before are processed

Parameters
zipThe ZIP handle
Returns
whether finished or not

◆ dynxx_z_zip_release()

void dynxx_z_zip_release ( DynXXZipHandle  zip)

release a ZIP process

Parameters
zipThe ZIP handle

Variable Documentation

◆ DynXXZipHandle

DYNXX_EXTERN_C_BEGIN typedef address DynXXZipHandle