libpressio 0.93.0
Loading...
Searching...
No Matches
pressio_option.h
Go to the documentation of this file.
1#ifdef __cplusplus
2extern "C" {
3#endif
8#ifndef PRESSIO_OPTION
12#define PRESSIO_OPTION
13#include <stdbool.h>
14#include <stdint.h>
15#include <stdbool.h>
16#include "pressio_options.h"
17#include "pressio_compressor.h"
18
19
29void pressio_option_free(struct pressio_option* options);
30
37
44
50bool pressio_option_has_value(struct pressio_option const* option);
51
61
70
78#define pressio_option_define_type(name, type) \
79 \
84 struct pressio_option* pressio_option_new_##name(type value); \
85 \
90 type pressio_option_get_##name(struct pressio_option const* option); \
91 \
96 void pressio_option_set_##name(struct pressio_option* option, type value);
98pressio_option_define_type(uinteger8, uint8_t)
100pressio_option_define_type(uinteger16, uint16_t)
101pressio_option_define_type(integer16, int16_t)
102pressio_option_define_type(uinteger, uint32_t)
103pressio_option_define_type(integer, int32_t)
104pressio_option_define_type(uinteger64, uint64_t)
105pressio_option_define_type(integer64, int64_t)
106pressio_option_define_type(float, float)
108pressio_option_define_type(double, double)
111pressio_option_define_type(string, const char*)
112pressio_option_define_type(userptr, void*)
113
123 void* value,
124 void* metadata,
125 void(*deleter)(void*, void*),
126 void(*copy)(void**, void**, const void*, const void*));
127
138 void* value,
139 void* metadata,
140 void(*deleter)(void*, void*),
141 void(*copy)(void**, void**, const void*, const void*));
142
149struct pressio_option* pressio_option_new_strings(const char** values, size_t size);
150
157const char** pressio_option_get_strings(struct pressio_option const* option, size_t* size);
158 \
165void pressio_option_set_strings(struct pressio_option* option, const char** values, size_t size);
166
173
179struct pressio_data* pressio_option_get_data(struct pressio_option const* option);
180
186void pressio_option_set_data(struct pressio_option* option, struct pressio_data* value);
187
188
189#undef pressio_option_define_type
190
206
207
221char* pressio_option_to_string(struct pressio_option const* option);
222
223#endif
224
225#ifdef __cplusplus
226}
227#endif
Compress, decompress, and configure pressio and lossless compressors.
pressio_thread_safety
Definition: pressio_compressor.h:268
pressio_dtype
Definition: pressio_dtype.h:16
void pressio_option_free(struct pressio_option *options)
struct pressio_option * pressio_option_new_userptr_managed(void *value, void *metadata, void(*deleter)(void *, void *), void(*copy)(void **, void **, const void *, const void *))
#define pressio_option_define_type(name, type)
Definition: pressio_option.h:78
enum pressio_options_key_status pressio_option_as_set(struct pressio_option *lhs, struct pressio_option *rhs)
const char ** pressio_option_get_strings(struct pressio_option const *option, size_t *size)
struct pressio_option * pressio_option_convert_implicit(struct pressio_option const *option, enum pressio_option_type type)
char * pressio_option_to_string(struct pressio_option const *option)
void pressio_option_set_type(struct pressio_option *option, enum pressio_option_type type)
void pressio_option_set_data(struct pressio_option *option, struct pressio_data *value)
enum pressio_option_type pressio_option_get_type(struct pressio_option const *option)
struct pressio_option * pressio_option_convert(struct pressio_option const *option, enum pressio_option_type type, enum pressio_conversion_safety safety)
bool pressio_option_has_value(struct pressio_option const *option)
void pressio_option_set_strings(struct pressio_option *option, const char **values, size_t size)
struct pressio_option * pressio_option_new_data(struct pressio_data *data)
struct pressio_data * pressio_option_get_data(struct pressio_option const *option)
enum pressio_options_key_status pressio_option_cast_set(struct pressio_option *lhs, struct pressio_option *rhs, enum pressio_conversion_safety safety)
struct pressio_option * pressio_option_new()
void pressio_option_set_userptr_managed(struct pressio_option *option, void *value, void *metadata, void(*deleter)(void *, void *), void(*copy)(void **, void **, const void *, const void *))
struct pressio_option * pressio_option_new_strings(const char **values, size_t size)
A set of options for a compressor.
pressio_option_type
Definition: pressio_options.h:57
pressio_conversion_safety
Definition: pressio_options.h:39
pressio_options_key_status
Definition: pressio_options.h:27
Definition: data.h:52
Definition: options.h:80
enum pressio_option_type type() const