libcbor  0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
callbacks.c
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 #include "callbacks.h"
9 
10 #define CBOR_DUMMY_CALLBACK { }
11 
12 void cbor_null_uint8_callback(void *_ctx, uint8_t _val) CBOR_DUMMY_CALLBACK
13 
14 void cbor_null_uint16_callback(void *_ctx, uint16_t _val) CBOR_DUMMY_CALLBACK
15 
16 void cbor_null_uint32_callback(void *_ctx, uint32_t _val) CBOR_DUMMY_CALLBACK
17 
18 void cbor_null_uint64_callback(void *_ctx, uint64_t _val) CBOR_DUMMY_CALLBACK
19 
20 void cbor_null_negint8_callback(void *_ctx, uint8_t _val) CBOR_DUMMY_CALLBACK
21 
22 void cbor_null_negint16_callback(void *_ctx, uint16_t _val) CBOR_DUMMY_CALLBACK
23 
24 void cbor_null_negint32_callback(void *_ctx, uint32_t _val) CBOR_DUMMY_CALLBACK
25 
26 void cbor_null_negint64_callback(void *_ctx, uint64_t _val) CBOR_DUMMY_CALLBACK
27 
28 void cbor_null_string_callback(void *_ctx, cbor_data _val, size_t _val2) CBOR_DUMMY_CALLBACK
29 
31 
33 
35 
37 
39 
41 
43 
44 void cbor_null_tag_callback(void *_ctx, uint64_t _val) CBOR_DUMMY_CALLBACK
45 
47 
49 
50 void cbor_null_float8_callback(void *_ctx, double _val) CBOR_DUMMY_CALLBACK
51 
53 
55 
57 
59 
60 const struct cbor_callbacks cbor_empty_callbacks = {
61  /* Type 0 - Unsigned integers */
63  .uint16 = cbor_null_uint16_callback,
64  .uint32 = cbor_null_uint32_callback,
65  .uint64 = cbor_null_uint64_callback,
66 
67  /* Type 1 - Negative integers */
68  .negint8 = cbor_null_negint8_callback,
69  .negint16 = cbor_null_negint16_callback,
70  .negint32 = cbor_null_negint32_callback,
71  .negint64 = cbor_null_negint64_callback,
72 
73  /* Type 2 - Byte strings */
74  .byte_string_start = cbor_null_byte_string_start_callback,
75  .byte_string = cbor_null_byte_string_callback,
76 
77  /* Type 3 - Strings */
78  .string_start = cbor_null_string_start_callback,
79  .string = cbor_null_string_callback,
80 
81  /* Type 4 - Arrays */
82  .indef_array_start = cbor_null_indef_array_start_callback,
83  .array_start = cbor_null_array_start_callback,
84 
85  /* Type 5 - Maps */
86  .indef_map_start = cbor_null_indef_map_start_callback,
87  .map_start = cbor_null_map_start_callback,
88 
89  /* Type 6 - Tags */
91 
92  /* Type 7 - Floats & misc */
93  /* Type names cannot be member names */
94  .float2 = cbor_null_float2_callback,
95  /* 2B float is not supported in standard C */
96  .float4 = cbor_null_float4_callback,
97  .float8 = cbor_null_float8_callback,
98  .undefined = cbor_null_undefined_callback,
100  .boolean = cbor_null_boolean_callback,
101 
102  /* Shared indefinites */
103  .indef_break = cbor_null_indef_break_callback,
104 };
void cbor_null_tag_callback(void *, uint64_t)
Dummy callback implementation - does nothing.
void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_null_negint8_callback(void *_ctx, uint8_t _val) CBOR_DUMMY_CALLBACK void cbor_null_negint16_callback(void *_ctx
Dummy callback implementation - does nothing.
void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_data _val
Definition: callbacks.c:32
void cbor_null_null_callback(void *)
Dummy callback implementation - does nothing.
cbor_int8_callback uint8
Unsigned int.
Definition: callbacks.h:50
void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_data size_t _val2 CBOR_DUMMY_CALLBACK void size_t _val CBOR_DUMMY_CALLBACK void cbor_null_indef_array_start_callback(void *_ctx) CBOR_DUMMY_CALLBACK void cbor_null_map_start_callback(void *_ctx
Dummy callback implementation - does nothing.
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_null_uint8_callback(void *_ctx, uint8_t _val) CBOR_DUMMY_CALLBACK void cbor_null_uint16_callback(void *_ctx
Dummy callback implementation - does nothing.
void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_data size_t _val2 CBOR_DUMMY_CALLBACK void size_t _val CBOR_DUMMY_CALLBACK void size_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_null_float2_callback(void *_ctx, float _val) CBOR_DUMMY_CALLBACK void cbor_null_float4_callback(void *_ctx
Dummy callback implementation - does nothing.
void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_data size_t _val2 CBOR_DUMMY_CALLBACK void size_t _val CBOR_DUMMY_CALLBACK void size_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void float _val CBOR_DUMMY_CALLBACK void cbor_null_float8_callback(void *_ctx, double _val) CBOR_DUMMY_CALLBACK void cbor_null_null_callback(void *_ctx) CBOR_DUMMY_CALLBACK void cbor_null_undefined_callback(void *_ctx) CBOR_DUMMY_CALLBACK void cbor_null_boolean_callback(void *_ctx
Dummy callback implementation - does nothing.
void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_data size_t _val2 CBOR_DUMMY_CALLBACK void size_t _val CBOR_DUMMY_CALLBACK void size_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void float _val CBOR_DUMMY_CALLBACK void bool _val CBOR_DUMMY_CALLBACK void cbor_null_indef_break_callback(void *_ctx) CBOR_DUMMY_CALLBACK const struct cbor_callbacks cbor_empty_callbacks
void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_data size_t _val2 CBOR_DUMMY_CALLBACK void cbor_null_byte_string_start_callback(void *_ctx) CBOR_DUMMY_CALLBACK void cbor_null_array_start_callback(void *_ctx
Dummy callback implementation - does nothing.
void cbor_null_map_start_callback(void *, size_t)
Dummy callback implementation - does nothing.
void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_null_string_callback(void *_ctx, cbor_data _val, size_t _val2) CBOR_DUMMY_CALLBACK void cbor_null_string_start_callback(void *_ctx) CBOR_DUMMY_CALLBACK void cbor_null_byte_string_callback(void *_ctx
Dummy callback implementation - does nothing.
void cbor_null_undefined_callback(void *)
Dummy callback implementation - does nothing.
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.
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 uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void uint16_t _val CBOR_DUMMY_CALLBACK void cbor_null_negint32_callback(void *_ctx, uint32_t _val) CBOR_DUMMY_CALLBACK void cbor_null_negint64_callback(void *_ctx
Dummy callback implementation - does nothing.
void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void uint16_t _val CBOR_DUMMY_CALLBACK void uint64_t _val CBOR_DUMMY_CALLBACK void cbor_data size_t _val2 CBOR_DUMMY_CALLBACK void size_t _val CBOR_DUMMY_CALLBACK void size_t _val CBOR_DUMMY_CALLBACK void cbor_null_indef_map_start_callback(void *_ctx) CBOR_DUMMY_CALLBACK void cbor_null_tag_callback(void *_ctx
Dummy callback implementation - does nothing.
void cbor_null_uint16_callback(void *, uint16_t)
Dummy callback implementation - does nothing.
void uint16_t _val CBOR_DUMMY_CALLBACK void cbor_null_uint32_callback(void *_ctx, uint32_t _val) CBOR_DUMMY_CALLBACK void cbor_null_uint64_callback(void *_ctx
Dummy callback implementation - does nothing.
void cbor_null_byte_string_callback(void *, cbor_data, size_t)
Dummy callback implementation - does nothing.
void cbor_null_string_start_callback(void *)
Dummy callback implementation - does nothing.
#define CBOR_DUMMY_CALLBACK
Definition: callbacks.c:10