Wirepas SDK
cbor.h File Reference

Go to the source code of this file.

Typedefs

typedef uint64_t CborTag
 
typedef CborError(* CborStreamFunction) (void *token, const char *fmt,...)
 

Functions

const CBOR_API char * cbor_error_string (CborError error)
 
CBOR_API void cbor_encoder_init (CborEncoder *encoder, uint8_t *buffer, size_t size, int flags)
 
CBOR_API CborError cbor_encode_uint (CborEncoder *encoder, uint64_t value)
 
CBOR_API CborError cbor_encode_int (CborEncoder *encoder, int64_t value)
 
CBOR_API CborError cbor_encode_negative_int (CborEncoder *encoder, uint64_t absolute_value)
 
CBOR_API CborError cbor_encode_simple_value (CborEncoder *encoder, uint8_t value)
 
CBOR_API CborError cbor_encode_tag (CborEncoder *encoder, CborTag tag)
 
CBOR_API CborError cbor_encode_text_string (CborEncoder *encoder, const char *string, size_t length)
 
static CborError cbor_encode_text_stringz (CborEncoder *encoder, const char *string)
 
CBOR_API CborError cbor_encode_byte_string (CborEncoder *encoder, const uint8_t *string, size_t length)
 
CBOR_API CborError cbor_encode_floating_point (CborEncoder *encoder, CborType fpType, const void *value)
 
static CborError cbor_encode_boolean (CborEncoder *encoder, bool value)
 
static CborError cbor_encode_null (CborEncoder *encoder)
 
static CborError cbor_encode_undefined (CborEncoder *encoder)
 
static CborError cbor_encode_half_float (CborEncoder *encoder, const void *value)
 
static CborError cbor_encode_float (CborEncoder *encoder, float value)
 
static CborError cbor_encode_double (CborEncoder *encoder, double value)
 
CBOR_API CborError cbor_encoder_create_array (CborEncoder *encoder, CborEncoder *arrayEncoder, size_t length)
 
CBOR_API CborError cbor_encoder_create_map (CborEncoder *encoder, CborEncoder *mapEncoder, size_t length)
 
CBOR_API CborError cbor_encoder_close_container (CborEncoder *encoder, const CborEncoder *containerEncoder)
 
CBOR_API CborError cbor_encoder_close_container_checked (CborEncoder *encoder, const CborEncoder *containerEncoder)
 
static uint8_t * _cbor_encoder_get_buffer_pointer (const CborEncoder *encoder)
 
static size_t cbor_encoder_get_buffer_size (const CborEncoder *encoder, const uint8_t *buffer)
 
static size_t cbor_encoder_get_extra_bytes_needed (const CborEncoder *encoder)
 
CBOR_API CborError cbor_parser_init (const uint8_t *buffer, size_t size, uint32_t flags, CborParser *parser, CborValue *it)
 
CBOR_API CborError cbor_value_validate_basic (const CborValue *it)
 
static bool cbor_value_at_end (const CborValue *it)
 
static const uint8_t * cbor_value_get_next_byte (const CborValue *it)
 
CBOR_API CborError cbor_value_advance_fixed (CborValue *it)
 
CBOR_API CborError cbor_value_advance (CborValue *it)
 
static bool cbor_value_is_container (const CborValue *it)
 
CBOR_API CborError cbor_value_enter_container (const CborValue *it, CborValue *recursed)
 
CBOR_API CborError cbor_value_leave_container (CborValue *it, const CborValue *recursed)
 
uint64_t _cbor_value_decode_int64_internal (const CborValue *value)
 
static uint64_t _cbor_value_extract_int64_helper (const CborValue *value)
 
static bool cbor_value_is_valid (const CborValue *value)
 
static CborType cbor_value_get_type (const CborValue *value)
 
static bool cbor_value_is_null (const CborValue *value)
 
static bool cbor_value_is_undefined (const CborValue *value)
 
static bool cbor_value_is_boolean (const CborValue *value)
 
static CborError cbor_value_get_boolean (const CborValue *value, bool *result)
 
static bool cbor_value_is_simple_type (const CborValue *value)
 
static CborError cbor_value_get_simple_type (const CborValue *value, uint8_t *result)
 
static bool cbor_value_is_integer (const CborValue *value)
 
static bool cbor_value_is_unsigned_integer (const CborValue *value)
 
static bool cbor_value_is_negative_integer (const CborValue *value)
 
static CborError cbor_value_get_raw_integer (const CborValue *value, uint64_t *result)
 
static CborError cbor_value_get_uint64 (const CborValue *value, uint64_t *result)
 
static CborError cbor_value_get_int64 (const CborValue *value, int64_t *result)
 
static CborError cbor_value_get_int (const CborValue *value, int *result)
 
CBOR_API CborError cbor_value_get_int64_checked (const CborValue *value, int64_t *result)
 
CBOR_API CborError cbor_value_get_int_checked (const CborValue *value, int *result)
 
static bool cbor_value_is_length_known (const CborValue *value)
 
static bool cbor_value_is_tag (const CborValue *value)
 
static CborError cbor_value_get_tag (const CborValue *value, CborTag *result)
 
CBOR_API CborError cbor_value_skip_tag (CborValue *it)
 
static bool cbor_value_is_byte_string (const CborValue *value)
 
static bool cbor_value_is_text_string (const CborValue *value)
 
static CborError cbor_value_get_string_length (const CborValue *value, size_t *length)
 
CborError _cbor_value_copy_string (const CborValue *value, void *buffer, size_t *buflen, CborValue *next)
 
CborError _cbor_value_dup_string (const CborValue *value, void **buffer, size_t *buflen, CborValue *next)
 
CBOR_API CborError cbor_value_calculate_string_length (const CborValue *value, size_t *length)
 
static CborError cbor_value_copy_text_string (const CborValue *value, char *buffer, size_t *buflen, CborValue *next)
 
static CborError cbor_value_copy_byte_string (const CborValue *value, uint8_t *buffer, size_t *buflen, CborValue *next)
 
static CborError cbor_value_dup_text_string (const CborValue *value, char **buffer, size_t *buflen, CborValue *next)
 
static CborError cbor_value_dup_byte_string (const CborValue *value, uint8_t **buffer, size_t *buflen, CborValue *next)
 
CBOR_API CborError cbor_value_text_string_equals (const CborValue *value, const char *string, bool *result)
 
static bool cbor_value_is_array (const CborValue *value)
 
static bool cbor_value_is_map (const CborValue *value)
 
static CborError cbor_value_get_array_length (const CborValue *value, size_t *length)
 
static CborError cbor_value_get_map_length (const CborValue *value, size_t *length)
 
CBOR_API CborError cbor_value_map_find_value (const CborValue *map, const char *string, CborValue *element)
 
static bool cbor_value_is_half_float (const CborValue *value)
 
CBOR_API CborError cbor_value_get_half_float (const CborValue *value, void *result)
 
static bool cbor_value_is_float (const CborValue *value)
 
static CborError cbor_value_get_float (const CborValue *value, float *result)
 
static bool cbor_value_is_double (const CborValue *value)
 
static CborError cbor_value_get_double (const CborValue *value, double *result)
 
CBOR_API CborError cbor_value_validate (const CborValue *it, uint32_t flags)
 
CBOR_API CborError cbor_value_to_pretty_stream (CborStreamFunction streamFunction, void *token, CborValue *value, int flags)
 
CBOR_API CborError cbor_value_to_pretty_advance_flags (FILE *out, CborValue *value, int flags)
 
CBOR_API CborError cbor_value_to_pretty_advance (FILE *out, CborValue *value)
 
static CborError cbor_value_to_pretty (FILE *out, const CborValue *value)
 

Data Structures

struct  CborEncoder
 
struct  CborParser
 
struct  CborValue
 
union  CborEncoder.data
 

Enumerations

enum  CborType {
  CborIntegerType = 0x00, CborByteStringType = 0x40, CborTextStringType = 0x60, CborArrayType = 0x80,
  CborMapType = 0xa0, CborTagType = 0xc0, CborSimpleType = 0xe0, CborBooleanType = 0xf5,
  CborNullType = 0xf6, CborUndefinedType = 0xf7, CborHalfFloatType = 0xf9, CborFloatType = 0xfa,
  CborDoubleType = 0xfb, CborInvalidType = 0xff
}
 
enum  CborKnownTags {
  CborDateTimeStringTag = 0, CborUnixTime_tTag = 1, CborPositiveBignumTag = 2, CborNegativeBignumTag = 3,
  CborDecimalTag = 4, CborBigfloatTag = 5, CborCOSE_Encrypt0Tag = 16, CborCOSE_Mac0Tag = 17,
  CborCOSE_Sign1Tag = 18, CborExpectedBase64urlTag = 21, CborExpectedBase64Tag = 22, CborExpectedBase16Tag = 23,
  CborEncodedCborTag = 24, CborUrlTag = 32, CborBase64urlTag = 33, CborBase64Tag = 34,
  CborRegularExpressionTag = 35, CborMimeMessageTag = 36, CborCOSE_EncryptTag = 96, CborCOSE_MacTag = 97,
  CborCOSE_SignTag = 98, CborSignatureTag = 55799
}
 
enum  CborError {
  CborNoError = 0, CborUnknownError, CborErrorUnknownLength, CborErrorAdvancePastEOF,
  CborErrorIO, CborErrorGarbageAtEnd = 256, CborErrorUnexpectedEOF, CborErrorUnexpectedBreak,
  CborErrorUnknownType, CborErrorIllegalType, CborErrorIllegalNumber, CborErrorIllegalSimpleType,
  CborErrorUnknownSimpleType = 512, CborErrorUnknownTag, CborErrorInappropriateTagForType, CborErrorDuplicateObjectKeys,
  CborErrorInvalidUtf8TextString, CborErrorExcludedType, CborErrorExcludedValue, CborErrorImproperValue,
  CborErrorOverlongEncoding, CborErrorMapKeyNotString, CborErrorMapNotSorted, CborErrorMapKeysNotUnique,
  CborErrorTooManyItems = 768, CborErrorTooFewItems, CborErrorDataTooLarge = 1024, CborErrorNestingTooDeep,
  CborErrorUnsupportedType, CborErrorJsonObjectKeyIsAggregate = 1280, CborErrorJsonObjectKeyNotString, CborErrorJsonNotImplemented,
  CborErrorOutOfMemory = (int) (~0U / 2 + 1), CborErrorInternalError = (int) (~0U / 2)
}
 
enum  CborParserIteratorFlags {
  CborIteratorFlag_IntegerValueTooLarge = 0x01, CborIteratorFlag_NegativeInteger = 0x02, CborIteratorFlag_IteratingStringChunks = 0x02, CborIteratorFlag_UnknownLength = 0x04,
  CborIteratorFlag_ContainerIsMap = 0x20
}
 
enum  CborValidationFlags {
  CborValidateShortestIntegrals = 0x0001, CborValidateShortestFloatingPoint = 0x0002, CborValidateShortestNumbers = CborValidateShortestIntegrals | CborValidateShortestFloatingPoint, CborValidateNoIndeterminateLength = 0x0100,
  CborValidateMapIsSorted = 0x0200 | CborValidateNoIndeterminateLength, CborValidateCanonicalFormat = 0x0fff, CborValidateMapKeysAreUnique = 0x1000 | CborValidateMapIsSorted, CborValidateTagUse = 0x2000,
  CborValidateUtf8 = 0x4000, CborValidateStrictMode = 0xfff00, CborValidateMapKeysAreString = 0x100000, CborValidateNoUndefined = 0x200000,
  CborValidateNoTags = 0x400000, CborValidateFiniteFloatingPoint = 0x800000, CborValidateNoUnknownSimpleTypesSA = 0x4000000, CborValidateNoUnknownSimpleTypes = 0x8000000 | CborValidateNoUnknownSimpleTypesSA,
  CborValidateNoUnknownTagsSA = 0x10000000, CborValidateNoUnknownTagsSR = 0x20000000 | CborValidateNoUnknownTagsSA, CborValidateNoUnknownTags = 0x40000000 | CborValidateNoUnknownTagsSR, CborValidateCompleteData = (int)0x80000000,
  CborValidateStrictest = (int)~0U, CborValidateBasic = 0
}
 
enum  CborPrettyFlags {
  CborPrettyNumericEncodingIndicators = 0x01, CborPrettyTextualEncodingIndicators = 0, CborPrettyIndicateIndeterminateLength = 0x02, CborPrettyIndicateIndetermineLength = CborPrettyIndicateIndeterminateLength,
  CborPrettyIndicateOverlongNumbers = 0x04, CborPrettyShowStringFragments = 0x100, CborPrettyMergeStringFragments = 0, CborPrettyDefaultFlags = CborPrettyIndicateIndeterminateLength
}
 

Macros

#define TINYCBOR_VERSION   ((TINYCBOR_VERSION_MAJOR << 16) | (TINYCBOR_VERSION_MINOR << 8) | TINYCBOR_VERSION_PATCH)
 
#define SIZE_MAX   ((size_t)-1)
 
#define CBOR_PRIVATE_API
 
#define CBOR_INLINE_API   static CBOR_INLINE
 
#define CBOR_INLINE
 
#define CborDateTimeStringTag   CborDateTimeStringTag
 
#define CborUnixTime_tTag   CborUnixTime_tTag
 
#define CborPositiveBignumTag   CborPositiveBignumTag
 
#define CborNegativeBignumTag   CborNegativeBignumTag
 
#define CborDecimalTag   CborDecimalTag
 
#define CborBigfloatTag   CborBigfloatTag
 
#define CborCOSE_Encrypt0Tag   CborCOSE_Encrypt0Tag
 
#define CborCOSE_Mac0Tag   CborCOSE_Mac0Tag
 
#define CborCOSE_Sign1Tag   CborCOSE_Sign1Tag
 
#define CborExpectedBase64urlTag   CborExpectedBase64urlTag
 
#define CborExpectedBase64Tag   CborExpectedBase64Tag
 
#define CborExpectedBase16Tag   CborExpectedBase16Tag
 
#define CborEncodedCborTag   CborEncodedCborTag
 
#define CborUrlTag   CborUrlTag
 
#define CborBase64urlTag   CborBase64urlTag
 
#define CborBase64Tag   CborBase64Tag
 
#define CborRegularExpressionTag   CborRegularExpressionTag
 
#define CborMimeMessageTag   CborMimeMessageTag
 
#define CborCOSE_EncryptTag   CborCOSE_EncryptTag
 
#define CborCOSE_MacTag   CborCOSE_MacTag
 
#define CborCOSE_SignTag   CborCOSE_SignTag
 
#define CborSignatureTag   CborSignatureTag
 

Variables

static const size_t CborIndefiniteLength = ((size_t)-1)
 

Typedef Documentation

◆ CborStreamFunction

typedef CborError(* CborStreamFunction) (void *token, const char *fmt,...)

Definition at line 582 of file cbor.h.

◆ CborTag

typedef uint64_t CborTag

Definition at line 100 of file cbor.h.

Function Documentation

◆ _cbor_encoder_get_buffer_pointer()

static uint8_t* _cbor_encoder_get_buffer_pointer ( const CborEncoder encoder)
static

Definition at line 250 of file cbor.h.

251 {
252  return encoder->data.ptr;
253 }

◆ _cbor_value_copy_string()

CborError _cbor_value_copy_string ( const CborValue value,
void *  buffer,
size_t *  buflen,
CborValue next 
)

◆ _cbor_value_decode_int64_internal()

uint64_t _cbor_value_decode_int64_internal ( const CborValue value)

◆ _cbor_value_dup_string()

CborError _cbor_value_dup_string ( const CborValue value,
void **  buffer,
size_t *  buflen,
CborValue next 
)

◆ _cbor_value_extract_int64_helper()

static uint64_t _cbor_value_extract_int64_helper ( const CborValue value)
static

Definition at line 310 of file cbor.h.

311 {
313  _cbor_value_decode_int64_internal(value) : value->extra;
314 }

◆ cbor_encode_boolean()

static CborError cbor_encode_boolean ( CborEncoder encoder,
bool  value 
)
static

Definition at line 231 of file cbor.h.

232 { return cbor_encode_simple_value(encoder, (int)value - 1 + (CborBooleanType & 0x1f)); }

◆ cbor_encode_byte_string()

CBOR_API CborError cbor_encode_byte_string ( CborEncoder encoder,
const uint8_t *  string,
size_t  length 
)

◆ cbor_encode_double()

static CborError cbor_encode_double ( CborEncoder encoder,
double  value 
)
static

Definition at line 242 of file cbor.h.

243 { return cbor_encode_floating_point(encoder, CborDoubleType, &value); }

◆ cbor_encode_float()

static CborError cbor_encode_float ( CborEncoder encoder,
float  value 
)
static

Definition at line 240 of file cbor.h.

241 { return cbor_encode_floating_point(encoder, CborFloatType, &value); }

◆ cbor_encode_floating_point()

CBOR_API CborError cbor_encode_floating_point ( CborEncoder encoder,
CborType  fpType,
const void *  value 
)

◆ cbor_encode_half_float()

static CborError cbor_encode_half_float ( CborEncoder encoder,
const void *  value 
)
static

Definition at line 238 of file cbor.h.

239 { return cbor_encode_floating_point(encoder, CborHalfFloatType, value); }

◆ cbor_encode_int()

CBOR_API CborError cbor_encode_int ( CborEncoder encoder,
int64_t  value 
)

◆ cbor_encode_negative_int()

CBOR_API CborError cbor_encode_negative_int ( CborEncoder encoder,
uint64_t  absolute_value 
)

◆ cbor_encode_null()

static CborError cbor_encode_null ( CborEncoder encoder)
static

Definition at line 233 of file cbor.h.

234 { return cbor_encode_simple_value(encoder, CborNullType & 0x1f); }

◆ cbor_encode_simple_value()

CBOR_API CborError cbor_encode_simple_value ( CborEncoder encoder,
uint8_t  value 
)

◆ cbor_encode_tag()

CBOR_API CborError cbor_encode_tag ( CborEncoder encoder,
CborTag  tag 
)

◆ cbor_encode_text_string()

CBOR_API CborError cbor_encode_text_string ( CborEncoder encoder,
const char *  string,
size_t  length 
)

◆ cbor_encode_text_stringz()

static CborError cbor_encode_text_stringz ( CborEncoder encoder,
const char *  string 
)
static

Definition at line 226 of file cbor.h.

227 { return cbor_encode_text_string(encoder, string, strlen(string)); }

◆ cbor_encode_uint()

CBOR_API CborError cbor_encode_uint ( CborEncoder encoder,
uint64_t  value 
)

◆ cbor_encode_undefined()

static CborError cbor_encode_undefined ( CborEncoder encoder)
static

Definition at line 235 of file cbor.h.

236 { return cbor_encode_simple_value(encoder, CborUndefinedType & 0x1f); }

◆ cbor_encoder_close_container()

CBOR_API CborError cbor_encoder_close_container ( CborEncoder encoder,
const CborEncoder containerEncoder 
)

◆ cbor_encoder_close_container_checked()

CBOR_API CborError cbor_encoder_close_container_checked ( CborEncoder encoder,
const CborEncoder containerEncoder 
)

◆ cbor_encoder_create_array()

CBOR_API CborError cbor_encoder_create_array ( CborEncoder encoder,
CborEncoder arrayEncoder,
size_t  length 
)

◆ cbor_encoder_create_map()

CBOR_API CborError cbor_encoder_create_map ( CborEncoder encoder,
CborEncoder mapEncoder,
size_t  length 
)

◆ cbor_encoder_get_buffer_size()

static size_t cbor_encoder_get_buffer_size ( const CborEncoder encoder,
const uint8_t *  buffer 
)
static

Definition at line 255 of file cbor.h.

256 {
257  return (size_t)(encoder->data.ptr - buffer);
258 }

◆ cbor_encoder_get_extra_bytes_needed()

static size_t cbor_encoder_get_extra_bytes_needed ( const CborEncoder encoder)
static

Definition at line 260 of file cbor.h.

261 {
262  return encoder->end ? 0 : (size_t)encoder->data.bytes_needed;
263 }

◆ cbor_encoder_init()

CBOR_API void cbor_encoder_init ( CborEncoder encoder,
uint8_t *  buffer,
size_t  size,
int  flags 
)

◆ cbor_error_string()

const CBOR_API char* cbor_error_string ( CborError  error)
Examples
tinycbor/app.c.

◆ cbor_parser_init()

CBOR_API CborError cbor_parser_init ( const uint8_t *  buffer,
size_t  size,
uint32_t  flags,
CborParser parser,
CborValue it 
)
Examples
tinycbor/app.c.

◆ cbor_value_advance()

CBOR_API CborError cbor_value_advance ( CborValue it)

◆ cbor_value_advance_fixed()

CBOR_API CborError cbor_value_advance_fixed ( CborValue it)
Examples
tinycbor/app.c.

◆ cbor_value_at_end()

static bool cbor_value_at_end ( const CborValue it)
static
Examples
tinycbor/app.c.

Definition at line 298 of file cbor.h.

299 { return it->remaining == 0; }

◆ cbor_value_calculate_string_length()

CBOR_API CborError cbor_value_calculate_string_length ( const CborValue value,
size_t *  length 
)

◆ cbor_value_copy_byte_string()

static CborError cbor_value_copy_byte_string ( const CborValue value,
uint8_t *  buffer,
size_t *  buflen,
CborValue next 
)
static
Examples
tinycbor/app.c.

Definition at line 436 of file cbor.h.

438 {
439  assert(cbor_value_is_byte_string(value));
440  return _cbor_value_copy_string(value, buffer, buflen, next);
441 }

◆ cbor_value_copy_text_string()

static CborError cbor_value_copy_text_string ( const CborValue value,
char *  buffer,
size_t *  buflen,
CborValue next 
)
static
Examples
tinycbor/app.c.

Definition at line 430 of file cbor.h.

432 {
433  assert(cbor_value_is_text_string(value));
434  return _cbor_value_copy_string(value, buffer, buflen, next);
435 }

◆ cbor_value_dup_byte_string()

static CborError cbor_value_dup_byte_string ( const CborValue value,
uint8_t **  buffer,
size_t *  buflen,
CborValue next 
)
static

Definition at line 449 of file cbor.h.

451 {
452  assert(cbor_value_is_byte_string(value));
453  return _cbor_value_dup_string(value, (void **)buffer, buflen, next);
454 }

◆ cbor_value_dup_text_string()

static CborError cbor_value_dup_text_string ( const CborValue value,
char **  buffer,
size_t *  buflen,
CborValue next 
)
static

Definition at line 443 of file cbor.h.

445 {
446  assert(cbor_value_is_text_string(value));
447  return _cbor_value_dup_string(value, (void **)buffer, buflen, next);
448 }

◆ cbor_value_enter_container()

CBOR_API CborError cbor_value_enter_container ( const CborValue it,
CborValue recursed 
)
Examples
tinycbor/app.c.

◆ cbor_value_get_array_length()

static CborError cbor_value_get_array_length ( const CborValue value,
size_t *  length 
)
static

Definition at line 464 of file cbor.h.

465 {
466  uint64_t v;
467  assert(cbor_value_is_array(value));
468  if (!cbor_value_is_length_known(value))
469  return CborErrorUnknownLength;
471  *length = (size_t)v;
472  if (*length != v)
473  return CborErrorDataTooLarge;
474  return CborNoError;
475 }

◆ cbor_value_get_boolean()

static CborError cbor_value_get_boolean ( const CborValue value,
bool *  result 
)
static
Examples
tinycbor/app.c.

Definition at line 330 of file cbor.h.

331 {
332  assert(cbor_value_is_boolean(value));
333  *result = !!value->extra;
334  return CborNoError;
335 }

◆ cbor_value_get_double()

static CborError cbor_value_get_double ( const CborValue value,
double *  result 
)
static

Definition at line 511 of file cbor.h.

512 {
513  uint64_t data;
514  assert(cbor_value_is_double(value));
516  data = _cbor_value_decode_int64_internal(value);
517  memcpy(result, &data, sizeof(*result));
518  return CborNoError;
519 }

◆ cbor_value_get_float()

static CborError cbor_value_get_float ( const CborValue value,
float *  result 
)
static

Definition at line 499 of file cbor.h.

500 {
501  uint32_t data;
502  assert(cbor_value_is_float(value));
504  data = (uint32_t)_cbor_value_decode_int64_internal(value);
505  memcpy(result, &data, sizeof(*result));
506  return CborNoError;
507 }

◆ cbor_value_get_half_float()

CBOR_API CborError cbor_value_get_half_float ( const CborValue value,
void *  result 
)

◆ cbor_value_get_int()

static CborError cbor_value_get_int ( const CborValue value,
int *  result 
)
static

Definition at line 378 of file cbor.h.

379 {
380  assert(cbor_value_is_integer(value));
381  *result = (int) _cbor_value_extract_int64_helper(value);
383  *result = -*result - 1;
384  return CborNoError;
385 }

◆ cbor_value_get_int64()

static CborError cbor_value_get_int64 ( const CborValue value,
int64_t *  result 
)
static

Definition at line 369 of file cbor.h.

370 {
371  assert(cbor_value_is_integer(value));
372  *result = (int64_t) _cbor_value_extract_int64_helper(value);
374  *result = -*result - 1;
375  return CborNoError;
376 }

◆ cbor_value_get_int64_checked()

CBOR_API CborError cbor_value_get_int64_checked ( const CborValue value,
int64_t *  result 
)

◆ cbor_value_get_int_checked()

CBOR_API CborError cbor_value_get_int_checked ( const CborValue value,
int *  result 
)
Examples
tinycbor/app.c.

◆ cbor_value_get_map_length()

static CborError cbor_value_get_map_length ( const CborValue value,
size_t *  length 
)
static

Definition at line 477 of file cbor.h.

478 {
479  uint64_t v;
480  assert(cbor_value_is_map(value));
481  if (!cbor_value_is_length_known(value))
482  return CborErrorUnknownLength;
484  *length = (size_t)v;
485  if (*length != v)
486  return CborErrorDataTooLarge;
487  return CborNoError;
488 }

◆ cbor_value_get_next_byte()

static const uint8_t* cbor_value_get_next_byte ( const CborValue it)
static

Definition at line 300 of file cbor.h.

301 { return it->ptr; }

◆ cbor_value_get_raw_integer()

static CborError cbor_value_get_raw_integer ( const CborValue value,
uint64_t *  result 
)
static

Definition at line 355 of file cbor.h.

356 {
357  assert(cbor_value_is_integer(value));
358  *result = _cbor_value_extract_int64_helper(value);
359  return CborNoError;
360 }

◆ cbor_value_get_simple_type()

static CborError cbor_value_get_simple_type ( const CborValue value,
uint8_t *  result 
)
static
Examples
tinycbor/app.c.

Definition at line 340 of file cbor.h.

341 {
342  assert(cbor_value_is_simple_type(value));
343  *result = (uint8_t)value->extra;
344  return CborNoError;
345 }

◆ cbor_value_get_string_length()

static CborError cbor_value_get_string_length ( const CborValue value,
size_t *  length 
)
static

Definition at line 410 of file cbor.h.

411 {
412  uint64_t v;
413  assert(cbor_value_is_byte_string(value) || cbor_value_is_text_string(value));
414  if (!cbor_value_is_length_known(value))
415  return CborErrorUnknownLength;
417  *length = (size_t)v;
418  if (*length != v)
419  return CborErrorDataTooLarge;
420  return CborNoError;
421 }

◆ cbor_value_get_tag()

static CborError cbor_value_get_tag ( const CborValue value,
CborTag result 
)
static
Examples
tinycbor/app.c.

Definition at line 396 of file cbor.h.

397 {
398  assert(cbor_value_is_tag(value));
399  *result = _cbor_value_extract_int64_helper(value);
400  return CborNoError;
401 }

◆ cbor_value_get_type()

static CborType cbor_value_get_type ( const CborValue value)
static
Examples
tinycbor/app.c.

Definition at line 318 of file cbor.h.

319 { return (CborType)value->type; }

◆ cbor_value_get_uint64()

static CborError cbor_value_get_uint64 ( const CborValue value,
uint64_t *  result 
)
static

Definition at line 362 of file cbor.h.

363 {
364  assert(cbor_value_is_unsigned_integer(value));
365  *result = _cbor_value_extract_int64_helper(value);
366  return CborNoError;
367 }

◆ cbor_value_is_array()

static bool cbor_value_is_array ( const CborValue value)
static

Definition at line 459 of file cbor.h.

460 { return value->type == CborArrayType; }

◆ cbor_value_is_boolean()

static bool cbor_value_is_boolean ( const CborValue value)
static

Definition at line 328 of file cbor.h.

329 { return value->type == CborBooleanType; }

◆ cbor_value_is_byte_string()

static bool cbor_value_is_byte_string ( const CborValue value)
static

Definition at line 405 of file cbor.h.

406 { return value->type == CborByteStringType; }

◆ cbor_value_is_container()

static bool cbor_value_is_container ( const CborValue it)
static

Definition at line 304 of file cbor.h.

305 { return it->type == CborArrayType || it->type == CborMapType; }

◆ cbor_value_is_double()

static bool cbor_value_is_double ( const CborValue value)
static

Definition at line 509 of file cbor.h.

510 { return value->type == CborDoubleType; }

◆ cbor_value_is_float()

static bool cbor_value_is_float ( const CborValue value)
static

Definition at line 497 of file cbor.h.

498 { return value->type == CborFloatType; }

◆ cbor_value_is_half_float()

static bool cbor_value_is_half_float ( const CborValue value)
static

Definition at line 493 of file cbor.h.

494 { return value->type == CborHalfFloatType; }

◆ cbor_value_is_integer()

static bool cbor_value_is_integer ( const CborValue value)
static

Definition at line 348 of file cbor.h.

349 { return value->type == CborIntegerType; }

◆ cbor_value_is_length_known()

static bool cbor_value_is_length_known ( const CborValue value)
static

Definition at line 390 of file cbor.h.

391 { return (value->flags & CborIteratorFlag_UnknownLength) == 0; }

◆ cbor_value_is_map()

static bool cbor_value_is_map ( const CborValue value)
static

Definition at line 461 of file cbor.h.

462 { return value->type == CborMapType; }

◆ cbor_value_is_negative_integer()

static bool cbor_value_is_negative_integer ( const CborValue value)
static

Definition at line 352 of file cbor.h.

353 { return cbor_value_is_integer(value) && (value->flags & CborIteratorFlag_NegativeInteger); }

◆ cbor_value_is_null()

static bool cbor_value_is_null ( const CborValue value)
static

Definition at line 322 of file cbor.h.

323 { return value->type == CborNullType; }

◆ cbor_value_is_simple_type()

static bool cbor_value_is_simple_type ( const CborValue value)
static

Definition at line 338 of file cbor.h.

339 { return value->type == CborSimpleType; }

◆ cbor_value_is_tag()

static bool cbor_value_is_tag ( const CborValue value)
static

Definition at line 394 of file cbor.h.

395 { return value->type == CborTagType; }

◆ cbor_value_is_text_string()

static bool cbor_value_is_text_string ( const CborValue value)
static

Definition at line 407 of file cbor.h.

408 { return value->type == CborTextStringType; }

◆ cbor_value_is_undefined()

static bool cbor_value_is_undefined ( const CborValue value)
static

Definition at line 324 of file cbor.h.

325 { return value->type == CborUndefinedType; }

◆ cbor_value_is_unsigned_integer()

static bool cbor_value_is_unsigned_integer ( const CborValue value)
static

Definition at line 350 of file cbor.h.

351 { return cbor_value_is_integer(value) && (value->flags & CborIteratorFlag_NegativeInteger) == 0; }

◆ cbor_value_is_valid()

static bool cbor_value_is_valid ( const CborValue value)
static

Definition at line 316 of file cbor.h.

317 { return value && value->type != CborInvalidType; }

◆ cbor_value_leave_container()

CBOR_API CborError cbor_value_leave_container ( CborValue it,
const CborValue recursed 
)
Examples
tinycbor/app.c.

◆ cbor_value_map_find_value()

CBOR_API CborError cbor_value_map_find_value ( const CborValue map,
const char *  string,
CborValue element 
)

◆ cbor_value_skip_tag()

CBOR_API CborError cbor_value_skip_tag ( CborValue it)

◆ cbor_value_text_string_equals()

CBOR_API CborError cbor_value_text_string_equals ( const CborValue value,
const char *  string,
bool *  result 
)

◆ cbor_value_to_pretty()

static CborError cbor_value_to_pretty ( FILE *  out,
const CborValue value 
)
static

Definition at line 594 of file cbor.h.

595 {
596  CborValue copy = *value;
598 }

◆ cbor_value_to_pretty_advance()

CBOR_API CborError cbor_value_to_pretty_advance ( FILE *  out,
CborValue value 
)

◆ cbor_value_to_pretty_advance_flags()

CBOR_API CborError cbor_value_to_pretty_advance_flags ( FILE *  out,
CborValue value,
int  flags 
)

◆ cbor_value_to_pretty_stream()

CBOR_API CborError cbor_value_to_pretty_stream ( CborStreamFunction  streamFunction,
void *  token,
CborValue value,
int  flags 
)

◆ cbor_value_validate()

CBOR_API CborError cbor_value_validate ( const CborValue it,
uint32_t  flags 
)
Examples
tinycbor/app.c.

◆ cbor_value_validate_basic()

CBOR_API CborError cbor_value_validate_basic ( const CborValue it)

Data Structure Documentation

◆ CborEncoder

struct CborEncoder

Definition at line 205 of file cbor.h.

Data Fields
union CborEncoder data
const uint8_t * end
int flags
size_t remaining

◆ CborParser

struct CborParser
Examples
tinycbor/app.c.

Definition at line 276 of file cbor.h.

Data Fields
const uint8_t * end
uint32_t flags

◆ CborValue

struct CborValue
Examples
tinycbor/app.c.

Definition at line 283 of file cbor.h.

Data Fields
uint16_t extra
uint8_t flags
const CborParser * parser
const uint8_t * ptr
uint32_t remaining
uint8_t type

◆ CborEncoder.data

union CborEncoder.data

Definition at line 207 of file cbor.h.

Data Fields
ptrdiff_t bytes_needed
uint8_t * ptr

Enumeration Type Documentation

◆ CborError

enum CborError
Enumerator
CborNoError 
CborUnknownError 
CborErrorUnknownLength 
CborErrorAdvancePastEOF 
CborErrorIO 
CborErrorGarbageAtEnd 
CborErrorUnexpectedEOF 
CborErrorUnexpectedBreak 
CborErrorUnknownType 
CborErrorIllegalType 
CborErrorIllegalNumber 
CborErrorIllegalSimpleType 
CborErrorUnknownSimpleType 
CborErrorUnknownTag 
CborErrorInappropriateTagForType 
CborErrorDuplicateObjectKeys 
CborErrorInvalidUtf8TextString 
CborErrorExcludedType 
CborErrorExcludedValue 
CborErrorImproperValue 
CborErrorOverlongEncoding 
CborErrorMapKeyNotString 
CborErrorMapNotSorted 
CborErrorMapKeysNotUnique 
CborErrorTooManyItems 
CborErrorTooFewItems 
CborErrorDataTooLarge 
CborErrorNestingTooDeep 
CborErrorUnsupportedType 
CborErrorJsonObjectKeyIsAggregate 
CborErrorJsonObjectKeyNotString 
CborErrorJsonNotImplemented 
CborErrorOutOfMemory 
CborErrorInternalError 

Definition at line 152 of file cbor.h.

152  {
153  CborNoError = 0,
154 
155  /* errors in all modes */
157  CborErrorUnknownLength, /* request for length in array, map, or string with indeterminate length */
159  CborErrorIO,
160 
161  /* parser errors streaming errors */
162  CborErrorGarbageAtEnd = 256,
165  CborErrorUnknownType, /* can only happen in major type 7 */
166  CborErrorIllegalType, /* type not allowed here */
168  CborErrorIllegalSimpleType, /* types of value less than 32 encoded in two bytes */
169 
170  /* parser errors in strict mode parsing only */
183 
184  /* encoder errors */
185  CborErrorTooManyItems = 768,
187 
188  /* internal implementation errors */
189  CborErrorDataTooLarge = 1024,
192 
193  /* errors in converting to JSON */
197 
198  CborErrorOutOfMemory = (int) (~0U / 2 + 1),
199  CborErrorInternalError = (int) (~0U / 2) /* INT_MAX on two's complement machines */
200 } CborError;

◆ CborKnownTags

Enumerator
CborDateTimeStringTag 
CborUnixTime_tTag 
CborPositiveBignumTag 
CborNegativeBignumTag 
CborDecimalTag 
CborBigfloatTag 
CborCOSE_Encrypt0Tag 
CborCOSE_Mac0Tag 
CborCOSE_Sign1Tag 
CborExpectedBase64urlTag 
CborExpectedBase64Tag 
CborExpectedBase16Tag 
CborEncodedCborTag 
CborUrlTag 
CborBase64urlTag 
CborBase64Tag 
CborRegularExpressionTag 
CborMimeMessageTag 
CborCOSE_EncryptTag 
CborCOSE_MacTag 
CborCOSE_SignTag 
CborSignatureTag 

Definition at line 101 of file cbor.h.

101  {
103  CborUnixTime_tTag = 1,
106  CborDecimalTag = 4,
107  CborBigfloatTag = 5,
109  CborCOSE_Mac0Tag = 17,
110  CborCOSE_Sign1Tag = 18,
114  CborEncodedCborTag = 24,
115  CborUrlTag = 32,
116  CborBase64urlTag = 33,
117  CborBase64Tag = 34,
119  CborMimeMessageTag = 36,
120  CborCOSE_EncryptTag = 96,
121  CborCOSE_MacTag = 97,
122  CborCOSE_SignTag = 98,
123  CborSignatureTag = 55799
124 } CborKnownTags;

◆ CborParserIteratorFlags

Enumerator
CborIteratorFlag_IntegerValueTooLarge 
CborIteratorFlag_NegativeInteger 
CborIteratorFlag_IteratingStringChunks 
CborIteratorFlag_UnknownLength 
CborIteratorFlag_ContainerIsMap 

Definition at line 267 of file cbor.h.

◆ CborPrettyFlags

Enumerator
CborPrettyNumericEncodingIndicators 
CborPrettyTextualEncodingIndicators 
CborPrettyIndicateIndeterminateLength 
CborPrettyIndicateIndetermineLength 
CborPrettyIndicateOverlongNumbers 
CborPrettyShowStringFragments 
CborPrettyMergeStringFragments 
CborPrettyDefaultFlags 

Definition at line 568 of file cbor.h.

◆ CborType

enum CborType
Enumerator
CborIntegerType 
CborByteStringType 
CborTextStringType 
CborArrayType 
CborMapType 
CborTagType 
CborSimpleType 
CborBooleanType 
CborNullType 
CborUndefinedType 
CborHalfFloatType 
CborFloatType 
CborDoubleType 
CborInvalidType 

Definition at line 82 of file cbor.h.

82  {
83  CborIntegerType = 0x00,
84  CborByteStringType = 0x40,
85  CborTextStringType = 0x60,
86  CborArrayType = 0x80,
87  CborMapType = 0xa0,
88  CborTagType = 0xc0,
89  CborSimpleType = 0xe0,
90  CborBooleanType = 0xf5,
91  CborNullType = 0xf6,
92  CborUndefinedType = 0xf7,
93  CborHalfFloatType = 0xf9,
94  CborFloatType = 0xfa,
95  CborDoubleType = 0xfb,
96 
97  CborInvalidType = 0xff /* equivalent to the break byte, so it will never be used */
98 } CborType;

◆ CborValidationFlags

Enumerator
CborValidateShortestIntegrals 
CborValidateShortestFloatingPoint 
CborValidateShortestNumbers 
CborValidateNoIndeterminateLength 
CborValidateMapIsSorted 
CborValidateCanonicalFormat 
CborValidateMapKeysAreUnique 
CborValidateTagUse 
CborValidateUtf8 
CborValidateStrictMode 
CborValidateMapKeysAreString 
CborValidateNoUndefined 
CborValidateNoTags 
CborValidateFiniteFloatingPoint 
CborValidateNoUnknownSimpleTypesSA 
CborValidateNoUnknownSimpleTypes 
CborValidateNoUnknownTagsSA 
CborValidateNoUnknownTagsSR 
CborValidateNoUnknownTags 
CborValidateCompleteData 
CborValidateStrictest 
CborValidateBasic 

Definition at line 523 of file cbor.h.

523  {
524  /* Bit mapping:
525  * bits 0-7 (8 bits): canonical format
526  * bits 8-11 (4 bits): canonical format & strict mode
527  * bits 12-20 (8 bits): strict mode
528  * bits 21-31 (10 bits): other
529  */
530 
536 
538 
540  CborValidateTagUse = 0x2000,
541  CborValidateUtf8 = 0x4000,
542 
543  CborValidateStrictMode = 0xfff00,
544 
545  CborValidateMapKeysAreString = 0x100000,
546  CborValidateNoUndefined = 0x200000,
547  CborValidateNoTags = 0x400000,
549  /* unused = 0x1000000, */
550  /* unused = 0x2000000, */
551 
554  CborValidateNoUnknownTagsSA = 0x10000000,
557 
558  CborValidateCompleteData = (int)0x80000000,
559 
560  CborValidateStrictest = (int)~0U,
562 };

Macro Definition Documentation

◆ CBOR_INLINE

#define CBOR_INLINE

Definition at line 77 of file cbor.h.

◆ CBOR_INLINE_API

#define CBOR_INLINE_API   static CBOR_INLINE

Definition at line 69 of file cbor.h.

◆ CBOR_PRIVATE_API

#define CBOR_PRIVATE_API

Definition at line 62 of file cbor.h.

◆ CborBase64Tag

#define CborBase64Tag   CborBase64Tag

Definition at line 142 of file cbor.h.

◆ CborBase64urlTag

#define CborBase64urlTag   CborBase64urlTag

Definition at line 141 of file cbor.h.

◆ CborBigfloatTag

#define CborBigfloatTag   CborBigfloatTag

Definition at line 132 of file cbor.h.

◆ CborCOSE_Encrypt0Tag

#define CborCOSE_Encrypt0Tag   CborCOSE_Encrypt0Tag

Definition at line 133 of file cbor.h.

◆ CborCOSE_EncryptTag

#define CborCOSE_EncryptTag   CborCOSE_EncryptTag

Definition at line 145 of file cbor.h.

◆ CborCOSE_Mac0Tag

#define CborCOSE_Mac0Tag   CborCOSE_Mac0Tag

Definition at line 134 of file cbor.h.

◆ CborCOSE_MacTag

#define CborCOSE_MacTag   CborCOSE_MacTag

Definition at line 146 of file cbor.h.

◆ CborCOSE_Sign1Tag

#define CborCOSE_Sign1Tag   CborCOSE_Sign1Tag

Definition at line 135 of file cbor.h.

◆ CborCOSE_SignTag

#define CborCOSE_SignTag   CborCOSE_SignTag

Definition at line 147 of file cbor.h.

◆ CborDateTimeStringTag

#define CborDateTimeStringTag   CborDateTimeStringTag

Definition at line 127 of file cbor.h.

◆ CborDecimalTag

#define CborDecimalTag   CborDecimalTag

Definition at line 131 of file cbor.h.

◆ CborEncodedCborTag

#define CborEncodedCborTag   CborEncodedCborTag

Definition at line 139 of file cbor.h.

◆ CborExpectedBase16Tag

#define CborExpectedBase16Tag   CborExpectedBase16Tag

Definition at line 138 of file cbor.h.

◆ CborExpectedBase64Tag

#define CborExpectedBase64Tag   CborExpectedBase64Tag

Definition at line 137 of file cbor.h.

◆ CborExpectedBase64urlTag

#define CborExpectedBase64urlTag   CborExpectedBase64urlTag

Definition at line 136 of file cbor.h.

◆ CborMimeMessageTag

#define CborMimeMessageTag   CborMimeMessageTag

Definition at line 144 of file cbor.h.

◆ CborNegativeBignumTag

#define CborNegativeBignumTag   CborNegativeBignumTag

Definition at line 130 of file cbor.h.

◆ CborPositiveBignumTag

#define CborPositiveBignumTag   CborPositiveBignumTag

Definition at line 129 of file cbor.h.

◆ CborRegularExpressionTag

#define CborRegularExpressionTag   CborRegularExpressionTag

Definition at line 143 of file cbor.h.

◆ CborSignatureTag

#define CborSignatureTag   CborSignatureTag

Definition at line 148 of file cbor.h.

◆ CborUnixTime_tTag

#define CborUnixTime_tTag   CborUnixTime_tTag

Definition at line 128 of file cbor.h.

◆ CborUrlTag

#define CborUrlTag   CborUrlTag

Definition at line 140 of file cbor.h.

◆ SIZE_MAX

#define SIZE_MAX   ((size_t)-1)

Definition at line 55 of file cbor.h.

◆ TINYCBOR_VERSION

#define TINYCBOR_VERSION   ((TINYCBOR_VERSION_MAJOR << 16) | (TINYCBOR_VERSION_MINOR << 8) | TINYCBOR_VERSION_PATCH)

Definition at line 39 of file cbor.h.

Variable Documentation

◆ CborIndefiniteLength

const size_t CborIndefiniteLength = ((size_t)-1)
static

Definition at line 217 of file cbor.h.

CborErrorOverlongEncoding
@ CborErrorOverlongEncoding
Definition: cbor.h:179
cbor_value_is_double
static bool cbor_value_is_double(const CborValue *value)
Definition: cbor.h:509
CborExpectedBase64urlTag
#define CborExpectedBase64urlTag
Definition: cbor.h:136
CborIntegerType
@ CborIntegerType
Definition: cbor.h:83
CborCOSE_EncryptTag
#define CborCOSE_EncryptTag
Definition: cbor.h:145
CborErrorUnknownType
@ CborErrorUnknownType
Definition: cbor.h:165
cbor_value_is_boolean
static bool cbor_value_is_boolean(const CborValue *value)
Definition: cbor.h:328
CborErrorExcludedValue
@ CborErrorExcludedValue
Definition: cbor.h:177
CborPrettyIndicateIndeterminateLength
@ CborPrettyIndicateIndeterminateLength
Definition: cbor.h:572
CborErrorImproperValue
@ CborErrorImproperValue
Definition: cbor.h:178
CborValidateNoUnknownSimpleTypes
@ CborValidateNoUnknownSimpleTypes
Definition: cbor.h:553
CborPrettyIndicateOverlongNumbers
@ CborPrettyIndicateOverlongNumbers
Definition: cbor.h:574
CborDecimalTag
#define CborDecimalTag
Definition: cbor.h:131
CborValidateUtf8
@ CborValidateUtf8
Definition: cbor.h:541
cbor_value_is_unsigned_integer
static bool cbor_value_is_unsigned_integer(const CborValue *value)
Definition: cbor.h:350
CborIteratorFlag_UnknownLength
@ CborIteratorFlag_UnknownLength
Definition: cbor.h:272
CborErrorInappropriateTagForType
@ CborErrorInappropriateTagForType
Definition: cbor.h:173
CborMimeMessageTag
#define CborMimeMessageTag
Definition: cbor.h:144
CborValidateShortestIntegrals
@ CborValidateShortestIntegrals
Definition: cbor.h:531
CborErrorUnknownSimpleType
@ CborErrorUnknownSimpleType
Definition: cbor.h:171
CborCOSE_Mac0Tag
#define CborCOSE_Mac0Tag
Definition: cbor.h:134
CborValidateNoIndeterminateLength
@ CborValidateNoIndeterminateLength
Definition: cbor.h:534
CborErrorIO
@ CborErrorIO
Definition: cbor.h:159
cbor_encode_floating_point
CBOR_API CborError cbor_encode_floating_point(CborEncoder *encoder, CborType fpType, const void *value)
CborValue
Definition: cbor.h:283
cbor_value_to_pretty_advance_flags
CBOR_API CborError cbor_value_to_pretty_advance_flags(FILE *out, CborValue *value, int flags)
CborValidateMapIsSorted
@ CborValidateMapIsSorted
Definition: cbor.h:535
cbor_value_is_simple_type
static bool cbor_value_is_simple_type(const CborValue *value)
Definition: cbor.h:338
_cbor_value_decode_int64_internal
uint64_t _cbor_value_decode_int64_internal(const CborValue *value)
CborErrorMapNotSorted
@ CborErrorMapNotSorted
Definition: cbor.h:181
CborValidateMapKeysAreUnique
@ CborValidateMapKeysAreUnique
Definition: cbor.h:539
CborErrorUnknownLength
@ CborErrorUnknownLength
Definition: cbor.h:157
CborUnixTime_tTag
#define CborUnixTime_tTag
Definition: cbor.h:128
CborErrorDataTooLarge
@ CborErrorDataTooLarge
Definition: cbor.h:189
CborUrlTag
#define CborUrlTag
Definition: cbor.h:140
CborNoError
@ CborNoError
Definition: cbor.h:153
CborErrorJsonNotImplemented
@ CborErrorJsonNotImplemented
Definition: cbor.h:196
CborIteratorFlag_NegativeInteger
@ CborIteratorFlag_NegativeInteger
Definition: cbor.h:270
CborPositiveBignumTag
#define CborPositiveBignumTag
Definition: cbor.h:129
CborValidateTagUse
@ CborValidateTagUse
Definition: cbor.h:540
CborValidateMapKeysAreString
@ CborValidateMapKeysAreString
Definition: cbor.h:545
_cbor_value_copy_string
CborError _cbor_value_copy_string(const CborValue *value, void *buffer, size_t *buflen, CborValue *next)
CborEncoder::data
union CborEncoder::@10 data
CborErrorJsonObjectKeyIsAggregate
@ CborErrorJsonObjectKeyIsAggregate
Definition: cbor.h:194
CborValidateCompleteData
@ CborValidateCompleteData
Definition: cbor.h:558
CborBigfloatTag
#define CborBigfloatTag
Definition: cbor.h:132
CborErrorInternalError
@ CborErrorInternalError
Definition: cbor.h:199
CborDateTimeStringTag
#define CborDateTimeStringTag
Definition: cbor.h:127
CborValidateStrictMode
@ CborValidateStrictMode
Definition: cbor.h:543
CborValidateNoUnknownTags
@ CborValidateNoUnknownTags
Definition: cbor.h:556
CborEncodedCborTag
#define CborEncodedCborTag
Definition: cbor.h:139
CborErrorTooManyItems
@ CborErrorTooManyItems
Definition: cbor.h:185
CborPrettyMergeStringFragments
@ CborPrettyMergeStringFragments
Definition: cbor.h:577
CborArrayType
@ CborArrayType
Definition: cbor.h:86
CborPrettyIndicateIndetermineLength
@ CborPrettyIndicateIndetermineLength
Definition: cbor.h:573
CborValue::remaining
uint32_t remaining
Definition: cbor.h:287
cbor_value_is_map
static bool cbor_value_is_map(const CborValue *value)
Definition: cbor.h:461
CborValidateNoUnknownSimpleTypesSA
@ CborValidateNoUnknownSimpleTypesSA
Definition: cbor.h:552
CborError
CborError
Definition: cbor.h:152
CborNegativeBignumTag
#define CborNegativeBignumTag
Definition: cbor.h:130
CborSignatureTag
#define CborSignatureTag
Definition: cbor.h:148
CborErrorUnexpectedBreak
@ CborErrorUnexpectedBreak
Definition: cbor.h:164
CborErrorIllegalNumber
@ CborErrorIllegalNumber
Definition: cbor.h:167
CborBooleanType
@ CborBooleanType
Definition: cbor.h:90
CborErrorMapKeysNotUnique
@ CborErrorMapKeysNotUnique
Definition: cbor.h:182
cbor_value_is_array
static bool cbor_value_is_array(const CborValue *value)
Definition: cbor.h:459
CborType
CborType
Definition: cbor.h:82
cbor_value_is_byte_string
static bool cbor_value_is_byte_string(const CborValue *value)
Definition: cbor.h:405
CborPrettyDefaultFlags
@ CborPrettyDefaultFlags
Definition: cbor.h:579
CborValidateShortestFloatingPoint
@ CborValidateShortestFloatingPoint
Definition: cbor.h:532
CborByteStringType
@ CborByteStringType
Definition: cbor.h:84
CborIteratorFlag_IteratingStringChunks
@ CborIteratorFlag_IteratingStringChunks
Definition: cbor.h:271
cbor_value_is_integer
static bool cbor_value_is_integer(const CborValue *value)
Definition: cbor.h:348
CborBase64urlTag
#define CborBase64urlTag
Definition: cbor.h:141
CborErrorNestingTooDeep
@ CborErrorNestingTooDeep
Definition: cbor.h:190
CborErrorDuplicateObjectKeys
@ CborErrorDuplicateObjectKeys
Definition: cbor.h:174
CborValue::ptr
const uint8_t * ptr
Definition: cbor.h:286
CborSimpleType
@ CborSimpleType
Definition: cbor.h:89
CborErrorTooFewItems
@ CborErrorTooFewItems
Definition: cbor.h:186
CborValidateStrictest
@ CborValidateStrictest
Definition: cbor.h:560
CborCOSE_MacTag
#define CborCOSE_MacTag
Definition: cbor.h:146
CborErrorExcludedType
@ CborErrorExcludedType
Definition: cbor.h:176
CborErrorGarbageAtEnd
@ CborErrorGarbageAtEnd
Definition: cbor.h:162
CborErrorIllegalType
@ CborErrorIllegalType
Definition: cbor.h:166
CborValidateNoUnknownTagsSA
@ CborValidateNoUnknownTagsSA
Definition: cbor.h:554
CborIteratorFlag_ContainerIsMap
@ CborIteratorFlag_ContainerIsMap
Definition: cbor.h:273
CborPrettyTextualEncodingIndicators
@ CborPrettyTextualEncodingIndicators
Definition: cbor.h:570
_cbor_value_extract_int64_helper
static uint64_t _cbor_value_extract_int64_helper(const CborValue *value)
Definition: cbor.h:310
CborNullType
@ CborNullType
Definition: cbor.h:91
cbor_encode_simple_value
CBOR_API CborError cbor_encode_simple_value(CborEncoder *encoder, uint8_t value)
CborPrettyShowStringFragments
@ CborPrettyShowStringFragments
Definition: cbor.h:576
cbor_value_is_tag
static bool cbor_value_is_tag(const CborValue *value)
Definition: cbor.h:394
CborKnownTags
CborKnownTags
Definition: cbor.h:101
CborCOSE_SignTag
#define CborCOSE_SignTag
Definition: cbor.h:147
CborValue::flags
uint8_t flags
Definition: cbor.h:290
CborErrorInvalidUtf8TextString
@ CborErrorInvalidUtf8TextString
Definition: cbor.h:175
CborValidateNoUndefined
@ CborValidateNoUndefined
Definition: cbor.h:546
CborErrorJsonObjectKeyNotString
@ CborErrorJsonObjectKeyNotString
Definition: cbor.h:195
CborUnknownError
@ CborUnknownError
Definition: cbor.h:156
CborFloatType
@ CborFloatType
Definition: cbor.h:94
CborValidateShortestNumbers
@ CborValidateShortestNumbers
Definition: cbor.h:533
CborValue::type
uint8_t type
Definition: cbor.h:289
CborValidateCanonicalFormat
@ CborValidateCanonicalFormat
Definition: cbor.h:537
CborErrorIllegalSimpleType
@ CborErrorIllegalSimpleType
Definition: cbor.h:168
CborValidateNoTags
@ CborValidateNoTags
Definition: cbor.h:547
CborErrorAdvancePastEOF
@ CborErrorAdvancePastEOF
Definition: cbor.h:158
CborExpectedBase16Tag
#define CborExpectedBase16Tag
Definition: cbor.h:138
CborErrorUnknownTag
@ CborErrorUnknownTag
Definition: cbor.h:172
CborErrorMapKeyNotString
@ CborErrorMapKeyNotString
Definition: cbor.h:180
CborErrorOutOfMemory
@ CborErrorOutOfMemory
Definition: cbor.h:198
CborBase64Tag
#define CborBase64Tag
Definition: cbor.h:142
CborErrorUnexpectedEOF
@ CborErrorUnexpectedEOF
Definition: cbor.h:163
CborMapType
@ CborMapType
Definition: cbor.h:87
CborExpectedBase64Tag
#define CborExpectedBase64Tag
Definition: cbor.h:137
CborHalfFloatType
@ CborHalfFloatType
Definition: cbor.h:93
CborInvalidType
@ CborInvalidType
Definition: cbor.h:97
_cbor_value_dup_string
CborError _cbor_value_dup_string(const CborValue *value, void **buffer, size_t *buflen, CborValue *next)
CborValue::extra
uint16_t extra
Definition: cbor.h:288
CborValidateFiniteFloatingPoint
@ CborValidateFiniteFloatingPoint
Definition: cbor.h:548
CborEncoder::end
const uint8_t * end
Definition: cbor.h:211
CborCOSE_Sign1Tag
#define CborCOSE_Sign1Tag
Definition: cbor.h:135
cbor_value_is_length_known
static bool cbor_value_is_length_known(const CborValue *value)
Definition: cbor.h:390
CborTextStringType
@ CborTextStringType
Definition: cbor.h:85
CborRegularExpressionTag
#define CborRegularExpressionTag
Definition: cbor.h:143
CborPrettyNumericEncodingIndicators
@ CborPrettyNumericEncodingIndicators
Definition: cbor.h:569
CborTagType
@ CborTagType
Definition: cbor.h:88
cbor_encode_text_string
CBOR_API CborError cbor_encode_text_string(CborEncoder *encoder, const char *string, size_t length)
CborValidateNoUnknownTagsSR
@ CborValidateNoUnknownTagsSR
Definition: cbor.h:555
CborErrorUnsupportedType
@ CborErrorUnsupportedType
Definition: cbor.h:191
CborDoubleType
@ CborDoubleType
Definition: cbor.h:95
CborValidateBasic
@ CborValidateBasic
Definition: cbor.h:561
CborCOSE_Encrypt0Tag
#define CborCOSE_Encrypt0Tag
Definition: cbor.h:133
cbor_value_is_text_string
static bool cbor_value_is_text_string(const CborValue *value)
Definition: cbor.h:407
cbor_value_is_float
static bool cbor_value_is_float(const CborValue *value)
Definition: cbor.h:497
CborIteratorFlag_IntegerValueTooLarge
@ CborIteratorFlag_IntegerValueTooLarge
Definition: cbor.h:269
CborUndefinedType
@ CborUndefinedType
Definition: cbor.h:92