1 ///////////////////////////////////////////////////////////////////////////////
3 /// \file simple_private.h
4 /// \brief Private definitions for so called simple filters
6 // Author: Lasse Collin
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
11 ///////////////////////////////////////////////////////////////////////////////
13 #ifndef LZMA_SIMPLE_PRIVATE_H
14 #define LZMA_SIMPLE_PRIVATE_H
16 #include "simple_coder.h"
19 typedef struct lzma_simple_s lzma_simple
;
22 /// Next filter in the chain
25 /// True if the next coder in the chain has returned LZMA_STREAM_END.
28 /// True if filter() should encode the data; false to decode.
29 /// Currently all simple filters use the same function for encoding
30 /// and decoding, because the difference between encoders and decoders
34 /// Pointer to filter-specific function, which does
35 /// the actual filtering.
36 size_t (*filter
)(lzma_simple
*simple
, uint32_t now_pos
,
37 bool is_encoder
, uint8_t *buffer
, size_t size
);
39 /// Pointer to filter-specific data, or NULL if filter doesn't need
43 /// The lowest 32 bits of the current position in the data. Most
44 /// filters need this to do conversions between absolute and relative
48 /// Size of the memory allocated for the buffer.
51 /// Flushing position in the temporary buffer. buffer[pos] is the
52 /// next byte to be copied to out[].
55 /// buffer[filtered] is the first unfiltered byte. When pos is smaller
56 /// than filtered, there is unflushed filtered data in the buffer.
59 /// Total number of bytes (both filtered and unfiltered) currently
60 /// in the temporary buffer.
68 extern lzma_ret
lzma_simple_coder_init(lzma_next_coder
*next
,
69 const lzma_allocator
*allocator
,
70 const lzma_filter_info
*filters
,
71 size_t (*filter
)(lzma_simple
*simple
, uint32_t now_pos
,
72 bool is_encoder
, uint8_t *buffer
, size_t size
),
73 size_t simple_size
, size_t unfiltered_max
,
74 uint32_t alignment
, bool is_encoder
);