Registry / serialization / libcbor

libcbor

JSON →
library0.13.0vcpkgunverified

A C library for parsing and generating CBOR, the general-purpose schema-less binary data format.

vcpkg install libcbor
INSTALL
IMPORT
SIG · LIBCBOR
L
libcbor
serializationcppv0.13.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cbor.h
#include <cbor.h>

Create a CBOR integer and serialize it to a buffer

#include "cbor.h" #include <stdio.h> int main() { // Create a CBOR integer cbor_item_t* item = cbor_build_uint8(42); if (!item) { fprintf(stderr, "Failed to create CBOR item\n"); return 1; } // Serialize to buffer unsigned char* buffer; size_t size; cbor_serialize_alloc(item, &buffer, &size); printf("Serialized %zu bytes\n", size); free(buffer); cbor_decref(&item); return 0; }
Debug
Known issues
gotchalibcbor uses reference counting; forgetting to decrement references can cause memory leaks.
fix
Always call cbor_decref() on items when done, or use cbor_move() for ownership transfer.
affects: *
Upgrade
Version history
0.13.0latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources

No resource links recorded.

libcbor — pip install libcbor · libregistry