44 #define HEADER_BYTES_ZIP 9
45 #define HEADER_MAGIC_LENGTH 4
46 #define HEADER_MAGIC1_OFFSET 0
47 #define HEADER_MAGIC2_OFFSET 2
48 #define HEADER_SIZE_OFFSET 9
49 #define HEADER_SIZE_LENGTH 8
50 #define HEADER_PARAMETERS_LENGTH 5
51 #define HEADER_LZMA_ALONE_LENGTH (HEADER_PARAMETERS_LENGTH + HEADER_SIZE_LENGTH)
117 if (compression_flags < 0 || compression_flags > 9) {
267 Bytef empty_buffer[1];
287 ctx->
zstr.next_out = empty_buffer;
288 ctx->
zstr.avail_out =
sizeof(*empty_buffer);
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
#define LZMA_CONCATENATED
const lzma_filter * filters
#define LZMA_PRESET_EXTREME
Extreme compression preset.
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
#define ZIP_ER_COMPRESSED_DATA
#define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS
void * malloc(size_t size)
static const char struct stat static buf struct stat static buf static vhangup int options
#define LZMA_FILTER_LZMA2
LZMA2 Filter ID.
#define LZMA_FILTER_LZMA1
LZMA1 Filter ID.
The public API of liblzma data compression library.
zip_uint8_t header_bytes_offset
zip_uint64_t uncompresssed_size
zip_uint8_t header[HEADER_MAGIC_LENGTH+HEADER_LZMA_ALONE_LENGTH]
zip_uint32_t compression_flags
enum header_state header_state
void * options
Pointer to filter-specific options structure.
Options specific to the LZMA1 and LZMA2 filters.
Passing data to and from liblzma.
zip_uint16_t general_purpose_bit_mask
zip_uint16_t general_purpose_bit_flags
uint64_t uncompressed_size
void error(const char *msg)
#define LZMA_VLI_UNKNOWN
VLI value to denote that the value is unknown.
lzma_ret
Return values used by several functions in liblzma.
@ LZMA_DATA_ERROR
Data is corrupt.
@ LZMA_MEM_ERROR
Cannot allocate memory.
@ LZMA_STREAM_END
End of stream was reached.
@ LZMA_UNSUPPORTED_CHECK
Cannot calculate the integrity check.
@ LZMA_BUF_ERROR
No progress is possible.
@ LZMA_OPTIONS_ERROR
Invalid or unsupported options.
@ LZMA_OK
Operation completed successfully.
@ LZMA_FINISH
Finish the coding operation.
@ LZMA_RUN
Continue coding.
static void * allocate(bool compress, int compression_flags, zip_error_t *error, zip_uint16_t method)
static zip_uint64_t maximum_compressed_size(zip_uint64_t uncompressed_size)
#define HEADER_MAGIC2_OFFSET
zip_compression_algorithm_t zip_algorithm_xz_compress
static void deallocate(void *ud)
#define HEADER_SIZE_OFFSET
#define HEADER_LZMA_ALONE_LENGTH
static int map_error(lzma_ret ret)
#define HEADER_MAGIC_LENGTH
static void * decompress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error)
static void * compress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error)
zip_compression_algorithm_t zip_algorithm_xz_decompress
static bool start(void *ud, zip_stat_t *st, zip_file_attributes_t *attributes)
#define HEADER_SIZE_LENGTH
static bool end(void *ud)
static zip_uint16_t general_purpose_bit_flags(void *ud)
static void end_of_input(void *ud)
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)
static zip_compression_status_t process(void *ud, zip_uint8_t *data, zip_uint64_t *length)
zip_buffer_t * _zip_buffer_new(zip_uint8_t *data, zip_uint64_t size)
void _zip_buffer_free(zip_buffer_t *buffer)
int _zip_buffer_put_64(zip_buffer_t *buffer, zip_uint64_t i)
enum zip_compression_status zip_compression_status_t
@ ZIP_COMPRESSION_NEED_DATA