64#ifndef __QCBOR__qcbor__
65#define __QCBOR__qcbor__
91#define QCBOR_MAX_ARRAY_NESTING1 15
100#define QCBOR_MAX_ARRAY_OFFSET (UINT32_MAX - 100)
123 } pArrays[QCBOR_MAX_ARRAY_NESTING1+1],
162 } pMapsAndArrays[QCBOR_MAX_ARRAY_NESTING1+1],
182 uint8_t bStringAllocateAll;
190 void *pStringAllocator;
194 const void *pCallerConfiguredTagList;
199#define CBOR_MAJOR_NONE_TYPE_RAW 9
200#define CBOR_MAJOR_NONE_TAG_LABEL_REORDER 10
219#define CBOR_MAJOR_TYPE_POSITIVE_INT 0
222#define CBOR_MAJOR_TYPE_NEGATIVE_INT 1
225#define CBOR_MAJOR_TYPE_BYTE_STRING 2
229#define CBOR_MAJOR_TYPE_TEXT_STRING 3
232#define CBOR_MAJOR_TYPE_ARRAY 4
237#define CBOR_MAJOR_TYPE_MAP 5
240#define CBOR_MAJOR_TYPE_OPTIONAL 6
243#define CBOR_MAJOR_TYPE_SIMPLE 7
250#define LEN_IS_ONE_BYTE 24
251#define LEN_IS_TWO_BYTES 25
252#define LEN_IS_FOUR_BYTES 26
253#define LEN_IS_EIGHT_BYTES 27
254#define ADDINFO_RESERVED1 28
255#define ADDINFO_RESERVED2 29
256#define ADDINFO_RESERVED3 30
257#define LEN_IS_INDEFINITE 31
264#define CBOR_TWENTY_FOUR 24
272#define CBOR_TAG_DATE_STRING 0
274#define CBOR_TAG_DATE_EPOCH 1
275#define CBOR_TAG_POS_BIGNUM 2
276#define CBOR_TAG_NEG_BIGNUM 3
277#define CBOR_TAG_FRACTION 4
278#define CBOR_TAG_BIGFLOAT 5
280#define CBOR_TAG_COSE_ENCRYPTO 16
281#define CBOR_TAG_COSE_MAC0 17
282#define CBOR_TAG_COSE_SIGN1 18
285#define CBOR_TAG_ENC_AS_B64URL 21
287#define CBOR_TAG_ENC_AS_B64 22
289#define CBOR_TAG_ENC_AS_B16 23
290#define CBOR_TAG_CBOR 24
292#define CBOR_TAG_URI 32
294#define CBOR_TAG_B64URL 33
296#define CBOR_TAG_B64 34
298#define CBOR_TAG_REGEX 35
300#define CBOR_TAG_MIME 36
302#define CBOR_TAG_BIN_UUID 37
304#define CBOR_TAG_CWT 61
306#define CBOR_TAG_ENCRYPT 96
307#define CBOR_TAG_MAC 97
308#define CBOR_TAG_SIGN 98
310#define CBOR_TAG_GEO_COORD 103
314#define CBOR_TAG_CBOR_MAGIC 55799
315#define CBOR_TAG_NONE UINT64_MAX
321#define CBOR_SIMPLEV_FALSE 20
322#define CBOR_SIMPLEV_TRUE 21
323#define CBOR_SIMPLEV_NULL 22
324#define CBOR_SIMPLEV_UNDEF 23
325#define CBOR_SIMPLEV_ONEBYTE 24
326#define HALF_PREC_FLOAT 25
327#define SINGLE_PREC_FLOAT 26
328#define DOUBLE_PREC_FLOAT 27
329#define CBOR_SIMPLE_BREAK 31
537#define QCBOR_MAX_ITEMS_IN_ARRAY (UINT16_MAX-1)
544#define QCBOR_MAX_ARRAY_NESTING QCBOR_MAX_ARRAY_NESTING1
550#define QCBOR_MAX_CUSTOM_TAGS 16
669#define QCBOR_TYPE_NONE 0
671#define QCBOR_TYPE_INT64 2
673#define QCBOR_TYPE_UINT64 3
675#define QCBOR_TYPE_ARRAY 4
677#define QCBOR_TYPE_MAP 5
679#define QCBOR_TYPE_BYTE_STRING 6
681#define QCBOR_TYPE_TEXT_STRING 7
683#define QCBOR_TYPE_POSBIGNUM 9
685#define QCBOR_TYPE_NEGBIGNUM 10
687#define QCBOR_TYPE_DATE_STRING 11
689#define QCBOR_TYPE_DATE_EPOCH 12
691#define QCBOR_TYPE_UKNOWN_SIMPLE 13
693#define QCBOR_TYPE_FALSE 20
695#define QCBOR_TYPE_TRUE 21
697#define QCBOR_TYPE_NULL 22
699#define QCBOR_TYPE_UNDEF 23
701#define QCBOR_TYPE_FLOAT 26
703#define QCBOR_TYPE_DOUBLE 27
705#define QCBOR_TYPE_MAP_AS_ARRAY 32
707#define QCBOR_TYPE_BREAK 31
709#define QCBOR_TYPE_OPTTAG 254
742 double fSecondsFraction;
785 void *pAllocaterContext;
786 UsefulBuf (*fAllocate)(
void *pAllocaterContext,
void *pOldMem,
size_t uNewSize);
787 void (*fFree)(
void *pAllocaterContext,
void *pMem);
788 void (*fDestructor)(
void *pAllocaterContext);
800#define QCBOR_DECODE_MIN_MEM_POOL_SIZE 72
814 const uint64_t *puTags;
833 uint8_t uNumAllocated;
917static void QCBOREncode_AddInt64ToMap(
QCBOREncodeContext *pCtx,
const char *szLabel, int64_t uNum);
919static void QCBOREncode_AddInt64ToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel, int64_t uNum);
938static void QCBOREncode_AddUInt64ToMap(
QCBOREncodeContext *pCtx,
const char *szLabel, uint64_t uNum);
940static void QCBOREncode_AddUInt64ToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel, uint64_t uNum);
981static void QCBOREncode_AddSZStringToMap(
QCBOREncodeContext *pCtx,
const char *szLabel,
const char *szString);
983static void QCBOREncode_AddSZStringToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel,
const char *szString);
1015static void QCBOREncode_AddDoubleToMap(
QCBOREncodeContext *pCtx,
const char *szLabel,
double dNum);
1017static void QCBOREncode_AddDoubleToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel,
double dNum);
1070static void QCBOREncode_AddDateEpochToMap(
QCBOREncodeContext *pCtx,
const char *szLabel, int64_t date);
1072static void QCBOREncode_AddDateEpochToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel, int64_t date);
1270static void QCBOREncode_AddDateStringToMap(
QCBOREncodeContext *pCtx,
const char *szLabel,
const char *szDate);
1272static void QCBOREncode_AddDateStringToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel,
const char *szDate);
1287static void QCBOREncode_AddBoolToMap(
QCBOREncodeContext *pCtx,
const char *szLabel,
bool b);
1289static void QCBOREncode_AddBoolToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel,
bool b);
1364static void QCBOREncode_OpenArrayInMap(
QCBOREncodeContext *pCtx,
const char *szLabel);
1982static inline int QCBOR_Int64ToInt32(int64_t src, int32_t *dest)
1984 if(src > INT32_MAX || src < INT32_MIN) {
1987 *dest = (int32_t) src;
1992static inline int QCBOR_Int64ToInt16(int64_t src, int16_t *dest)
1994 if(src > INT16_MAX || src < INT16_MIN) {
1997 *dest = (int16_t) src;
2002static inline int QCBOR_Int64ToInt8(int64_t src, int8_t *dest)
2004 if(src > INT8_MAX || src < INT8_MIN) {
2007 *dest = (int8_t) src;
2012static inline int QCBOR_Int64ToUInt32(int64_t src, uint32_t *dest)
2014 if(src > UINT32_MAX || src < 0) {
2017 *dest = (uint32_t) src;
2022static inline int QCBOR_Int64UToInt16(int64_t src, uint16_t *dest)
2024 if(src > UINT16_MAX || src < 0) {
2027 *dest = (uint16_t) src;
2032static inline int QCBOR_Int64ToUInt8(int64_t src, uint8_t *dest)
2034 if(src > UINT8_MAX || src < 0) {
2037 *dest = (uint8_t) src;
2042static inline int QCBOR_Int64ToUInt64(int64_t src, uint64_t *dest)
2047 *dest = (uint64_t) src;
2127static inline void QCBOREncode_AddInt64ToMap(
QCBOREncodeContext *pCtx,
const char *szLabel, int64_t uNum)
2133static inline void QCBOREncode_AddInt64ToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel, int64_t uNum)
2140static inline void QCBOREncode_AddUInt64ToMap(
QCBOREncodeContext *pCtx,
const char *szLabel, uint64_t uNum)
2146static inline void QCBOREncode_AddUInt64ToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel, uint64_t uNum)
2160 QCBOREncode_AddText(pCtx, UsefulBuf_FromSZ(szLabel));
2161 QCBOREncode_AddText(pCtx, Text);
2167 QCBOREncode_AddText(pCtx, Text);
2171inline static void QCBOREncode_AddSZString(
QCBOREncodeContext *pCtx,
const char *szString)
2173 QCBOREncode_AddText(pCtx, UsefulBuf_FromSZ(szString));
2176static inline void QCBOREncode_AddSZStringToMap(
QCBOREncodeContext *pCtx,
const char *szLabel,
const char *szString)
2178 QCBOREncode_AddSZString(pCtx, szLabel);
2179 QCBOREncode_AddSZString(pCtx, szString);
2182static inline void QCBOREncode_AddSZStringToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel,
const char *szString)
2185 QCBOREncode_AddSZString(pCtx, szString);
2189static inline void QCBOREncode_AddDoubleToMap(
QCBOREncodeContext *pCtx,
const char *szLabel,
double dNum)
2191 QCBOREncode_AddSZString(pCtx, szLabel);
2195static inline void QCBOREncode_AddDoubleToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel,
double dNum)
2208static inline void QCBOREncode_AddDateEpochToMap(
QCBOREncodeContext *pCtx,
const char *szLabel, int64_t date)
2210 QCBOREncode_AddSZString(pCtx, szLabel);
2215static inline void QCBOREncode_AddDateEpochToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel, int64_t date)
2230 QCBOREncode_AddSZString(pCtx, szLabel);
2231 QCBOREncode_AddBytes(pCtx, Bytes);
2237 QCBOREncode_AddBytes(pCtx, Bytes);
2244 QCBOREncode_AddBytes(pCtx, Bytes);
2249 QCBOREncode_AddSZString(pCtx, szLabel);
2251 QCBOREncode_AddBytes(pCtx, Bytes);
2258 QCBOREncode_AddBytes(pCtx, Bytes);
2265 QCBOREncode_AddBytes(pCtx, Bytes);
2270 QCBOREncode_AddSZString(pCtx, szLabel);
2272 QCBOREncode_AddBytes(pCtx, Bytes);
2279 QCBOREncode_AddBytes(pCtx, Bytes);
2286 QCBOREncode_AddBytes(pCtx, Bytes);
2291 QCBOREncode_AddSZString(pCtx, szLabel);
2293 QCBOREncode_AddBytes(pCtx, Bytes);
2300 QCBOREncode_AddBytes(pCtx, Bytes);
2307 QCBOREncode_AddText(pCtx, URI);
2312 QCBOREncode_AddSZString(pCtx, szLabel);
2314 QCBOREncode_AddText(pCtx, URI);
2321 QCBOREncode_AddText(pCtx, URI);
2329 QCBOREncode_AddText(pCtx, B64Text);
2334 QCBOREncode_AddSZString(pCtx, szLabel);
2336 QCBOREncode_AddText(pCtx, B64Text);
2343 QCBOREncode_AddText(pCtx, B64Text);
2350 QCBOREncode_AddText(pCtx, B64Text);
2355 QCBOREncode_AddSZString(pCtx, szLabel);
2357 QCBOREncode_AddText(pCtx, B64Text);
2364 QCBOREncode_AddText(pCtx, B64Text);
2371 QCBOREncode_AddText(pCtx, Bytes);
2376 QCBOREncode_AddSZString(pCtx, szLabel);
2378 QCBOREncode_AddText(pCtx, Bytes);
2385 QCBOREncode_AddText(pCtx, Bytes);
2392 QCBOREncode_AddText(pCtx, MIMEData);
2397 QCBOREncode_AddSZString(pCtx, szLabel);
2399 QCBOREncode_AddText(pCtx, MIMEData);
2406 QCBOREncode_AddText(pCtx, MIMEData);
2410static inline void QCBOREncode_AddDateString(
QCBOREncodeContext *pCtx,
const char *szDate)
2413 QCBOREncode_AddSZString(pCtx, szDate);
2416static inline void QCBOREncode_AddDateStringToMap(
QCBOREncodeContext *pCtx,
const char *szLabel,
const char *szDate)
2418 QCBOREncode_AddSZString(pCtx, szLabel);
2420 QCBOREncode_AddSZString(pCtx, szDate);
2423static inline void QCBOREncode_AddDateStringToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel,
const char *szDate)
2427 QCBOREncode_AddSZString(pCtx, szDate);
2436static inline void QCBOREncode_AddSimpleToMap(
QCBOREncodeContext *pCtx,
const char *szLabel, uint8_t uSimple)
2438 QCBOREncode_AddSZString(pCtx, szLabel);
2439 QCBOREncode_AddSimple(pCtx, uSimple);
2442static inline void QCBOREncode_AddSimpleToMapN(
QCBOREncodeContext *pCtx,
int nLabel, uint8_t uSimple)
2445 QCBOREncode_AddSimple(pCtx, uSimple);
2451 uint8_t uSimple = CBOR_SIMPLEV_FALSE;
2453 uSimple = CBOR_SIMPLEV_TRUE;
2455 QCBOREncode_AddSimple(pCtx, uSimple);
2458static inline void QCBOREncode_AddBoolToMap(
QCBOREncodeContext *pCtx,
const char *szLabel,
bool b)
2460 QCBOREncode_AddSZString(pCtx, szLabel);
2461 QCBOREncode_AddBool(pCtx, b);
2464static inline void QCBOREncode_AddBoolToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel,
bool b)
2467 QCBOREncode_AddBool(pCtx, b);
2473 QCBOREncode_AddSimple(pCtx, CBOR_SIMPLEV_NULL);
2476static inline void QCBOREncode_AddNULLToMap(
QCBOREncodeContext *pCtx,
const char *szLabel)
2478 QCBOREncode_AddSZString(pCtx, szLabel);
2479 QCBOREncode_AddNULL(pCtx);
2482static inline void QCBOREncode_AddNULLToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel)
2485 QCBOREncode_AddNULL(pCtx);
2491 QCBOREncode_AddSimple(pCtx, CBOR_SIMPLEV_UNDEF);
2494static inline void QCBOREncode_AddUndefToMap(
QCBOREncodeContext *pCtx,
const char *szLabel)
2496 QCBOREncode_AddSZString(pCtx, szLabel);
2497 QCBOREncode_AddUndef(pCtx);
2500static inline void QCBOREncode_AddUndefToMapN(
QCBOREncodeContext *pCtx, int64_t nLabel)
2503 QCBOREncode_AddUndef(pCtx);
2512static inline void QCBOREncode_OpenArrayInMap(
QCBOREncodeContext *pCtx,
const char *szLabel)
2514 QCBOREncode_AddSZString(pCtx, szLabel);
2515 QCBOREncode_OpenArray(pCtx);
2518static inline void QCBOREncode_OpenArrayInMapN(
QCBOREncodeContext *pCtx, int64_t nLabel)
2521 QCBOREncode_OpenArray(pCtx);
2535static inline void QCBOREncode_OpenMapInMap(
QCBOREncodeContext *pCtx,
const char *szLabel)
2537 QCBOREncode_AddSZString(pCtx, szLabel);
2538 QCBOREncode_OpenMap(pCtx);
2541static inline void QCBOREncode_OpenMapInMapN(
QCBOREncodeContext *pCtx, int64_t nLabel)
2544 QCBOREncode_OpenMap(pCtx);
2558static inline void QCBOREncode_BstrWrapInMap(
QCBOREncodeContext *pCtx,
const char *szLabel)
2560 QCBOREncode_AddSZString(pCtx, szLabel);
2561 QCBOREncode_BstrWrap(pCtx);
2564static inline void QCBOREncode_BstrWrapInMapN(
QCBOREncodeContext *pCtx, int64_t nLabel)
2567 QCBOREncode_BstrWrap(pCtx);
2583 QCBOREncode_AddSZString(pCtx, szLabel);
2584 QCBOREncode_AddEncoded(pCtx, Encoded);
2590 QCBOREncode_AddEncoded(pCtx, Encoded);
The goal of this code is to make buffer and pointer manipulation easier and safer when working with b...
struct useful_buf UsefulBuf
The non-const UsefulBuf typically used for some allocated memory that is to be filled in.
QCBORError QCBOREncode_FinishGetSize(QCBOREncodeContext *pCtx, size_t *uEncodedLen)
Get the encoded CBOR and error status.
void QCBORDecode_SetCallerConfiguredTagList(QCBORDecodeContext *pCtx, const QCBORTagListIn *pTagList)
Configure list of caller selected tags to be recognized.
void QCBORDecode_SetUpAllocator(QCBORDecodeContext *pCtx, const QCBORStringAllocator *pAllocator, bool bAllocAll)
Sets up a custom string allocator for indefinite length strings.
void QCBOREncode_AddTag(QCBOREncodeContext *pCtx, uint64_t uTag)
[in] Add an optional tag
QCBORError QCBORDecode_GetNextWithTags(QCBORDecodeContext *pCtx, QCBORItem *pDecodedItem, QCBORTagListOut *pTagList)
Gets the next item including full list of tags for item.
void QCBOREncode_OpenMapOrArray(QCBOREncodeContext *pCtx, uint8_t uMajorType)
Semi-private method to open a map, array or bstr wrapped CBOR.
#define CBOR_TAG_URI
The data in the string is a URIs, as defined in RFC3986.
#define CBOR_TAG_B64URL
The data in the string is a base 64'd URL.
void QCBOREncode_AddUInt64(QCBOREncodeContext *pCtx, uint64_t uNum)
Add an unsigned 64-bit integer to the encoded output.
QCBORError QCBORDecode_GetNext(QCBORDecodeContext *pCtx, QCBORItem *pDecodedItem)
Gets the next item (integer, byte string, array...) in pre order traversal of CBOR tree.
#define CBOR_TAG_DATE_STRING
See QCBOREncode_AddDateString() below.
int QCBORDecode_IsTagged(QCBORDecodeContext *pCtx, const QCBORItem *pItem, uint64_t uTag)
Determine if a CBOR item was tagged with a particular tag.
QCBORError QCBORDecode_Finish(QCBORDecodeContext *pCtx)
Check whether all the bytes have been decoded and maps and arrays closed.
#define CBOR_TAG_DATE_EPOCH
See QCBOREncode_AddDateEpoch_2()
#define CBOR_TAG_B64
The data in the string is base 64'd.
#define CBOR_TAG_BIN_UUID
Binary UUID.
void QCBOREncode_CloseMapOrArray(QCBOREncodeContext *pCtx, uint8_t uMajorType, UsefulBufC *pWrappedCBOR)
Semi-private method to close a map, array or bstr wrapped CBOR.
@ QCBOR_ERR_DATE_OVERFLOW
During decoding, a date greater than +- 292 billion years from Jan 1 1970 encountered during parsing.
@ QCBOR_ERR_ARRAY_NESTING_TOO_DEEP
During encoding or decoding, the array or map nesting was deeper than this implementation can handle.
@ QCBOR_ERR_BUFFER_TOO_LARGE
During encoding, the length of the encoded CBOR exceeded UINT32_MAX.
@ QCBOR_ERR_ARRAY_TOO_LONG
During decoding or encoding, the array or map had too many items in it.
@ QCBOR_ERR_BAD_BREAK
During decoding, a break occurred outside an indefinite length item.
@ QCBOR_ERR_CLOSE_MISMATCH
During encoding, QCBOREncode_Close() call with a different type than is currently open.
@ QCBOR_ERR_EXTRA_BYTES
Returned by QCBORDecode_Finish() if all the inputs bytes have not been consumed.
@ QCBOR_ERR_ARRAY_OR_MAP_STILL_OPEN
During encoding or decoding, the number of array or map opens was not matched by the number of closes...
@ QCBOR_ERR_NO_STRING_ALLOCATOR
Unable to decode an indefinite length string because no string allocator was configured.
@ QCBOR_ERR_BAD_SIMPLE
During encoding, the simple value is not between CBOR_SIMPLEV_FALSE and CBOR_SIMPLEV_UNDEF.
@ QCBOR_ERR_MAP_LABEL_TYPE
During decoding, the label for a map entry is bad.
@ QCBOR_ERR_UNSUPPORTED
During decoding, some CBOR construct was encountered that this decoder doesn't support,...
@ QCBOR_ERR_INDEFINITE_STRING_CHUNK
One of the chunks in an indefinite length string is not of the type of the string.
@ QCBOR_ERR_INVALID_CBOR
During decoding, the CBOR is not valid, primarily a simple type is encoded in a prohibited way.
@ QCBOR_ERR_INT_OVERFLOW
During decoding, an integer smaller than INT64_MIN was received (CBOR can represent integers smaller ...
@ QCBOR_ERR_TOO_MANY_CLOSES
During encoding, more arrays or maps were closed than opened.
@ QCBOR_ERR_STRING_ALLOCATE
Error allocating space for a string, usually for an indefinite length string.
@ QCBOR_ERR_TOO_MANY_TAGS
During decoding, too many tags in the caller-configured tag list, or not enough space in QCBORTagList...
@ QCBOR_ERR_BAD_OPT_TAG
Optional tagging that doesn't make sense (an int is tagged as a date string) or can't be handled.
@ QCBOR_ERR_MEM_POOL_INTERNAL
Returned by QCBORDecode_SetMemPool() when xx is too small.
@ QCBOR_ERR_BUFFER_TOO_SMALL
The buffer provided for the encoded output when doing encoding was too small and the encoded output w...
@ QCBOR_SUCCESS
The encode or decode completely correctly.
@ QCBOR_ERR_HIT_END
During decoding, hit the end of the given data to decode.
void QCBOREncode_AddBuffer(QCBOREncodeContext *pCtx, uint8_t uMajorType, UsefulBufC Bytes)
Semi-private method to add a buffer full of bytes to encoded output.
void QCBOREncode_AddDouble(QCBOREncodeContext *pCtx, double dNum)
Add a floating-point number to the encoded output.
void QCBOREncode_AddInt64(QCBOREncodeContext *pCtx, int64_t nNum)
Add a signed 64-bit integer to the encoded output.
#define CBOR_TAG_REGEX
regular expressions in Perl Compatible Regular Expressions (PCRE) / JavaScript syntax ECMA262.
void QCBORDecode_Init(QCBORDecodeContext *pCtx, UsefulBufC EncodedCBOR, QCBORDecodeMode nMode)
Initialize the CBOR decoder context.
void QCBOREncode_Init(QCBOREncodeContext *pCtx, UsefulBuf Storage)
Initialize the the encoder to prepare to encode some CBOR.
void QCBOREncode_AddType7(QCBOREncodeContext *pCtx, size_t uSize, uint64_t uNum)
Semi-private method to add simple types.
QCBORError QCBOREncode_Finish(QCBOREncodeContext *pCtx, UsefulBufC *pEncodedCBOR)
Get the encoded result.
QCBORError QCBORDecode_SetMemPool(QCBORDecodeContext *pCtx, UsefulBuf MemPool, bool bAllStrings)
Set up the MemPool string allocator for indefinite length strings.
#define CBOR_TAG_MIME
MIME messages (including all headers), as defined in RFC2045.
struct _QCBORItem QCBORItem
QCBORItem holds the type, value and other info for a decoded item returned by GetNextItem().
@ QCBOR_DECODE_MODE_NORMAL
See QCBORDecode_Init()
@ QCBOR_DECODE_MODE_MAP_STRINGS_ONLY
See QCBORDecode_Init()
@ QCBOR_DECODE_MODE_MAP_AS_ARRAY
See QCBORDecode_Init()
QCBORItem holds the type, value and other info for a decoded item returned by GetNextItem().
union _QCBORItem::@84 val
If not equal to uNestingLevel, this item closed out at least one map/array.
UsefulBufC bigNum
The value for uDataType QCBOR_TYPE_DATE_STRING.
uint8_t uSimple
The value for uDataType QCBOR_TYPE_BIGNUM.
UsefulBufC string
The value for uDataType QCBOR_TYPE_UINT64.
uint8_t uLabelAlloc
1 if allocated with string allocator, 0 if not.
double dfnum
The "value" for uDataType QCBOR_TYPE_ARRAY or QCBOR_TYPE_MAP – the number of items in the array or ma...
int64_t int64
The label for uLabelType QCBOR_TYPE_BYTE_STRING and QCBOR_TYPE_TEXT_STRING.
uint64_t uTagV
The integer value for unknown simple types.
uint64_t uint64
The value for uDataType QCBOR_TYPE_INT64.
uint8_t uDataAlloc
Tells what element of the label union to use.
UsefulBufC dateString
The value for uDataType QCBOR_TYPE_DATE_EPOCH.
struct _QCBORItem::@84::@86 epochDate
The value for uDataType QCBOR_TYPE_DOUBLE.
uint8_t uNestingLevel
Tells what element of the val union to use.
uint8_t uLabelType
How deep the nesting from arrays and maps are.
uint8_t uNextNestLevel
Like uDataAlloc, but for label.
uint64_t uTagBits
Union holding the different label types selected based on uLabelType.
uint16_t uCount
The value for uDataType QCBOR_TYPE_BYTE_STRING and QCBOR_TYPE_TEXT_STRING.
union _QCBORItem::@85 label
The union holding the item's value.
This is a set of functions and pointer context (in object-oriented parlance, an "object") used to all...
This is used to tell the decoder about tags that it should record in uTagBits in QCBORItem beyond the...
This is for QCBORDecode_GetNextWithTags() to be able to return the full list of tags on an item.
UsefulBufC and UsefulBuf are simple data structures to hold a pointer and length for a binary data.
The non-const UsefulBuf typically used for some allocated memory that is to be filled in.
UsefulOutBuf is a structure and functions (an object) that are good for serializing data into a buffe...