libcbor 0.12.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
|
Go to the source code of this file.
Functions | |
cbor_float_width | cbor_float_get_width (const cbor_item_t *item) |
Get the float width. | |
uint8_t | cbor_ctrl_value (const cbor_item_t *item) |
Reads the control value. | |
bool | cbor_float_ctrl_is_ctrl (const cbor_item_t *item) |
Is this a ctrl value? | |
float | cbor_float_get_float2 (const cbor_item_t *item) |
Get a half precision float. | |
float | cbor_float_get_float4 (const cbor_item_t *item) |
Get a single precision float. | |
double | cbor_float_get_float8 (const cbor_item_t *item) |
Get a double precision float. | |
double | cbor_float_get_float (const cbor_item_t *item) |
Get the float value represented as double. | |
bool | cbor_get_bool (const cbor_item_t *item) |
Get value from a boolean ctrl item. | |
void | cbor_set_float2 (cbor_item_t *item, float value) |
Assigns a float value. | |
void | cbor_set_float4 (cbor_item_t *item, float value) |
Assigns a float value. | |
void | cbor_set_float8 (cbor_item_t *item, double value) |
Assigns a float value. | |
void | cbor_set_ctrl (cbor_item_t *item, uint8_t value) |
Assign a control value. | |
void | cbor_set_bool (cbor_item_t *item, bool value) |
Assign a boolean value to a boolean ctrl item. | |
cbor_item_t * | cbor_new_ctrl (void) |
Constructs a new ctrl item. | |
cbor_item_t * | cbor_new_float2 (void) |
Constructs a new float item. | |
cbor_item_t * | cbor_new_float4 (void) |
Constructs a new float item. | |
cbor_item_t * | cbor_new_float8 (void) |
Constructs a new float item. | |
cbor_item_t * | cbor_new_null (void) |
Constructs new null ctrl item. | |
cbor_item_t * | cbor_new_undef (void) |
Constructs new undef ctrl item. | |
cbor_item_t * | cbor_build_bool (bool value) |
Constructs new boolean ctrl item. | |
cbor_item_t * | cbor_build_float2 (float value) |
Constructs a new float. | |
cbor_item_t * | cbor_build_float4 (float value) |
Constructs a new float. | |
cbor_item_t * | cbor_build_float8 (double value) |
Constructs a new float. | |
cbor_item_t * | cbor_build_ctrl (uint8_t value) |
Constructs a ctrl item. | |
cbor_item_t * cbor_build_bool | ( | bool | value | ) |
Constructs new boolean ctrl item.
value | The value to use |
NULL
if memory allocation fails Definition at line 161 of file floats_ctrls.c.
cbor_item_t * cbor_build_ctrl | ( | uint8_t | value | ) |
Constructs a ctrl item.
value | the value to use |
NULL
if memory allocation fails 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 |
NULL
if memory allocation fails 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 |
NULL
if memory allocation fails 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 |
NULL
if memory allocation fails Definition at line 179 of file floats_ctrls.c.
uint8_t cbor_ctrl_value | ( | const cbor_item_t * | item | ) |
Reads the control value.
item | A ctrl item |
Definition at line 17 of file floats_ctrls.c.
bool cbor_float_ctrl_is_ctrl | ( | const cbor_item_t * | item | ) |
Is this a ctrl value?
item | A float or ctrl item |
Definition at line 23 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.
item | Any float |
Definition at line 46 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
item | A half precision float |
Definition at line 28 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
item | A single precision float |
Definition at line 34 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
item | A double precision float |
Definition at line 40 of file floats_ctrls.c.
cbor_float_width cbor_float_get_width | ( | const cbor_item_t * | item | ) |
Get the float width.
item | A float or ctrl item |
Definition at line 12 of file floats_ctrls.c.
bool cbor_get_bool | ( | const cbor_item_t * | item | ) |
Get value from a boolean ctrl item.
item | A ctrl item |
Definition at line 63 of file floats_ctrls.c.
cbor_item_t * cbor_new_ctrl | ( | void | ) |
Constructs a new ctrl item.
The width cannot be changed once the item is created
NULL
if memory allocation fails Definition at line 98 of file floats_ctrls.c.
cbor_item_t * cbor_new_float2 | ( | void | ) |
Constructs a new float item.
The width cannot be changed once the item is created
NULL
if memory allocation fails Definition at line 111 of file floats_ctrls.c.
cbor_item_t * cbor_new_float4 | ( | void | ) |
Constructs a new float item.
The width cannot be changed once the item is created
NULL
if memory allocation fails Definition at line 123 of file floats_ctrls.c.
cbor_item_t * cbor_new_float8 | ( | void | ) |
Constructs a new float item.
The width cannot be changed once the item is created
NULL
if memory allocation fails Definition at line 135 of file floats_ctrls.c.
cbor_item_t * cbor_new_null | ( | void | ) |
Constructs new null ctrl item.
NULL
if memory allocation fails Definition at line 147 of file floats_ctrls.c.
cbor_item_t * cbor_new_undef | ( | void | ) |
Constructs new undef ctrl item.
NULL
if memory allocation fails Definition at line 154 of file floats_ctrls.c.
void cbor_set_bool | ( | cbor_item_t * | item, |
bool | value ) |
Assign a boolean value to a boolean ctrl item.
item | A ctrl item |
value | The simple value to assign. |
Definition at line 92 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 | A ctrl item |
value | The simple value to assign. Please consult the standard for allowed values |
Definition at line 86 of file floats_ctrls.c.
void cbor_set_float2 | ( | cbor_item_t * | item, |
float | value ) |
Assigns a float value.
item | A half precision float |
value | The value to assign |
Definition at line 68 of file floats_ctrls.c.
void cbor_set_float4 | ( | cbor_item_t * | item, |
float | value ) |
Assigns a float value.
item | A single precision float |
value | The value to assign |
Definition at line 74 of file floats_ctrls.c.
void cbor_set_float8 | ( | cbor_item_t * | item, |
double | value ) |
Assigns a float value.
item | A double precision float |
value | The value to assign |
Definition at line 80 of file floats_ctrls.c.