ObjFW  Diff

Differences From Artifact [2f21e16d6f]:

To Artifact [ee0596ab39]:


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38







39
40
41
42
43
44
45
 */

#import "OFStream.h"

#define OF_DEFLATE_STREAM_BUFFER_SIZE 4096

/*!
 * @brief A class for a stream that handles deflate compression or decompression
 *	  transparently for an underlying stream.
 */
@interface OFDeflateStream: OFStream
{
#ifdef OF_DEFLATE_STREAM_M
@public
#endif
	OFStream *_stream;
	uint8_t _buffer[OF_DEFLATE_STREAM_BUFFER_SIZE];
	uint_fast16_t _bufferIndex, _bufferLength;
	uint8_t _byte;
	uint_fast8_t _bitIndex, _savedBitsLength;
	uint_fast16_t _savedBits;
@protected
	char *_slidingWindow;
	uint_fast16_t _slidingWindowIndex;







	enum {
		OF_DEFLATE_STREAM_BLOCK_HEADER,
		OF_DEFLATE_STREAM_UNCOMPRESSED_BLOCK_HEADER,
		OF_DEFLATE_STREAM_UNCOMPRESSED_BLOCK,
		OF_DEFLATE_STREAM_HUFFMAN_TREE,
		OF_DEFLATE_STREAM_HUFFMAN_BLOCK
	} _state;







|














|
|
>
>
>
>
>
>
>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 */

#import "OFStream.h"

#define OF_DEFLATE_STREAM_BUFFER_SIZE 4096

/*!
 * @brief A class for a stream that handles Deflate compression or decompression
 *	  transparently for an underlying stream.
 */
@interface OFDeflateStream: OFStream
{
#ifdef OF_DEFLATE_STREAM_M
@public
#endif
	OFStream *_stream;
	uint8_t _buffer[OF_DEFLATE_STREAM_BUFFER_SIZE];
	uint_fast16_t _bufferIndex, _bufferLength;
	uint8_t _byte;
	uint_fast8_t _bitIndex, _savedBitsLength;
	uint_fast16_t _savedBits;
@protected
	uint8_t *_slidingWindow;
	uint_fast16_t _slidingWindowIndex, _slidingWindowMask;
	struct {
		uint_fast8_t numDistanceCodes;
		const uint8_t *lengthCodes;
		const uint8_t *lengthExtraBits;
		const uint16_t *distanceCodes;
		const uint8_t *distanceExtraBits;
	} _codes;
	enum {
		OF_DEFLATE_STREAM_BLOCK_HEADER,
		OF_DEFLATE_STREAM_UNCOMPRESSED_BLOCK_HEADER,
		OF_DEFLATE_STREAM_UNCOMPRESSED_BLOCK,
		OF_DEFLATE_STREAM_HUFFMAN_TREE,
		OF_DEFLATE_STREAM_HUFFMAN_BLOCK
	} _state;