]> pd.if.org Git - zpackage/blobdiff - lzma/common/common.h
use lzma from xz 5.2.4
[zpackage] / lzma / common / common.h
index 955d784a5b6aff7f584ac978e524b87013b7b0d1..b3d3b7a059b108592e23232c6b92779000d41d18 100644 (file)
 #define LZMA_TIMED_OUT 32
 
 
-/// Type of encoder/decoder specific data; the actual structure is defined
-/// differently in different coders.
-typedef struct lzma_coder_s lzma_coder;
-
 typedef struct lzma_next_coder_s lzma_next_coder;
 
 typedef struct lzma_filter_info_s lzma_filter_info;
@@ -107,7 +103,7 @@ typedef lzma_ret (*lzma_init_function)(
 /// input and output buffers, but for simplicity they still use this same
 /// function prototype.
 typedef lzma_ret (*lzma_code_function)(
-               lzma_coder *coder, const lzma_allocator *allocator,
+               void *coder, const lzma_allocator *allocator,
                const uint8_t *restrict in, size_t *restrict in_pos,
                size_t in_size, uint8_t *restrict out,
                size_t *restrict out_pos, size_t out_size,
@@ -115,7 +111,7 @@ typedef lzma_ret (*lzma_code_function)(
 
 /// Type of a function to free the memory allocated for the coder
 typedef void (*lzma_end_function)(
-               lzma_coder *coder, const lzma_allocator *allocator);
+               void *coder, const lzma_allocator *allocator);
 
 
 /// Raw coder validates and converts an array of lzma_filter structures to
@@ -138,7 +134,7 @@ struct lzma_filter_info_s {
 /// Hold data and function pointers of the next filter in the chain.
 struct lzma_next_coder_s {
        /// Pointer to coder-specific data
-       lzma_coder *coder;
+       void *coder;
 
        /// Filter ID. This is LZMA_VLI_UNKNOWN when this structure doesn't
        /// point to a filter coder.
@@ -160,21 +156,21 @@ struct lzma_next_coder_s {
 
        /// Pointer to a function to get progress information. If this is NULL,
        /// lzma_stream.total_in and .total_out are used instead.
-       void (*get_progress)(lzma_coder *coder,
+       void (*get_progress)(void *coder,
                        uint64_t *progress_in, uint64_t *progress_out);
 
        /// Pointer to function to return the type of the integrity check.
        /// Most coders won't support this.
-       lzma_check (*get_check)(const lzma_coder *coder);
+       lzma_check (*get_check)(const void *coder);
 
        /// Pointer to function to get and/or change the memory usage limit.
        /// If new_memlimit == 0, the limit is not changed.
-       lzma_ret (*memconfig)(lzma_coder *coder, uint64_t *memusage,
+       lzma_ret (*memconfig)(void *coder, uint64_t *memusage,
                        uint64_t *old_memlimit, uint64_t new_memlimit);
 
        /// Update the filter-specific options or the whole filter chain
        /// in the encoder.
-       lzma_ret (*update)(lzma_coder *coder, const lzma_allocator *allocator,
+       lzma_ret (*update)(void *coder, const lzma_allocator *allocator,
                        const lzma_filter *filters,
                        const lzma_filter *reversed_filters);
 };