33 #ifndef qcbor_common_h
34 #define qcbor_common_h
60 #define QCBOR_VERSION_MAJOR 1
61 #define QCBOR_VERSION_MINOR 6
62 #define QCBOR_VERSION_PATCH 1
72 #define STR(x) STR1(x)
73 #define QCBOR_VERSION_STRING "libqcbor " STR(QCBOR_VERSION_MAJOR) "." \
74 STR(QCBOR_VERSION_MINOR) "." \
75 STR(QCBOR_VERSION_PATCH)
87 #define QCBOR_SPIFFY_DECODE
92 #define CBOR_MAJOR_TYPE_POSITIVE_INT 0
95 #define CBOR_MAJOR_TYPE_NEGATIVE_INT 1
98 #define CBOR_MAJOR_TYPE_BYTE_STRING 2
102 #define CBOR_MAJOR_TYPE_TEXT_STRING 3
105 #define CBOR_MAJOR_TYPE_ARRAY 4
110 #define CBOR_MAJOR_TYPE_MAP 5
119 #define CBOR_MAJOR_TYPE_TAG 6
120 #define CBOR_MAJOR_TYPE_OPTIONAL 6
123 #define CBOR_MAJOR_TYPE_SIMPLE 7
134 #define CBOR_TAG_DATE_STRING 0
136 #define CBOR_TAG_DATE_EPOCH 1
138 #define CBOR_TAG_POS_BIGNUM 2
140 #define CBOR_TAG_NEG_BIGNUM 3
144 #define CBOR_TAG_DECIMAL_FRACTION 4
148 #define CBOR_TAG_BIGFLOAT 5
153 #define CBOR_TAG_COSE_ENCRYPT0 16
154 #define CBOR_TAG_COSE_ENCRYPTO 16
159 #define CBOR_TAG_COSE_MAC0 17
163 #define CBOR_TAG_COSE_SIGN1 18
169 #define CBOR_TAG_ENC_AS_B64URL 21
175 #define CBOR_TAG_ENC_AS_B64 22
183 #define CBOR_TAG_ENC_AS_B16 23
185 #define CBOR_TAG_CBOR 24
187 #define CBOR_TAG_URI 32
189 #define CBOR_TAG_B64URL 33
191 #define CBOR_TAG_B64 34
193 #define CBOR_TAG_REGEX 35
195 #define CBOR_TAG_MIME 36
197 #define CBOR_TAG_BIN_UUID 37
201 #define CBOR_TAG_CWT 61
205 #define CBOR_TAG_CBOR_SEQUENCE 63
209 #define CBOR_TAG_COSE_ENCRYPT 96
210 #define CBOR_TAG_ENCRYPT 96
214 #define CBOR_TAG_COSE_MAC 97
215 #define CBOR_TAG_MAC 97
219 #define CBOR_TAG_COSE_SIGN 98
220 #define CBOR_TAG_SIGN 98
224 #define CBOR_TAG_DAYS_EPOCH 100
228 #define CBOR_TAG_GEO_COORD 103
230 #define CBOR_TAG_BINARY_MIME 257
234 #define CBOR_TAG_DAYS_STRING 1004
237 #define CBOR_TAG_CBOR_MAGIC 55799
240 #define CBOR_TAG_INVALID16 0xffff
242 #define CBOR_TAG_INVALID32 0xffffffff
244 #define CBOR_TAG_INVALID64 0xffffffffffffffffULL
316 #define QCBOR_START_OF_NOT_WELL_FORMED_ERRORS 20
345 #define QCBOR_START_OF_UNRECOVERABLE_DECODE_ERRORS 30
366 #define QCBOR_END_OF_NOT_WELL_FORMED_ERRORS 39
425 QCBOR_ERR_BAD_TAG_CONTENT = 48,
426 QCBOR_ERR_BAD_OPT_TAG = 48,
441 #define QCBOR_END_OF_UNRECOVERABLE_DECODE_ERRORS 59
577 #define QCBOR_MAX_ARRAY_NESTING 15
584 #define QCBOR_MAX_ITEMS_IN_ARRAY (UINT16_MAX-1)
593 #define QCBOR_MAX_ITEMS_IN_MAP (QCBOR_MAX_ITEMS_IN_ARRAY/2)
const char * qcbor_err_to_str(QCBORError uErr)
Get string describing an error code.
QCBORError
Definition: qcbor_common.h:265
@ QCBOR_ERR_DATE_OVERFLOW
Definition: qcbor_common.h:471
@ QCBOR_ERR_MAP_NOT_ENTERED
Definition: qcbor_common.h:498
@ QCBOR_ERR_BAD_TYPE_7
Definition: qcbor_common.h:321
@ QCBOR_ERR_ARRAY_NESTING_TOO_DEEP
Definition: qcbor_common.h:287
@ QCBOR_ERR_ARRAY_DECODE_TOO_LONG
Definition: qcbor_common.h:385
@ QCBOR_ERR_BUFFER_TOO_LARGE
Definition: qcbor_common.h:280
@ QCBOR_ERR_ARRAY_TOO_LONG
Definition: qcbor_common.h:296
@ QCBOR_ERR_HALF_PRECISION_DISABLED
Definition: qcbor_common.h:512
@ QCBOR_ERR_STRING_TOO_LONG
Definition: qcbor_common.h:393
@ QCBOR_ERR_BAD_INT
Definition: qcbor_common.h:343
@ QCBOR_ERR_NUMBER_SIGN_CONVERSION
Definition: qcbor_common.h:490
@ QCBOR_ERR_BAD_BREAK
Definition: qcbor_common.h:364
@ QCBOR_ERR_MEM_POOL_SIZE
Definition: qcbor_common.h:461
@ QCBOR_ERR_INDEF_LEN_STRINGS_DISABLED
Definition: qcbor_common.h:430
@ QCBOR_ERR_CANNOT_CANCEL
Definition: qcbor_common.h:314
@ QCBOR_ERR_CALLBACK_FAIL
Definition: qcbor_common.h:502
@ QCBOR_ERR_CLOSE_MISMATCH
Definition: qcbor_common.h:291
@ QCBOR_ERR_EXTRA_BYTES
Definition: qcbor_common.h:326
@ QCBOR_ERR_ARRAY_OR_MAP_STILL_OPEN
Definition: qcbor_common.h:306
@ QCBOR_ERR_OPEN_BYTE_STRING
Definition: qcbor_common.h:310
@ QCBOR_ERR_UNRECOVERABLE_TAG_CONTENT
Definition: qcbor_common.h:424
@ QCBOR_ERR_NO_STRING_ALLOCATOR
Definition: qcbor_common.h:404
@ QCBOR_ERR_LAST_USER_DEFINED
Definition: qcbor_common.h:547
@ QCBOR_ERR_NO_MORE_ITEMS
Definition: qcbor_common.h:482
@ QCBOR_ERR_INDEF_LEN_ARRAYS_DISABLED
Definition: qcbor_common.h:435
@ QCBOR_ERR_ALL_FLOAT_DISABLED
Definition: qcbor_common.h:527
@ QCBOR_ERR_TAGS_DISABLED
Definition: qcbor_common.h:439
@ QCBOR_ERR_MAP_LABEL_TYPE
Definition: qcbor_common.h:415
@ QCBOR_ERR_UNSUPPORTED
Definition: qcbor_common.h:333
@ QCBOR_ERR_LABEL_NOT_FOUND
Definition: qcbor_common.h:486
@ QCBOR_ERR_FLOAT_EXCEPTION
Definition: qcbor_common.h:523
@ QCBOR_ERR_INDEFINITE_STRING_CHUNK
Definition: qcbor_common.h:351
@ QCBOR_ERR_EXIT_MISMATCH
Definition: qcbor_common.h:475
@ QCBOR_ERR_HW_FLOAT_DISABLED
Definition: qcbor_common.h:516
@ QCBOR_ERR_UNEXPECTED_TYPE
Definition: qcbor_common.h:452
@ QCBOR_ERR_RECOVERABLE_BAD_TAG_CONTENT
Definition: qcbor_common.h:534
@ QCBOR_ERR_ENCODE_UNSUPPORTED
Definition: qcbor_common.h:275
@ QCBOR_ERR_INT_OVERFLOW
Definition: qcbor_common.h:466
@ QCBOR_ERR_TOO_MANY_CLOSES
Definition: qcbor_common.h:301
@ QCBOR_ERR_DUPLICATE_LABEL
Definition: qcbor_common.h:455
@ QCBOR_ERR_STRING_ALLOCATE
Definition: qcbor_common.h:409
@ QCBOR_ERR_BAD_EXP_AND_MANTISSA
Definition: qcbor_common.h:398
@ QCBOR_ERR_TOO_MANY_TAGS
Definition: qcbor_common.h:449
@ QCBOR_ERR_CONVERSION_UNDER_OVER_FLOW
Definition: qcbor_common.h:494
@ QCBOR_ERR_FLOAT_DATE_DISABLED
Definition: qcbor_common.h:509
@ QCBOR_ERR_ARRAY_OR_MAP_UNCONSUMED
Definition: qcbor_common.h:338
@ QCBOR_ERR_BUFFER_TOO_SMALL
Definition: qcbor_common.h:271
@ QCBOR_ERR_CANNOT_ENTER_ALLOCATED_STRING
Definition: qcbor_common.h:539
@ QCBOR_ERR_ARRAY_DECODE_NESTING_TOO_DEEP
Definition: qcbor_common.h:379
@ QCBOR_ERR_FIRST_USER_DEFINED
Definition: qcbor_common.h:544
@ QCBOR_SUCCESS
Definition: qcbor_common.h:267
@ QCBOR_ERR_HIT_END
Definition: qcbor_common.h:359
@ QCBOR_ERR_INPUT_TOO_LARGE
Definition: qcbor_common.h:371