GskZlibDeflator — a zlib compressor.


GskStream*  gsk_zlib_deflator_new           (gint compression_level,
                                             int flush_millis);


A stream which compresses data on its input to its output. This is the raw zlib deflated data. See RFCs 1950 and 1951.

We use the implementation in a shared library -lz.



typedef struct {
  GskStream      stream;
  gpointer       private_stream;
  GskBuffer      compressed;
  guint          level;
  gint           flush_millis;
  GskSource     *flush_source;
} GskZlibDeflator;

A zlib deflator (compressor) object. One writes raw data to it, and one can read the compressed data from it.

GskStream stream; parent instance.
gpointer private_stream; zlib library object.
GskBuffer compressed; buffer of compressed data.
guint level; compressor level (private).
gint flush_millis; milliseconds to wait to flush the buffer or -1 to indicate that flush need only be done at end-of-file.
GskSource *flush_source; private: flush timeout source.

gsk_zlib_deflator_new ()

GskStream*  gsk_zlib_deflator_new           (gint compression_level,
                                             int flush_millis);

Create a new Zlib deflation stream. This stream is written uncompressed input, and then compressed output can be read back from it.

compression_level : the level of compression to attain in exchange for running slower.
flush_millis : number of milliseconds to wait before flushing all input characters to the output.
Returns : the newly allocated deflator.

See Also