libcbor  0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
Functions
cbor.c File Reference
#include "cbor.h"
#include "cbor/internal/builder_callbacks.h"
#include "cbor/internal/loaders.h"

Go to the source code of this file.

Functions

cbor_item_tcbor_load (cbor_data source, size_t source_size, struct cbor_load_result *result)
 Loads data item from a buffer. More...
 
cbor_item_tcbor_copy (cbor_item_t *item)
 Deep copy of an item. More...
 

Function Documentation

§ cbor_copy()

cbor_item_t* cbor_copy ( cbor_item_t item)

Deep copy of an item.

All the reference counts in the new structure are set to one.

Parameters
item[borrow]item to copy
Returns
new CBOR deep copy

Definition at line 164 of file cbor.c.

§ cbor_load()

cbor_item_t* cbor_load ( cbor_data  source,
size_t  source_size,
struct cbor_load_result result 
)

Loads data item from a buffer.

Parameters
sourceThe buffer
source_size
result[out]Result indicator. CBOR_ERR_NONE on success
Returns
new CBOR item or NULL on failure. In that case, result contains location and description of the error.

Definition at line 12 of file cbor.c.