Low-level compression and decompression streams.  
More...
|  | 
| SquashOperation | squash_stream_yield (SquashStream *stream, SquashStatus status) | 
|  | Yield execution back to the main thread.  More... 
 | 
|  | 
| void | squash_stream_init (void *stream, SquashCodec *codec, SquashStreamType stream_type, SquashOptions *options, SquashDestroyNotify destroy_notify) | 
|  | Initialize a stream.  More... 
 | 
|  | 
| void | squash_stream_destroy (void *stream) | 
|  | Destroy a stream.  More... 
 | 
|  | 
| SquashStream * | squash_stream_new (const char *codec, SquashStreamType stream_type,...) | 
|  | Create a new stream.  More... 
 | 
|  | 
| SquashStream * | squash_stream_newv (const char *codec, SquashStreamType stream_type, va_list options) | 
|  | Create a new stream with a variadic list of options.  More... 
 | 
|  | 
| SquashStream * | squash_stream_newa (const char *codec, SquashStreamType stream_type, const char *const *keys, const char *const *values) | 
|  | Create a new stream with key/value option arrays.  More... 
 | 
|  | 
| SquashStream * | squash_stream_new_with_options (const char *codec, SquashStreamType stream_type, SquashOptions *options) | 
|  | Create a new stream with options.  More... 
 | 
|  | 
| SquashStream * | squash_stream_new_codec (SquashCodec *codec, SquashStreamType stream_type,...) | 
|  | Create a new stream using a codec instance.  More... 
 | 
|  | 
| SquashStream * | squash_stream_new_codec_with_options (SquashCodec *codec, SquashStreamType stream_type, SquashOptions *options) | 
|  | Create a new stream using codec and options intances.  More... 
 | 
|  | 
| SquashStatus | squash_stream_process (SquashStream *stream) | 
|  | Process a stream.  More... 
 | 
|  | 
| SquashStatus | squash_stream_flush (SquashStream *stream) | 
|  | Flush a stream.  More... 
 | 
|  | 
| SquashStatus | squash_stream_finish (SquashStream *stream) | 
|  | Finish writing to a stream.  More... 
 | 
|  | 
Low-level compression and decompression streams. 
Operations to perform on a stream. 
| Enumerator | 
|---|
| SQUASH_OPERATION_PROCESS | Continue processing the stream normally.  See alsosquash_stream_process 
 | 
| SQUASH_OPERATION_FLUSH | Flush the stream.  See alsosquash_stream_flush 
 | 
| SQUASH_OPERATION_FINISH | Finish processing the stream.  See alsosquash_stream_finish 
 | 
| SQUASH_OPERATION_TERMINATE | Abort.  This value is only passed to plugins with the SQUASH_CODEC_INFO_RUN_IN_THREAD flag set, and signals that the stream is being destroyed (likely before processing has completed). There will be no further input, and any output will be ignored.  | 
Definition at line 51 of file stream.h.
 
 
Stream type. 
| Enumerator | 
|---|
| SQUASH_STREAM_COMPRESS | A compression stream.  | 
| SQUASH_STREAM_DECOMPRESS | A decompression stream.  | 
Definition at line 38 of file stream.h.
 
 
  
  | 
        
          | void squash_stream_destroy | ( | void * | stream | ) |  |  | protected | 
 
 
Finish writing to a stream. 
- Parameters
- 
  
  
- Returns
- A status code. 
Definition at line 743 of file stream.c.
 
 
Flush a stream. 
This method will attempt to process data in a stream. It should be squashled repeatedly, adding data to the avail_in field and removing data from the avail_out field as necessary.
- Parameters
- 
  
  
- Returns
- A status code. 
Definition at line 732 of file stream.c.
 
 
Initialize a stream. 
- Parameters
- 
  
    | stream | The stream to initialize. |  | codec | The codec to use. |  | stream_type | The stream type. |  | options | The options. |  | destroy_notify | Function to call to destroy the instance. |  
 
- See also
- squash_object_init 
Definition at line 277 of file stream.c.
 
 
      
        
          | SquashStream* squash_stream_new | ( | const char * | codec, | 
        
          |  |  | SquashStreamType | stream_type, | 
        
          |  |  |  | ... | 
        
          |  | ) |  |  | 
      
 
Create a new stream. 
- Parameters
- 
  
    | codec | The name of the codec. |  | stream_type | Stream type. |  | ... | List of key/value option pairs, followed by NULL |  
 
- Returns
- A new stream, or NULL on failure. 
Definition at line 382 of file stream.c.
 
 
      
        
          | SquashStream* squash_stream_new_codec | ( | SquashCodec * | codec, | 
        
          |  |  | SquashStreamType | stream_type, | 
        
          |  |  |  | ... | 
        
          |  | ) |  |  | 
      
 
Create a new stream using a codec instance. 
- Parameters
- 
  
    | codec | Codec to use |  | stream_type | Stream type |  | ... | List of options |  
 
- Returns
- A new stream, or NULL on failure 
Definition at line 471 of file stream.c.
 
 
      
        
          | SquashStream* squash_stream_new_codec_with_options | ( | SquashCodec * | codec, | 
        
          |  |  | SquashStreamType | stream_type, | 
        
          |  |  | SquashOptions * | options | 
        
          |  | ) |  |  | 
      
 
Create a new stream using codec and options intances. 
- Parameters
- 
  
    | codec | Codec to use |  | stream_type | Stream type |  | options | An option group |  
 
- Returns
- A new stream, or NULL on failure 
Definition at line 495 of file stream.c.
 
 
      
        
          | SquashStream* squash_stream_new_with_options | ( | const char * | codec, | 
        
          |  |  | SquashStreamType | stream_type, | 
        
          |  |  | SquashOptions * | options | 
        
          |  | ) |  |  | 
      
 
Create a new stream with options. 
- Parameters
- 
  
    | codec | The name of the codec. |  | stream_type | Stream type. |  | options | An option group. |  
 
- Returns
- A new stream, or NULL on failure. 
Definition at line 449 of file stream.c.
 
 
      
        
          | SquashStream* squash_stream_newa | ( | const char * | codec, | 
        
          |  |  | SquashStreamType | stream_type, | 
        
          |  |  | const char *const * | keys, | 
        
          |  |  | const char *const * | values | 
        
          |  | ) |  |  | 
      
 
Create a new stream with key/value option arrays. 
- Parameters
- 
  
    | codec | The name of the codec. |  | stream_type | Stream type. |  | keys | NULL-terminated array of option keys. |  | values | Array of option values. |  
 
- Returns
- A new stream, or NULL on failure. 
Definition at line 433 of file stream.c.
 
 
      
        
          | SquashStream* squash_stream_newv | ( | const char * | codec, | 
        
          |  |  | SquashStreamType | stream_type, | 
        
          |  |  | va_list | options | 
        
          |  | ) |  |  | 
      
 
Create a new stream with a variadic list of options. 
- Parameters
- 
  
    | codec | The name of the codec. |  | stream_type | Stream type. |  | options | List of key/value option pairs, followed by NULL |  
 
- Returns
- A new stream, or NULL on failure. 
Definition at line 404 of file stream.c.
 
 
Process a stream. 
This method will attempt to process data in a stream. It should be squashled repeatedly, adding data to the avail_in field and removing data from the avail_out field as necessary.
- Parameters
- 
  
  
- Returns
- A status code. 
- Return values
- 
  
    | SQUASH_OK | All input successfully consumed. Check the output buffer for data then proceed with new input. |  | SQUASH_PROCESSING | Progress was made, but not all input could be consumed. Remove some data from the output buffer and run squash_stream_process again. |  | SQUASH_END_OF_STREAM | The end of stream was reached. You shouldn't call squash_stream_process again. Decompression only. |  
 
Definition at line 717 of file stream.c.
 
 
Yield execution back to the main thread. 
This function may only be called inside the processing thread spawned for thread-based plugins.
- Parameters
- 
  
    | stream | The stream |  | status | Status code to return for the current request |  
 
- Returns
- The code of the next requested operation 
Definition at line 223 of file stream.c.