6#ifndef LIBPRESSIO_OPTIONS_H
10#define LIBPRESSIO_OPTIONS_H
22struct pressio_options_iter;
57enum 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,
187#define pressio_options_define_type_set(name, type) \
193 void pressio_options_set_##name(struct pressio_options* options, const char* key, type value);
196#define pressio_options_define_type_get(name, type) \
206 enum pressio_options_key_status pressio_options_get_##name(struct pressio_options \
207 const* options, const char* key, type * value);
210#define pressio_options_define_type_cast(name, type) \
219 enum pressio_options_key_status pressio_options_cast_##name(struct pressio_options \
220 const* options, const char* key, const enum pressio_conversion_safety safety, \
224#define pressio_options_define_type_as(name, type) \
232 enum pressio_options_key_status pressio_options_as_##name(struct pressio_options \
233 const* options, const char* key, type * value);
240#define pressio_options_define_type(name, type) \
241 pressio_options_define_type_set(name, type) \
242 pressio_options_define_type_get(name, type) \
243 pressio_options_define_type_cast(name, type) \
244 pressio_options_define_type_as(name, type)
282 void(*deleter)(
void*,
void*),
283 void(*copy)(
void**,
void**, const
void*, const
void*));
315 size_t* size,
char*** values); \
325 const* options, const
char* key,
size_t* size,
char*** values);
344#undef pressio_options_define_type
345#undef pressio_options_define_type_set
346#undef pressio_options_define_type_get
347#undef pressio_options_define_type_as
348#undef pressio_options_define_type_cast
Compress, decompress, and configure pressio and lossless compressors.
pressio_thread_safety
Definition: pressio_compressor.h:268
Information on types used by libpressio.
pressio_dtype
Definition: pressio_dtype.h:16
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)
enum pressio_options_key_status pressio_options_as_strings(struct pressio_options const *options, const char *key, size_t *size, char ***values)
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)
struct pressio_options * pressio_options_copy(struct pressio_options const *options)
enum pressio_options_key_status pressio_options_exists(struct pressio_options const *options, const char *key)
#define pressio_options_define_type_as(name, type)
Definition: pressio_options.h:205
size_t pressio_options_size(struct pressio_options const *options)
struct pressio_option * pressio_options_get(struct pressio_options const *options, const char *key)
char * pressio_options_to_string(struct pressio_options const *options)
#define pressio_options_define_type(name, type)
Definition: pressio_options.h:215
size_t pressio_options_num_set(struct pressio_options const *options)
void pressio_options_free(struct pressio_options *options)
pressio_option_type
Definition: pressio_options.h:57
@ pressio_option_uint8_type
Definition: pressio_options.h:67
@ pressio_option_charptr_array_type
Definition: pressio_options.h:65
@ pressio_option_charptr_type
Definition: pressio_options.h:62
@ pressio_option_data_type
Definition: pressio_options.h:66
@ pressio_option_int64_type
Definition: pressio_options.h:72
@ pressio_option_uint64_type
Definition: pressio_options.h:71
@ pressio_option_unset_type
Definition: pressio_options.h:64
@ pressio_option_float_type
Definition: pressio_options.h:60
@ pressio_option_bool_type
Definition: pressio_options.h:73
@ pressio_option_double_type
Definition: pressio_options.h:61
@ pressio_option_uint32_type
Definition: pressio_options.h:58
@ pressio_option_int32_type
Definition: pressio_options.h:59
@ pressio_option_int16_type
Definition: pressio_options.h:70
@ pressio_option_userptr_type
Definition: pressio_options.h:63
@ pressio_option_int8_type
Definition: pressio_options.h:68
@ pressio_option_uint16_type
Definition: pressio_options.h:69
@ pressio_option_threadsafety_type
Definition: pressio_options.h:75
@ pressio_option_dtype_type
Definition: pressio_options.h:74
#define pressio_options_define_type_cast(name, type)
Definition: pressio_options.h:198
void pressio_options_clear(struct pressio_options *options, const char *key)
struct pressio_options * pressio_options_new()
enum pressio_options_key_status pressio_options_get_strings(struct pressio_options const *options, const char *key, size_t *size, const char ***values)
enum pressio_options_key_status pressio_options_as_set(struct pressio_options *options, const char *key, struct pressio_option *option)
pressio_conversion_safety
Definition: pressio_options.h:39
@ pressio_conversion_implicit
Definition: pressio_options.h:43
@ pressio_conversion_special
Definition: pressio_options.h:53
@ pressio_conversion_explicit
Definition: pressio_options.h:48
void pressio_options_set_userptr_managed(struct pressio_options *options, const char *key, void *value, void *metadata, void(*deleter)(void *, void *), void(*copy)(void **, void **, const void *, const void *))
#define pressio_options_define_type_get(name, type)
Definition: pressio_options.h:192
void pressio_options_set_strings(struct pressio_options *options, const char *key, size_t size, const char *const *values)
pressio_options_key_status
Definition: pressio_options.h:27
@ pressio_options_key_does_not_exist
Definition: pressio_options.h:35
@ pressio_options_key_set
Definition: pressio_options.h:29
@ pressio_options_key_exists
Definition: pressio_options.h:32
void pressio_options_set_type(struct pressio_options *options, const char *key, enum pressio_option_type type)
#define pressio_options_define_type_set(name, type)
Definition: pressio_options.h:187
struct pressio_options * pressio_options_merge(struct pressio_options const *lhs, struct pressio_options const *rhs)
void pressio_options_set(struct pressio_options *options, const char *key, struct pressio_option *option)
enum pressio_option_type type() const
Definition: options.h:352