json-gen-c  0.1.5
json-gen-c generate C code for json manipulation
cbor_codec.h File Reference

CBOR (RFC 8949) wire format constants and reader/writer declarations. More...

#include <stdint.h>
#include <stddef.h>
Include dependency graph for cbor_codec.h:

Go to the source code of this file.

Classes

struct  cb_reader
 

Macros

#define CB_MAJOR_UINT   0 /* Major type 0: unsigned integer */
 
#define CB_MAJOR_NINT   1 /* Major type 1: negative integer */
 
#define CB_MAJOR_BSTR   2 /* Major type 2: byte string */
 
#define CB_MAJOR_TSTR   3 /* Major type 3: text string (UTF-8) */
 
#define CB_MAJOR_ARRAY   4 /* Major type 4: array */
 
#define CB_MAJOR_MAP   5 /* Major type 5: map */
 
#define CB_MAJOR_TAG   6 /* Major type 6: semantic tag */
 
#define CB_MAJOR_SIMPLE   7 /* Major type 7: simple/float */
 
#define CB_INITIAL(major, ai)   (((major) << 5) | (ai))
 
#define CB_AI_1BYTE   24 /* Next 1 byte is the value/length */
 
#define CB_AI_2BYTE   25 /* Next 2 bytes */
 
#define CB_AI_4BYTE   26 /* Next 4 bytes */
 
#define CB_AI_8BYTE   27 /* Next 8 bytes */
 
#define CB_FALSE   CB_INITIAL(7, 20) /* 0xf4 */
 
#define CB_TRUE   CB_INITIAL(7, 21) /* 0xf5 */
 
#define CB_NULL   CB_INITIAL(7, 22) /* 0xf6 */
 
#define CB_UNDEFINED   CB_INITIAL(7, 23) /* 0xf7 */
 
#define CB_FLOAT16   CB_INITIAL(7, 25) /* 0xf9 — half-precision */
 
#define CB_FLOAT32   CB_INITIAL(7, 26) /* 0xfa */
 
#define CB_FLOAT64   CB_INITIAL(7, 27) /* 0xfb */
 

Detailed Description

CBOR (RFC 8949) wire format constants and reader/writer declarations.

This file is NOT compiled directly; it is converted to a C byte array via xxd and embedded into the generated cbor.gen.c output.