19bool _cbor_enable_assert =
true;
123 for (
size_t i = 0; i < size; i++)
size_t cbor_array_size(const cbor_item_t *item)
Get the number of members.
cbor_item_t ** cbor_array_handle(const cbor_item_t *item)
Get the array contents.
bool cbor_bytestring_is_definite(const cbor_item_t *item)
Is the byte string definite?
cbor_item_t ** cbor_bytestring_chunks_handle(const cbor_item_t *item)
Get the handle to the array of chunks.
size_t cbor_bytestring_chunk_count(const cbor_item_t *item)
Get the number of chunks this string consist of.
bool cbor_isa_string(const cbor_item_t *item)
Does the item have the appropriate major type?
bool cbor_isa_negint(const cbor_item_t *item)
Does the item have the appropriate major type?
bool cbor_isa_tag(const cbor_item_t *item)
Does the item have the appropriate major type?
cbor_item_t * cbor_move(cbor_item_t *item)
Provides CPP-like move construct.
bool cbor_is_float(const cbor_item_t *item)
Is the item an a floating point number?
bool cbor_is_int(const cbor_item_t *item)
Is the item an integer, either positive or negative?
void cbor_intermediate_decref(cbor_item_t *item)
Decreases the item's reference count by one, deallocating the item if needed.
bool cbor_is_bool(const cbor_item_t *item)
Is the item an a boolean?
bool cbor_isa_uint(const cbor_item_t *item)
Does the item have the appropriate major type?
bool cbor_isa_float_ctrl(const cbor_item_t *item)
Does the item have the appropriate major type?
bool cbor_isa_array(const cbor_item_t *item)
Does the item have the appropriate major type?
cbor_item_t * cbor_incref(cbor_item_t *item)
Increases the item's reference count by one.
size_t cbor_refcount(const cbor_item_t *item)
Get the item's reference count.
cbor_type cbor_typeof(const cbor_item_t *item)
Get the type of the item.
bool cbor_is_null(const cbor_item_t *item)
Does this item represent null
bool cbor_isa_bytestring(const cbor_item_t *item)
Does the item have the appropriate major type?
void cbor_decref(cbor_item_t **item_ref)
Decreases the item's reference count by one, deallocating the item if needed.
bool cbor_isa_map(const cbor_item_t *item)
Does the item have the appropriate major type?
bool cbor_is_undef(const cbor_item_t *item)
Does this item represent undefined
cbor_type
Specifies the Major type of cbor_item_t.
@ CBOR_TYPE_FLOAT_CTRL
7 - decimals and special values (true, false, nil, ...)
@ CBOR_TYPE_UINT
0 - positive integers
@ CBOR_TYPE_BYTESTRING
2 - byte strings
@ CBOR_TYPE_STRING
3 - strings
@ CBOR_TYPE_NEGINT
1 - negative integers
@ CBOR_TYPE_ARRAY
4 - arrays
bool cbor_float_ctrl_is_ctrl(const cbor_item_t *item)
Is this a ctrl value?
uint8_t cbor_ctrl_value(const cbor_item_t *item)
Reads the control value.
struct cbor_pair * cbor_map_handle(const cbor_item_t *item)
Get the pairs storage.
bool cbor_string_is_definite(const cbor_item_t *item)
Is the string definite?
cbor_item_t ** cbor_string_chunks_handle(const cbor_item_t *item)
Get the handle to the array of chunks.
size_t cbor_string_chunk_count(const cbor_item_t *item)
Get the number of chunks this string consist of.
Defines cbor_item_t::data structure for indefinite strings and bytestrings.
unsigned char * data
Raw data block - interpretation depends on metadata.
cbor_type type
Major type discriminator.
size_t refcount
Reference count - initialize to 0.
union cbor_item_metadata metadata
Discriminated by type.
Simple pair of items for use in maps.