Skip to content

Commit 4cb650a

Browse files
improving documentation
1 parent 91036f4 commit 4cb650a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/decompress/lzss.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,19 @@ void lzss_flush();
2525
class LZSSDecoder {
2626
public:
2727

28+
/**
29+
* Build an LZSS decoder by providing a callback for storing the decoded bytes
30+
* @param putc_cbk: a callback that takes a char and stores it e.g. a callback to fwrite
31+
*/
2832
LZSSDecoder(std::function<void(const uint8_t)> putc_cbk);
2933

34+
/**
35+
* Build an LZSS decoder providing a callback for getting a char and putting a char
36+
* in this way you need to call decompress with no parameters
37+
* @param putc_cbk: a callback that takes a char and stores it e.g. a callback to fwrite
38+
* @param getc_cbk: a callback that returns the next char to consume
39+
* -1 means EOF, -2 means buffer is temporairly finished
40+
*/
3041
LZSSDecoder(std::function<int()> getc_cbk, std::function<void(const uint8_t)> putc_cbk);
3142

3243
/**
@@ -43,7 +54,7 @@ class LZSSDecoder {
4354

4455
/**
4556
* decode the provided buffer until buffer ends, then pause the process
46-
* @return 0 if the decompression is completed, 1 if not
57+
* @return DONE if the decompression is completed, NOT_COMPLETED if not
4758
*/
4859
status decompress(const char* buffer, uint32_t size);
4960
private:

0 commit comments

Comments
 (0)