libcbor  0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
serialization.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_SERIALIZATION_H
9 #define LIBCBOR_SERIALIZATION_H
10 
11 #include "cbor/common.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 
18 /*
19 * ============================================================================
20 * High level encoding
21 * ============================================================================
22 */
23 
31 size_t cbor_serialize(const cbor_item_t * item, cbor_mutable_data buffer, size_t buffer_size);
32 
44 size_t cbor_serialize_alloc(const cbor_item_t * item, cbor_mutable_data * buffer, size_t * buffer_size);
45 
53 size_t cbor_serialize_uint(const cbor_item_t *, cbor_mutable_data, size_t);
54 
62 size_t cbor_serialize_negint(const cbor_item_t *, cbor_mutable_data, size_t);
63 
72 
80 size_t cbor_serialize_string(const cbor_item_t *, cbor_mutable_data, size_t);
81 
89 size_t cbor_serialize_array(const cbor_item_t *, cbor_mutable_data, size_t);
90 
98 size_t cbor_serialize_map(const cbor_item_t *, cbor_mutable_data, size_t);
99 
107 size_t cbor_serialize_tag(const cbor_item_t *, cbor_mutable_data, size_t);
108 
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 
123 #endif //LIBCBOR_SERIALIZATION_H
size_t cbor_serialize_map(const cbor_item_t *, cbor_mutable_data, size_t)
Serialize a map.
size_t cbor_serialize_array(const cbor_item_t *, cbor_mutable_data, size_t)
Serialize an array.
size_t cbor_serialize_negint(const cbor_item_t *, cbor_mutable_data, size_t)
Serialize a negint.
Definition: serialization.c:93
size_t cbor_serialize_uint(const cbor_item_t *, cbor_mutable_data, size_t)
Serialize an uint.
Definition: serialization.c:76
unsigned char * cbor_mutable_data
Definition: data.h:21
size_t cbor_serialize_bytestring(const cbor_item_t *, cbor_mutable_data, size_t)
Serialize a bytestring.
size_t cbor_serialize_alloc(const cbor_item_t *item, cbor_mutable_data *buffer, size_t *buffer_size)
Serialize the given item, allocating buffers as needed.
Definition: serialization.c:44
size_t cbor_serialize_float_ctrl(const cbor_item_t *, cbor_mutable_data, size_t)
Serialize a.
size_t cbor_serialize_string(const cbor_item_t *, cbor_mutable_data, size_t)
Serialize a string.
The item handle.
Definition: data.h:149
size_t cbor_serialize(const cbor_item_t *item, cbor_mutable_data buffer, size_t buffer_size)
Serialize the given item.
Definition: serialization.c:20
size_t cbor_serialize_tag(const cbor_item_t *, cbor_mutable_data, size_t)
Serialize a tag.