Soletta™ Framework
|
Data Structures | |
struct | sol_blob |
Data type describing the default blob implementation. More... | |
struct | sol_blob_type |
Data type describing a blob type. More... | |
struct | sol_direction_vector |
Data type to describe a direction vector. More... | |
struct | sol_drange |
Data type describing a Double range. More... | |
struct | sol_drange_spec |
Data type describing a spec for Double ranges. More... | |
struct | sol_irange |
Data type describing Integer ranges. More... | |
struct | sol_irange_spec |
Data type describing a spec for Integer ranges. More... | |
struct | sol_key_value |
Data type to describe <key, value> pairs of strings. More... | |
struct | sol_location |
Data type to describe a location. More... | |
struct | sol_rgb |
Data type to describe a RGB color. More... | |
Macros | |
#define | SOL_BLOB_NEW_DUP(mem_) sol_blob_new_dup((&mem_), sizeof(mem_)) |
Helper macro to create a new blob duplicating target memory calculating target size. More... | |
#define | SOL_DRANGE_INIT() |
Helper macro to initialize a double range with default values. More... | |
#define | SOL_DRANGE_INIT_VALUE(value_) |
Helper macro to initialize a double range with default spec and a given value. More... | |
#define | SOL_IRANGE_INIT() |
Helper macro to initialize an integer range with default values. More... | |
#define | SOL_IRANGE_INIT_VALUE(value_) |
Helper macro to initialize a integer range with default spec and a given value. More... | |
Typedefs | |
typedef struct sol_blob | sol_blob |
Data type describing the default blob implementation. More... | |
typedef struct sol_blob_type | sol_blob_type |
Data type describing a blob type. More... | |
typedef struct sol_direction_vector | sol_direction_vector |
Data type to describe a direction vector. More... | |
typedef struct sol_drange | sol_drange |
Data type describing a Double range. More... | |
typedef struct sol_drange_spec | sol_drange_spec |
Data type describing a spec for Double ranges. More... | |
typedef struct sol_irange | sol_irange |
Data type describing Integer ranges. More... | |
typedef struct sol_irange_spec | sol_irange_spec |
Data type describing a spec for Integer ranges. More... | |
typedef struct sol_key_value | sol_key_value |
Data type to describe <key, value> pairs of strings. More... | |
typedef struct sol_location | sol_location |
Data type to describe a location. More... | |
typedef struct sol_rgb | sol_rgb |
Data type to describe a RGB color. More... | |
Functions | |
struct sol_blob * | sol_blob_new (const struct sol_blob_type *type, struct sol_blob *parent, const void *mem, size_t size) |
Creates a new blob instance of the given type type . More... | |
static struct sol_blob * | sol_blob_new_dup (const void *mem, size_t size) |
Creates a new blob duplicating target memory,. More... | |
static struct sol_blob * | sol_blob_new_dup_str (const char *str) |
Creates a new blob duplicating target NUL terminated string. More... | |
struct sol_blob * | sol_blob_ref (struct sol_blob *blob) |
Increments the reference counter of the given blob. More... | |
void | sol_blob_set_parent (struct sol_blob *blob, struct sol_blob *parent) |
Set the blob's parent. More... | |
int | sol_blob_setup (struct sol_blob *blob, const struct sol_blob_type *type, const void *mem, size_t size) |
Setup a blob structure with the given parameters. More... | |
void | sol_blob_unref (struct sol_blob *blob) |
Decreases the reference counter of the given blob. More... | |
bool | sol_direction_vector_eq (const struct sol_direction_vector *var0, const struct sol_direction_vector *var1) |
Checks the ranges of var0 and var1 for equality. More... | |
int | sol_drange_add (const struct sol_drange *var0, const struct sol_drange *var1, struct sol_drange *result) |
Adds the double ranges var0 and var1 and stores the result in result . More... | |
int | sol_drange_compose (const struct sol_drange_spec *spec, double value, struct sol_drange *result) |
Initializes result with the given spec and value . More... | |
int | sol_drange_div (const struct sol_drange *var0, const struct sol_drange *var1, struct sol_drange *result) |
Divides the double range var0 by var1 and stores the result in result . More... | |
bool | sol_drange_eq (const struct sol_drange *var0, const struct sol_drange *var1) |
Checks the double ranges var0 and var1 for equality. More... | |
int | sol_drange_mod (const struct sol_drange *var0, const struct sol_drange *var1, struct sol_drange *result) |
Calculates the module of the double range var0 by var1 and stores the result in result . More... | |
int | sol_drange_mul (const struct sol_drange *var0, const struct sol_drange *var1, struct sol_drange *result) |
Multiplies the double ranges var0 and var1 and stores the result in result . More... | |
int | sol_drange_sub (const struct sol_drange *var0, const struct sol_drange *var1, struct sol_drange *result) |
Subtracts the double range var1 from var0 and stores the result in result . More... | |
int | sol_irange_add (const struct sol_irange *var0, const struct sol_irange *var1, struct sol_irange *result) |
Adds the integer ranges var0 and var1 and stores the result in result . More... | |
int | sol_irange_compose (const struct sol_irange_spec *spec, int32_t value, struct sol_irange *result) |
Initializes result with the given spec and value . More... | |
int | sol_irange_div (const struct sol_irange *var0, const struct sol_irange *var1, struct sol_irange *result) |
Divides the integer range var0 by var1 and stores the result in result . More... | |
bool | sol_irange_eq (const struct sol_irange *var0, const struct sol_irange *var1) |
Checks the integer ranges var0 and var1 for equality. More... | |
int | sol_irange_mod (const struct sol_irange *var0, const struct sol_irange *var1, struct sol_irange *result) |
Calculates the module of the integer range var0 by var1 and stores the result in result . More... | |
int | sol_irange_mul (const struct sol_irange *var0, const struct sol_irange *var1, struct sol_irange *result) |
Multiplies the integer ranges var0 and var1 and stores the result in result . More... | |
int | sol_irange_sub (const struct sol_irange *var0, const struct sol_irange *var1, struct sol_irange *result) |
Subtracts the integer range var1 from var0 and stores the result in result . More... | |
bool | sol_rgb_eq (const struct sol_rgb *var0, const struct sol_rgb *var1) |
Checks the ranges of var0 and var1 for equality. More... | |
int | sol_rgb_set_max (struct sol_rgb *color, uint32_t max_value) |
Set a maximum value for all components of a RGB color. More... | |
Variables | |
const struct sol_blob_type | SOL_BLOB_TYPE_DEFAULT |
Blob type object for the default implementation. More... | |
const struct sol_blob_type | SOL_BLOB_TYPE_NO_FREE |
Blob type object for the nofree implementation. More... | |
const struct sol_blob_type | SOL_BLOB_TYPE_NO_FREE_DATA |
Blob type object for the nofree implementation. More... | |
#define SOL_BLOB_NEW_DUP | ( | mem_ | ) | sol_blob_new_dup((&mem_), sizeof(mem_)) |
Helper macro to create a new blob duplicating target memory calculating target size.
#define SOL_DRANGE_INIT | ( | ) |
Helper macro to initialize a double range with default values.
#define SOL_DRANGE_INIT_VALUE | ( | value_ | ) |
Helper macro to initialize a double range with default spec and a given value.
value_ | Initial value |
#define SOL_IRANGE_INIT | ( | ) |
Helper macro to initialize an integer range with default values.
#define SOL_IRANGE_INIT_VALUE | ( | value_ | ) |
Helper macro to initialize a integer range with default spec and a given value.
value_ | Initial value |
typedef struct sol_blob_type sol_blob_type |
Data type describing a blob type.
This should be used by different kinds of Blob implementation to make than compatible to our blob API.
typedef struct sol_direction_vector sol_direction_vector |
Data type to describe a direction vector.
typedef struct sol_drange sol_drange |
Data type describing a Double range.
typedef struct sol_drange_spec sol_drange_spec |
Data type describing a spec for Double ranges.
A range spec is composed by the range limits and step.
typedef struct sol_irange sol_irange |
Data type describing Integer ranges.
typedef struct sol_irange_spec sol_irange_spec |
Data type describing a spec for Integer ranges.
A range spec is composed by the range limits and step.
typedef struct sol_key_value sol_key_value |
Data type to describe <key, value> pairs of strings.
typedef struct sol_location sol_location |
Data type to describe a location.
struct sol_blob* sol_blob_new | ( | const struct sol_blob_type * | type, |
struct sol_blob * | parent, | ||
const void * | mem, | ||
size_t | size | ||
) |
Creates a new blob instance of the given type type
.
type | Blob type of the new instance |
parent | Parent blob |
mem | Blob's data |
size | Blob's data size |
Referenced by coord_to_str(), on_data(), on_stdin_hash(), producer_make_data(), sol_blob_new_dup(), sol_efivars_write_string(), sol_fs_write_string(), sol_memmap_write_string(), sol_str_slice_to_blob(), and startup().
|
static |
Creates a new blob duplicating target memory,.
Instead creating a blob wrapping any given memory, it duplicates given memory. Useful, for instance, to create blobs for packet types.
mem | memory that blob will duplicate and refers to |
size | size of memory block |
NULL
on failure References sol_blob_new(), and SOL_BLOB_TYPE_DEFAULT.
Referenced by main(), and sol_blob_new_dup_str().
|
static |
Creates a new blob duplicating target NUL terminated string.
str | string to be duplicated in a blob. |
NULL
on failure References sol_blob_new_dup().
Increments the reference counter of the given blob.
blob | The Blob increase the references |
Referenced by my_stream_api_feed(), write_security_res(), and write_server_res().
Set the blob's parent.
blob | The blob |
parent | New parent |
int sol_blob_setup | ( | struct sol_blob * | blob, |
const struct sol_blob_type * | type, | ||
const void * | mem, | ||
size_t | size | ||
) |
Setup a blob structure with the given parameters.
blob | Blob to setup |
type | Blob's type |
mem | Blob's data |
size | Blob's data size |
0
on success, error code (always negative) otherwise. void sol_blob_unref | ( | struct sol_blob * | blob | ) |
Decreases the reference counter of the given blob.
When the reference counter reaches 0
, the blob is freed.
blob | The Blob to decrease the references |
Referenced by _can_write(), api_close(), create_security_obj(), del_security_obj(), del_server_obj(), hash_file(), main(), my_stream_api_feed(), on_data(), on_stdin(), on_stdin_hash(), read_location_obj(), send_blob(), shutdown(), sol_efivars_write_bool(), sol_efivars_write_double(), sol_efivars_write_drange(), sol_efivars_write_int32(), sol_efivars_write_irange(), sol_efivars_write_string(), sol_efivars_write_uint8(), sol_fs_write_bool(), sol_fs_write_double(), sol_fs_write_drange(), sol_fs_write_int32(), sol_fs_write_irange(), sol_fs_write_string(), sol_fs_write_uint8(), sol_memmap_write_bool(), sol_memmap_write_double(), sol_memmap_write_drange(), sol_memmap_write_int32(), sol_memmap_write_irange(), sol_memmap_write_string(), sol_memmap_write_uint8(), startup(), write_security_res(), write_security_tlv(), write_server_res(), and write_server_tlv().
bool sol_direction_vector_eq | ( | const struct sol_direction_vector * | var0, |
const struct sol_direction_vector * | var1 | ||
) |
Checks the ranges of var0
and var1
for equality.
var0 | The first direction vector |
var1 | The second direction vector |
true
if both are equal, false
otherwise. int sol_drange_add | ( | const struct sol_drange * | var0, |
const struct sol_drange * | var1, | ||
struct sol_drange * | result | ||
) |
Adds the double ranges var0
and var1
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First double range |
var1 | Second double range |
result | Resulting range |
0
on success, error code (always negative) otherwise. int sol_drange_compose | ( | const struct sol_drange_spec * | spec, |
double | value, | ||
struct sol_drange * | result | ||
) |
Initializes result
with the given spec
and value
.
spec | Double range spec |
value | Desired value |
result | Double range to be initialized |
0
on success, error code (always negative) otherwise. int sol_drange_div | ( | const struct sol_drange * | var0, |
const struct sol_drange * | var1, | ||
struct sol_drange * | result | ||
) |
Divides the double range var0
by var1
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First double range |
var1 | Second double range |
result | Resulting range |
0
on success, error code (always negative) otherwise. bool sol_drange_eq | ( | const struct sol_drange * | var0, |
const struct sol_drange * | var1 | ||
) |
Checks the double ranges var0
and var1
for equality.
This function takes into consideration the range spec of the arguments.
var0 | First double range |
var1 | Second double range |
true
if both are equal, false
otherwise. int sol_drange_mod | ( | const struct sol_drange * | var0, |
const struct sol_drange * | var1, | ||
struct sol_drange * | result | ||
) |
Calculates the module of the double range var0
by var1
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First double range |
var1 | Second double range |
result | Resulting range |
0
on success, error code (always negative) otherwise. int sol_drange_mul | ( | const struct sol_drange * | var0, |
const struct sol_drange * | var1, | ||
struct sol_drange * | result | ||
) |
Multiplies the double ranges var0
and var1
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First double range |
var1 | Second double range |
result | Resulting range |
0
on success, error code (always negative) otherwise. int sol_drange_sub | ( | const struct sol_drange * | var0, |
const struct sol_drange * | var1, | ||
struct sol_drange * | result | ||
) |
Subtracts the double range var1
from var0
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First double range |
var1 | Second double range |
result | Resulting range |
0
on success, error code (always negative) otherwise. int sol_irange_add | ( | const struct sol_irange * | var0, |
const struct sol_irange * | var1, | ||
struct sol_irange * | result | ||
) |
Adds the integer ranges var0
and var1
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First integer range |
var1 | Second integer range |
result | Resulting range |
0
on success, error code (always negative) otherwise. int sol_irange_compose | ( | const struct sol_irange_spec * | spec, |
int32_t | value, | ||
struct sol_irange * | result | ||
) |
Initializes result
with the given spec
and value
.
spec | Integer range spec |
value | Desired value |
result | Integer range to be initialized |
0
on success, error code (always negative) otherwise. int sol_irange_div | ( | const struct sol_irange * | var0, |
const struct sol_irange * | var1, | ||
struct sol_irange * | result | ||
) |
Divides the integer range var0
by var1
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First integer range |
var1 | Second integer range |
result | Resulting range |
0
on success, error code (always negative) otherwise. bool sol_irange_eq | ( | const struct sol_irange * | var0, |
const struct sol_irange * | var1 | ||
) |
Checks the integer ranges var0
and var1
for equality.
This function takes into consideration the range spec of the arguments.
var0 | First integer range |
var1 | Second integer range |
true
if both are equal, false
otherwise. int sol_irange_mod | ( | const struct sol_irange * | var0, |
const struct sol_irange * | var1, | ||
struct sol_irange * | result | ||
) |
Calculates the module of the integer range var0
by var1
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First integer range |
var1 | Second integer range |
result | Resulting range |
0
on success, error code (always negative) otherwise. int sol_irange_mul | ( | const struct sol_irange * | var0, |
const struct sol_irange * | var1, | ||
struct sol_irange * | result | ||
) |
Multiplies the integer ranges var0
and var1
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First integer range |
var1 | Second integer range |
result | Resulting range |
0
on success, error code (always negative) otherwise. int sol_irange_sub | ( | const struct sol_irange * | var0, |
const struct sol_irange * | var1, | ||
struct sol_irange * | result | ||
) |
Subtracts the integer range var1
from var0
and stores the result in result
.
This function takes into consideration the range spec of the arguments and set the appropriated spec in the result.
var0 | First integer range |
var1 | Second integer range |
result | Resulting range |
0
on success, error code (always negative) otherwise. Checks the ranges of var0
and var1
for equality.
var0 | The first RGB |
var1 | The second RGB |
true
if both are equal, false
otherwise. int sol_rgb_set_max | ( | struct sol_rgb * | color, |
uint32_t | max_value | ||
) |
Set a maximum value for all components of a RGB color.
color | The RGB color |
max_value | Maximum value to set |
0
on success, error code (always negative) otherwise const struct sol_blob_type SOL_BLOB_TYPE_DEFAULT |
Blob type object for the default implementation.
The default type uses free() to release the blob's memory
Referenced by coord_to_str(), on_stdin_hash(), producer_make_data(), sol_blob_new_dup(), sol_efivars_write_string(), sol_fs_write_string(), sol_memmap_write_string(), and sol_str_slice_to_blob().
const struct sol_blob_type SOL_BLOB_TYPE_NO_FREE |
Blob type object for the nofree
implementation.
The no-free type doesn't free blob's data memory and the blob itself. Used when creating a blob in the application's stack with constant data.
const struct sol_blob_type SOL_BLOB_TYPE_NO_FREE_DATA |
Blob type object for the nofree
implementation.
The no-free type doesn't free blob's data memory. Used when pointing to inner position of a pre existing blob or any other case when blob's data memory shouldn't be freed.