libcbor
0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
|
#include "cbor/common.h"
Go to the source code of this file.
Functions | |
size_t | cbor_encode_uint8 (uint8_t, unsigned char *, size_t) |
size_t | cbor_encode_uint16 (uint16_t, unsigned char *, size_t) |
size_t | cbor_encode_uint32 (uint32_t, unsigned char *, size_t) |
size_t | cbor_encode_uint64 (uint64_t, unsigned char *, size_t) |
size_t | cbor_encode_uint (uint64_t, unsigned char *, size_t) |
size_t | cbor_encode_negint8 (uint8_t, unsigned char *, size_t) |
size_t | cbor_encode_negint16 (uint16_t, unsigned char *, size_t) |
size_t | cbor_encode_negint32 (uint32_t, unsigned char *, size_t) |
size_t | cbor_encode_negint64 (uint64_t, unsigned char *, size_t) |
size_t | cbor_encode_negint (uint64_t, unsigned char *, size_t) |
size_t | cbor_encode_bytestring_start (size_t, unsigned char *, size_t) |
size_t | cbor_encode_indef_bytestring_start (unsigned char *, size_t) |
size_t | cbor_encode_string_start (size_t, unsigned char *, size_t) |
size_t | cbor_encode_indef_string_start (unsigned char *, size_t) |
size_t | cbor_encode_array_start (size_t, unsigned char *, size_t) |
size_t | cbor_encode_indef_array_start (unsigned char *, size_t) |
size_t | cbor_encode_map_start (size_t, unsigned char *, size_t) |
size_t | cbor_encode_indef_map_start (unsigned char *, size_t) |
size_t | cbor_encode_tag (uint64_t, unsigned char *, size_t) |
size_t | cbor_encode_bool (bool, unsigned char *, size_t) |
size_t | cbor_encode_null (unsigned char *, size_t) |
size_t | cbor_encode_undef (unsigned char *, size_t) |
size_t | cbor_encode_half (float, unsigned char *, size_t) |
Encodes a half-precision float. More... | |
size_t | cbor_encode_single (float, unsigned char *, size_t) |
size_t | cbor_encode_double (double, unsigned char *, size_t) |
size_t | cbor_encode_break (unsigned char *, size_t) |
size_t | cbor_encode_ctrl (uint8_t, unsigned char *, size_t) |
size_t cbor_encode_array_start | ( | size_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 91 of file encoding.c.
size_t cbor_encode_bool | ( | bool | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 116 of file encoding.c.
size_t cbor_encode_break | ( | unsigned char * | , |
size_t | |||
) |
Definition at line 178 of file encoding.c.
size_t cbor_encode_bytestring_start | ( | size_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 62 of file encoding.c.
size_t cbor_encode_ctrl | ( | uint8_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 183 of file encoding.c.
size_t cbor_encode_double | ( | double | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 173 of file encoding.c.
size_t cbor_encode_half | ( | float | , |
unsigned char * | , | ||
size_t | |||
) |
Encodes a half-precision float.
Since there is no native representation or semantics for half floats in the language, we use single-precision floats, as every value that can be expressed as a half-float can also be expressed as a float.
This however means that not all floats passed to this function can be unambiguously encoded. The behavior is as follows:
value | |
buffer | Target buffer |
buffer_size | Available space in the buffer |
Definition at line 131 of file encoding.c.
size_t cbor_encode_indef_array_start | ( | unsigned char * | , |
size_t | |||
) |
Definition at line 96 of file encoding.c.
size_t cbor_encode_indef_bytestring_start | ( | unsigned char * | , |
size_t | |||
) |
Definition at line 76 of file encoding.c.
size_t cbor_encode_indef_map_start | ( | unsigned char * | , |
size_t | |||
) |
Definition at line 106 of file encoding.c.
size_t cbor_encode_indef_string_start | ( | unsigned char * | , |
size_t | |||
) |
Definition at line 86 of file encoding.c.
size_t cbor_encode_map_start | ( | size_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 101 of file encoding.c.
size_t cbor_encode_negint | ( | uint64_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 57 of file encoding.c.
size_t cbor_encode_negint16 | ( | uint16_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 42 of file encoding.c.
size_t cbor_encode_negint32 | ( | uint32_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 47 of file encoding.c.
size_t cbor_encode_negint64 | ( | uint64_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 52 of file encoding.c.
size_t cbor_encode_negint8 | ( | uint8_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 37 of file encoding.c.
size_t cbor_encode_null | ( | unsigned char * | , |
size_t | |||
) |
Definition at line 121 of file encoding.c.
size_t cbor_encode_single | ( | float | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 167 of file encoding.c.
size_t cbor_encode_string_start | ( | size_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 81 of file encoding.c.
size_t cbor_encode_tag | ( | uint64_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 111 of file encoding.c.
size_t cbor_encode_uint | ( | uint64_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 31 of file encoding.c.
size_t cbor_encode_uint16 | ( | uint16_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 16 of file encoding.c.
size_t cbor_encode_uint32 | ( | uint32_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 21 of file encoding.c.
size_t cbor_encode_uint64 | ( | uint64_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 26 of file encoding.c.
size_t cbor_encode_uint8 | ( | uint8_t | , |
unsigned char * | , | ||
size_t | |||
) |
Definition at line 11 of file encoding.c.
size_t cbor_encode_undef | ( | unsigned char * | , |
size_t | |||
) |
Definition at line 126 of file encoding.c.