libcbor 0.12.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
|
#include "cbor/common.h"
#include "arrays.h"
#include "bytestrings.h"
#include "data.h"
#include "floats_ctrls.h"
#include "ints.h"
#include "maps.h"
#include "strings.h"
#include "tags.h"
Go to the source code of this file.
Functions | |
bool | cbor_isa_uint (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_bytestring (const cbor_item_t *item) |
Does the item have the appropriate major type? | |
bool | cbor_isa_string (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? | |
bool | cbor_isa_map (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? | |
bool | cbor_isa_float_ctrl (const cbor_item_t *item) |
Does the item have the appropriate major type? | |
cbor_type | cbor_typeof (const cbor_item_t *item) |
Get the type of the item. | |
bool | cbor_is_int (const cbor_item_t *item) |
Is the item an integer, either positive or negative? | |
bool | cbor_is_bool (const cbor_item_t *item) |
Is the item an a boolean? | |
bool | cbor_is_null (const cbor_item_t *item) |
Does this item represent null | |
bool | cbor_is_undef (const cbor_item_t *item) |
Does this item represent undefined | |
bool | cbor_is_float (const cbor_item_t *item) |
Is the item an a floating point number? | |
cbor_item_t * | cbor_incref (cbor_item_t *item) |
Increases the item's reference count by one. | |
void | cbor_decref (cbor_item_t **item_ref) |
Decreases the item's reference count by one, deallocating the item if needed. | |
void | cbor_intermediate_decref (cbor_item_t *item) |
Decreases the item's reference count by one, deallocating the item if needed. | |
size_t | cbor_refcount (const cbor_item_t *item) |
Get the item's reference count. | |
cbor_item_t * | cbor_move (cbor_item_t *item) |
Provides CPP-like move construct. | |
void cbor_decref | ( | cbor_item_t ** | item | ) |
Decreases the item's reference count by one, deallocating the item if needed.
In case the item is deallocated, the reference count of all items this item references will also be cbor_decref 'ed recursively.
item | Reference to an item. Will be set to NULL if deallocated |
cbor_item_t * cbor_incref | ( | cbor_item_t * | item | ) |
Increases the item's reference count by one.
Constant complexity; items referring to this one or items being referred to are not updated.
This function can be used to extend reference counting to client code.
item | Reference to an item |
item
void cbor_intermediate_decref | ( | cbor_item_t * | item | ) |
Decreases the item's reference count by one, deallocating the item if needed.
Convenience wrapper for cbor_decref when its set-to-null behavior is not needed
item | Reference to an item |
bool cbor_is_bool | ( | const cbor_item_t * | item | ) |
bool cbor_is_float | ( | const cbor_item_t * | item | ) |
bool cbor_is_int | ( | const cbor_item_t * | item | ) |
bool cbor_is_null | ( | const cbor_item_t * | item | ) |
bool cbor_is_undef | ( | const cbor_item_t * | item | ) |
bool cbor_isa_array | ( | const cbor_item_t * | item | ) |
Does the item have the appropriate major type?
item | the item |
bool cbor_isa_bytestring | ( | const cbor_item_t * | item | ) |
Does the item have the appropriate major type?
item | the item |
bool cbor_isa_float_ctrl | ( | const cbor_item_t * | item | ) |
Does the item have the appropriate major type?
item | the item |
bool cbor_isa_map | ( | const cbor_item_t * | item | ) |
Does the item have the appropriate major type?
item | the item |
bool cbor_isa_negint | ( | const cbor_item_t * | item | ) |
Does the item have the appropriate major type?
item | the item |
bool cbor_isa_string | ( | const cbor_item_t * | item | ) |
Does the item have the appropriate major type?
item | the item |
bool cbor_isa_tag | ( | const cbor_item_t * | item | ) |
Does the item have the appropriate major type?
item | the item |
bool cbor_isa_uint | ( | const cbor_item_t * | item | ) |
Does the item have the appropriate major type?
item | the item |
cbor_item_t * cbor_move | ( | cbor_item_t * | item | ) |
Provides CPP-like move construct.
Decreases the reference count by one, but does not deallocate the item even if its refcount reaches zero. This is useful for passing intermediate values to functions that increase reference count. Should only be used with functions that incref
their arguments.
embed:rst:leading-asterisk * .. warning:: If the item is moved without correctly increasing the reference * count afterwards, the memory will be leaked. *
item | Reference to an item |
size_t cbor_refcount | ( | const cbor_item_t * | item | ) |
cbor_type cbor_typeof | ( | const cbor_item_t * | item | ) |