A set of compression/decompression options.
More...
|
const char * | squash_options_get_string (SquashOptions *options, const char *key) |
|
bool | squash_options_get_bool (SquashOptions *options, const char *key) |
|
int | squash_options_get_int (SquashOptions *options, const char *key) |
|
size_t | squash_options_get_size (SquashOptions *options, const char *key) |
|
SquashStatus | squash_options_parse_option (SquashOptions *options, const char *key, const char *value) |
| Parse a single option. More...
|
|
SquashStatus | squash_options_parsea (SquashOptions *options, const char *const *keys, const char *const *values) |
| Parse an array of options. More...
|
|
SquashStatus | squash_options_parsev (SquashOptions *options, va_list options_list) |
| Parse a va_list of options. More...
|
|
SquashStatus | squash_options_parse (SquashOptions *options,...) |
| Parse a variadic list of options. More...
|
|
SquashOptions * | squash_options_new (SquashCodec *codec,...) |
| Create a new group of options. More...
|
|
SquashOptions * | squash_options_newv (SquashCodec *codec, va_list options) |
| Create a new group of options from a variadic list. More...
|
|
SquashOptions * | squash_options_newa (SquashCodec *codec, const char *const *keys, const char *const *values) |
| Create a new group of options from key and value arrays. More...
|
|
void | squash_options_init (void *options, SquashCodec *codec, SquashDestroyNotify destroy_notify) |
| Initialize a new SquashOptions instance. More...
|
|
void | squash_options_destroy (void *options) |
| Destroy a SquashOptions instance. More...
|
|
A set of compression/decompression options.
void squash_options_destroy |
( |
void * |
options | ) |
|
Destroy a SquashOptions instance.
This function should only be used for subclassing. See squash_object_destroy for more information.
- Parameters
-
options | The instance to destroy. |
Definition at line 661 of file options.c.
bool squash_options_get_bool |
( |
SquashOptions * |
options, |
|
|
const char * |
key |
|
) |
| |
Retrieve the value of a boolean option
- Parameters
-
options | the options to retrieve the value from |
key | name of the option to retrieve the value from |
- Returns
- the value
Definition at line 217 of file options.c.
int squash_options_get_int |
( |
SquashOptions * |
options, |
|
|
const char * |
key |
|
) |
| |
Retrieve the value of an integer option
- Parameters
-
options | the options to retrieve the value from |
key | name of the option to retrieve the value from |
- Returns
- the value
Definition at line 246 of file options.c.
size_t squash_options_get_size |
( |
SquashOptions * |
options, |
|
|
const char * |
key |
|
) |
| |
Retrieve the value of a size option
- Parameters
-
options | the options to retrieve the value from |
key | name of the option to retrieve the value from |
- Returns
- the value
Definition at line 277 of file options.c.
const char* squash_options_get_string |
( |
SquashOptions * |
options, |
|
|
const char * |
key |
|
) |
| |
Retrieve the value of a string option
- Note
- If the option is not natively a string (e.g., if it is an integer, size, or boolean), it will not be serialized to one.
- Parameters
-
options | the options to retrieve the value from |
key | name of the option to retrieve the value from |
- Returns
- the value, or NULL on failure
Definition at line 186 of file options.c.
void squash_options_init |
( |
void * |
options, |
|
|
SquashCodec * |
codec, |
|
|
SquashDestroyNotify |
destroy_notify |
|
) |
| |
Initialize a new SquashOptions instance.
This function should only be used for subclassing. See squash_object_init for more information.
- Parameters
-
options | The instance to initialize. |
codec | The codec to use. |
destroy_notify | The function to be squashled when the reference count reaches 0 |
Definition at line 607 of file options.c.
SquashOptions* squash_options_new |
( |
SquashCodec * |
codec, |
|
|
|
... |
|
) |
| |
Create a new group of options.
- Parameters
-
codec | The codec to create the options for. |
... | A variadic list of string key/value pairs followed by NULL |
- Returns
- A new option group, or NULL on failure.
Definition at line 533 of file options.c.
SquashOptions* squash_options_newa |
( |
SquashCodec * |
codec, |
|
|
const char *const * |
keys, |
|
|
const char *const * |
values |
|
) |
| |
Create a new group of options from key and value arrays.
- Parameters
-
codec | The codec to create the options for. |
keys | A NULL-terminated array of keys. |
values | A NULL-terminated array of values. |
- Returns
- A new option group, or NULL on failure.
Definition at line 582 of file options.c.
SquashOptions* squash_options_newv |
( |
SquashCodec * |
codec, |
|
|
va_list |
options |
|
) |
| |
Create a new group of options from a variadic list.
- Parameters
-
codec | The codec to create the options for. |
options | A variadic list of string key/value pairs followed by NULL |
- Returns
- A new option group, or NULL if codec does not accept any options or could not be loaded.
Definition at line 560 of file options.c.
SquashStatus squash_options_parse |
( |
SquashOptions * |
options, |
|
|
|
... |
|
) |
| |
Parse a variadic list of options.
- Parameters
-
options | The options context. |
... | The options to parse. These should be alternating key and value pairs of strings, one for each option, followed by NULL. |
- Returns
- A status code.
Definition at line 514 of file options.c.
SquashStatus squash_options_parse_option |
( |
SquashOptions * |
options, |
|
|
const char * |
key, |
|
|
const char * |
value |
|
) |
| |
Parse a single option.
- Parameters
-
options | The options context. |
key | The option key to parse. |
value | The option value to parse. |
- Returns
- A status code.
- Return values
-
SQUASH_OK | Option parsed successfully. |
SQUASH_BAD_PARAM | Invalid key. |
SQUASH_BAD_VALUE | Invalid value |
Definition at line 311 of file options.c.
SquashStatus squash_options_parsea |
( |
SquashOptions * |
options, |
|
|
const char *const * |
keys, |
|
|
const char *const * |
values |
|
) |
| |
Parse an array of options.
- Parameters
-
options | The options context. |
keys | The option keys to parse. |
values | The option values to parse. |
- Returns
- A status code.
Definition at line 458 of file options.c.
SquashStatus squash_options_parsev |
( |
SquashOptions * |
options, |
|
|
va_list |
options_list |
|
) |
| |
Parse a va_list of options.
- Parameters
-
options | - The options context. |
options_list | - The options to parse. See squash_options_parse for a description of the format. |
- Returns
- A status code.
Definition at line 486 of file options.c.
SquashOptionInfoRangeInt::allow_zero |
whether to allow zero as a value
Note that this is in addition to the range, and independent of the modulus.
Definition at line 86 of file options.h.
SquashOptionInfoRangeSize::allow_zero |
whether to allow zero as a value
Note that this is in addition to the range, and independent of the modulus.
Definition at line 93 of file options.h.