libcbor
0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
|
#include "cbor/common.h"
Go to the source code of this file.
Functions | |
bool | cbor_float_ctrl_is_ctrl (const cbor_item_t *item) |
Is this a ctrl value? More... | |
cbor_float_width | cbor_float_get_width (const cbor_item_t *item) |
Get the float width. More... | |
float | cbor_float_get_float2 (const cbor_item_t *item) |
Get a half precision float. More... | |
float | cbor_float_get_float4 (const cbor_item_t *item) |
Get a single precision float. More... | |
double | cbor_float_get_float8 (const cbor_item_t *item) |
Get a double precision float. More... | |
double | cbor_float_get_float (const cbor_item_t *item) |
Get the float value represented as double. More... | |
cbor_item_t * | cbor_new_ctrl () |
Constructs a new ctrl item. More... | |
cbor_item_t * | cbor_new_float2 () |
Constructs a new float item. More... | |
cbor_item_t * | cbor_new_float4 () |
Constructs a new float item. More... | |
cbor_item_t * | cbor_new_float8 () |
Constructs a new float item. More... | |
cbor_item_t * | cbor_new_null () |
Constructs new null ctrl item. More... | |
cbor_item_t * | cbor_new_undef () |
Constructs new under ctrl item. More... | |
cbor_item_t * | cbor_build_bool (bool value) |
Constructs new boolean ctrl item. More... | |
void | cbor_set_ctrl (cbor_item_t *item, uint8_t value) |
Assign a control value. More... | |
void | cbor_set_float2 (cbor_item_t *item, float value) |
Assigns a float value. More... | |
void | cbor_set_float4 (cbor_item_t *item, float value) |
Assigns a float value. More... | |
void | cbor_set_float8 (cbor_item_t *item, double value) |
Assigns a float value. More... | |
uint8_t | cbor_ctrl_value (const cbor_item_t *item) |
Reads the control value. More... | |
bool | cbor_ctrl_is_bool (const cbor_item_t *item) |
Is this ctrl item a boolean? More... | |
cbor_item_t * | cbor_build_float2 (float value) |
Constructs a new float. More... | |
cbor_item_t * | cbor_build_float4 (float value) |
Constructs a new float. More... | |
cbor_item_t * | cbor_build_float8 (double value) |
Constructs a new float. More... | |
cbor_item_t * | cbor_build_ctrl (uint8_t value) |
Constructs a ctrl item. More... | |
cbor_item_t* cbor_build_bool | ( | bool | value | ) |
Constructs new boolean ctrl item.
value | The value to use |
Definition at line 160 of file floats_ctrls.c.
cbor_item_t* cbor_build_ctrl | ( | uint8_t | value | ) |
Constructs a ctrl item.
value | the value to use |
Definition at line 186 of file floats_ctrls.c.
cbor_item_t* cbor_build_float2 | ( | float | value | ) |
Constructs a new float.
value | the value to use |
Definition at line 165 of file floats_ctrls.c.
cbor_item_t* cbor_build_float4 | ( | float | value | ) |
Constructs a new float.
value | the value to use |
Definition at line 172 of file floats_ctrls.c.
cbor_item_t* cbor_build_float8 | ( | double | value | ) |
Constructs a new float.
value | the value to use |
Definition at line 179 of file floats_ctrls.c.
bool cbor_ctrl_is_bool | ( | const cbor_item_t * | item | ) |
Is this ctrl item a boolean?
item[borrow] | A ctrl item |
Definition at line 92 of file floats_ctrls.c.
uint8_t cbor_ctrl_value | ( | const cbor_item_t * | item | ) |
Reads the control value.
item[borrow] | A ctrl item |
Definition at line 18 of file floats_ctrls.c.
bool cbor_float_ctrl_is_ctrl | ( | const cbor_item_t * | item | ) |
Is this a ctrl value?
item[borrow] | A float or ctrl item |
Definition at line 25 of file floats_ctrls.c.
double cbor_float_get_float | ( | const cbor_item_t * | item | ) |
Get the float value represented as double.
Can be used regardless of the width.
Definition at line 52 of file floats_ctrls.c.
float cbor_float_get_float2 | ( | const cbor_item_t * | item | ) |
Get a half precision float.
The item must have the corresponding width
Definition at line 31 of file floats_ctrls.c.
float cbor_float_get_float4 | ( | const cbor_item_t * | item | ) |
Get a single precision float.
The item must have the corresponding width
Definition at line 38 of file floats_ctrls.c.
double cbor_float_get_float8 | ( | const cbor_item_t * | item | ) |
Get a double precision float.
The item must have the corresponding width
Definition at line 45 of file floats_ctrls.c.
cbor_float_width cbor_float_get_width | ( | const cbor_item_t * | item | ) |
Get the float width.
item[borrow] | A float or ctrl item |
Definition at line 12 of file floats_ctrls.c.
cbor_item_t* cbor_new_ctrl | ( | ) |
Constructs a new ctrl item.
The width cannot be changed once the item is created
Definition at line 98 of file floats_ctrls.c.
cbor_item_t* cbor_new_float2 | ( | ) |
Constructs a new float item.
The width cannot be changed once the item is created
Definition at line 110 of file floats_ctrls.c.
cbor_item_t* cbor_new_float4 | ( | ) |
Constructs a new float item.
The width cannot be changed once the item is created
Definition at line 122 of file floats_ctrls.c.
cbor_item_t* cbor_new_float8 | ( | ) |
Constructs a new float item.
The width cannot be changed once the item is created
Definition at line 134 of file floats_ctrls.c.
cbor_item_t* cbor_new_null | ( | ) |
Constructs new null ctrl item.
Definition at line 146 of file floats_ctrls.c.
cbor_item_t* cbor_new_undef | ( | ) |
Constructs new under ctrl item.
Definition at line 153 of file floats_ctrls.c.
void cbor_set_ctrl | ( | cbor_item_t * | item, |
uint8_t | value | ||
) |
Assign a control value.
embed:rst:leading-asterisk * .. warning:: It is possible to produce an invalid CBOR value by assigning a invalid value using this mechanism. Please consult the standard before use. *
item[borrow] | A ctrl item |
value | The simple value to assign. Please consult the standard for allowed values |
Definition at line 85 of file floats_ctrls.c.
void cbor_set_float2 | ( | cbor_item_t * | item, |
float | value | ||
) |
Assigns a float value.
item[borrow] | A half precision float |
value | The value to assign |
Definition at line 64 of file floats_ctrls.c.
void cbor_set_float4 | ( | cbor_item_t * | item, |
float | value | ||
) |
Assigns a float value.
item[borrow] | A single precision float |
value | The value to assign |
Definition at line 71 of file floats_ctrls.c.
void cbor_set_float8 | ( | cbor_item_t * | item, |
double | value | ||
) |
Assigns a float value.
item[borrow] | A double precision float |
value | The value to assign |
Definition at line 78 of file floats_ctrls.c.