libcbor  0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
encoding.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2017 Pavel Kalvoda <me@pavelkalvoda.com>
3  *
4  * libcbor is free software; you can redistribute it and/or modify
5  * it under the terms of the MIT license. See LICENSE for details.
6  */
7 
8 #ifndef LIBCBOR_ENCODING_H
9 #define LIBCBOR_ENCODING_H
10 
11 #include "cbor/common.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 
18 /*
19 * ============================================================================
20 * Primitives encoding
21 * ============================================================================
22 */
23 
24 size_t cbor_encode_uint8(uint8_t, unsigned char *, size_t);
25 
26 size_t cbor_encode_uint16(uint16_t, unsigned char *, size_t);
27 
28 size_t cbor_encode_uint32(uint32_t, unsigned char *, size_t);
29 
30 size_t cbor_encode_uint64(uint64_t, unsigned char *, size_t);
31 
32 size_t cbor_encode_uint(uint64_t, unsigned char *, size_t);
33 
34 size_t cbor_encode_negint8(uint8_t, unsigned char *, size_t);
35 
36 size_t cbor_encode_negint16(uint16_t, unsigned char *, size_t);
37 
38 size_t cbor_encode_negint32(uint32_t, unsigned char *, size_t);
39 
40 size_t cbor_encode_negint64(uint64_t, unsigned char *, size_t);
41 
42 size_t cbor_encode_negint(uint64_t, unsigned char *, size_t);
43 
44 size_t cbor_encode_bytestring_start(size_t, unsigned char *, size_t);
45 
46 size_t cbor_encode_indef_bytestring_start(unsigned char *, size_t);
47 
48 size_t cbor_encode_string_start(size_t, unsigned char *, size_t);
49 
50 size_t cbor_encode_indef_string_start(unsigned char *, size_t);
51 
52 size_t cbor_encode_array_start(size_t, unsigned char *, size_t);
53 
54 size_t cbor_encode_indef_array_start(unsigned char *, size_t);
55 
56 size_t cbor_encode_map_start(size_t, unsigned char *, size_t);
57 
58 size_t cbor_encode_indef_map_start(unsigned char *, size_t);
59 
60 size_t cbor_encode_tag(uint64_t, unsigned char *, size_t);
61 
62 size_t cbor_encode_bool(bool, unsigned char *, size_t);
63 
64 size_t cbor_encode_null(unsigned char *, size_t);
65 
66 size_t cbor_encode_undef(unsigned char *, size_t);
67 
92 size_t cbor_encode_half(float, unsigned char *, size_t);
93 
94 size_t cbor_encode_single(float, unsigned char *, size_t);
95 
96 size_t cbor_encode_double(double, unsigned char *, size_t);
97 
98 size_t cbor_encode_break(unsigned char *, size_t);
99 
100 size_t cbor_encode_ctrl(uint8_t, unsigned char *, size_t);
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 
107 #endif //LIBCBOR_ENCODING_H
size_t cbor_encode_indef_map_start(unsigned char *, size_t)
Definition: encoding.c:106
size_t cbor_encode_uint(uint64_t, unsigned char *, size_t)
Definition: encoding.c:31
size_t cbor_encode_negint(uint64_t, unsigned char *, size_t)
Definition: encoding.c:57
size_t cbor_encode_negint8(uint8_t, unsigned char *, size_t)
Definition: encoding.c:37
size_t cbor_encode_uint16(uint16_t, unsigned char *, size_t)
Definition: encoding.c:16
size_t cbor_encode_null(unsigned char *, size_t)
Definition: encoding.c:121
size_t cbor_encode_uint32(uint32_t, unsigned char *, size_t)
Definition: encoding.c:21
size_t cbor_encode_half(float, unsigned char *, size_t)
Encodes a half-precision float.
Definition: encoding.c:131
size_t cbor_encode_undef(unsigned char *, size_t)
Definition: encoding.c:126
size_t cbor_encode_bytestring_start(size_t, unsigned char *, size_t)
Definition: encoding.c:62
size_t cbor_encode_indef_string_start(unsigned char *, size_t)
Definition: encoding.c:86
size_t cbor_encode_map_start(size_t, unsigned char *, size_t)
Definition: encoding.c:101
size_t cbor_encode_uint8(uint8_t, unsigned char *, size_t)
Definition: encoding.c:11
size_t cbor_encode_break(unsigned char *, size_t)
Definition: encoding.c:178
size_t cbor_encode_bool(bool, unsigned char *, size_t)
Definition: encoding.c:116
size_t cbor_encode_negint16(uint16_t, unsigned char *, size_t)
Definition: encoding.c:42
size_t cbor_encode_uint64(uint64_t, unsigned char *, size_t)
Definition: encoding.c:26
size_t cbor_encode_array_start(size_t, unsigned char *, size_t)
Definition: encoding.c:91
size_t cbor_encode_ctrl(uint8_t, unsigned char *, size_t)
Definition: encoding.c:183
size_t cbor_encode_indef_bytestring_start(unsigned char *, size_t)
Definition: encoding.c:76
size_t cbor_encode_single(float, unsigned char *, size_t)
Definition: encoding.c:167
size_t cbor_encode_negint64(uint64_t, unsigned char *, size_t)
Definition: encoding.c:52
size_t cbor_encode_negint32(uint32_t, unsigned char *, size_t)
Definition: encoding.c:47
size_t cbor_encode_string_start(size_t, unsigned char *, size_t)
Definition: encoding.c:81
size_t cbor_encode_tag(uint64_t, unsigned char *, size_t)
Definition: encoding.c:111
size_t cbor_encode_indef_array_start(unsigned char *, size_t)
Definition: encoding.c:96
size_t cbor_encode_double(double, unsigned char *, size_t)
Definition: encoding.c:173