7#include <zcbor_decode.h>
8#include <zcbor_encode.h>
10#if defined(ZCBOR_VERSION_MAJOR) && defined(ZCBOR_VERSION_MINOR) && ZCBOR_VERSION_MAJOR == 0 \
11 && ZCBOR_VERSION_MINOR < 8
14#define ZCBOR_MAJOR_TYPE(header_byte) ((zcbor_major_type_t) (((header_byte) >> 5) & 0x7))
16#define ZCBOR_STATE_D_COMPAT(name, num_backups, payload, payload_size, elem_count, n_flags) \
17 ZCBOR_STATE_D(name, num_backups, payload, payload_size, elem_count)
21 return state->indefinite_length_array;
26 return zcbor_tstr_put_term(state, str);
31#define ZCBOR_STATE_D_COMPAT(name, num_backups, payload, payload_size, elem_count, n_flags) \
32 ZCBOR_STATE_D(name, num_backups, payload, payload_size, elem_count, n_flags)
36 return state->decode_state.indefinite_length_array;
41 return zcbor_tstr_put_term(state, str, maxlen);
79 return *state->payload == 0xff;
82 return state->elem_count == 0;
136#define ZCBOR_U32_MAP_ENTRY(_u32, _decode, _value) \
140 .type = ZCBOR_MAP_KEY_TYPE_U32, \
143 .decode = _decode, .value = _value, \
153#define ZCBOR_TSTR_LIT_MAP_ENTRY(_tstr_lit, _decode, _value) \
157 .type = ZCBOR_MAP_KEY_TYPE_TSTR, \
158 .tstr = {(const uint8_t *) _tstr_lit, sizeof(_tstr_lit) - 1}, \
160 .decode = _decode, .value = _value, \
int(* decode)(zcbor_state_t *zsd, void *value)
int zcbor_map_tstr_decode(zcbor_state_t *zsd, void *value)
Decode text string value from CBOR map.
static bool zcbor_is_indefinite_length_array(zcbor_state_t *state)
@ ZCBOR_MAP_KEY_TYPE_TSTR
int zcbor_map_int64_decode(zcbor_state_t *zsd, void *value)
Decode int64_t value from CBOR map.
int zcbor_map_decode(zcbor_state_t *zsd, struct zcbor_map_entry *entries, size_t num_entries)
Decode CBOR map with specified entries.
static bool zcbor_list_or_map_end(zcbor_state_t *state)
Check the end of CBOR list or map.
static bool zcbor_tstr_put_term_compat(zcbor_state_t *state, char const *str, size_t maxlen)