libcbor
Documentation for version 0.11.0, updated on May 14, 2024.
Overview
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
- Main features
Complete IETF RFC 8949 (STD 94) conformance [1]
Robust C99 implementation
Layered architecture offers both control and convenience
Flexible memory management
No shared global state - threading friendly [2]
Proper handling of UTF-8
Full support for streams & incremental processing
Extensive documentation and test suite
No runtime dependencies, small footprint
Contents
- Getting started
- Usage & preliminaries
- API
- Types of items
- Memory management and reference counting
- Decoding
- Encoding
- Streaming Decoding
cbor_stream_decode()cbor_callbacksuint8uint16uint32uint64negint64negint32negint16negint8byte_string_startbyte_stringstringstring_startindef_array_startarray_startindef_map_startmap_starttagfloat2float4float8undefinednullbooleanindef_breakcbor_empty_callbacks- Callback types definition
- Streaming Encoding
cbor_encode_uint8()cbor_encode_uint16()cbor_encode_uint32()cbor_encode_uint64()cbor_encode_uint()cbor_encode_negint8()cbor_encode_negint16()cbor_encode_negint32()cbor_encode_negint64()cbor_encode_negint()cbor_encode_bytestring_start()cbor_encode_indef_bytestring_start()cbor_encode_string_start()cbor_encode_indef_string_start()cbor_encode_array_start()cbor_encode_indef_array_start()cbor_encode_map_start()cbor_encode_indef_map_start()cbor_encode_tag()cbor_encode_bool()cbor_encode_null()cbor_encode_undef()cbor_encode_half()cbor_encode_single()cbor_encode_double()cbor_encode_break()cbor_encode_ctrl()
- Types 0 & 1 – Positive and negative integers
- Type 2 – Byte strings
- Type 3 – UTF-8 strings
- Type 4 – Arrays
- Type 5 – Maps
- Type 6 – Semantic tags
- Type 7 – Floats & control tokens
- Tests
- IETF standard conformance
- Internal mechanics
- Changelog
- Next
- 0.11.0 (2024-02-04)
- 0.10.2 (2023-01-31)
- 0.10.1 (2022-12-30)
- 0.10.0 (2022-12-29)
- 0.9.0 (2021-11-14)
- 0.8.0 (2020-09-20)
- 0.7.0 (2020-04-25)
- 0.6.1 (2020-03-26)
- 0.6.0 (2020-03-15)
- 0.5.0 (2017-02-06)
- 0.4.0 (2015-12-25)
- 0.3.1 (2015-05-21)
- 0.3.0 (2015-05-21)
- 0.2.1 (2015-05-17)
- 0.2.0 (2015-05-17)
- 0.1.0 (2015-05-06)
- Development