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 Fields
sol_memdesc Struct Reference

Data type to describe a memory region. More...

#include <sol-memdesc.h>

Data Fields

union {
   const struct sol_memdesc *   array_item
 Type of array item. More...
 
   const struct sol_str_table_int64 *   enumeration_mapping
 null-terminated array of struct sol_str_table. More...
 
   const struct sol_memdesc *   pointed_item
 Type of a memory pointer. More...
 
   const struct
sol_memdesc_structure_member *   structure_members
 null-terminated array of structure members. More...
 
}; 
 how to access complex types (structures and arrays). More...
 
uint16_t api_version
 API version, must match SOL_MEMDESC_API_VERSION at runtime. More...
 
union {
   bool   b
 use when SOL_MEMDESC_TYPE_BOOL More...
 
   double   d
 use when SOL_MEMDESC_TYPE_DOUBLE More...
 
   int64_t   e
 use when SOL_MEMDESC_TYPE_ENUMERATION More...
 
   int16_t   i16
 use when SOL_MEMDESC_TYPE_INT16 More...
 
   int32_t   i32
 use when SOL_MEMDESC_TYPE_INT32 More...
 
   int64_t   i64
 use when SOL_MEMDESC_TYPE_INT64 More...
 
   int8_t   i8
 use when SOL_MEMDESC_TYPE_INT8 More...
 
   long   l
 use when SOL_MEMDESC_TYPE_LONG More...
 
   const void *   p
 use when SOL_MEMDESC_TYPE_PTR, SOL_MEMDESC_TYPE_STRUCTURE or SOL_MEMDESC_TYPE_ARRAY More...
 
   const char *   s
 use when SOL_MEMDESC_TYPE_STRING or SOL_MEMDESC_TYPE_CONST_STRING More...
 
   ssize_t   ssz
 use when SOL_MEMDESC_TYPE_SSIZE More...
 
   size_t   sz
 use when SOL_MEMDESC_TYPE_SIZE More...
 
   uint16_t   u16
 use when SOL_MEMDESC_TYPE_UINT16 More...
 
   uint32_t   u32
 use when SOL_MEMDESC_TYPE_UINT32 More...
 
   uint64_t   u64
 use when SOL_MEMDESC_TYPE_UINT64 More...
 
   uint8_t   u8
 use when SOL_MEMDESC_TYPE_UINT8 More...
 
   unsigned long   ul
 use when SOL_MEMDESC_TYPE_ULONG More...
 
defcontent
 default contents to be used if required == false. More...
 
const struct sol_memdesc_opsops
 Override operations to use when operating on the memory. More...
 
uint16_t size
 size in bytes of the member memory. More...
 
enum sol_memdesc_type type
 basic type of the member memory. More...
 

Detailed Description

Data type to describe a memory region.

Field Documentation

union { ... }

how to access complex types (structures and arrays).

If the memory is complex, use a recursive description specified here.

uint16_t sol_memdesc::api_version
const struct sol_memdesc* sol_memdesc::array_item

Type of array item.

Only to be used in SOL_MEMDESC_TYPE_ARRAY.

Referenced by sol_memdesc_append_array_element().

bool sol_memdesc::b

use when SOL_MEMDESC_TYPE_BOOL

double sol_memdesc::d

use when SOL_MEMDESC_TYPE_DOUBLE

union { ... } sol_memdesc::defcontent

default contents to be used if required == false.

If struct sol_memdesc::required is false, then this content can be used to provide defaults.

Note that complex types SOL_MEMDESC_TYPE_STRUCTURE, SOL_MEMDESC_TYPE_ARRAY and SOL_MEMDESC_TYPE_PTR have their own handling with struct sol_memdesc::structure_members, struct sol_memdesc::array_item, struct sol_memdesc::pointed_item.

Referenced by sol_memdesc_get_as_int64(), sol_memdesc_get_as_uint64(), sol_memdesc_set_as_int64(), and sol_memdesc_set_as_uint64().

int64_t sol_memdesc::e
const struct sol_str_table_int64* sol_memdesc::enumeration_mapping

null-terminated array of struct sol_str_table.

Only to be used in SOL_MEMDESC_TYPE_ENUMERATION.

int16_t sol_memdesc::i16

use when SOL_MEMDESC_TYPE_INT16

int32_t sol_memdesc::i32

use when SOL_MEMDESC_TYPE_INT32

int64_t sol_memdesc::i64

use when SOL_MEMDESC_TYPE_INT64

int8_t sol_memdesc::i8

use when SOL_MEMDESC_TYPE_INT8

long sol_memdesc::l

use when SOL_MEMDESC_TYPE_LONG

const struct sol_memdesc_ops* sol_memdesc::ops

Override operations to use when operating on the memory.

May be NULL to use the default operations.

const void* sol_memdesc::p

use when SOL_MEMDESC_TYPE_PTR, SOL_MEMDESC_TYPE_STRUCTURE or SOL_MEMDESC_TYPE_ARRAY

const struct sol_memdesc* sol_memdesc::pointed_item

Type of a memory pointer.

Only to be used in SOL_MEMDESC_TYPE_PTR

const char* sol_memdesc::s

use when SOL_MEMDESC_TYPE_STRING or SOL_MEMDESC_TYPE_CONST_STRING

uint16_t sol_memdesc::size

size in bytes of the member memory.

Usually this is sizeof(type), if a structure it will account for all members plus paddings.

This is only used for SOL_MEMDESC_TYPE_STRUCTURE and SOL_MEMDESC_TYPE_ARRAY.

Referenced by sol_memdesc_get_as_int64(), sol_memdesc_get_as_uint64(), sol_memdesc_get_size(), sol_memdesc_set_as_int64(), and sol_memdesc_set_as_uint64().

ssize_t sol_memdesc::ssz

use when SOL_MEMDESC_TYPE_SSIZE

const struct sol_memdesc_structure_member* sol_memdesc::structure_members

null-terminated array of structure members.

Only to be used in SOL_MEMDESC_TYPE_STRUCTURE.

Loops should stop when type is SOL_MEMDESC_TYPE_UNKNOWN (0).

size_t sol_memdesc::sz

use when SOL_MEMDESC_TYPE_SIZE

enum sol_memdesc_type sol_memdesc::type

basic type of the member memory.

All handling of the memory depends on how it is to be accessed. Like integers will have sign or not and a number of bits. Strings will be duplicated with strdup() and then released with free().

Referenced by sol_memdesc_get_as_int64(), sol_memdesc_get_as_uint64(), sol_memdesc_get_size(), sol_memdesc_is_signed_integer(), sol_memdesc_is_unsigned_integer(), sol_memdesc_set_as_int64(), and sol_memdesc_set_as_uint64().

uint16_t sol_memdesc::u16

use when SOL_MEMDESC_TYPE_UINT16

uint32_t sol_memdesc::u32

use when SOL_MEMDESC_TYPE_UINT32

uint64_t sol_memdesc::u64

use when SOL_MEMDESC_TYPE_UINT64

uint8_t sol_memdesc::u8

use when SOL_MEMDESC_TYPE_UINT8

unsigned long sol_memdesc::ul

use when SOL_MEMDESC_TYPE_ULONG


The documentation for this struct was generated from the following file: