libpressio 0.93.0
|
Compress, decompress, and configure pressio and lossless compressors. More...
#include "stddef.h"
Go to the source code of this file.
Enumerations | |
enum | pressio_thread_safety { pressio_thread_safety_single = 0 , pressio_thread_safety_serialized = 1 , pressio_thread_safety_multiple = 2 } |
Compress, decompress, and configure pressio and lossless compressors.
reports the level of thread safety supported by the compressor.
Compressors MUST report a thread safety by setting the pressio:thread_safe option on the object returned by get_configuration and the level supported by the plug-in.
Safety is defined in terms of if the both of the following sequence of calls from multiple threads can be made without a data race:
and
and
and
All metrics plugins MUST support pressio_thread_safety_multiple (i.e. safe as long as different objects are used)
int pressio_compressor_check_options | ( | struct pressio_compressor * | compressor, |
struct pressio_options const * | options | ||
) |
Validates that only defined options have been set. This can be useful for programmer errors. This function should NOT be used with any option structure which contains options for multiple compressors. Other checks MAY be preformed implementing compressors.
[in] | compressor | which compressor to validate the options struct against |
[in] | options | which options set to check against. It should ONLY contain options returned by pressio_compressor_get_options |
struct pressio_compressor * pressio_compressor_clone | ( | struct pressio_compressor * | compressor | ) |
Clones a compressor and its configuration including metrics information
[in] | compressor | the compressor to clone. It will not be modified except to modify a reference count as needed. |
int pressio_compressor_compress | ( | struct pressio_compressor * | compressor, |
const struct pressio_data * | input, | ||
struct pressio_data * | output | ||
) |
compresses the data in data using the specified compressor
[in] | compressor | compressor to be used |
[in] | input | data to be compressed and associated metadata |
[in,out] | output | when passed in, output MAY contain metadata (type, dimentions) and additionally MAY contain a buffer. pressio_data_free will be called on the pointer passed into this function if a new owning pressio_data structure is returned. when passed out, output will contain either:
|
int pressio_compressor_compress_many | ( | struct pressio_compressor * | compressor, |
struct pressio_data const *const | in[], | ||
size_t | num_inputs, | ||
struct pressio_data * | out[], | ||
size_t | num_outputs | ||
) |
compress multiple data buffers in one api call. Underlying implementations may do this in serial or parallel
[in] | compressor | the compressor object that will perform compression |
[in] | in | array of input buffers |
[in] | num_inputs | the number of elements of the "in" array |
[in,out] | out | array of compressed data buffers When passed in, each element of out MAY contain metadata (type, dimentions), and may additionally contain a buffer. pressio_data_free will need to be called on the object returned from this buffer. When passed out, each elements of out will contain either
|
[in] | num_outputs | the number of elements of the "out" array |
int pressio_compressor_decompress | ( | struct pressio_compressor * | compressor, |
const struct pressio_data * | input, | ||
struct pressio_data * | output | ||
) |
decompresses the compressed data using the specified compressor calling this without calling libpressio_compressor_set_options() has undefined behavior decompressing with a compressor with different settings than used for compression has undefined behavior
[in] | compressor | compressor to be used |
[in] | input | data to be decompressed and associated metadata |
[in,out] | output | when passed in, output SHOULD contain the metadata (type, dimentions) for the output of the compression if available. pressio_data_free will be called the pointer passed in during this function. when passed out, it will contain either
|
output
output
int pressio_compressor_decompress_many | ( | struct pressio_compressor * | compressor, |
struct pressio_data const *const | in[], | ||
size_t | num_inputs, | ||
struct pressio_data * | out[], | ||
size_t | num_outputs | ||
) |
decompress multiple data buffers in one api call. Underlying implementations may do this in serial or parallel
[in] | compressor | the compressor object that will perform compression |
[in] | in | array of input buffers |
[in] | num_inputs | the number of elements of the "in" array |
[in,out] | out | array of compressed data buffers When passed in, each element of out MAY contain metadata (type, dimentions), and may additionally contain a buffer. pressio_data_free will need to be called on the object returned from this buffer. When passed out, each elements of out will contain either
|
[in] | num_outputs | the number of elements of the "out" array |
int pressio_compressor_error_code | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | the compressor to query |
const char * pressio_compressor_error_msg | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | the compressor to query |
struct pressio_options * pressio_compressor_get_configuration | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | which compressor to get compile-time configuration for |
struct pressio_options * pressio_compressor_get_documentation | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | which compressor to get documentation for |
struct pressio_metrics * pressio_compressor_get_metrics | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | the compressor to get the metrics plugin for |
struct pressio_options * pressio_compressor_get_metrics_results | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | the compressor to get results from |
const char * pressio_compressor_get_name | ( | struct pressio_compressor const * | compressor | ) |
Get the name of a compressor
[in] | compressor | the compressor to get the name of |
struct pressio_options * pressio_compressor_get_options | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | which compressor to get options for |
const char * pressio_compressor_get_prefix | ( | const struct pressio_compressor * | compressor | ) |
Returns the name this compressor uses its keys
[in] | compressor | the compressor to get the prefix for |
int pressio_compressor_major_version | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | the compressor to query |
struct pressio_options * pressio_compressor_metrics_get_options | ( | struct pressio_compressor const * | compressor | ) |
Gets the options for a metrics structure
[in] | compressor | the metrics structure to get options for |
int pressio_compressor_metrics_set_options | ( | struct pressio_compressor const * | compressor, |
struct pressio_options const * | options | ||
) |
Gets the options for a metrics structure
[in] | compressor | the compressor structure to get metrics options for |
[in] | options | the options to set |
int pressio_compressor_minor_version | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | the compressor to query |
int pressio_compressor_patch_version | ( | struct pressio_compressor const * | compressor | ) |
[in] | compressor | the compressor to query |
void pressio_compressor_release | ( | struct pressio_compressor * | compressor | ) |
[in] | compressor | deallocates a reference to a compressor. |
void pressio_compressor_set_metrics | ( | struct pressio_compressor * | compressor, |
struct pressio_metrics * | plugin | ||
) |
[in] | compressor | the compressor to set metrics plugin for |
[in] | plugin | the configured libpressio_metricsplugin plugin to use |
void pressio_compressor_set_name | ( | struct pressio_compressor * | compressor, |
const char * | new_name | ||
) |
Assign a new name to a compressor. Names are used to prefix options in meta-compressors.
sub-compressors will be renamed either by the of the sub-compressors prefix or by the $prefix:name configuration option
i.e. for some new_name and a compressor with prefix foo and subcompressors with prefixs "abc", "def", "ghi" respectively
[in] | compressor | the compressor to get the name of |
[in] | new_name | the name to set |
int pressio_compressor_set_options | ( | struct pressio_compressor * | compressor, |
struct pressio_options const * | options | ||
) |
sets the options for the pressio_compressor. Compressors MAY choose to ignore some subset of options passed in if there valid but conflicting settings (i.e. two settings that adjust the same underlying configuration). Additionally, if one of the two settings is a generic one (i.e. pressio:abs) the compressor specific version should prevail. Compressors SHOULD return an error value if configuration failed due to a missing required setting or an invalid one. Users MAY call pressio_compressor_error_msg() to get more information about the warnings or errors Compressors MUST ignore any and all options set that they do not support.
[in] | compressor | which compressor to get options for |
[in] | options | the options to set |
const char * pressio_compressor_version | ( | struct pressio_compressor const * | compressor | ) |
Get the version and feature information. The version string may include more information than major/minor/patch provide.
[in] | compressor | the compressor to query |