Advance the context to the next sub-block in the input data.
- Parameters
-
| [in] | ctx | LZW reading context, updated on success. |
- Returns
- LZW_OK or LZW_OK_EOD on success, appropriate error otherwise.
Definition at line 127 of file lzw.cpp.hpp.
128{
129 fl::size block_size;
131 const fl::u8 *data_next = ctx->
data + next_block_pos;
132
133 if (next_block_pos >= ctx->
data_len) {
135 }
136
137 block_size = *data_next;
138
139 if ((next_block_pos + block_size) >= ctx->
data_len) {
141 }
142
145
146 if (block_size == 0) {
149 }
150
153
155}
@ LZW_NO_DATA
Error: Out of data.
@ LZW_OK_EOD
Success; reached zero-length sub-block.
fl::size data_sb_next
Offset to sub-block size.
const fl::u8 * sb_data
Pointer to current sub-block in data.
fl::u32 sb_bit_count
Bit count in sub-block.
fl::size sb_bit
Current bit offset in sub-block.
fl::size data_len
Input data length.
const fl::u8 * data
Pointer to start of input data.
References FL_NOEXCEPT, LZW_NO_DATA, LZW_OK, and LZW_OK_EOD.
Referenced by lzw__read_code().