libcbor  0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
callbacks.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_CALLBACKS_H
9 #define LIBCBOR_CALLBACKS_H
10 
11 #include "cbor/common.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
18 typedef void(*cbor_int8_callback)(void *, uint8_t);
19 
21 typedef void(*cbor_int16_callback)(void *, uint16_t);
22 
24 typedef void(*cbor_int32_callback)(void *, uint32_t);
25 
27 typedef void(*cbor_int64_callback)(void *, uint64_t);
28 
30 typedef void(*cbor_simple_callback)(void *);
31 
33 typedef void(*cbor_string_callback)(void *, cbor_data, size_t);
34 
36 typedef void(*cbor_collection_callback)(void *, size_t);
37 
39 typedef void(*cbor_float_callback)(void *, float);
40 
42 typedef void(*cbor_double_callback)(void *, double);
43 
45 typedef void(*cbor_bool_callback)(void *, bool);
46 
57 
66 
71 
76 
81 
86 
89 
102 
105 };
106 
108 void cbor_null_uint8_callback(void *, uint8_t);
109 
111 void cbor_null_uint16_callback(void *, uint16_t);
112 
114 void cbor_null_uint32_callback(void *, uint32_t);
115 
117 void cbor_null_uint64_callback(void *, uint64_t);
118 
120 void cbor_null_negint8_callback(void *, uint8_t);
121 
123 void cbor_null_negint16_callback(void *, uint16_t);
124 
126 void cbor_null_negint32_callback(void *, uint32_t);
127 
129 void cbor_null_negint64_callback(void *, uint64_t);
130 
132 void cbor_null_string_callback(void *, cbor_data, size_t);
133 
136 
138 void cbor_null_byte_string_callback(void *, cbor_data, size_t);
139 
142 
144 void cbor_null_array_start_callback(void *, size_t);
145 
148 
150 void cbor_null_map_start_callback(void *, size_t);
151 
154 
156 void cbor_null_tag_callback(void *, uint64_t);
157 
159 void cbor_null_float2_callback(void *, float);
160 
162 void cbor_null_float4_callback(void *, float);
163 
165 void cbor_null_float8_callback(void *, double);
166 
168 void cbor_null_null_callback(void *);
169 
171 void cbor_null_undefined_callback(void *);
172 
174 void cbor_null_boolean_callback(void *, bool);
175 
177 void cbor_null_indef_break_callback(void *);
178 
180 extern const struct cbor_callbacks cbor_empty_callbacks;
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 
187 #endif //LIBCBOR_CALLBACKS_H
void cbor_null_tag_callback(void *, uint64_t)
Dummy callback implementation - does nothing.
cbor_simple_callback indef_array_start
Definite array.
Definition: callbacks.h:78
void cbor_null_byte_string_start_callback(void *)
Dummy callback implementation - does nothing.
void(* cbor_simple_callback)(void *)
Callback prototype.
Definition: callbacks.h:30
void cbor_null_indef_map_start_callback(void *)
Dummy callback implementation - does nothing.
void(* cbor_int64_callback)(void *, uint64_t)
Callback prototype.
Definition: callbacks.h:27
cbor_string_callback string
Definite string.
Definition: callbacks.h:73
void(* cbor_int8_callback)(void *, uint8_t)
Callback prototype.
Definition: callbacks.h:18
void cbor_null_negint8_callback(void *, uint8_t)
Dummy callback implementation - does nothing.
void cbor_null_null_callback(void *)
Dummy callback implementation - does nothing.
cbor_int8_callback uint8
Unsigned int.
Definition: callbacks.h:50
void cbor_null_string_callback(void *, cbor_data, size_t)
Dummy callback implementation - does nothing.
cbor_int16_callback negint16
Negative int.
Definition: callbacks.h:63
cbor_double_callback float8
Double float.
Definition: callbacks.h:95
void cbor_null_float4_callback(void *, float)
Dummy callback implementation - does nothing.
void cbor_null_negint64_callback(void *, uint64_t)
Dummy callback implementation - does nothing.
void(* cbor_double_callback)(void *, double)
Callback prototype.
Definition: callbacks.h:42
void(* cbor_float_callback)(void *, float)
Callback prototype.
Definition: callbacks.h:39
cbor_collection_callback map_start
Indefinite map.
Definition: callbacks.h:85
cbor_simple_callback indef_map_start
Definite map.
Definition: callbacks.h:83
cbor_bool_callback boolean
Bool.
Definition: callbacks.h:101
void(* cbor_string_callback)(void *, cbor_data, size_t)
Callback prototype.
Definition: callbacks.h:33
void cbor_null_float2_callback(void *, float)
Dummy callback implementation - does nothing.
cbor_simple_callback byte_string_start
Definite byte string.
Definition: callbacks.h:68
void cbor_null_map_start_callback(void *, size_t)
Dummy callback implementation - does nothing.
cbor_float_callback float2
Half float.
Definition: callbacks.h:91
cbor_int32_callback uint32
Unsigned int.
Definition: callbacks.h:54
void(* cbor_bool_callback)(void *, bool)
Callback prototype.
Definition: callbacks.h:45
cbor_int64_callback uint64
Unsigned int.
Definition: callbacks.h:56
cbor_simple_callback string_start
Indefinite string start.
Definition: callbacks.h:75
cbor_simple_callback undefined
Undef.
Definition: callbacks.h:97
cbor_int64_callback negint64
Negative int.
Definition: callbacks.h:59
cbor_int8_callback negint8
Negative int.
Definition: callbacks.h:65
cbor_simple_callback null
Null.
Definition: callbacks.h:99
void cbor_null_negint32_callback(void *, uint32_t)
Dummy callback implementation - does nothing.
void cbor_null_indef_break_callback(void *)
Dummy callback implementation - does nothing.
cbor_float_callback float4
Single float.
Definition: callbacks.h:93
void(* cbor_collection_callback)(void *, size_t)
Callback prototype.
Definition: callbacks.h:36
void cbor_null_undefined_callback(void *)
Dummy callback implementation - does nothing.
cbor_string_callback byte_string
Indefinite byte string start.
Definition: callbacks.h:70
void(* cbor_int16_callback)(void *, uint16_t)
Callback prototype.
Definition: callbacks.h:21
const unsigned char * cbor_data
Definition: data.h:20
void cbor_null_array_start_callback(void *, size_t)
Dummy callback implementation - does nothing.
void cbor_null_uint64_callback(void *, uint64_t)
Dummy callback implementation - does nothing.
const struct cbor_callbacks cbor_empty_callbacks
Dummy callback bundle - does nothing.
cbor_int64_callback tag
Tags.
Definition: callbacks.h:88
void cbor_null_boolean_callback(void *, bool)
Dummy callback implementation - does nothing.
void cbor_null_negint16_callback(void *, uint16_t)
Dummy callback implementation - does nothing.
Callback bundle – passed to the decoder.
Definition: callbacks.h:48
void cbor_null_float8_callback(void *, double)
Dummy callback implementation - does nothing.
void cbor_null_uint8_callback(void *, uint8_t)
Dummy callback implementation - does nothing.
void cbor_null_uint16_callback(void *, uint16_t)
Dummy callback implementation - does nothing.
void cbor_null_indef_array_start_callback(void *)
Dummy callback implementation - does nothing.
void(* cbor_int32_callback)(void *, uint32_t)
Callback prototype.
Definition: callbacks.h:24
cbor_simple_callback indef_break
Indefinite item break.
Definition: callbacks.h:104
cbor_collection_callback array_start
Indefinite array.
Definition: callbacks.h:80
cbor_int16_callback uint16
Unsigned int.
Definition: callbacks.h:52
void cbor_null_uint32_callback(void *, uint32_t)
Dummy callback implementation - does nothing.
void cbor_null_byte_string_callback(void *, cbor_data, size_t)
Dummy callback implementation - does nothing.
cbor_int32_callback negint32
Negative int.
Definition: callbacks.h:61
void cbor_null_string_start_callback(void *)
Dummy callback implementation - does nothing.