110ff414cSEd Maste /*
210ff414cSEd Maste * Copyright (c) 2014-2020 Pavel Kalvoda <me@pavelkalvoda.com>
310ff414cSEd Maste *
410ff414cSEd Maste * libcbor is free software; you can redistribute it and/or modify
510ff414cSEd Maste * it under the terms of the MIT license. See LICENSE for details.
610ff414cSEd Maste */
710ff414cSEd Maste
810ff414cSEd Maste #include "callbacks.h"
910ff414cSEd Maste
cbor_null_uint8_callback(void * _CBOR_UNUSED (_ctx),uint8_t _CBOR_UNUSED (_val))10*5d3e7166SEd Maste void cbor_null_uint8_callback(void *_CBOR_UNUSED(_ctx),
11*5d3e7166SEd Maste uint8_t _CBOR_UNUSED(_val)) {}
1210ff414cSEd Maste
cbor_null_uint16_callback(void * _CBOR_UNUSED (_ctx),uint16_t _CBOR_UNUSED (_val))13*5d3e7166SEd Maste void cbor_null_uint16_callback(void *_CBOR_UNUSED(_ctx),
14*5d3e7166SEd Maste uint16_t _CBOR_UNUSED(_val)) {}
1510ff414cSEd Maste
cbor_null_uint32_callback(void * _CBOR_UNUSED (_ctx),uint32_t _CBOR_UNUSED (_val))16*5d3e7166SEd Maste void cbor_null_uint32_callback(void *_CBOR_UNUSED(_ctx),
17*5d3e7166SEd Maste uint32_t _CBOR_UNUSED(_val)) {}
1810ff414cSEd Maste
cbor_null_uint64_callback(void * _CBOR_UNUSED (_ctx),uint64_t _CBOR_UNUSED (_val))19*5d3e7166SEd Maste void cbor_null_uint64_callback(void *_CBOR_UNUSED(_ctx),
20*5d3e7166SEd Maste uint64_t _CBOR_UNUSED(_val)) {}
2110ff414cSEd Maste
cbor_null_negint8_callback(void * _CBOR_UNUSED (_ctx),uint8_t _CBOR_UNUSED (_val))22*5d3e7166SEd Maste void cbor_null_negint8_callback(void *_CBOR_UNUSED(_ctx),
23*5d3e7166SEd Maste uint8_t _CBOR_UNUSED(_val)) {}
2410ff414cSEd Maste
cbor_null_negint16_callback(void * _CBOR_UNUSED (_ctx),uint16_t _CBOR_UNUSED (_val))25*5d3e7166SEd Maste void cbor_null_negint16_callback(void *_CBOR_UNUSED(_ctx),
26*5d3e7166SEd Maste uint16_t _CBOR_UNUSED(_val)) {}
2710ff414cSEd Maste
cbor_null_negint32_callback(void * _CBOR_UNUSED (_ctx),uint32_t _CBOR_UNUSED (_val))28*5d3e7166SEd Maste void cbor_null_negint32_callback(void *_CBOR_UNUSED(_ctx),
29*5d3e7166SEd Maste uint32_t _CBOR_UNUSED(_val)) {}
3010ff414cSEd Maste
cbor_null_negint64_callback(void * _CBOR_UNUSED (_ctx),uint64_t _CBOR_UNUSED (_val))31*5d3e7166SEd Maste void cbor_null_negint64_callback(void *_CBOR_UNUSED(_ctx),
32*5d3e7166SEd Maste uint64_t _CBOR_UNUSED(_val)) {}
3310ff414cSEd Maste
cbor_null_string_callback(void * _CBOR_UNUSED (_ctx),cbor_data _CBOR_UNUSED (_val),uint64_t _CBOR_UNUSED (_val2))34*5d3e7166SEd Maste void cbor_null_string_callback(void *_CBOR_UNUSED(_ctx),
35*5d3e7166SEd Maste cbor_data _CBOR_UNUSED(_val),
36*5d3e7166SEd Maste uint64_t _CBOR_UNUSED(_val2)) {}
3710ff414cSEd Maste
cbor_null_string_start_callback(void * _CBOR_UNUSED (_ctx))38*5d3e7166SEd Maste void cbor_null_string_start_callback(void *_CBOR_UNUSED(_ctx)) {}
3910ff414cSEd Maste
cbor_null_byte_string_callback(void * _CBOR_UNUSED (_ctx),cbor_data _CBOR_UNUSED (_val),uint64_t _CBOR_UNUSED (_val2))40*5d3e7166SEd Maste void cbor_null_byte_string_callback(void *_CBOR_UNUSED(_ctx),
41*5d3e7166SEd Maste cbor_data _CBOR_UNUSED(_val),
42*5d3e7166SEd Maste uint64_t _CBOR_UNUSED(_val2)) {}
4310ff414cSEd Maste
cbor_null_byte_string_start_callback(void * _CBOR_UNUSED (_ctx))44*5d3e7166SEd Maste void cbor_null_byte_string_start_callback(void *_CBOR_UNUSED(_ctx)) {}
4510ff414cSEd Maste
cbor_null_array_start_callback(void * _CBOR_UNUSED (_ctx),uint64_t _CBOR_UNUSED (_val))46*5d3e7166SEd Maste void cbor_null_array_start_callback(void *_CBOR_UNUSED(_ctx),
47*5d3e7166SEd Maste uint64_t _CBOR_UNUSED(_val)) {}
4810ff414cSEd Maste
cbor_null_indef_array_start_callback(void * _CBOR_UNUSED (_ctx))49*5d3e7166SEd Maste void cbor_null_indef_array_start_callback(void *_CBOR_UNUSED(_ctx)) {}
5010ff414cSEd Maste
cbor_null_map_start_callback(void * _CBOR_UNUSED (_ctx),uint64_t _CBOR_UNUSED (_val))51*5d3e7166SEd Maste void cbor_null_map_start_callback(void *_CBOR_UNUSED(_ctx),
52*5d3e7166SEd Maste uint64_t _CBOR_UNUSED(_val)) {}
5310ff414cSEd Maste
cbor_null_indef_map_start_callback(void * _CBOR_UNUSED (_ctx))54*5d3e7166SEd Maste void cbor_null_indef_map_start_callback(void *_CBOR_UNUSED(_ctx)) {}
5510ff414cSEd Maste
cbor_null_tag_callback(void * _CBOR_UNUSED (_ctx),uint64_t _CBOR_UNUSED (_val))56*5d3e7166SEd Maste void cbor_null_tag_callback(void *_CBOR_UNUSED(_ctx),
57*5d3e7166SEd Maste uint64_t _CBOR_UNUSED(_val)) {}
5810ff414cSEd Maste
cbor_null_float2_callback(void * _CBOR_UNUSED (_ctx),float _CBOR_UNUSED (_val))59*5d3e7166SEd Maste void cbor_null_float2_callback(void *_CBOR_UNUSED(_ctx),
60*5d3e7166SEd Maste float _CBOR_UNUSED(_val)) {}
6110ff414cSEd Maste
cbor_null_float4_callback(void * _CBOR_UNUSED (_ctx),float _CBOR_UNUSED (_val))62*5d3e7166SEd Maste void cbor_null_float4_callback(void *_CBOR_UNUSED(_ctx),
63*5d3e7166SEd Maste float _CBOR_UNUSED(_val)) {}
6410ff414cSEd Maste
cbor_null_float8_callback(void * _CBOR_UNUSED (_ctx),double _CBOR_UNUSED (_val))65*5d3e7166SEd Maste void cbor_null_float8_callback(void *_CBOR_UNUSED(_ctx),
66*5d3e7166SEd Maste double _CBOR_UNUSED(_val)) {}
6710ff414cSEd Maste
cbor_null_null_callback(void * _CBOR_UNUSED (_ctx))68*5d3e7166SEd Maste void cbor_null_null_callback(void *_CBOR_UNUSED(_ctx)) {}
6910ff414cSEd Maste
cbor_null_undefined_callback(void * _CBOR_UNUSED (_ctx))70*5d3e7166SEd Maste void cbor_null_undefined_callback(void *_CBOR_UNUSED(_ctx)) {}
7110ff414cSEd Maste
cbor_null_boolean_callback(void * _CBOR_UNUSED (_ctx),bool _CBOR_UNUSED (_val))72*5d3e7166SEd Maste void cbor_null_boolean_callback(void *_CBOR_UNUSED(_ctx),
73*5d3e7166SEd Maste bool _CBOR_UNUSED(_val)) {}
7410ff414cSEd Maste
cbor_null_indef_break_callback(void * _CBOR_UNUSED (_ctx))75*5d3e7166SEd Maste void cbor_null_indef_break_callback(void *_CBOR_UNUSED(_ctx)) {}
7610ff414cSEd Maste
7710ff414cSEd Maste CBOR_EXPORT const struct cbor_callbacks cbor_empty_callbacks = {
7810ff414cSEd Maste /* Type 0 - Unsigned integers */
7910ff414cSEd Maste .uint8 = cbor_null_uint8_callback,
8010ff414cSEd Maste .uint16 = cbor_null_uint16_callback,
8110ff414cSEd Maste .uint32 = cbor_null_uint32_callback,
8210ff414cSEd Maste .uint64 = cbor_null_uint64_callback,
8310ff414cSEd Maste
8410ff414cSEd Maste /* Type 1 - Negative integers */
8510ff414cSEd Maste .negint8 = cbor_null_negint8_callback,
8610ff414cSEd Maste .negint16 = cbor_null_negint16_callback,
8710ff414cSEd Maste .negint32 = cbor_null_negint32_callback,
8810ff414cSEd Maste .negint64 = cbor_null_negint64_callback,
8910ff414cSEd Maste
9010ff414cSEd Maste /* Type 2 - Byte strings */
9110ff414cSEd Maste .byte_string_start = cbor_null_byte_string_start_callback,
9210ff414cSEd Maste .byte_string = cbor_null_byte_string_callback,
9310ff414cSEd Maste
9410ff414cSEd Maste /* Type 3 - Strings */
9510ff414cSEd Maste .string_start = cbor_null_string_start_callback,
9610ff414cSEd Maste .string = cbor_null_string_callback,
9710ff414cSEd Maste
9810ff414cSEd Maste /* Type 4 - Arrays */
9910ff414cSEd Maste .indef_array_start = cbor_null_indef_array_start_callback,
10010ff414cSEd Maste .array_start = cbor_null_array_start_callback,
10110ff414cSEd Maste
10210ff414cSEd Maste /* Type 5 - Maps */
10310ff414cSEd Maste .indef_map_start = cbor_null_indef_map_start_callback,
10410ff414cSEd Maste .map_start = cbor_null_map_start_callback,
10510ff414cSEd Maste
10610ff414cSEd Maste /* Type 6 - Tags */
10710ff414cSEd Maste .tag = cbor_null_tag_callback,
10810ff414cSEd Maste
10910ff414cSEd Maste /* Type 7 - Floats & misc */
11010ff414cSEd Maste /* Type names cannot be member names */
11110ff414cSEd Maste .float2 = cbor_null_float2_callback,
11210ff414cSEd Maste /* 2B float is not supported in standard C */
11310ff414cSEd Maste .float4 = cbor_null_float4_callback,
11410ff414cSEd Maste .float8 = cbor_null_float8_callback,
11510ff414cSEd Maste .undefined = cbor_null_undefined_callback,
11610ff414cSEd Maste .null = cbor_null_null_callback,
11710ff414cSEd Maste .boolean = cbor_null_boolean_callback,
11810ff414cSEd Maste
11910ff414cSEd Maste /* Shared indefinites */
12010ff414cSEd Maste .indef_break = cbor_null_indef_break_callback,
12110ff414cSEd Maste };
122