libpressio 0.93.0
|
A set of options for a compressor. More...
#include "pressio_dtype.h"
#include "pressio_compressor.h"
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Macros | |
#define | LIBPRESSIO_OPTIONS_H |
#define | pressio_options_define_type_set(name, type) |
#define | pressio_options_define_type_get(name, type) |
#define | pressio_options_define_type_cast(name, type) |
#define | pressio_options_define_type_as(name, type) |
#define | pressio_options_define_type(name, type) |
Enumerations | |
enum | pressio_options_key_status { pressio_options_key_set =0 , pressio_options_key_exists =1 , pressio_options_key_does_not_exist =2 } |
enum | pressio_conversion_safety { pressio_conversion_implicit =0 , pressio_conversion_explicit =1 , pressio_conversion_special =2 } |
enum | pressio_option_type { pressio_option_uint32_type =0 , pressio_option_int32_type =1 , pressio_option_float_type =2 , pressio_option_double_type =3 , pressio_option_charptr_type =4 , pressio_option_userptr_type =5 , pressio_option_unset_type =6 , pressio_option_charptr_array_type =7 , pressio_option_data_type =8 , pressio_option_uint8_type =9 , pressio_option_int8_type =10 , pressio_option_uint16_type =11 , pressio_option_int16_type =12 , pressio_option_uint64_type =13 , pressio_option_int64_type =14 , pressio_option_bool_type =15 , pressio_option_dtype_type =16 , pressio_option_threadsafety_type =17 } |
A set of options for a compressor.
#define LIBPRESSIO_OPTIONS_H |
Header Guard
#define pressio_options_define_type | ( | name, | |
type | |||
) |
Generate get/set/as/cast functions for the pressio_options class
[in] | name | the name to append to the function |
[in] | type | the type to wrap |
#define pressio_options_define_type_as | ( | name, | |
type | |||
) |
internal macro used to define implicit casting functions
#define pressio_options_define_type_cast | ( | name, | |
type | |||
) |
internal macro used to define casting functions
#define pressio_options_define_type_get | ( | name, | |
type | |||
) |
internal macro used to define getter functions
#define pressio_options_define_type_set | ( | name, | |
type | |||
) |
internal macro used to define setter functions
level of safety to require for conversions
enum pressio_option_type |
possible types contained in a pressio_option, more types may be added in the future
Enumerator | |
---|---|
pressio_option_uint32_type | option is a 32 bit unsigned integer |
pressio_option_int32_type | option is a 32 bit signed integer |
pressio_option_float_type | option is a 32 bit single precision floating point |
pressio_option_double_type | option is a 64 bit double precision floating point |
pressio_option_charptr_type | option is a non-owning pointer to a c-style string |
pressio_option_userptr_type | option is a non-owning pointer to a arbitrary data |
pressio_option_unset_type | option is a non-owning pointer to a arbitrary data |
pressio_option_charptr_array_type | option is an array of c-style strings |
pressio_option_data_type | option is a pressio_data structure |
pressio_option_uint8_type | option is a 8 bit unsigned integer |
pressio_option_int8_type | option is a 8 bit signed integer |
pressio_option_uint16_type | option is a 16 bit unsigned integer |
pressio_option_int16_type | option is a 16 bit signed integer |
pressio_option_uint64_type | option is a 64 bit unsigned integer |
pressio_option_int64_type | option is a 64 bit signed integer |
pressio_option_bool_type | option is a boolean |
pressio_option_dtype_type | option is a pressio_dtype |
pressio_option_threadsafety_type | option is a threadsafety |
possible status of a particular key in the option structure
enum pressio_options_key_status pressio_options_as_bool | ( | struct pressio_options const * | options, |
const char * | key, | ||
bool * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_data | ( | struct pressio_options const * | options, |
const char * | key, | ||
struct pressio_data ** | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_double | ( | struct pressio_options const * | options, |
const char * | key, | ||
double * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_dtype | ( | struct pressio_options const * | options, |
const char * | key, | ||
enum pressio_dtype * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_float | ( | struct pressio_options const * | options, |
const char * | key, | ||
float * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_integer | ( | struct pressio_options const * | options, |
const char * | key, | ||
int32_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_integer16 | ( | struct pressio_options const * | options, |
const char * | key, | ||
int16_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_integer64 | ( | struct pressio_options const * | options, |
const char * | key, | ||
int64_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_integer8 | ( | struct pressio_options const * | options, |
const char * | key, | ||
int8_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_set | ( | struct pressio_options * | options, |
const char * | key, | ||
struct pressio_option * | option | ||
) |
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] | options | the option to get an pressio_option for |
[in] | key | the key to get from the options structure |
[in] | option | value to assign in the pressio_options structure |
enum pressio_options_key_status pressio_options_as_string | ( | struct pressio_options const * | options, |
const char * | key, | ||
char ** | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_strings | ( | struct pressio_options const * | options, |
const char * | key, | ||
size_t * | size, | ||
char *** | values | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | size | the number of strings returned. 0 on error |
[out] | values | the value retrieved, only if it is convertible. both the values and the pointer must be freed with free() |
enum pressio_options_key_status pressio_options_as_threadsafety | ( | struct pressio_options const * | options, |
const char * | key, | ||
enum pressio_thread_safety * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_uinteger | ( | struct pressio_options const * | options, |
const char * | key, | ||
uint32_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_uinteger16 | ( | struct pressio_options const * | options, |
const char * | key, | ||
uint16_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_uinteger64 | ( | struct pressio_options const * | options, |
const char * | key, | ||
uint64_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_uinteger8 | ( | struct pressio_options const * | options, |
const char * | key, | ||
uint8_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_as_userptr | ( | struct pressio_options const * | options, |
const char * | key, | ||
void ** | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_bool | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
bool * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_data | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
struct pressio_data ** | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_double | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
double * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_dtype | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
enum pressio_dtype * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_float | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
float * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_integer | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
int32_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_integer16 | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
int16_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_integer64 | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
int64_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_integer8 | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
int8_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_set | ( | struct pressio_options * | options, |
const char * | key, | ||
struct pressio_option const * | option, | ||
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] | options | the option to get an pressio_option for |
[in] | key | the key to get from the options structure |
[in] | option | value to assign in the pressio_options structure |
[in] | safety | what kind of conversions to allow |
enum pressio_options_key_status pressio_options_cast_string | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
char ** | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_strings | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
size_t * | size, | ||
char *** | values | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | size | the number of strings returned. 0 on error |
[out] | values | the value retrieved, only if it is convertible. both the values and the pointer must be freed with free() |
enum pressio_options_key_status pressio_options_cast_threadsafety | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
enum pressio_thread_safety * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_uinteger | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
uint32_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_uinteger16 | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
uint16_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_uinteger64 | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
uint64_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_uinteger8 | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
uint8_t * | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
enum pressio_options_key_status pressio_options_cast_userptr | ( | struct pressio_options const * | options, |
const char * | key, | ||
const enum pressio_conversion_safety | safety, | ||
void ** | value | ||
) |
Gets an particular key in an options structure, casting it if necessary
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | safety | what kind of conversions to allow |
[out] | value | the value retrieved, only if it is convertible. If returning a char*, the memory must be freed with free() |
void pressio_options_clear | ( | struct pressio_options * | options, |
const char * | key | ||
) |
Clear the value associated with a key, but retains the entry in the options.
This MAY be used by libpressio plugin implementations to suggest a key to set libpressio plugin implementations SHOULD not change the underlying setting if the option has been cleared
[in] | options | the options structure to clear a value for |
[in] | key | the key whose value to clear |
struct pressio_options * pressio_options_copy | ( | struct pressio_options const * | options | ) |
Copies the memory associated with this pressio option structure
[in] | options | the options structure to copy |
enum pressio_options_key_status pressio_options_exists | ( | struct pressio_options const * | options, |
const char * | key | ||
) |
[in] | options | the option to get an pressio_options_key_status for |
[in] | key | the key to get from the options structure |
void pressio_options_free | ( | struct pressio_options * | options | ) |
Frees the memory associated with a pressio option structure
[in,out] | options | frees the pressio option structure |
struct pressio_option * pressio_options_get | ( | struct pressio_options const * | options, |
const char * | key | ||
) |
Gets a generic pressio_option for the specified key. Calling this with an nonexistent key has undefined behavior
[in] | options | the option to get an pressio_option for |
[in] | key | the key to get from the options structure |
enum pressio_options_key_status pressio_options_get_bool | ( | struct pressio_options const * | options, |
const char * | key, | ||
bool * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_data | ( | struct pressio_options const * | options, |
const char * | key, | ||
struct pressio_data ** | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_double | ( | struct pressio_options const * | options, |
const char * | key, | ||
double * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_dtype | ( | struct pressio_options const * | options, |
const char * | key, | ||
enum pressio_dtype * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_float | ( | struct pressio_options const * | options, |
const char * | key, | ||
float * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_integer | ( | struct pressio_options const * | options, |
const char * | key, | ||
int32_t * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_integer16 | ( | struct pressio_options const * | options, |
const char * | key, | ||
int16_t * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_integer64 | ( | struct pressio_options const * | options, |
const char * | key, | ||
int64_t * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_integer8 | ( | struct pressio_options const * | options, |
const char * | key, | ||
int8_t * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_string | ( | struct pressio_options const * | options, |
const char * | key, | ||
const char ** | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_strings | ( | struct pressio_options const * | options, |
const char * | key, | ||
size_t * | size, | ||
const char *** | values | ||
) |
Gets a particular value in a map if it exists
pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | size | the number of strings returned, 0 on error |
[out] | values | the value retrieved, both the values and the pointer must be freed with free() |
enum pressio_options_key_status pressio_options_get_threadsafety | ( | struct pressio_options const * | options, |
const char * | key, | ||
enum pressio_thread_safety * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_uinteger | ( | struct pressio_options const * | options, |
const char * | key, | ||
uint32_t * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_uinteger16 | ( | struct pressio_options const * | options, |
const char * | key, | ||
uint16_t * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_uinteger64 | ( | struct pressio_options const * | options, |
const char * | key, | ||
uint64_t * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_uinteger8 | ( | struct pressio_options const * | options, |
const char * | key, | ||
uint8_t * | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
enum pressio_options_key_status pressio_options_get_userptr | ( | struct pressio_options const * | options, |
const char * | key, | ||
void ** | value | ||
) |
Gets a particular value in a map if it exists * * pressio_options_get_string returns a newly allocated copy of the string
[in] | options | the options structure to modify |
[in] | key | the key to change |
[out] | value | the value retrieved |
struct pressio_options * pressio_options_merge | ( | struct pressio_options const * | lhs, |
struct pressio_options const * | rhs | ||
) |
Merges two pressio options together into one. Copies all keys and corresponding values from rhs not in lhs into a new structure.
[in] | lhs | the first structure to merge |
[in] | rhs | the second structure to merge; if lhs and rhs both have the same key the value from lhs is preserved |
struct pressio_options * pressio_options_new | ( | ) |
Creates an empty pressio_options structure returns NULL if the allocation fails
size_t pressio_options_num_set | ( | struct pressio_options const * | options | ) |
[in] | options | the options structure to get the size of |
void pressio_options_set | ( | struct pressio_options * | options, |
const char * | key, | ||
struct pressio_option * | option | ||
) |
Sets pressio_option for the specified key with a generic pressio_options
[in] | options | the option to get an pressio_option for |
[in] | key | the key to get from the options structure |
[in] | option | value to set in the pressio_options structure |
void pressio_options_set_bool | ( | struct pressio_options * | options, |
const char * | key, | ||
bool | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_data | ( | struct pressio_options * | options, |
const char * | key, | ||
struct pressio_data * | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_double | ( | struct pressio_options * | options, |
const char * | key, | ||
double | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_dtype | ( | struct pressio_options * | options, |
const char * | key, | ||
enum pressio_dtype | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_float | ( | struct pressio_options * | options, |
const char * | key, | ||
float | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_integer | ( | struct pressio_options * | options, |
const char * | key, | ||
int32_t | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_integer16 | ( | struct pressio_options * | options, |
const char * | key, | ||
int16_t | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_integer64 | ( | struct pressio_options * | options, |
const char * | key, | ||
int64_t | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_integer8 | ( | struct pressio_options * | options, |
const char * | key, | ||
int8_t | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_string | ( | struct pressio_options * | options, |
const char * | key, | ||
const char * | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_strings | ( | struct pressio_options * | options, |
const char * | key, | ||
size_t | size, | ||
const char *const * | values | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | size | the number of strings passed |
[in] | values | the value to change to |
void pressio_options_set_threadsafety | ( | struct pressio_options * | options, |
const char * | key, | ||
enum pressio_thread_safety | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_type | ( | struct pressio_options * | options, |
const char * | key, | ||
enum pressio_option_type | type | ||
) |
Sets pressio_option to the specified type
[in] | options | the option to set type of a pressio_option for |
[in] | key | the key to get from the options structure |
[in] | type | value to set in the pressio_options structure |
void pressio_options_set_uinteger | ( | struct pressio_options * | options, |
const char * | key, | ||
uint32_t | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_uinteger16 | ( | struct pressio_options * | options, |
const char * | key, | ||
uint16_t | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_uinteger64 | ( | struct pressio_options * | options, |
const char * | key, | ||
uint64_t | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_uinteger8 | ( | struct pressio_options * | options, |
const char * | key, | ||
uint8_t | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_userptr | ( | struct pressio_options * | options, |
const char * | key, | ||
void * | value | ||
) |
Sets an particular key in an options structure with the given key to a value
[in] | options | the options structure to modify |
[in] | key | the key to change |
[in] | value | the value to change to |
void pressio_options_set_userptr_managed | ( | struct pressio_options * | options, |
const char * | key, | ||
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] | options | the options structure to set |
[in] | key | the value to use to create the object |
[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 |
size_t pressio_options_size | ( | struct pressio_options const * | options | ) |
[in] | options | the options structure to get the size of |
char * pressio_options_to_string | ( | struct pressio_options const * | options | ) |
Create a human readable string for the options passed.
The format is unspecified and should NOT be parsed. It may change without warning.
For machine readable formats, please use pressio_options_get_iter() to iterate over each object and convert each item as a string using pressio_options_cast_string()/pressio_options_cast_string() or the equivelent C++ routines.
[in] | options | the options to format as a string |