66 #if defined(HAVE_LIBBZ2)
69 #if defined(HAVE_LIBLZMA)
78 #if defined(HAVE_LIBZSTD)
173 ctx->end_of_stream =
false;
174 ctx->is_stored =
false;
192 ctx->algorithm->deallocate(
ctx->ud);
211 if (
len == 0 ||
ctx->end_of_stream) {
218 while (!
end && out_offset <
len) {
219 out_len =
len - out_offset;
220 ret =
ctx->algorithm->process(
ctx->ud, (
zip_uint8_t *)data + out_offset, &out_len);
223 out_offset += out_len;
228 ctx->end_of_stream =
true;
234 if (
ctx->first_read < 0) {
241 ctx->is_stored =
true;
267 if (
ctx->first_read < 0) {
272 if (
ctx->first_read >= 0) {
274 ctx->can_store =
false;
294 if (out_offset > 0) {
295 ctx->can_store =
false;
296 ctx->size += out_offset;
317 ctx->end_of_stream =
false;
318 ctx->is_stored =
false;
319 ctx->first_read = -1;
326 if (!
ctx->algorithm->start(
ctx->ud, &st, &attributes)) {
337 if (!
ctx->algorithm->end(
ctx->ud)) {
348 if (
ctx->end_of_stream) {
360 if (
ctx->end_of_stream) {
378 if (
len <
sizeof(*attributes)) {
388 return sizeof(*attributes);
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
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 cmd
RZ_API void Ht_() free(HtName_(Ht) *ht)
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_SOURCE_SUPPORTS_READABLE
ZIP_EXTERN zip_int64_t zip_source_read(zip_source_t *_Nonnull, void *_Nonnull, zip_uint64_t)
#define ZIP_STAT_COMP_METHOD
ZIP_EXTERN int zip_source_get_file_attributes(zip_source_t *_Nonnull, zip_file_attributes_t *_Nonnull)
ZIP_EXTERN void zip_error_init(zip_error_t *_Nonnull)
ZIP_EXTERN int zip_source_stat(zip_source_t *_Nonnull, zip_stat_t *_Nonnull)
enum zip_source_cmd zip_source_cmd_t
#define ZIP_STAT_COMP_SIZE
@ ZIP_SOURCE_GET_FILE_ATTRIBUTES
#define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS
ZIP_EXTERN void zip_error_fini(zip_error_t *_Nonnull)
#define ZIP_ER_COMPNOTSUPP
ZIP_EXTERN zip_int64_t zip_source_make_command_bitmap(zip_source_cmd_t,...)
#define ZIP_FILE_ATTRIBUTES_VERSION_NEEDED
ZIP_EXTERN int zip_error_code_zip(const zip_error_t *_Nonnull)
ZIP_EXTERN zip_int64_t zip_error_to_data(const zip_error_t *_Nonnull, void *_Nonnull, zip_uint64_t)
void * malloc(size_t size)
zip_compression_algorithm_t * algorithm
zip_compression_algorithm_t * compress
zip_compression_algorithm_t * decompress
zip_uint16_t general_purpose_bit_mask
zip_uint16_t general_purpose_bit_flags
zip_uint8_t version_needed
zip_compression_algorithm_t zip_algorithm_bzip2_decompress
zip_compression_algorithm_t zip_algorithm_bzip2_compress
zip_compression_algorithm_t zip_algorithm_deflate_decompress
zip_compression_algorithm_t zip_algorithm_deflate_compress
zip_compression_algorithm_t zip_algorithm_xz_compress
zip_compression_algorithm_t zip_algorithm_xz_decompress
zip_compression_algorithm_t zip_algorithm_zstd_compress
zip_compression_algorithm_t zip_algorithm_zstd_decompress
void _zip_error_set_from_source(zip_error_t *err, zip_source_t *src)
ZIP_EXTERN int zip_compression_method_supported(zip_int32_t method, int compress)
zip_compression_algorithm_t * _zip_get_compression_algorithm(zip_int32_t method, bool compress)
static struct implementation implementations[]
static zip_int64_t compress_callback(zip_source_t *, void *, void *, zip_uint64_t, zip_source_cmd_t)
static zip_source_t * compression_source_new(zip_t *za, zip_source_t *src, zip_int32_t method, bool compress, int compression_flags)
zip_source_t * zip_source_decompress(zip_t *za, zip_source_t *src, zip_int32_t method)
zip_source_t * zip_source_compress(zip_t *za, zip_source_t *src, zip_int32_t method, int compression_flags)
static zip_int64_t compress_read(zip_source_t *, struct context *, void *, zip_uint64_t)
static struct context * context_new(zip_int32_t method, bool compress, int compression_flags, zip_compression_algorithm_t *algorithm)
static void context_free(struct context *ctx)
static size_t implementations_size
zip_source_t * zip_source_layered(zip_t *za, zip_source_t *src, zip_source_layered_callback cb, void *ud)
#define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS_ALLOWED_MASK
enum zip_compression_status zip_compression_status_t
#define ZIP_CM_IS_DEFAULT(x)
@ ZIP_COMPRESSION_NEED_DATA