make the decode tag requirement an enum
diff --git a/inc/qcbor/qcbor_number_decode.h b/inc/qcbor/qcbor_number_decode.h
index 6972671..d431c4f 100644
--- a/inc/qcbor/qcbor_number_decode.h
+++ b/inc/qcbor/qcbor_number_decode.h
@@ -15,6 +15,7 @@
#include "qcbor/qcbor_main_decode.h"
+#include "qcbor/qcbor_tag_decode.h"
#ifdef __cplusplus
@@ -210,7 +211,8 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See also QCBORDecode_GetUInt64Convert() and QCBORDecode_GetUInt64ConvertAll().
+ * See also QCBORDecode_GetUInt64Convert() and
+ * QCBORDecode_GetUInt64ConvertAll().
*/
static void
QCBORDecode_GetUInt64(QCBORDecodeContext *pCtx,
@@ -228,7 +230,8 @@
/**
- * @brief Decode next item as an unsigned 64-bit integer with basic conversions.
+ * @brief Decode next item as an unsigned 64-bit integer with basic
+ * conversions.
*
* @param[in] pCtx The decode context.
* @param[in] uConvertTypes The integer conversion options.
@@ -569,14 +572,16 @@
/**
- * @brief Decode next item as a big number encoded using preferred serialization.
+ * @brief Decode next item as a big number encoded using preferred
+ * serialization.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement @ref QCBOR_TAG_REQUIREMENT_TAG or related.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[in] BigNumberBuf The buffer to write the result into.
* @param[out] pBigNumber The decoded big number, most significant
* byte first (network byte order).
- * @param[in,out] pbIsNegative Set to true if the resulting big number is negative.
+ * @param[in,out] pbIsNegative Set to true if the resulting big number
+ * is negative.
*
* This decodes CBOR tag numbers 2 and 3, positive and negative big
* numbers, as defined in [RFC 8949 section 3.4.3]
@@ -621,38 +626,39 @@
* See @ref Tag-Usage for discussion on tag requirements.
*/
void
-QCBORDecode_GetTBigNumber(QCBORDecodeContext *pCtx,
- const uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative);
+QCBORDecode_GetTBigNumber(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative);
void
-QCBORDecode_GetTBigNumberInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative);
+QCBORDecode_GetTBigNumberInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative);
void
-QCBORDecode_GetTBigNumberInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative);
+QCBORDecode_GetTBigNumberInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative);
/**
* @brief Decode next item as a big number without preferred serialization.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement @ref QCBOR_TAG_REQUIREMENT_TAG or related.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[in] BigNumberBuf The buffer to write the result into.
* @param[out] pBigNumber The decoded big number, most significant
* byte first (network byte order).
- * @param[in,out] pbIsNegative Set to true if the returned big number is negative.
+ * @param[in,out] pbIsNegative Set to true if the returned big number
+ * is negative.
*
* This is the same as QCBORDecode_GetTBigNumber(), but will error out
* on type 0 and 1 integers as it doesn't support the preferred
@@ -664,34 +670,34 @@
* and QCBORDecode_GetTBigNumberRaw().
*/
void
-QCBORDecode_GetTBigNumberNoPreferred(QCBORDecodeContext *pCtx,
- const uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative);
+QCBORDecode_GetTBigNumberNoPreferred(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative);
void
-QCBORDecode_GetTBigNumberNoPreferredInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative);
+QCBORDecode_GetTBigNumberNoPreferredInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative);
void
-QCBORDecode_GetTBigNumberNoPreferredInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative);
+QCBORDecode_GetTBigNumberNoPreferredInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative);
/**
* @brief Decode the next item as a big number with no processing
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement @ref QCBOR_TAG_REQUIREMENT_TAG or related.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pBigNumber The decoded big number, most significant
* byte first (network byte order).
* @param[out] pbIsNegative Is @c true if the big number is negative. This
@@ -712,13 +718,15 @@
* it can be (trivially) used to perform the offset of one for
* negative numbers.
*
- * This links in much less object code than QCBORDecode_GetTBigNumber() and
+ * This links in much less object code than
+ * QCBORDecode_GetTBigNumber() and
* QCBORDecode_GetTBigNumberNoPreferred().
*
- * This does the same minimal processing as installing QCBORDecode_StringsTagCB()
- * installed to handle @ref CBOR_TAG_POS_BIGNUM and @ref CBOR_TAG_NEG_BIGNUM
- * so QCBORDecode_VGetNext() returns a @ref QCBORItem of type
- * @ref QCBOR_TYPE_POSBIGNUM or @ref QCBOR_TYPE_POSBIGNUM
+ * This does the same minimal processing as installing
+ * QCBORDecode_StringsTagCB() installed to handle @ref
+ * CBOR_TAG_POS_BIGNUM and @ref CBOR_TAG_NEG_BIGNUM so
+ * QCBORDecode_VGetNext() returns a @ref QCBORItem of type @ref
+ * QCBOR_TYPE_POSBIGNUM or @ref QCBOR_TYPE_POSBIGNUM
*
* See @ref BigNumbers for a useful overview of CBOR big numbers and
* QCBOR's support for them. See QCBOREncode_AddTBigNumberRaw() for
@@ -727,28 +735,26 @@
* serialization big numbers.
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
- *
- * See @ref Tag-Usage for discussion on tag requirements.
*/
void
-QCBORDecode_GetTBigNumberRaw(QCBORDecodeContext *pCtx,
- const uint8_t uTagRequirement,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative);
+QCBORDecode_GetTBigNumberRaw(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative);
void
-QCBORDecode_GetTBigNumberRawInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative);
+QCBORDecode_GetTBigNumberRawInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative);
void
-QCBORDecode_GetTBigNumberRawInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative);
+QCBORDecode_GetTBigNumberRawInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative);
@@ -759,7 +765,7 @@
* @brief Decode the next item as a decimal fraction.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pnMantissa The mantissa.
* @param[out] pnExponent The base 10 exponent.
*
@@ -789,9 +795,9 @@
*
* mantissa * ( 10 ** exponent )
*
- * Various format and type issues will result in @ref QCBOR_ERR_BAD_EXP_AND_MANTISSA
- * being set. See @ref Decode-Errors-Overview "Decode Errors
- * Overview".
+ * Various format and type issues will result in @ref
+ * QCBOR_ERR_BAD_EXP_AND_MANTISSA being set. See @ref
+ * Decode-Errors-Overview "Decode Errors Overview".
*
* See also QCBORDecode_GetInt64ConvertAll(),
* QCBORDecode_GetUInt64ConvertAll() and
@@ -806,30 +812,30 @@
* preceded by by a tag number or if the mantissa is a big number.
*/
void
-QCBORDecode_GetTDecimalFraction(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent);
+QCBORDecode_GetTDecimalFraction(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTDecimalFractionInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent);
+QCBORDecode_GetTDecimalFractionInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTDecimalFractionInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent);
+QCBORDecode_GetTDecimalFractionInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent);
/**
* @brief Decode the next item as a decimal fraction with a big number mantissa.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[in] MantissaBuffer The buffer in which to put the mantissa.
* @param[out] pMantissa The big num mantissa.
* @param[out] pbMantissaIsNegative Is @c true if @c pMantissa is negative.
@@ -850,41 +856,42 @@
* fractions.
*
* See also @ref CBOR_TAG_DECIMAL_FRACTION,
- * QCBOREncode_AddTDecimalFractionBigMantissa(), @ref QCBOR_TYPE_DECIMAL_FRACTION
- * and QCBORDecode_GetTDecimalFraction().
+ * QCBOREncode_AddTDecimalFractionBigMantissa(), @ref
+ * QCBOR_TYPE_DECIMAL_FRACTION and QCBORDecode_GetTDecimalFraction().
*/
void
-QCBORDecode_GetTDecimalFractionBigMantissa(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTDecimalFractionBigMantissa(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTDecimalFractionBigMantissaInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pbMantissaIsNegative,
- bool *pbIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTDecimalFractionBigMantissaInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pbMantissaIsNegative,
+ bool *pbIsNegative,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTDecimalFractionBigMantissaInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTDecimalFractionBigMantissaInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
/**
- * @brief Decode the next item as a decimal fraction with a big number mantissa raw.
+ * @brief Decode the next item as a decimal fraction with a big number.
+ * mantissa raw.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[in] MantissaBuffer The buffer in which to put the mantissa.
* @param[out] pMantissa The big num mantissa.
* @param[out] pbMantissaIsNegative Is @c true if @c pMantissa is negative.
@@ -905,41 +912,42 @@
* fractions.
*
* See also @ref CBOR_TAG_DECIMAL_FRACTION,
- * QCBOREncode_AddTDecimalFractionBigMantissaRaw(), @ref QCBOR_TYPE_DECIMAL_FRACTION
- * and QCBORDecode_GetTDecimalFractionBigMantissa().
+ * QCBOREncode_AddTDecimalFractionBigMantissaRaw(), @ref
+ * QCBOR_TYPE_DECIMAL_FRACTION and
+ * QCBORDecode_GetTDecimalFractionBigMantissa().
*/
void
-QCBORDecode_GetTDecimalFractionBigMantissaRaw(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTDecimalFractionBigMantissaRaw(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTDecimalFractionBigMantissaRawInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pbMantissaIsNegative,
- bool *pbIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTDecimalFractionBigMantissaRawInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pbMantissaIsNegative,
+ bool *pbIsNegative,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTDecimalFractionBigMantissaRawInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTDecimalFractionBigMantissaRawInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
/**
* @brief Decode the next item as a big float.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pnMantissa The mantissa.
* @param[out] pnExponent The base 2 exponent.
*
@@ -982,31 +990,31 @@
* preceded by by a tag number or if the mantissa is a big number.
*/
void
-QCBORDecode_GetTBigFloat(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent);
+QCBORDecode_GetTBigFloat(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTBigFloatInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent);
+QCBORDecode_GetTBigFloatInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTBigFloatInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent);
+QCBORDecode_GetTBigFloatInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent);
/**
* @brief Decode the next item as a big float with a big number mantissa.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[in] MantissaBuffer The buffer in which to put the mantissa.
* @param[out] pMantissa The big num mantissa.
* @param[out] pbMantissaIsNegative Is @c true if @c pMantissa is negative.
@@ -1017,46 +1025,46 @@
* size of @c MantissaBuffer.
*
* The encoded mantissa may be an integer or a big number. The
- * standard CBOR offset of 1 for negative is applied, so the mantissa can be used as
- * returned.
+ * standard CBOR offset of 1 for negative is applied, so the mantissa
+ * can be used as returned.
*
* See also @ref CBOR_TAG_BIGFLOAT,
* QCBOREncode_AddTBigFloatBigNumber(), @ref QCBOR_TYPE_BIGFLOAT and
* QCBORDecode_GetTBigFloat().
*/
void
-QCBORDecode_GetTBigFloatBigMantissa(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
-
+QCBORDecode_GetTBigFloatBigMantissa(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTBigFloatBigMantissaInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTBigFloatBigMantissaInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTBigFloatBigMantissaInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTBigFloatBigMantissaInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
/**
- * @brief Decode the next item as a big float with a big number mantissa with out offsetting the mantissa
+ * @brief Decode the next item as a big float with a big number mantissa
+ * with out offsetting the mantissa
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[in] MantissaBuffer The buffer in which to put the mantissa.
* @param[out] pMantissa The big num mantissa.
* @param[out] pbMantissaIsNegative Is @c true if @c pMantissa is negative.
@@ -1080,31 +1088,30 @@
* QCBORDecode_GetTBigFloat().
*/
void
-QCBORDecode_GetTBigFloatBigMantissaRaw(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
-
+QCBORDecode_GetTBigFloatBigMantissaRaw(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTBigFloatBigMantissaRawInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTBigFloatBigMantissaRawInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
void
-QCBORDecode_GetTBigFloatBigMantissaRawInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent);
+QCBORDecode_GetTBigFloatBigMantissaRawInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent);
#endif /* ! QCBOR_DISABLE_EXP_AND_MANTISSA */
@@ -1250,50 +1257,50 @@
/* Deprecated. Use QCBORDecode_GetTBigNumberRaw() instead. */
static void
-QCBORDecode_GetBignum(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pValue,
- bool *pbIsNegative);
+QCBORDecode_GetBignum(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pValue,
+ bool *pbIsNegative);
/* Deprecated. Use QCBORDecode_GetTBigNumberRawInMapN() instead. */
static void
-QCBORDecode_GetBignumInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pValue,
- bool *pbIsNegative);
+QCBORDecode_GetBignumInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pValue,
+ bool *pbIsNegative);
/* Deprecated. Use QCBORDecode_GetTBigNumberRawInMapSZ() instead. */
static void
-QCBORDecode_GetBignumInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pValue,
- bool *pbIsNegative);
+QCBORDecode_GetBignumInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pValue,
+ bool *pbIsNegative);
#ifndef QCBOR_CONFIG_DISABLE_EXP_AND_MANTISSA
/* Deprecated. Use QCBORDecode_GetTDecimalFraction() instead. */
static void
-QCBORDecode_GetDecimalFraction(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent);
+QCBORDecode_GetDecimalFraction(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent);
/* Deprecated. Use QCBORDecode_GetTDecimalFractionInMapN() instead. */
static void
-QCBORDecode_GetDecimalFractionInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent);
+QCBORDecode_GetDecimalFractionInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent);
/* Deprecated. Use QCBORDecode_GetTDecimalFractionInMapSZ() instead. */
static void
-QCBORDecode_GetDecimalFractionInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent);
+QCBORDecode_GetDecimalFractionInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent);
/* Deprecated. Use QCBORDecode_GetTDecimalFractionBigMantissaRaw() instead. */
/*
@@ -1309,7 +1316,7 @@
* correct and can be used instead of this. */
static void
QCBORDecode_GetDecimalFractionBig(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -1319,7 +1326,7 @@
static void
QCBORDecode_GetDecimalFractionBigInMapN(QCBORDecodeContext *pCtx,
int64_t nLabel,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
UsefulBuf MantissaBuffer,
UsefulBufC *pbMantissaIsNegative,
bool *pbIsNegative,
@@ -1329,7 +1336,7 @@
static void
QCBORDecode_GetDecimalFractionBigInMapSZ(QCBORDecodeContext *pCtx,
const char *szLabel,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -1338,7 +1345,7 @@
/* Deprecated. Use QCBORDecode_GetTBigFloat() instead. */
static void
QCBORDecode_GetBigFloat(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
int64_t *pnMantissa,
int64_t *pnExponent);
@@ -1346,7 +1353,7 @@
static void
QCBORDecode_GetBigFloatInMapN(QCBORDecodeContext *pCtx,
int64_t nLabel,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
int64_t *pnMantissa,
int64_t *pnExponent);
@@ -1354,14 +1361,14 @@
static void
QCBORDecode_GetBigFloatInMapSZ(QCBORDecodeContext *pCtx,
const char *szLabel,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
int64_t *pnMantissa,
int64_t *pnExponent);
/* Deprecated. Use QCBORDecode_GetTBigFloatBigMantissaRaw() instead. */
static void
QCBORDecode_GetBigFloatBig(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -1371,7 +1378,7 @@
static void
QCBORDecode_GetBigFloatBigInMapN(QCBORDecodeContext *pCtx,
int64_t nLabel,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -1381,7 +1388,7 @@
static void
QCBORDecode_GetBigFloatBigInMapSZ(QCBORDecodeContext *pCtx,
const char *szLabel,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -1474,36 +1481,6 @@
#endif /* ! USEFULBUF_DISABLE_ALL_FLOAT */
-/* Semi-private. See qcbor_number_decode.c */
-void
-QCBORDecode_Private_GetTaggedString(QCBORDecodeContext *pMe,
- uint8_t uTagRequirement,
- uint8_t uQCBOR_Type,
- uint64_t uTagNumber,
- UsefulBufC *pBstr);
-
-
-/* Semi-private. See qcbor_number_decode.c */
-void
-QCBORDecode_Private_GetTaggedStringInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- const uint8_t uQCBOR_Type,
- const uint64_t uTagNumber,
- UsefulBufC *pString);
-
-
-/* Semi-private. See qcbor_number_decode.c */
-void
-QCBORDecode_Private_GetTaggedStringInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- uint8_t uQCBOR_Type,
- uint64_t uTagNumber,
- UsefulBufC *pString);
-
-
-
static inline void
QCBORDecode_GetUInt64Convert(QCBORDecodeContext *pMe,
@@ -1722,20 +1699,20 @@
static inline void /* Deprecated */
-QCBORDecode_GetBignum(QCBORDecodeContext *pMe,
- uint8_t uTagRequirement,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetBignum(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORDecode_GetTBigNumberRaw(pMe, uTagRequirement, pBigNumber, pbIsNegative);
}
static inline void /* Deprecated */
-QCBORDecode_GetBignumInMapN(QCBORDecodeContext *pMe,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetBignumInMapN(QCBORDecodeContext *pMe,
+ int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORDecode_GetTBigNumberRawInMapN(pMe,
nLabel,
@@ -1745,11 +1722,11 @@
}
static inline void /* Deprecated */
-QCBORDecode_GetBignumInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetBignumInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORDecode_GetTBigNumberRawInMapSZ(pMe,
szLabel,
@@ -1760,10 +1737,10 @@
#ifndef QCBOR_CONFIG_DISABLE_EXP_AND_MANTISSA
static inline void /* Deprecated */
-QCBORDecode_GetDecimalFraction(QCBORDecodeContext *pMe,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetDecimalFraction(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORDecode_GetTDecimalFraction(pMe,
uTagRequirement,
@@ -1772,11 +1749,11 @@
}
static inline void /* Deprecated */
-QCBORDecode_GetDecimalFractionInMapN(QCBORDecodeContext *pMe,
- int64_t nLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetDecimalFractionInMapN(QCBORDecodeContext *pMe,
+ int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORDecode_GetTDecimalFractionInMapN(pMe,
nLabel,
@@ -1786,11 +1763,11 @@
}
static inline void /* Deprecated */
-QCBORDecode_GetDecimalFractionInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetDecimalFractionInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORDecode_GetTDecimalFractionInMapSZ(pMe,
szLabel,
@@ -1801,12 +1778,12 @@
static inline void /* Deprecated */
-QCBORDecode_GetDecimalFractionBig(QCBORDecodeContext *pMe,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent)
+QCBORDecode_GetDecimalFractionBig(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent)
{
QCBORDecode_GetTDecimalFractionBigMantissaRaw(pMe,
uTagRequirement,
@@ -1817,13 +1794,13 @@
}
static inline void /* Deprecated */
-QCBORDecode_GetDecimalFractionBigInMapN(QCBORDecodeContext *pMe,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent)
+QCBORDecode_GetDecimalFractionBigInMapN(QCBORDecodeContext *pMe,
+ int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent)
{
QCBORDecode_GetTDecimalFractionBigMantissaRawInMapN(pMe,
nLabel,
@@ -1837,7 +1814,7 @@
static inline void /* Deprecated */
QCBORDecode_GetDecimalFractionBigInMapSZ(QCBORDecodeContext *pMe,
const char *szLabel,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -1854,20 +1831,20 @@
}
static inline void /* Deprecated */
-QCBORDecode_GetBigFloat(QCBORDecodeContext *pMe,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetBigFloat(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORDecode_GetTBigFloat(pMe, uTagRequirement, pnMantissa, pnExponent);
}
static inline void /* Deprecated */
-QCBORDecode_GetBigFloatInMapN(QCBORDecodeContext *pMe,
- int64_t nLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetBigFloatInMapN(QCBORDecodeContext *pMe,
+ int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORDecode_GetTBigFloatInMapN(pMe,
nLabel,
@@ -1877,11 +1854,11 @@
}
static inline void /* Deprecated */
-QCBORDecode_GetBigFloatInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetBigFloatInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORDecode_GetTBigFloatInMapSZ(pMe,
szLabel,
@@ -1891,12 +1868,12 @@
}
static inline void /* Deprecated */
-QCBORDecode_GetBigFloatBig(QCBORDecodeContext *pMe,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent)
+QCBORDecode_GetBigFloatBig(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent)
{
QCBORDecode_GetTBigFloatBigMantissaRaw(pMe,
uTagRequirement,
@@ -1909,7 +1886,7 @@
static inline void /* Deprecated */
QCBORDecode_GetBigFloatBigInMapN(QCBORDecodeContext *pMe,
int64_t nLabel,
- uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -1925,13 +1902,13 @@
}
static inline void /* Deprecated */
-QCBORDecode_GetBigFloatBigInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent)
+QCBORDecode_GetBigFloatBigInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent)
{
QCBORDecode_GetTBigFloatBigMantissaRawInMapSZ(pMe,
szLabel,
diff --git a/inc/qcbor/qcbor_tag_decode.h b/inc/qcbor/qcbor_tag_decode.h
index 74128e1..7da46f0 100644
--- a/inc/qcbor/qcbor_tag_decode.h
+++ b/inc/qcbor/qcbor_tag_decode.h
@@ -119,29 +119,40 @@
* to work.
*/
+/**
+ * When decoding a particular tag like an epoch date, the tag number
+ * identifying it may be required to be present, or to be absent depending
+ * on the protocol design. It may also be optional. This enum tells the decoder
+ * what is required to decode a particular tagged type.
+ *
+ * See @ref Tag-Usage.
+ */
+enum QCBORDecodeTagReq {
+
+ /** The data item must be a tag of the expected type. It is an error
+ * if it is not. For example when calling QCBORDecode_GetEpochDate(),
+ * the data item must be an @ref CBOR_TAG_DATE_EPOCH tag.
+ */
+ QCBOR_TAG_REQUIREMENT_TAG = 0,
+
+ /** The data item must be of the type expected for content data type
+ * being fetched. It is an error if it is not. For example, when
+ * calling QCBORDecode_GetEpochDate() and it must not be an @ref
+ * CBOR_TAG_DATE_EPOCH tag. */
+ QCBOR_TAG_REQUIREMENT_NOT_A_TAG = 1,
+
+ /** Either of the above two are allowed. This allows implementation of
+ * being liberal in what you receive, but it is better if CBOR-based
+ * protocols pick one and stick to and not required the reciever to
+ * take either. */
+ QCBOR_TAG_REQUIREMENT_OPTIONAL_TAG = 2,
+
+ /** Add this into the above value if other tags not processed by QCBOR
+ * are to be allowed to surround the data item. */
+ QCBOR_TAG_REQUIREMENT_ALLOW_ADDITIONAL_TAGS = 0x80
+};
-/** The data item must be a tag of the expected type. It is an error
- * if it is not. For example when calling QCBORDecode_GetEpochDate(),
- * the data item must be an @ref CBOR_TAG_DATE_EPOCH tag. See
- * @ref Tag-Usage. */
-#define QCBOR_TAG_REQUIREMENT_TAG 0
-
-/** The data item must be of the type expected for content data type
- * being fetched. It is an error if it is not. For example, when
- * calling QCBORDecode_GetEpochDate() and it must not be an @ref
- * CBOR_TAG_DATE_EPOCH tag. See @ref Tag-Usage. */
-#define QCBOR_TAG_REQUIREMENT_NOT_A_TAG 1
-
-/** Either of the above two are allowed. This allows implementation of
- * being liberal in what you receive, but it is better if CBOR-based
- * protocols pick one and stick to and not required the reciever to
- * take either. See @ref Tag-Usage. */
-#define QCBOR_TAG_REQUIREMENT_OPTIONAL_TAG 2
-
-/** Add this into the above value if other tags not processed by QCBOR
- * are to be allowed to surround the data item. See @ref Tag-Usage. */
-#define QCBOR_TAG_REQUIREMENT_ALLOW_ADDITIONAL_TAGS 0x80
#ifndef QCBOR_DISABLE_TAGS
@@ -290,7 +301,7 @@
* @brief Decode some byte-string wrapped CBOR.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pBstr Pointer and length of byte-string wrapped CBOR (optional).
*
* This is for use on some CBOR that has been wrapped in a byte
@@ -338,21 +349,21 @@
* QCBORDecode_EnterArray().
*/
void
-QCBORDecode_EnterBstrWrapped(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pBstr);
+QCBORDecode_EnterBstrWrapped(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBstr);
void
-QCBORDecode_EnterBstrWrappedFromMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pBstr);
+QCBORDecode_EnterBstrWrappedFromMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBstr);
void
-QCBORDecode_EnterBstrWrappedFromMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pBstr);
+QCBORDecode_EnterBstrWrappedFromMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBstr);
/**
@@ -378,7 +389,7 @@
* @brief Decode the next item as a date string.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pDateString The decoded date.
*
* This decodes the standard CBOR date/time string tag, integer tag
@@ -387,27 +398,25 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* See also @ref CBOR_TAG_DATE_STRING, QCBOREncode_AddDateString() and
* @ref QCBOR_TYPE_DATE_STRING.
*/
static void
-QCBORDecode_GetDateString(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pDateString);
+QCBORDecode_GetDateString(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pDateString);
static void
-QCBORDecode_GetDateStringInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pDateString);
+QCBORDecode_GetDateStringInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pDateString);
static void
-QCBORDecode_GetDateStringInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pDateString);
+QCBORDecode_GetDateStringInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pDateString);
/**
@@ -448,27 +457,25 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* See also @ref CBOR_TAG_DATE_EPOCH, QCBOREncode_AddTDateEpoch() and
* @ref QCBOR_TYPE_DATE_EPOCH.
*/
void
-QCBORDecode_GetEpochDate(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- int64_t *pnTime);
+QCBORDecode_GetEpochDate(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnTime);
void
-QCBORDecode_GetEpochDateInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- int64_t *pnTime);
+QCBORDecode_GetEpochDateInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnTime);
void
-QCBORDecode_GetEpochDateInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- int64_t *pnTime);
+QCBORDecode_GetEpochDateInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnTime);
@@ -476,7 +483,7 @@
* @brief Decode the next item as a date-only string.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pDateString The decoded date.
*
* This decodes the CBOR date-only string tag, integer tag number of
@@ -485,34 +492,32 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* See also @ref CBOR_TAG_DAYS_STRING, QCBOREncode_AddDaysString() and
* @ref QCBOR_TYPE_DAYS_STRING.
*/
static void
-QCBORDecode_GetDaysString(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pDateString);
+QCBORDecode_GetDaysString(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pDateString);
static void
-QCBORDecode_GetDaysStringInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pDateString);
+QCBORDecode_GetDaysStringInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pDateString);
static void
-QCBORDecode_GetDaysStringInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pDateString);
+QCBORDecode_GetDaysStringInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pDateString);
/**
* @brief Decode the next item as an days-count epoch date.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pnDays The decoded epoch date.
*
* This decodes the CBOR epoch date tag, integer tag number of 100, or
@@ -522,34 +527,32 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* See also @ref CBOR_TAG_DAYS_EPOCH, QCBOREncode_AddTDaysEpoch() and
* @ref QCBOR_TYPE_DAYS_EPOCH.
*/
void
-QCBORDecode_GetEpochDays(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- int64_t *pnDays);
+QCBORDecode_GetEpochDays(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnDays);
void
-QCBORDecode_GetEpochDaysInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- int64_t *pnDays);
+QCBORDecode_GetEpochDaysInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnDays);
void
-QCBORDecode_GetEpochDaysInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- int64_t *pnDays);
+QCBORDecode_GetEpochDaysInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnDays);
/**
* @brief Decode the next item as a URI.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pURI The decoded URI.
*
* This decodes a standard CBOR URI tag, integer tag number of 32, or
@@ -558,34 +561,32 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* See also @ref CBOR_TAG_URI, QCBOREncode_AddTURI() and
* @ref QCBOR_TYPE_URI.
*/
static void
-QCBORDecode_GetURI(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pURI);
+QCBORDecode_GetURI(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pURI);
static void
-QCBORDecode_GetURIInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pURI);
+QCBORDecode_GetURIInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pURI);
static void
-QCBORDecode_GetURIInMapSZ(QCBORDecodeContext *pCtx,
- const char * szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pURI);
+QCBORDecode_GetURIInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pURI);
/**
* @brief Decode the next item as base64 encoded text.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pB64Text The decoded base64 text.
*
* This decodes a standard CBOR base64 tag, integer tag number of 34,
@@ -594,35 +595,33 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* Note that this does not actually remove the base64 encoding.
*
* See also @ref CBOR_TAG_B64, QCBOREncode_AddB64Text() and
* @ref QCBOR_TYPE_BASE64.
*/
static void
-QCBORDecode_GetB64(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pB64Text);
+QCBORDecode_GetB64(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text);
static void
-QCBORDecode_GetB64InMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pB64Text);
+QCBORDecode_GetB64InMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text);
static void
-QCBORDecode_GetB64InMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pB64Text);
+QCBORDecode_GetB64InMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text);
/**
* @brief Decode the next item as base64URL encoded text.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pB64Text The decoded base64 text.
*
* This decodes a standard CBOR base64url tag, integer tag number of
@@ -631,35 +630,33 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* Note that this does not actually remove the base64url encoding.
*
* See also @ref CBOR_TAG_B64URL, QCBOREncode_AddTB64URLText() and
* @ref QCBOR_TYPE_BASE64URL.
*/
static void
-QCBORDecode_GetB64URL(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pB64Text);
+QCBORDecode_GetB64URL(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text);
static void
-QCBORDecode_GetB64URLInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pB64Text);
+QCBORDecode_GetB64URLInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text);
static void
-QCBORDecode_GetB64URLInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pB64Text);
+QCBORDecode_GetB64URLInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text);
/**
* @brief Decode the next item as a regular expression.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pRegex The decoded regular expression.
*
* This decodes a standard CBOR regex tag, integer tag number of 35,
@@ -668,34 +665,32 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* See also @ref CBOR_TAG_REGEX, QCBOREncode_AddTRegex() and
* @ref QCBOR_TYPE_REGEX.
*/
static void
-QCBORDecode_GetRegex(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pRegex);
+QCBORDecode_GetRegex(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pRegex);
static void
-QCBORDecode_GetRegexInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pRegex);
+QCBORDecode_GetRegexInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pRegex);
static void
-QCBORDecode_GetRegexInMapSZ(QCBORDecodeContext *pCtx,
- const char * szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pRegex);
+QCBORDecode_GetRegexInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pRegex);
/**
* @brief Decode the next item as a MIME message.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
* @param[out] pMessage The decoded regular expression.
* @param[out] pbIsTag257 @c true if tag was 257. May be @c NULL.
*
@@ -705,8 +700,6 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* The MIME message itself is not parsed.
*
* This decodes both tag 36 and 257. If it is tag 257, pbIsTag257 is
@@ -723,32 +716,31 @@
* for a discussion of line endings in CBOR.
*/
void
-QCBORDecode_GetMIMEMessage(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pMessage,
- bool *pbIsTag257);
-
- void
-QCBORDecode_GetMIMEMessageInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pMessage,
- bool *pbIsTag257);
-
+QCBORDecode_GetMIMEMessage(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pMessage,
+ bool *pbIsTag257);
void
-QCBORDecode_GetMIMEMessageInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pMessage,
- bool *pbIsTag257);
+QCBORDecode_GetMIMEMessageInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pMessage,
+ bool *pbIsTag257);
+
+void
+QCBORDecode_GetMIMEMessageInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pMessage,
+ bool *pbIsTag257);
/**
* @brief Decode the next item as a UUID.
*
* @param[in] pCtx The decode context.
- * @param[in] uTagRequirement One of @c QCBOR_TAG_REQUIREMENT_XXX.
- * @param[out] pUUID The decoded UUID
+ * @param[in] uTagRequirement See @ref QCBORDecodeTagReq.
+ * @param[out] pUUID The decoded UUID.
*
* This decodes a standard CBOR UUID tag, integer tag number of 37, or
* encoded CBOR that is not a tag, that is a UUID encoded in a byte
@@ -756,27 +748,25 @@
*
* Please see @ref Decode-Errors-Overview "Decode Errors Overview".
*
- * See @ref Tag-Usage for discussion on tag requirements.
- *
* See also @ref CBOR_TAG_BIN_UUID, QCBOREncode_AddTBinaryUUID() and
* @ref QCBOR_TYPE_UUID.
*/
static void
-QCBORDecode_GetBinaryUUID(QCBORDecodeContext *pCtx,
- uint8_t uTagRequirement,
- UsefulBufC *pUUID);
+QCBORDecode_GetBinaryUUID(QCBORDecodeContext *pCtx,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pUUID);
static void
-QCBORDecode_GetBinaryUUIDInMapN(QCBORDecodeContext *pCtx,
- int64_t nLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pUUID);
+QCBORDecode_GetBinaryUUIDInMapN(QCBORDecodeContext *pCtx,
+ int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pUUID);
static void
-QCBORDecode_GetBinaryUUIDInMapSZ(QCBORDecodeContext *pCtx,
- const char *szLabel,
- uint8_t uTagRequirement,
- UsefulBufC *pUUID);
+QCBORDecode_GetBinaryUUIDInMapSZ(QCBORDecodeContext *pCtx,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pUUID);
@@ -1120,35 +1110,35 @@
/* Semi-private used by public inline functions. See qcbor_tag_decode.c */
void
-QCBORDecode_Private_GetTaggedString(QCBORDecodeContext *pMe,
- uint8_t uTagRequirement,
- uint8_t uQCBOR_Type,
- uint64_t uTagNumber,
- UsefulBufC *pBstr);
+QCBORDecode_Private_GetTaggedString(QCBORDecodeContext *pMe,
+ enum QCBORDecodeTagReq uTagRequirement,
+ uint8_t uQCBOR_Type,
+ uint64_t uTagNumber,
+ UsefulBufC *pBstr);
/* Semi-private used by public inline functions. See qcbor_tag_decode.c */
void
-QCBORDecode_Private_GetTaggedStringInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- const uint8_t uQCBOR_Type,
- const uint64_t uTagNumber,
- UsefulBufC *pString);
+QCBORDecode_Private_GetTaggedStringInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ const uint8_t uQCBOR_Type,
+ const uint64_t uTagNumber,
+ UsefulBufC *pString);
/* Semi-private used by public inline functions. See qcbor_tag_decode.c */
void
-QCBORDecode_Private_GetTaggedStringInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- uint8_t uQCBOR_Type,
- uint64_t uTagNumber,
- UsefulBufC *pString);
+QCBORDecode_Private_GetTaggedStringInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ uint8_t uQCBOR_Type,
+ uint64_t uTagNumber,
+ UsefulBufC *pString);
/* Semi-private function. See qcbor_tag_decode.c */
void
QCBORDecode_Private_ProcessTagItemMulti(QCBORDecodeContext *pMe,
QCBORItem *pItem,
- const uint8_t uTagRequirement,
+ enum QCBORDecodeTagReq uTagRequirement,
const uint8_t uQCBORTypes[],
const uint64_t uTagNumbers[],
QCBORTagContentCallBack *pfCB,
@@ -1158,7 +1148,7 @@
void
QCBORDecode_Private_ProcessTagItem(QCBORDecodeContext *pMe,
QCBORItem *pItem,
- const uint8_t uTagRequirement,
+ enum QCBORDecodeTagReq uTagRequirement,
const uint8_t uQCBORTypes[],
const uint64_t uTagNumber,
QCBORTagContentCallBack *pfCB,
@@ -1181,9 +1171,9 @@
static inline void
-QCBORDecode_GetDateString(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBufC *pValue)
+QCBORDecode_GetDateString(QCBORDecodeContext *pMe,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pValue)
{
QCBORDecode_Private_GetTaggedString(pMe,
uTagRequirement,
@@ -1193,10 +1183,10 @@
}
static inline void
-QCBORDecode_GetDateStringInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pText)
+QCBORDecode_GetDateStringInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pText)
{
QCBORDecode_Private_GetTaggedStringInMapN(pMe,
nLabel,
@@ -1207,10 +1197,10 @@
}
static inline void
-QCBORDecode_GetDateStringInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pText)
+QCBORDecode_GetDateStringInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pText)
{
QCBORDecode_Private_GetTaggedStringInMapSZ(pMe,
szLabel,
@@ -1221,9 +1211,9 @@
}
static inline void
-QCBORDecode_GetDaysString(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBufC *pValue)
+QCBORDecode_GetDaysString(QCBORDecodeContext *pMe,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pValue)
{
QCBORDecode_Private_GetTaggedString(pMe,
uTagRequirement,
@@ -1233,10 +1223,10 @@
}
static inline void
-QCBORDecode_GetDaysStringInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pText)
+QCBORDecode_GetDaysStringInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pText)
{
QCBORDecode_Private_GetTaggedStringInMapN(pMe,
nLabel,
@@ -1247,10 +1237,10 @@
}
static inline void
-QCBORDecode_GetDaysStringInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pText)
+QCBORDecode_GetDaysStringInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pText)
{
QCBORDecode_Private_GetTaggedStringInMapSZ(pMe,
szLabel,
@@ -1263,9 +1253,9 @@
static inline void
-QCBORDecode_GetURI(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBufC *pUUID)
+QCBORDecode_GetURI(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pUUID)
{
QCBORDecode_Private_GetTaggedString(pMe,
uTagRequirement,
@@ -1275,10 +1265,10 @@
}
static inline void
-QCBORDecode_GetURIInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pUUID)
+QCBORDecode_GetURIInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pUUID)
{
QCBORDecode_Private_GetTaggedStringInMapN(pMe,
nLabel,
@@ -1289,10 +1279,10 @@
}
static inline void
-QCBORDecode_GetURIInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pUUID)
+QCBORDecode_GetURIInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pUUID)
{
QCBORDecode_Private_GetTaggedStringInMapSZ(pMe,
szLabel,
@@ -1304,9 +1294,9 @@
static inline void
-QCBORDecode_GetB64(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBufC *pB64Text)
+QCBORDecode_GetB64(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text)
{
QCBORDecode_Private_GetTaggedString(pMe,
uTagRequirement,
@@ -1316,10 +1306,10 @@
}
static inline void
-QCBORDecode_GetB64InMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pB64Text)
+QCBORDecode_GetB64InMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text)
{
QCBORDecode_Private_GetTaggedStringInMapN(pMe,
nLabel,
@@ -1330,10 +1320,10 @@
}
static inline void
-QCBORDecode_GetB64InMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pB64Text)
+QCBORDecode_GetB64InMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text)
{
QCBORDecode_Private_GetTaggedStringInMapSZ(pMe,
szLabel,
@@ -1346,7 +1336,7 @@
static inline void
QCBORDecode_GetB64URL(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
UsefulBufC *pB64Text)
{
QCBORDecode_Private_GetTaggedString(pMe,
@@ -1357,10 +1347,10 @@
}
static inline void
-QCBORDecode_GetB64URLInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pB64Text)
+QCBORDecode_GetB64URLInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text)
{
QCBORDecode_Private_GetTaggedStringInMapN(pMe,
nLabel,
@@ -1371,10 +1361,10 @@
}
static inline void
-QCBORDecode_GetB64URLInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pB64Text)
+QCBORDecode_GetB64URLInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pB64Text)
{
QCBORDecode_Private_GetTaggedStringInMapSZ(pMe,
szLabel,
@@ -1386,9 +1376,9 @@
static inline void
-QCBORDecode_GetRegex(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBufC *pRegex)
+QCBORDecode_GetRegex(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pRegex)
{
QCBORDecode_Private_GetTaggedString(pMe,
uTagRequirement,
@@ -1398,24 +1388,24 @@
}
static inline void
-QCBORDecode_GetRegexInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pRegex)
+QCBORDecode_GetRegexInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pRegex)
{
QCBORDecode_Private_GetTaggedStringInMapN(pMe,
- nLabel,
- uTagRequirement,
- QCBOR_TYPE_REGEX,
- CBOR_TAG_REGEX,
- pRegex);
+ nLabel,
+ uTagRequirement,
+ QCBOR_TYPE_REGEX,
+ CBOR_TAG_REGEX,
+ pRegex);
}
static inline void
-QCBORDecode_GetRegexInMapSZ(QCBORDecodeContext *pMe,
- const char * szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pRegex)
+QCBORDecode_GetRegexInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pRegex)
{
QCBORDecode_Private_GetTaggedStringInMapSZ(pMe,
szLabel,
@@ -1427,9 +1417,9 @@
static inline void
-QCBORDecode_GetBinaryUUID(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBufC *pUUID)
+QCBORDecode_GetBinaryUUID(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pUUID)
{
QCBORDecode_Private_GetTaggedString(pMe,
uTagRequirement,
@@ -1439,10 +1429,10 @@
}
static inline void
-QCBORDecode_GetBinaryUUIDInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pUUID)
+QCBORDecode_GetBinaryUUIDInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pUUID)
{
QCBORDecode_Private_GetTaggedStringInMapN(pMe,
nLabel,
@@ -1453,10 +1443,10 @@
}
static inline void
-QCBORDecode_GetBinaryUUIDInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pUUID)
+QCBORDecode_GetBinaryUUIDInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pUUID)
{
QCBORDecode_Private_GetTaggedStringInMapSZ(pMe,
szLabel,
diff --git a/src/qcbor_number_decode.c b/src/qcbor_number_decode.c
index 8c5e2f3..912d2f2 100644
--- a/src/qcbor_number_decode.c
+++ b/src/qcbor_number_decode.c
@@ -2041,12 +2041,12 @@
* numbers.
*/
static void
-QCBORDecode_Private_BigNumberRawMain(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- QCBORItem *pItem,
- UsefulBufC *pBignumber,
- bool *pbIsNegative,
- size_t uOffset)
+QCBORDecode_Private_BigNumberRawMain(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ QCBORItem *pItem,
+ UsefulBufC *pBignumber,
+ bool *pbIsNegative,
+ size_t uOffset)
{
QCBORDecode_Private_ProcessTagItemMulti(pMe,
pItem,
@@ -2069,13 +2069,13 @@
static void
-QCBORDecode_Private_BigNumberNoPreferredMain(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- QCBORItem *pItem,
- const size_t uOffset,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_Private_BigNumberNoPreferredMain(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ QCBORItem *pItem,
+ const size_t uOffset,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORDecode_Private_ProcessTagItemMulti(pMe,
pItem,
@@ -2093,13 +2093,13 @@
static void
-QCBORDecode_Private_BigNumberMain(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- QCBORItem *pItem,
- const size_t uOffset,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_Private_BigNumberMain(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ QCBORItem *pItem,
+ const size_t uOffset,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORDecode_Private_ProcessTagItemMulti(pMe,
pItem,
@@ -2118,11 +2118,11 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigNumber(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetTBigNumber(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORItem Item;
size_t uOffset;
@@ -2133,12 +2133,12 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigNumberInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetTBigNumberInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORItem Item;
size_t uOffset;
@@ -2155,12 +2155,12 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigNumberInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetTBigNumberInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORItem Item;
size_t uOffset;
@@ -2178,11 +2178,11 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigNumberNoPreferred(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetTBigNumberNoPreferred(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORItem Item;
size_t uOffset;
@@ -2193,12 +2193,12 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigNumberNoPreferredInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetTBigNumberNoPreferredInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORItem Item;
size_t uOffset;
@@ -2210,12 +2210,12 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigNumberNoPreferredInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBuf BigNumberBuf,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetTBigNumberNoPreferredInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBuf BigNumberBuf,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORItem Item;
size_t uOffset;
@@ -2228,10 +2228,10 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigNumberRaw(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBufC *pBignumber,
- bool *pbIsNegative)
+QCBORDecode_GetTBigNumberRaw(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBignumber,
+ bool *pbIsNegative)
{
QCBORItem Item;
size_t uOffset;
@@ -2247,11 +2247,11 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigNumberRawInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetTBigNumberRawInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORItem Item;
size_t uOffset;
@@ -2268,11 +2268,11 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigNumberRawInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pBigNumber,
- bool *pbIsNegative)
+QCBORDecode_GetTBigNumberRawInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBigNumber,
+ bool *pbIsNegative)
{
QCBORItem Item;
size_t uOffset;
@@ -2367,13 +2367,13 @@
* same in QCBOR v1 and v2.
*/
static void
-QCBORDecode_Private_ExpIntMantissaMain(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- const uint64_t uTagNumber,
- const size_t uOffset,
- QCBORItem *pItem,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_Private_ExpIntMantissaMain(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ const uint64_t uTagNumber,
+ const size_t uOffset,
+ QCBORItem *pItem,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORError uErr;
const uint8_t *qTypes;
@@ -2440,7 +2440,7 @@
static void
QCBORDecode_Private_ExpBigMantissaRawMain(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
const uint64_t uTagNumber,
const size_t uOffset,
QCBORItem *pItem,
@@ -2547,15 +2547,15 @@
* caller doesn't need to. This links more object code than QCBORDecode_Private_ProcessExpMantissaBig().
*/
static void
-QCBORDecode_Private_ExpBigMantissaMain(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- const uint64_t uTagNumber,
- const size_t uOffset,
- QCBORItem *pItem,
- const UsefulBuf BufferForMantissa,
- UsefulBufC *pMantissa,
- bool *pbIsNegative,
- int64_t *pnExponent)
+QCBORDecode_Private_ExpBigMantissaMain(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ const uint64_t uTagNumber,
+ const size_t uOffset,
+ QCBORItem *pItem,
+ const UsefulBuf BufferForMantissa,
+ UsefulBufC *pMantissa,
+ bool *pbIsNegative,
+ int64_t *pnExponent)
{
QCBORError uErr;
QCBORItem TempMantissa;
@@ -2632,10 +2632,10 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTDecimalFraction(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetTDecimalFraction(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
@@ -2653,11 +2653,11 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTDecimalFractionInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetTDecimalFractionInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
@@ -2676,11 +2676,11 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTDecimalFractionInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetTDecimalFractionInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
@@ -2698,12 +2698,12 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTDecimalFractionBigMantissa(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- const UsefulBuf MantissaBuffer,
- UsefulBufC *pMantissa,
- bool *pbMantissaIsNegative,
- int64_t *pnExponent)
+QCBORDecode_GetTDecimalFractionBigMantissa(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ const UsefulBuf MantissaBuffer,
+ UsefulBufC *pMantissa,
+ bool *pbMantissaIsNegative,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
@@ -2725,7 +2725,7 @@
void
QCBORDecode_GetTDecimalFractionBigMantissaInMapN(QCBORDecodeContext *pMe,
const int64_t nLabel,
- const uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
const UsefulBuf BufferForMantissa,
UsefulBufC *pMantissa,
bool *pbIsNegative,
@@ -2751,7 +2751,7 @@
void
QCBORDecode_GetTDecimalFractionBigMantissaInMapSZ(QCBORDecodeContext *pMe,
const char *szLabel,
- const uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
const UsefulBuf BufferForMantissa,
UsefulBufC *pMantissa,
bool *pbIsNegative,
@@ -2775,7 +2775,7 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
QCBORDecode_GetTDecimalFractionBigMantissaRaw(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
const UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -2799,13 +2799,13 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTDecimalFractionBigMantissaRawInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- const UsefulBuf BufferForMantissa,
- UsefulBufC *pMantissa,
- bool *pbIsNegative,
- int64_t *pnExponent)
+QCBORDecode_GetTDecimalFractionBigMantissaRawInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ const UsefulBuf BufferForMantissa,
+ UsefulBufC *pMantissa,
+ bool *pbIsNegative,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
@@ -2827,7 +2827,7 @@
void
QCBORDecode_GetTDecimalFractionBigMantissaRawInMapSZ(QCBORDecodeContext *pMe,
const char *szLabel,
- const uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
const UsefulBuf BufferForMantissa,
UsefulBufC *pMantissa,
bool *pbIsNegative,
@@ -2851,10 +2851,10 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigFloat(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetTBigFloat(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
@@ -2872,11 +2872,11 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigFloatInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetTBigFloatInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
@@ -2894,11 +2894,11 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigFloatInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- int64_t *pnMantissa,
- int64_t *pnExponent)
+QCBORDecode_GetTBigFloatInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnMantissa,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
@@ -2916,8 +2916,8 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigFloatBigMantissa(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
+QCBORDecode_GetTBigFloatBigMantissa(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
const UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -2944,7 +2944,7 @@
void
QCBORDecode_GetTBigFloatBigMantissaInMapN(QCBORDecodeContext *pMe,
const int64_t nLabel,
- const uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
const UsefulBuf BufferForMantissa,
UsefulBufC *pMantissa,
bool *pbIsNegative,
@@ -2968,13 +2968,13 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigFloatBigMantissaInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- const UsefulBuf BufferForMantissa,
- UsefulBufC *pMantissa,
- bool *pbIsNegative,
- int64_t *pnExponent)
+QCBORDecode_GetTBigFloatBigMantissaInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ const UsefulBuf BufferForMantissa,
+ UsefulBufC *pMantissa,
+ bool *pbIsNegative,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
@@ -2995,7 +2995,7 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
QCBORDecode_GetTBigFloatBigMantissaRaw(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
const UsefulBuf MantissaBuffer,
UsefulBufC *pMantissa,
bool *pbMantissaIsNegative,
@@ -3020,7 +3020,7 @@
void
QCBORDecode_GetTBigFloatBigMantissaRawInMapN(QCBORDecodeContext *pMe,
const int64_t nLabel,
- const uint8_t uTagRequirement,
+ const enum QCBORDecodeTagReq uTagRequirement,
const UsefulBuf BufferForMantissa,
UsefulBufC *pMantissa,
bool *pbIsNegative,
@@ -3044,13 +3044,13 @@
/* Public function, see qcbor/qcbor_number_decode.h */
void
-QCBORDecode_GetTBigFloatBigMantissaRawInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- const UsefulBuf BufferForMantissa,
- UsefulBufC *pMantissa,
- bool *pbIsNegative,
- int64_t *pnExponent)
+QCBORDecode_GetTBigFloatBigMantissaRawInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ const UsefulBuf BufferForMantissa,
+ UsefulBufC *pMantissa,
+ bool *pbIsNegative,
+ int64_t *pnExponent)
{
QCBORItem Item;
size_t uOffset;
diff --git a/src/qcbor_tag_decode.c b/src/qcbor_tag_decode.c
index 05fa90e..46da8a9 100644
--- a/src/qcbor_tag_decode.c
+++ b/src/qcbor_tag_decode.c
@@ -284,19 +284,20 @@
static QCBORError
-QCBORDecode_Private_CheckTagNType(QCBORDecodeContext *pMe,
- const QCBORItem *pItem,
- const size_t uOffset,
- const uint8_t *uQCBORTypes,
- const uint64_t *uTagNumbers,
- const uint8_t uTagRequirement,
- bool *bTypeMatched)
+QCBORDecode_Private_CheckTagNType(QCBORDecodeContext *pMe,
+ const QCBORItem *pItem,
+ const size_t uOffset,
+ const uint8_t *uQCBORTypes,
+ const uint64_t *uTagNumbers,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ bool *bTypeMatched)
{
const uint64_t *pQType;
const uint64_t *pTNum;
const uint8_t *pTypeNum;
- const int nTagReq = uTagRequirement & ~QCBOR_TAG_REQUIREMENT_ALLOW_ADDITIONAL_TAGS;
+ const enum QCBORDecodeTagReq nTagReq = (enum QCBORDecodeTagReq)((int)uTagRequirement & ~QCBOR_TAG_REQUIREMENT_ALLOW_ADDITIONAL_TAGS);
+
*bTypeMatched = false;
for(pTypeNum = uQCBORTypes; *pTypeNum != QCBOR_TYPE_NONE; pTypeNum++) {
@@ -366,7 +367,7 @@
void
QCBORDecode_Private_ProcessTagItemMulti(QCBORDecodeContext *pMe,
QCBORItem *pItem,
- const uint8_t uTagRequirement,
+ enum QCBORDecodeTagReq uTagRequirement,
const uint8_t uQCBORTypes[],
const uint64_t uTagNumbers[],
QCBORTagContentCallBack *pfCB,
@@ -408,7 +409,7 @@
void
QCBORDecode_Private_ProcessTagItem(QCBORDecodeContext *pMe,
QCBORItem *pItem,
- const uint8_t uTagRequirement,
+ enum QCBORDecodeTagReq uTagRequirement,
const uint8_t uQCBORTypes[],
const uint64_t uTagNumber,
QCBORTagContentCallBack *pfCB,
@@ -432,7 +433,7 @@
static void
QCBORDecode_Private_ProcessTagOne(QCBORDecodeContext *pMe,
QCBORItem *pItem,
- const uint8_t uTagRequirement,
+ enum QCBORDecodeTagReq uTagRequirement,
const uint8_t uQCBORType,
const uint64_t uTagNumber,
QCBORTagContentCallBack *pfCB,
@@ -454,11 +455,11 @@
void
-QCBORDecode_Private_GetTaggedString(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- const uint8_t uQCBOR_Type,
- const uint64_t uTagNumber,
- UsefulBufC *pStr)
+QCBORDecode_Private_GetTaggedString(QCBORDecodeContext *pMe,
+ enum QCBORDecodeTagReq uTagRequirement,
+ const uint8_t uQCBOR_Type,
+ const uint64_t uTagNumber,
+ UsefulBufC *pStr)
{
QCBORItem Item;
size_t uOffset;
@@ -496,12 +497,12 @@
* specification. If not, an error is set in the decode context.
*/
void
-QCBORDecode_Private_GetTaggedStringInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- const uint8_t uQCBOR_Type,
- const uint64_t uTagNumber,
- UsefulBufC *pString)
+QCBORDecode_Private_GetTaggedStringInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ const uint8_t uQCBOR_Type,
+ const uint64_t uTagNumber,
+ UsefulBufC *pString)
{
QCBORItem Item;
size_t uOffset;
@@ -541,12 +542,12 @@
* specification. If not, an error is set in the decode context.
*/
void
-QCBORDecode_Private_GetTaggedStringInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- uint8_t uQCBOR_Type,
- uint64_t uTagNumber,
- UsefulBufC *pString)
+QCBORDecode_Private_GetTaggedStringInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ uint8_t uQCBOR_Type,
+ uint64_t uTagNumber,
+ UsefulBufC *pString)
{
QCBORItem Item;
size_t uOffset;
@@ -588,11 +589,11 @@
* See QCBORDecode_EnterBstrWrapped() for details on uTagRequirement.
*/
static QCBORError
-QCBORDecode_Private_EnterBstrWrapped(QCBORDecodeContext *pMe,
- const QCBORItem *pItem,
- const uint8_t uTagRequirement,
- const size_t uOffset,
- UsefulBufC *pBstr)
+QCBORDecode_Private_EnterBstrWrapped(QCBORDecodeContext *pMe,
+ const QCBORItem *pItem,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ const size_t uOffset,
+ UsefulBufC *pBstr)
{
bool bTypeMatched;
QCBORError uError;
@@ -683,9 +684,9 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_EnterBstrWrapped(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBufC *pBstr)
+QCBORDecode_EnterBstrWrapped(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBstr)
{
QCBORItem Item;
size_t uOffset;
@@ -701,10 +702,10 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_EnterBstrWrappedFromMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pBstr)
+QCBORDecode_EnterBstrWrappedFromMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBstr)
{
QCBORItem Item;
size_t uOffset;
@@ -724,10 +725,10 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_EnterBstrWrappedFromMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pBstr)
+QCBORDecode_EnterBstrWrappedFromMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pBstr)
{
QCBORItem Item;
size_t uOffset;
@@ -778,9 +779,9 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_GetEpochDate(QCBORDecodeContext *pMe,
- uint8_t uTagRequirement,
- int64_t *pnTime)
+QCBORDecode_GetEpochDate(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnTime)
{
QCBORItem Item;
size_t uOffset;
@@ -799,10 +800,10 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_GetEpochDateInMapN(QCBORDecodeContext *pMe,
- int64_t nLabel,
- uint8_t uTagRequirement,
- int64_t *pnTime)
+QCBORDecode_GetEpochDateInMapN(QCBORDecodeContext *pMe,
+ int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnTime)
{
QCBORItem Item;
size_t uOffset;
@@ -825,10 +826,10 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_GetEpochDateInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- int64_t *pnTime)
+QCBORDecode_GetEpochDateInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnTime)
{
QCBORItem Item;
size_t uOffset;
@@ -851,9 +852,9 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_GetEpochDays(QCBORDecodeContext *pMe,
- uint8_t uTagRequirement,
- int64_t *pnDays)
+QCBORDecode_GetEpochDays(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnDays)
{
QCBORItem Item;
size_t uOffset;
@@ -872,10 +873,10 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_GetEpochDaysInMapN(QCBORDecodeContext *pMe,
- int64_t nLabel,
- uint8_t uTagRequirement,
- int64_t *pnDays)
+QCBORDecode_GetEpochDaysInMapN(QCBORDecodeContext *pMe,
+ int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnDays)
{
QCBORItem Item;
size_t uOffset;
@@ -898,10 +899,10 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_GetEpochDaysInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- uint8_t uTagRequirement,
- int64_t *pnDays)
+QCBORDecode_GetEpochDaysInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ int64_t *pnDays)
{
QCBORItem Item;
size_t uOffset;
@@ -925,12 +926,12 @@
static void
-QCBORDecode_Private_GetMIME(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- QCBORItem *pItem,
- UsefulBufC *pValue,
- bool *pbIsTag257,
- size_t uOffset)
+QCBORDecode_Private_GetMIME(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ QCBORItem *pItem,
+ UsefulBufC *pValue,
+ bool *pbIsTag257,
+ size_t uOffset)
{
QCBORError uErr;
@@ -964,10 +965,10 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_GetMIMEMessage(QCBORDecodeContext *pMe,
- const uint8_t uTagRequirement,
- UsefulBufC *pMessage,
- bool *pbIsTag257)
+QCBORDecode_GetMIMEMessage(QCBORDecodeContext *pMe,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pMessage,
+ bool *pbIsTag257)
{
QCBORItem Item;
size_t uOffset;
@@ -983,11 +984,11 @@
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_GetMIMEMessageInMapN(QCBORDecodeContext *pMe,
- const int64_t nLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pMessage,
- bool *pbIsTag257)
+QCBORDecode_GetMIMEMessageInMapN(QCBORDecodeContext *pMe,
+ const int64_t nLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pMessage,
+ bool *pbIsTag257)
{
QCBORItem Item;
size_t uOffset;
@@ -998,20 +999,20 @@
&Item,
&uOffset);
QCBORDecode_Private_GetMIME(pMe,
- uTagRequirement,
- &Item,
- pMessage,
- pbIsTag257,
- uOffset);
+ uTagRequirement,
+ &Item,
+ pMessage,
+ pbIsTag257,
+ uOffset);
}
/* Public function; see qcbor_tag_decode.h */
void
-QCBORDecode_GetMIMEMessageInMapSZ(QCBORDecodeContext *pMe,
- const char *szLabel,
- const uint8_t uTagRequirement,
- UsefulBufC *pMessage,
- bool *pbIsTag257)
+QCBORDecode_GetMIMEMessageInMapSZ(QCBORDecodeContext *pMe,
+ const char *szLabel,
+ const enum QCBORDecodeTagReq uTagRequirement,
+ UsefulBufC *pMessage,
+ bool *pbIsTag257)
{
QCBORItem Item;
size_t uOffset;
@@ -1022,11 +1023,11 @@
&Item,
&uOffset);
QCBORDecode_Private_GetMIME(pMe,
- uTagRequirement,
- &Item,
- pMessage,
- pbIsTag257,
- uOffset);
+ uTagRequirement,
+ &Item,
+ pMessage,
+ pbIsTag257,
+ uOffset);
}