Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
sol-types.h File Reference

These routines are used for Soletta types' manipulation. More...

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <sol-common-buildopts.h>
#include <sol-vector.h>

Go to the source code of this file.

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_TYPE_CHECK(type, var, value)   ({ type var = (value); var; })
 Internal macro to check type of given value. 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. More...
 
#define SOL_BLOB_TYPE_API_VERSION   (1)
 
#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...
 
#define SOL_TYPE_CHECK(type, value)   _SOL_TYPE_CHECK(type, __dummy_ ## __COUNTER__, (value))
 Macro to check type of given value. More...
 
#define SSIZE_MAX   LONG_MAX
 Maximum value of a ssize variable. More...
 
#define SSIZE_MIN   LONG_MIN
 Minimum value of a ssize variable. 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_blobsol_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_blobsol_blob_new_dup (const void *mem, size_t size)
 Creates a new blob duplicating target memory,. More...
 
static struct sol_blobsol_blob_new_dup_str (const char *str)
 Creates a new blob duplicating target NUL terminated string. More...
 
struct sol_blobsol_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...
 

Detailed Description

These routines are used for Soletta types' manipulation.

Macro Definition Documentation

#define SOL_BLOB_TYPE_API_VERSION   (1)