File: builder_callbacks.h

package info (click to toggle)
aws-crt-python 0.24.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 75,932 kB
  • sloc: ansic: 418,984; python: 23,626; makefile: 6,035; sh: 4,075; ruby: 208; java: 82; perl: 73; cpp: 25; xml: 11
file content (85 lines) | stat: -rw-r--r-- 2,173 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * Copyright (c) 2014-2020 Pavel Kalvoda <me@pavelkalvoda.com>
 *
 * libcbor is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#ifndef LIBCBOR_BUILDER_CALLBACKS_H
#define LIBCBOR_BUILDER_CALLBACKS_H

#include "../callbacks.h"
#include "cbor/common.h"
#include "stack.h"

#ifdef __cplusplus
extern "C" {
#endif

/** High-level decoding context */
struct _cbor_decoder_context {
  /** Callback creating the last item has failed */
  bool creation_failed;
  /** Stack expectation mismatch */
  bool syntax_error;
  cbor_item_t *root;
  struct _cbor_stack *stack;
};

/** Internal helper: Append item to the top of the stack while handling errors.
 */
void _cbor_builder_append(cbor_item_t *item, struct _cbor_decoder_context *ctx);

void cbor_builder_uint8_callback(void *, uint8_t);

void cbor_builder_uint16_callback(void *, uint16_t);

void cbor_builder_uint32_callback(void *, uint32_t);

void cbor_builder_uint64_callback(void *, uint64_t);

void cbor_builder_negint8_callback(void *, uint8_t);

void cbor_builder_negint16_callback(void *, uint16_t);

void cbor_builder_negint32_callback(void *, uint32_t);

void cbor_builder_negint64_callback(void *, uint64_t);

void cbor_builder_string_callback(void *, cbor_data, uint64_t);

void cbor_builder_string_start_callback(void *);

void cbor_builder_byte_string_callback(void *, cbor_data, uint64_t);

void cbor_builder_byte_string_start_callback(void *);

void cbor_builder_array_start_callback(void *, uint64_t);

void cbor_builder_indef_array_start_callback(void *);

void cbor_builder_map_start_callback(void *, uint64_t);

void cbor_builder_indef_map_start_callback(void *);

void cbor_builder_tag_callback(void *, uint64_t);

void cbor_builder_float2_callback(void *, float);

void cbor_builder_float4_callback(void *, float);

void cbor_builder_float8_callback(void *, double);

void cbor_builder_null_callback(void *);

void cbor_builder_undefined_callback(void *);

void cbor_builder_boolean_callback(void *, bool);

void cbor_builder_indef_break_callback(void *);

#ifdef __cplusplus
}
#endif

#endif  // LIBCBOR_BUILDER_CALLBACKS_H