libpressio 0.93.0
|
A single option value for a compressor. More...
#include <stdbool.h>
#include <stdint.h>
#include "pressio_options.h"
#include "pressio_compressor.h"
Go to the source code of this file.
Macros | |
#define | PRESSIO_OPTION |
#define | pressio_option_define_type(name, type) |
A single option value for a compressor.
#define PRESSIO_OPTION |
hearder guard
#define pressio_option_define_type | ( | name, | |
type | |||
) |
defines a getter and setter prototype for a pressio option type
[in] | name | the name to append to the function |
[in] | type | the type return or accept in the function |
enum pressio_options_key_status pressio_option_as_set | ( | struct pressio_option * | lhs, |
struct pressio_option * | rhs | ||
) |
Sets pressio_option for the specified key with a generic pressio_options preserving the type of the key in the options structure using an implicit cast if necessary
[in] | lhs | the option to get an pressio_option for |
[in] | rhs | value to assign in the pressio_options structure |
enum pressio_options_key_status pressio_option_cast_set | ( | struct pressio_option * | lhs, |
struct pressio_option * | rhs, | ||
enum pressio_conversion_safety | safety | ||
) |
Sets pressio_option for the specified key with a generic pressio_options preserving the type of the key in the options structure using the specified cast if necessary
[in] | lhs | the option to get an pressio_option for |
[in] | rhs | value to assign in the pressio_options structure |
[in] | safety | what kind of conversions to allow |
struct pressio_option * pressio_option_convert | ( | struct pressio_option const * | option, |
enum pressio_option_type | type, | ||
enum pressio_conversion_safety | safety | ||
) |
converts between one type and another
[in] | option | the option to convert |
[in] | type | the type to convert to |
[in] | safety | how safe to make perform a conversion |
struct pressio_option * pressio_option_convert_implicit | ( | struct pressio_option const * | option, |
enum pressio_option_type | type | ||
) |
[in] | option | the option to convert |
[in] | type | the type to convert to |
void pressio_option_free | ( | struct pressio_option * | options | ) |
frees the memory associated with a returned option
[in] | options | the option to free |
bool pressio_option_get_bool | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
struct pressio_data * pressio_option_get_data | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
double pressio_option_get_double | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
enum pressio_dtype pressio_option_get_dtype | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
float pressio_option_get_float | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
int32_t pressio_option_get_integer | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
int16_t pressio_option_get_integer16 | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
int64_t pressio_option_get_integer64 | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
int8_t pressio_option_get_integer8 | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
const char * pressio_option_get_string | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
const char ** pressio_option_get_strings | ( | struct pressio_option const * | option, |
size_t * | size | ||
) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
[out] | size | the size of the array returned |
enum pressio_thread_safety pressio_option_get_threadsafety | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
enum pressio_option_type pressio_option_get_type | ( | struct pressio_option const * | option | ) |
gets the type of the returned pressio_option
[in] | option | the option to get the dtype for |
uint32_t pressio_option_get_uinteger | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
uint16_t pressio_option_get_uinteger16 | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
uint64_t pressio_option_get_uinteger64 | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
uint8_t pressio_option_get_uinteger8 | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
void * pressio_option_get_userptr | ( | struct pressio_option const * | option | ) |
Gets the value stored in the pressio_option. Calling this with the improper dtype has undefined behavior
[in] | option | the option to retrieve a value from |
bool pressio_option_has_value | ( | struct pressio_option const * | option | ) |
returns true if the option contains a value
[in] | option | the option to check for a value |
struct pressio_option * pressio_option_new | ( | ) |
creates an empty pressio_option
struct pressio_option * pressio_option_new_bool | ( | bool | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_data | ( | struct pressio_data * | data | ) |
Creates a new pressio_option containing the specified value
[in] | data | the value to use to create the object |
struct pressio_option * pressio_option_new_double | ( | double | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_dtype | ( | enum pressio_dtype | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_float | ( | float | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_integer | ( | int32_t | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_integer16 | ( | int16_t | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_integer64 | ( | int64_t | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_integer8 | ( | int8_t | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_string | ( | const char * | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_strings | ( | const char ** | values, |
size_t | size | ||
) |
Creates a new pressio_option containing the specified value
[in] | values | the value to use to create the object |
[in] | size | the length of the array |
struct pressio_option * pressio_option_new_threadsafety | ( | enum pressio_thread_safety | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_uinteger | ( | uint32_t | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_uinteger16 | ( | uint16_t | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_uinteger64 | ( | uint64_t | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_uinteger8 | ( | uint8_t | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_userptr | ( | void * | value | ) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
struct pressio_option * pressio_option_new_userptr_managed | ( | void * | value, |
void * | metadata, | ||
void(*)(void *, void *) | deleter, | ||
void(*)(void **, void **, const void *, const void *) | copy | ||
) |
Creates a new pressio_option containing the specified value
[in] | value | the value to use to create the object |
[in] | metadata | to use to manage the allocation of value |
[in] | deleter | deletes the value |
[in] | copy | copies the value |
void pressio_option_set_bool | ( | struct pressio_option * | option, |
bool | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_data | ( | struct pressio_option * | option, |
struct pressio_data * | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_double | ( | struct pressio_option * | option, |
double | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_dtype | ( | struct pressio_option * | option, |
enum pressio_dtype | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_float | ( | struct pressio_option * | option, |
float | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_integer | ( | struct pressio_option * | option, |
int32_t | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_integer16 | ( | struct pressio_option * | option, |
int16_t | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_integer64 | ( | struct pressio_option * | option, |
int64_t | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_integer8 | ( | struct pressio_option * | option, |
int8_t | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_string | ( | struct pressio_option * | option, |
const char * | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_strings | ( | struct pressio_option * | option, |
const char ** | values, | ||
size_t | size | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | values | the value to set |
[in] | size | the size of the array of values |
void pressio_option_set_threadsafety | ( | struct pressio_option * | option, |
enum pressio_thread_safety | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_type | ( | struct pressio_option * | option, |
enum pressio_option_type | type | ||
) |
set the type of the passed pressio_option
[in] | option | the option to get the dtype for |
[in] | type | the option to get the dtype for |
void pressio_option_set_uinteger | ( | struct pressio_option * | option, |
uint32_t | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_uinteger16 | ( | struct pressio_option * | option, |
uint16_t | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_uinteger64 | ( | struct pressio_option * | option, |
uint64_t | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_uinteger8 | ( | struct pressio_option * | option, |
uint8_t | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_userptr | ( | struct pressio_option * | option, |
void * | value | ||
) |
Sets the option to an integer value
[in] | option | the option to set |
[in] | value | the value to set |
void pressio_option_set_userptr_managed | ( | struct pressio_option * | option, |
void * | value, | ||
void * | metadata, | ||
void(*)(void *, void *) | deleter, | ||
void(*)(void **, void **, const void *, const void *) | copy | ||
) |
Set a pressio_option containing the specified value
[in] | option | the option structure to set |
[in] | value | the value to use to create the object |
[in] | metadata | to use to manage the allocation of value |
[in] | deleter | deletes the value |
[in] | copy | copies the value |
char * pressio_option_to_string | ( | struct pressio_option const * | option | ) |
Create a human readable string for the option passed.
The format is unspecified and should NOT be parsed. It may change without warning.
For machine readable formats, please use the accessor methods pressio_options_cast_string()/pressio_options_cast_string() or the equivelent C++ routines.
[in] | option | the option to format as a string |