Deleted Added
full compact
simple_private.h (292588) simple_private.h (312518)
1///////////////////////////////////////////////////////////////////////////////
2//
3/// \file simple_private.h
4/// \brief Private definitions for so called simple filters
5//
6// Author: Lasse Collin
7//
8// This file has been put into the public domain.
9// You can do whatever you want with this file.
10//
11///////////////////////////////////////////////////////////////////////////////
12
13#ifndef LZMA_SIMPLE_PRIVATE_H
14#define LZMA_SIMPLE_PRIVATE_H
15
16#include "simple_coder.h"
17
18
1///////////////////////////////////////////////////////////////////////////////
2//
3/// \file simple_private.h
4/// \brief Private definitions for so called simple filters
5//
6// Author: Lasse Collin
7//
8// This file has been put into the public domain.
9// You can do whatever you want with this file.
10//
11///////////////////////////////////////////////////////////////////////////////
12
13#ifndef LZMA_SIMPLE_PRIVATE_H
14#define LZMA_SIMPLE_PRIVATE_H
15
16#include "simple_coder.h"
17
18
19typedef struct lzma_simple_s lzma_simple;
20
21struct lzma_coder_s {
19typedef struct {
22 /// Next filter in the chain
23 lzma_next_coder next;
24
25 /// True if the next coder in the chain has returned LZMA_STREAM_END.
26 bool end_was_reached;
27
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
31 /// is very small.
32 bool is_encoder;
33
34 /// Pointer to filter-specific function, which does
35 /// the actual filtering.
20 /// Next filter in the chain
21 lzma_next_coder next;
22
23 /// True if the next coder in the chain has returned LZMA_STREAM_END.
24 bool end_was_reached;
25
26 /// True if filter() should encode the data; false to decode.
27 /// Currently all simple filters use the same function for encoding
28 /// and decoding, because the difference between encoders and decoders
29 /// is very small.
30 bool is_encoder;
31
32 /// Pointer to filter-specific function, which does
33 /// the actual filtering.
36 size_t (*filter)(lzma_simple *simple, uint32_t now_pos,
34 size_t (*filter)(void *simple, uint32_t now_pos,
37 bool is_encoder, uint8_t *buffer, size_t size);
38
39 /// Pointer to filter-specific data, or NULL if filter doesn't need
40 /// any extra data.
35 bool is_encoder, uint8_t *buffer, size_t size);
36
37 /// Pointer to filter-specific data, or NULL if filter doesn't need
38 /// any extra data.
41 lzma_simple *simple;
39 void *simple;
42
43 /// The lowest 32 bits of the current position in the data. Most
44 /// filters need this to do conversions between absolute and relative
45 /// addresses.
46 uint32_t now_pos;
47
48 /// Size of the memory allocated for the buffer.
49 size_t allocated;

--- 7 unchanged lines hidden (view full) ---

57 size_t filtered;
58
59 /// Total number of bytes (both filtered and unfiltered) currently
60 /// in the temporary buffer.
61 size_t size;
62
63 /// Temporary buffer
64 uint8_t buffer[];
40
41 /// The lowest 32 bits of the current position in the data. Most
42 /// filters need this to do conversions between absolute and relative
43 /// addresses.
44 uint32_t now_pos;
45
46 /// Size of the memory allocated for the buffer.
47 size_t allocated;

--- 7 unchanged lines hidden (view full) ---

55 size_t filtered;
56
57 /// Total number of bytes (both filtered and unfiltered) currently
58 /// in the temporary buffer.
59 size_t size;
60
61 /// Temporary buffer
62 uint8_t buffer[];
65};
63} lzma_simple_coder;
66
67
68extern lzma_ret lzma_simple_coder_init(lzma_next_coder *next,
69 const lzma_allocator *allocator,
70 const lzma_filter_info *filters,
64
65
66extern lzma_ret lzma_simple_coder_init(lzma_next_coder *next,
67 const lzma_allocator *allocator,
68 const lzma_filter_info *filters,
71 size_t (*filter)(lzma_simple *simple, uint32_t now_pos,
69 size_t (*filter)(void *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);
75
76#endif
70 bool is_encoder, uint8_t *buffer, size_t size),
71 size_t simple_size, size_t unfiltered_max,
72 uint32_t alignment, bool is_encoder);
73
74#endif