File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,13 @@ int LZSSDecoder::bits_required(LZSSDecoder::FSM_STATES s) {
181
181
}
182
182
}
183
183
184
+ LZSSDecoder::LZSSDecoder (std::function<int ()> getc_cbk, std::function<void(const uint8_t )> putc_cbk)
185
+ : put_char_cbk(putc_cbk), get_char_cbk(getc_cbk), state(FSM_0), available(0 ) {
186
+ for (int i = 0 ; i < N - F; i++) buffer[i] = ' ' ;
187
+ r = N - F;
188
+ }
189
+
190
+
184
191
LZSSDecoder::LZSSDecoder (std::function<void (const uint8_t )> putc_cbk)
185
192
: put_char_cbk(putc_cbk), state(FSM_0), available_bits(0 ) {
186
193
for (int i = 0 ; i < N - F; i++) buffer[i] = ' ' ;
Original file line number Diff line number Diff line change @@ -22,10 +22,13 @@ void lzss_flush();
22
22
**************************************************************************************/
23
23
24
24
25
- // TODO improve documentation
26
25
class LZSSDecoder {
27
26
public:
28
- LZSSDecoder (std::function<void (const uint8_t )>);
27
+
28
+ LZSSDecoder (std::function<void (const uint8_t )> putc_cbk);
29
+
30
+ LZSSDecoder (std::function<int ()> getc_cbk, std::function<void (const uint8_t )> putc_cbk);
31
+
29
32
/* *
30
33
* this enum describes the result of the computation of a single FSM computation
31
34
* DONE: the decompression is completed
@@ -85,6 +88,7 @@ class LZSSDecoder {
85
88
int i, r;
86
89
87
90
std::function<void (const uint8_t )> put_char_cbk=nullptr ;
91
+ std::function<void (const uint8_t )> get_char_cbk=nullptr ;
88
92
89
93
inline void putc (const uint8_t c) { if (put_char_cbk) { put_char_cbk (c); } }
90
94
You can’t perform that action at this time.
0 commit comments