summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3-second.h
diff options
context:
space:
mode:
Diffstat (limited to 'xdelta3/xdelta3-second.h')
-rw-r--r--xdelta3/xdelta3-second.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/xdelta3/xdelta3-second.h b/xdelta3/xdelta3-second.h
index a1fe120..f4dc908 100644
--- a/xdelta3/xdelta3-second.h
+++ b/xdelta3/xdelta3-second.h
@@ -19,50 +19,6 @@
19#ifndef _XDELTA3_SECOND_H_ 19#ifndef _XDELTA3_SECOND_H_
20#define _XDELTA3_SECOND_H_ 20#define _XDELTA3_SECOND_H_
21 21
22/**************************************************************
23 Secondary compression
24 **************************************************************/
25
26#define xd3_sec_data(s) ((s)->sec_stream_d)
27#define xd3_sec_inst(s) ((s)->sec_stream_i)
28#define xd3_sec_addr(s) ((s)->sec_stream_a)
29
30struct _xd3_sec_type
31{
32 int id;
33 const char *name;
34 xd3_secondary_flags flags;
35
36 /* xd3_sec_stream is opaque to the generic code */
37 xd3_sec_stream* (*alloc) (xd3_stream *stream);
38 void (*destroy) (xd3_stream *stream,
39 xd3_sec_stream *sec);
40 void (*init) (xd3_sec_stream *sec);
41 int (*decode) (xd3_stream *stream,
42 xd3_sec_stream *sec_stream,
43 const uint8_t **input,
44 const uint8_t *input_end,
45 uint8_t **output,
46 const uint8_t *output_end);
47#if XD3_ENCODER
48 int (*encode) (xd3_stream *stream,
49 xd3_sec_stream *sec_stream,
50 xd3_output *input,
51 xd3_output *output,
52 xd3_sec_cfg *cfg);
53#endif
54};
55
56#define BIT_STATE_ENCODE_INIT { 0, 1 }
57#define BIT_STATE_DECODE_INIT { 0, 0x100 }
58
59typedef struct _bit_state bit_state;
60struct _bit_state
61{
62 usize_t cur_byte;
63 usize_t cur_mask;
64};
65
66static inline void xd3_bit_state_encode_init (bit_state *bits) 22static inline void xd3_bit_state_encode_init (bit_state *bits)
67{ 23{
68 bits->cur_byte = 0; 24 bits->cur_byte = 0;
@@ -204,7 +160,6 @@ xd3_decode_secondary (xd3_stream *stream,
204} 160}
205 161
206#if XD3_ENCODER 162#if XD3_ENCODER
207/* OPT: Should these be inline? */
208static inline int xd3_encode_bit (xd3_stream *stream, 163static inline int xd3_encode_bit (xd3_stream *stream,
209 xd3_output **output, 164 xd3_output **output,
210 bit_state *bits, 165 bit_state *bits,