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, 1, 1, 1, 1, 0, 1, 1, 1, 1,
44 1, 0, 1, 0, 1, 1, 1, 1, 1, 1,
45 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1,
46 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
47 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
48 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1,
49 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
50 1, 3, 1, 3, 1, 1, 1, 1, 1, 1,
51 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1,
52 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1,
53 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
60 uint32_t type = utf8d[byte];
62 *codep = (*state !=
UTF8_ACCEPT) ? (
byte & 0x3fu) | (*codep << 6)
63 : (0xff >> type) & (
byte);
65 *state = utf8d[256 + *state * 16 + type];
74 size_t pos = 0, count = 0;
76 for (; pos < source_length; pos++) {
const unsigned char * cbor_data
Signals unicode validation error and possibly its location.
size_t _cbor_unicode_codepoint_count(cbor_data source, size_t source_length, struct _cbor_unicode_status *status)
uint32_t _cbor_unicode_decode(uint32_t *state, uint32_t *codep, uint32_t byte)