{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.BoIVUOsi/b1/tinycbor_0.6.0+git20250214.53ff130-2_i386.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.BoIVUOsi/b2/tinycbor_0.6.0+git20250214.53ff130-2_i386.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,6 +1,6 @@\n \n- db0368b75da14079944e6ce3d752c5ee 155480 libdevel optional libtinycbor-dev_0.6.0+git20250214.53ff130-2_i386.deb\n+ cbf8acc9ef41906f6fffc88038104f07 155520 libdevel optional libtinycbor-dev_0.6.0+git20250214.53ff130-2_i386.deb\n cf8153e429d15ce36c0877d2b72745c0 69508 debug optional libtinycbor0.6-dbgsym_0.6.0+git20250214.53ff130-2_i386.deb\n 9851657d69bbc5f18f177dba0305c2f6 23032 libs optional libtinycbor0.6_0.6.0+git20250214.53ff130-2_i386.deb\n a7f95412cc6b42ab1333c7e462189080 75664 debug optional tinycbor-utils-dbgsym_0.6.0+git20250214.53ff130-2_i386.deb\n 0983d3213f45f176f474ed6c692c9bd3 25968 utils optional tinycbor-utils_0.6.0+git20250214.53ff130-2_i386.deb\n"}, {"source1": "libtinycbor-dev_0.6.0+git20250214.53ff130-2_i386.deb", "source2": "libtinycbor-dev_0.6.0+git20250214.53ff130-2_i386.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2025-02-26 07:23:03.000000 debian-binary\n -rw-r--r-- 0 0 0 2444 2025-02-26 07:23:03.000000 control.tar.xz\n--rw-r--r-- 0 0 0 152844 2025-02-26 07:23:03.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 152884 2025-02-26 07:23:03.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}, {"source1": "line order", "source2": "line order", "unified_diff": "@@ -2,20 +2,20 @@\n usr/include/tinycbor/cborjson.h\n usr/include/tinycbor/tinycbor-version.h\n usr/lib/i386-linux-gnu/libtinycbor.a\n usr/lib/i386-linux-gnu/pkgconfig/tinycbor.pc\n usr/share/doc-base/libtinycbor-dev.libtinycbor-dev\n usr/share/doc/libtinycbor-dev/changelog.Debian.gz\n usr/share/doc/libtinycbor-dev/copyright\n-usr/share/doc/libtinycbor-dev/html/a00014.html\n usr/share/doc/libtinycbor-dev/html/a00014_source.html\n+usr/share/doc/libtinycbor-dev/html/a00026.html\n+usr/share/doc/libtinycbor-dev/html/a00026_source.html\n+usr/share/doc/libtinycbor-dev/html/a00035_source.html\n+usr/share/doc/libtinycbor-dev/html/a00038.html\n usr/share/doc/libtinycbor-dev/html/a00038_source.html\n-usr/share/doc/libtinycbor-dev/html/a00041.html\n-usr/share/doc/libtinycbor-dev/html/a00041_source.html\n-usr/share/doc/libtinycbor-dev/html/a00047_source.html\n usr/share/doc/libtinycbor-dev/html/a00054.html\n usr/share/doc/libtinycbor-dev/html/a00055.html\n usr/share/doc/libtinycbor-dev/html/a00056.html\n usr/share/doc/libtinycbor-dev/html/a00057.html\n usr/share/doc/libtinycbor-dev/html/a00058.html\n usr/share/doc/libtinycbor-dev/html/a00062.html\n usr/share/doc/libtinycbor-dev/html/a00082.html\n"}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -12,20 +12,20 @@\n -rw-r--r-- 0 root (0) root (0) 257 2025-02-26 07:23:03.000000 ./usr/lib/i386-linux-gnu/pkgconfig/tinycbor.pc\n drwxr-xr-x 0 root (0) root (0) 0 2025-02-26 07:23:03.000000 ./usr/share/\n drwxr-xr-x 0 root (0) root (0) 0 2025-02-26 07:23:03.000000 ./usr/share/doc/\n drwxr-xr-x 0 root (0) root (0) 0 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/\n -rw-r--r-- 0 root (0) root (0) 597 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/changelog.Debian.gz\n -rw-r--r-- 0 root (0) root (0) 1397 2024-10-19 16:35:58.000000 ./usr/share/doc/libtinycbor-dev/copyright\n drwxr-xr-x 0 root (0) root (0) 0 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/\n--rw-r--r-- 0 root (0) root (0) 45293 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00014.html\n--rw-r--r-- 0 root (0) root (0) 137371 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00014_source.html\n--rw-r--r-- 0 root (0) root (0) 7302 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00038_source.html\n--rw-r--r-- 0 root (0) root (0) 4218 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00041.html\n--rw-r--r-- 0 root (0) root (0) 12436 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00041_source.html\n--rw-r--r-- 0 root (0) root (0) 2641 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00047_source.html\n+-rw-r--r-- 0 root (0) root (0) 7302 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00014_source.html\n+-rw-r--r-- 0 root (0) root (0) 45293 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00026.html\n+-rw-r--r-- 0 root (0) root (0) 137371 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00026_source.html\n+-rw-r--r-- 0 root (0) root (0) 2641 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00035_source.html\n+-rw-r--r-- 0 root (0) root (0) 4218 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00038.html\n+-rw-r--r-- 0 root (0) root (0) 12436 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00038_source.html\n -rw-r--r-- 0 root (0) root (0) 3029 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00054.html\n -rw-r--r-- 0 root (0) root (0) 51196 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00055.html\n -rw-r--r-- 0 root (0) root (0) 46890 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00056.html\n -rw-r--r-- 0 root (0) root (0) 11719 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00057.html\n -rw-r--r-- 0 root (0) root (0) 10695 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00058.html\n -rw-r--r-- 0 root (0) root (0) 2475 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00062.html\n -rw-r--r-- 0 root (0) root (0) 2695 2025-02-26 07:23:03.000000 ./usr/share/doc/libtinycbor-dev/html/a00082.html\n"}, {"source1": "./usr/share/doc/libtinycbor-dev/html/a00014_source.html", "source2": "./usr/share/doc/libtinycbor-dev/html/a00014_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-TinyCBOR 0.6.0 API: cbor.h Source File\n+TinyCBOR 0.6.0 API: memory.h Source File\n \n \n \n \n \n \n
\n@@ -39,20 +39,20 @@\n \n
\n \n
\n-
cbor.h
\n+
memory.h
\n
\n
\n-Go to the documentation of this file.
1/****************************************************************************
\n+
1/****************************************************************************
\n
2**
\n-
3** Copyright (C) 2021 Intel Corporation
\n+
3** Copyright (C) 2016 Intel Corporation
\n
4**
\n
5** Permission is hereby granted, free of charge, to any person obtaining a copy
\n
6** of this software and associated documentation files (the "Software"), to deal
\n
7** in the Software without restriction, including without limitation the rights
\n
8** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\n
9** copies of the Software, and to permit persons to whom the Software is
\n
10** furnished to do so, subject to the following conditions:
\n@@ -66,754 +66,21 @@\n
18** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\n
19** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\n
20** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\n
21** THE SOFTWARE.
\n
22**
\n
23****************************************************************************/
\n
24
\n-
25#ifndef CBOR_H
\n-
26#define CBOR_H
\n-
27
\n-
28#ifndef assert
\n-
29#include <assert.h>
\n-
30#endif
\n-
31#include <limits.h>
\n-
32#include <stddef.h>
\n-
33#include <stdint.h>
\n-
34#include <string.h>
\n-
35#include <stdio.h>
\n-
36
\n-
37#ifdef CBOR_EXTERNAL_CFG
\n-
38#include "cbor_cfg.h"
\n-
39#endif
\n-
40
\n-
41#include "tinycbor-version.h"
\n-
42
\n-
43#define TINYCBOR_VERSION ((TINYCBOR_VERSION_MAJOR << 16) | (TINYCBOR_VERSION_MINOR << 8) | TINYCBOR_VERSION_PATCH)
\n-
44
\n-
45#ifdef __cplusplus
\n-
46extern "C" {
\n-
47#else
\n-
48#include <stdbool.h>
\n-
49#endif
\n-
50
\n-
51#ifndef SIZE_MAX
\n-
52/* Some systems fail to define SIZE_MAX in <stdint.h>, even though C99 requires it...
\n-
53 * Conversion from signed to unsigned is defined in 6.3.1.3 (Signed and unsigned integers) p2,
\n-
54 * which says: "the value is converted by repeatedly adding or subtracting one more than the
\n-
55 * maximum value that can be represented in the new type until the value is in the range of the
\n-
56 * new type."
\n-
57 * So -1 gets converted to size_t by adding SIZE_MAX + 1, which results in SIZE_MAX.
\n-
58 */
\n-
59# define SIZE_MAX ((size_t)-1)
\n-
60#endif
\n-
61
\n-
62#ifndef CBOR_API
\n-
63# define CBOR_API
\n-
64#endif
\n-
65#ifndef CBOR_PRIVATE_API
\n-
66# define CBOR_PRIVATE_API
\n-
67#endif
\n-
68#ifndef CBOR_INLINE_API
\n-
69# if defined(__cplusplus)
\n-
70# define CBOR_INLINE inline
\n-
71# define CBOR_INLINE_API inline
\n-
72# else
\n-
73# define CBOR_INLINE_API static CBOR_INLINE
\n-
74# if defined(_MSC_VER)
\n-
75# define CBOR_INLINE __inline
\n-
76# elif defined(__GNUC__)
\n-
77# define CBOR_INLINE __inline__
\n-
78# elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
\n-
79# define CBOR_INLINE inline
\n-
80# else
\n-
81# define CBOR_INLINE
\n-
82# endif
\n-
83# endif
\n-
84#endif
\n-
85
\n-
86typedef enum CborType {
\n-
87 CborIntegerType = 0x00,
\n-
88 CborByteStringType = 0x40,
\n-
89 CborTextStringType = 0x60,
\n-
90 CborArrayType = 0x80,
\n-
91 CborMapType = 0xa0,
\n-
92 CborTagType = 0xc0,
\n-
93 CborSimpleType = 0xe0,
\n-
94 CborBooleanType = 0xf5,
\n-
95 CborNullType = 0xf6,
\n-
96 CborUndefinedType = 0xf7,
\n-
97 CborHalfFloatType = 0xf9,
\n-
98 CborFloatType = 0xfa,
\n-
99 CborDoubleType = 0xfb,
\n-
100
\n-
101 CborInvalidType = 0xff /* equivalent to the break byte, so it will never be used */
\n-
102} CborType;
\n-
103
\n-
104typedef uint64_t CborTag;
\n-
105typedef enum CborKnownTags {
\n-
106 CborDateTimeStringTag = 0,
\n-
107 CborUnixTime_tTag = 1,
\n-
108 CborPositiveBignumTag = 2,
\n-
109 CborNegativeBignumTag = 3,
\n-
110 CborDecimalTag = 4,
\n-
111 CborBigfloatTag = 5,
\n-
112 CborCOSE_Encrypt0Tag = 16,
\n-
113 CborCOSE_Mac0Tag = 17,
\n-
114 CborCOSE_Sign1Tag = 18,
\n-
115 CborExpectedBase64urlTag = 21,
\n-
116 CborExpectedBase64Tag = 22,
\n-
117 CborExpectedBase16Tag = 23,
\n-
118 CborEncodedCborTag = 24,
\n-
119 CborUrlTag = 32,
\n-
120 CborBase64urlTag = 33,
\n-
121 CborBase64Tag = 34,
\n-
122 CborRegularExpressionTag = 35,
\n-
123 CborMimeMessageTag = 36,
\n-
124 CborCOSE_EncryptTag = 96,
\n-
125 CborCOSE_MacTag = 97,
\n-
126 CborCOSE_SignTag = 98,
\n-
127 CborSignatureTag = 55799
\n-
128} CborKnownTags;
\n-
129
\n-
130/* #define the constants so we can check with #ifdef */
\n-
131#define CborDateTimeStringTag CborDateTimeStringTag
\n-
132#define CborUnixTime_tTag CborUnixTime_tTag
\n-
133#define CborPositiveBignumTag CborPositiveBignumTag
\n-
134#define CborNegativeBignumTag CborNegativeBignumTag
\n-
135#define CborDecimalTag CborDecimalTag
\n-
136#define CborBigfloatTag CborBigfloatTag
\n-
137#define CborCOSE_Encrypt0Tag CborCOSE_Encrypt0Tag
\n-
138#define CborCOSE_Mac0Tag CborCOSE_Mac0Tag
\n-
139#define CborCOSE_Sign1Tag CborCOSE_Sign1Tag
\n-
140#define CborExpectedBase64urlTag CborExpectedBase64urlTag
\n-
141#define CborExpectedBase64Tag CborExpectedBase64Tag
\n-
142#define CborExpectedBase16Tag CborExpectedBase16Tag
\n-
143#define CborEncodedCborTag CborEncodedCborTag
\n-
144#define CborUrlTag CborUrlTag
\n-
145#define CborBase64urlTag CborBase64urlTag
\n-
146#define CborBase64Tag CborBase64Tag
\n-
147#define CborRegularExpressionTag CborRegularExpressionTag
\n-
148#define CborMimeMessageTag CborMimeMessageTag
\n-
149#define CborCOSE_EncryptTag CborCOSE_EncryptTag
\n-
150#define CborCOSE_MacTag CborCOSE_MacTag
\n-
151#define CborCOSE_SignTag CborCOSE_SignTag
\n-
152#define CborSignatureTag CborSignatureTag
\n-
153
\n-
154/* Error API */
\n-
155
\n-
156typedef enum CborError {
\n-
157 CborNoError = 0,
\n-
158
\n-
159 /* errors in all modes */
\n-
160 CborUnknownError,
\n-
161 CborErrorUnknownLength, /* request for length in array, map, or string with indeterminate length */
\n-
162 CborErrorAdvancePastEOF,
\n-
163 CborErrorIO,
\n-
164
\n-
165 /* parser errors streaming errors */
\n-
166 CborErrorGarbageAtEnd = 256,
\n-
167 CborErrorUnexpectedEOF,
\n-
168 CborErrorUnexpectedBreak,
\n-
169 CborErrorUnknownType, /* can only happen in major type 7 */
\n-
170 CborErrorIllegalType, /* type not allowed here */
\n-
171 CborErrorIllegalNumber,
\n-
172 CborErrorIllegalSimpleType, /* types of value less than 32 encoded in two bytes */
\n-
173 CborErrorNoMoreStringChunks,
\n-
174
\n-
175 /* parser errors in strict mode parsing only */
\n-
176 CborErrorUnknownSimpleType = 512,
\n-
177 CborErrorUnknownTag,
\n-
178 CborErrorInappropriateTagForType,
\n-
179 CborErrorDuplicateObjectKeys,
\n-
180 CborErrorInvalidUtf8TextString,
\n-
181 CborErrorExcludedType,
\n-
182 CborErrorExcludedValue,
\n-
183 CborErrorImproperValue,
\n-
184 CborErrorOverlongEncoding,
\n-
185 CborErrorMapKeyNotString,
\n-
186 CborErrorMapNotSorted,
\n-
187 CborErrorMapKeysNotUnique,
\n-
188
\n-
189 /* encoder errors */
\n-
190 CborErrorTooManyItems = 768,
\n-
191 CborErrorTooFewItems,
\n-
192
\n-
193 /* internal implementation errors */
\n-
194 CborErrorDataTooLarge = 1024,
\n-
195 CborErrorNestingTooDeep,
\n-
196 CborErrorUnsupportedType,
\n-
197 CborErrorUnimplementedValidation,
\n-
198
\n-
199 /* errors in converting to JSON */
\n-
200 CborErrorJsonObjectKeyIsAggregate = 1280,
\n-
201 CborErrorJsonObjectKeyNotString,
\n-
202 CborErrorJsonNotImplemented,
\n-
203
\n-
204 CborErrorOutOfMemory = (int) (~0U / 2 + 1),
\n-
205 CborErrorInternalError = (int) (~0U / 2) /* INT_MAX on two's complement machines */
\n-
206} CborError;
\n-
207
\n-
208CBOR_API const char *cbor_error_string(CborError error);
\n-
209
\n-
210/* Encoder API */
\n-
211
\n-
212typedef enum CborEncoderAppendType
\n-
213{
\n-
214 CborEncoderAppendCborData = 0,
\n-
215 CborEncoderAppendStringData = 1
\n-
216} CborEncoderAppendType;
\n-
217
\n-
218typedef CborError (*CborEncoderWriteFunction)(void *, const void *, size_t, CborEncoderAppendType);
\n-
219
\n-
220enum CborEncoderFlags
\n-
221{
\n-
222 CborIteratorFlag_WriterFunction = 0x01,
\n-
223 CborIteratorFlag_ContainerIsMap_ = 0x20
\n-
224};
\n-
225
\n-\n-
227{
\n-
228 union {
\n-
229 uint8_t *ptr;
\n-
230 ptrdiff_t bytes_needed;
\n-
231 CborEncoderWriteFunction writer;
\n-
232 } data;
\n-
233 uint8_t *end;
\n-
234 size_t remaining;
\n-
235 int flags;
\n-
236};
\n-
237typedef struct CborEncoder CborEncoder;
\n-
238
\n-
239static const size_t CborIndefiniteLength = SIZE_MAX;
\n-
240
\n-
241#ifndef CBOR_NO_ENCODER_API
\n-
242CBOR_API void cbor_encoder_init(CborEncoder *encoder, uint8_t *buffer, size_t size, int flags);
\n-
243CBOR_API void cbor_encoder_init_writer(CborEncoder *encoder, CborEncoderWriteFunction writer, void *);
\n-
244CBOR_API CborError cbor_encode_uint(CborEncoder *encoder, uint64_t value);
\n-
245CBOR_API CborError cbor_encode_int(CborEncoder *encoder, int64_t value);
\n-
246CBOR_API CborError cbor_encode_negative_int(CborEncoder *encoder, uint64_t absolute_value);
\n-
247CBOR_API CborError cbor_encode_simple_value(CborEncoder *encoder, uint8_t value);
\n-
248CBOR_API CborError cbor_encode_tag(CborEncoder *encoder, CborTag tag);
\n-
249CBOR_API CborError cbor_encode_text_string(CborEncoder *encoder, const char *string, size_t length);
\n-
250CBOR_INLINE_API CborError cbor_encode_text_stringz(CborEncoder *encoder, const char *string)
\n-
251{ return cbor_encode_text_string(encoder, string, strlen(string)); }
\n-
252CBOR_API CborError cbor_encode_byte_string(CborEncoder *encoder, const uint8_t *string, size_t length);
\n-
253CBOR_API CborError cbor_encode_floating_point(CborEncoder *encoder, CborType fpType, const void *value);
\n-
254
\n-
255CBOR_INLINE_API CborError cbor_encode_boolean(CborEncoder *encoder, bool value)
\n-
256{ return cbor_encode_simple_value(encoder, (int)value - 1 + (CborBooleanType & 0x1f)); }
\n-
257CBOR_INLINE_API CborError cbor_encode_null(CborEncoder *encoder)
\n-
258{ return cbor_encode_simple_value(encoder, CborNullType & 0x1f); }
\n-
259CBOR_INLINE_API CborError cbor_encode_undefined(CborEncoder *encoder)
\n-
260{ return cbor_encode_simple_value(encoder, CborUndefinedType & 0x1f); }
\n-
261
\n-
262CBOR_INLINE_API CborError cbor_encode_half_float(CborEncoder *encoder, const void *value)
\n-
263{ return cbor_encode_floating_point(encoder, CborHalfFloatType, value); }
\n-
264CBOR_API CborError cbor_encode_float_as_half_float(CborEncoder *encoder, float value);
\n-
265CBOR_INLINE_API CborError cbor_encode_float(CborEncoder *encoder, float value)
\n-
266{ return cbor_encode_floating_point(encoder, CborFloatType, &value); }
\n-
267CBOR_INLINE_API CborError cbor_encode_double(CborEncoder *encoder, double value)
\n-
268{ return cbor_encode_floating_point(encoder, CborDoubleType, &value); }
\n-
269
\n-
270CBOR_API CborError cbor_encoder_create_array(CborEncoder *parentEncoder, CborEncoder *arrayEncoder, size_t length);
\n-
271CBOR_API CborError cbor_encoder_create_map(CborEncoder *parentEncoder, CborEncoder *mapEncoder, size_t length);
\n-
272CBOR_API CborError cbor_encoder_close_container(CborEncoder *parentEncoder, const CborEncoder *containerEncoder);
\n-
273CBOR_API CborError cbor_encoder_close_container_checked(CborEncoder *parentEncoder, const CborEncoder *containerEncoder);
\n-
274
\n-
275CBOR_INLINE_API uint8_t *_cbor_encoder_get_buffer_pointer(const CborEncoder *encoder)
\n-
276{
\n-
277 return encoder->data.ptr;
\n-
278}
\n-
279
\n-
280CBOR_INLINE_API size_t cbor_encoder_get_buffer_size(const CborEncoder *encoder, const uint8_t *buffer)
\n-
281{
\n-
282 return (size_t)(encoder->data.ptr - buffer);
\n-
283}
\n-
284
\n-
285CBOR_INLINE_API size_t cbor_encoder_get_extra_bytes_needed(const CborEncoder *encoder)
\n-
286{
\n-
287 return encoder->end ? 0 : (size_t)encoder->data.bytes_needed;
\n-
288}
\n-
289#endif /* CBOR_NO_ENCODER_API */
\n-
290
\n-
291/* Parser API */
\n-
292
\n-
293enum CborParserGlobalFlags
\n-
294{
\n-
295 CborParserFlag_ExternalSource = 0x01
\n-
296};
\n-
297
\n-
298enum CborParserIteratorFlags
\n-
299{
\n-
300 /* used for all types, but not during string chunk iteration
\n-
301 * (values are static-asserted, don't change) */
\n-
302 CborIteratorFlag_IntegerValueIs64Bit = 0x01,
\n-
303 CborIteratorFlag_IntegerValueTooLarge = 0x02,
\n-
304
\n-
305 /* used only for CborIntegerType */
\n-
306 CborIteratorFlag_NegativeInteger = 0x04,
\n-
307
\n-
308 /* used only during string iteration */
\n-
309 CborIteratorFlag_BeforeFirstStringChunk = 0x04,
\n-
310 CborIteratorFlag_IteratingStringChunks = 0x08,
\n-
311
\n-
312 /* used for arrays, maps and strings, including during chunk iteration */
\n-
313 CborIteratorFlag_UnknownLength = 0x10,
\n-
314
\n-
315 /* used for maps, but must be kept for all types
\n-
316 * (ContainerIsMap value must be CborMapType - CborArrayType) */
\n-
317 CborIteratorFlag_ContainerIsMap = 0x20,
\n-
318 CborIteratorFlag_NextIsMapKey = 0x40
\n-
319};
\n-
320
\n-
321struct CborValue;
\n-
322struct CborParserOperations
\n-
323{
\n-
324 bool (*can_read_bytes)(void *token, size_t len);
\n-
325 void *(*read_bytes)(void *token, void *dst, size_t offset, size_t len);
\n-
326 void (*advance_bytes)(void *token, size_t len);
\n-
327 CborError (*transfer_string)(void *token, const void **userptr, size_t offset, size_t len);
\n-
328};
\n-
329
\n-
330struct CborParser
\n-
331{
\n-
332 union {
\n-
333 const uint8_t *end;
\n-
334 const struct CborParserOperations *ops;
\n-
335 } source;
\n-
336 enum CborParserGlobalFlags flags;
\n-
337};
\n-
338typedef struct CborParser CborParser;
\n-
339
\n-\n-
341{
\n-
342 const CborParser *parser;
\n-
343 union {
\n-
344 const uint8_t *ptr;
\n-
345 void *token;
\n-
346 } source;
\n-
347 uint32_t remaining;
\n-
348 uint16_t extra;
\n-
349 uint8_t type;
\n-
350 uint8_t flags;
\n-
351};
\n-
352typedef struct CborValue CborValue;
\n-
353
\n-
354#ifndef CBOR_NO_PARSER_API
\n-
355CBOR_API CborError cbor_parser_init(const uint8_t *buffer, size_t size, uint32_t flags, CborParser *parser, CborValue *it);
\n-
356CBOR_API CborError cbor_parser_init_reader(const struct CborParserOperations *ops, CborParser *parser, CborValue *it, void *token);
\n-
357
\n-
358CBOR_API CborError cbor_value_validate_basic(const CborValue *it);
\n-
359
\n-
360CBOR_INLINE_API bool cbor_value_at_end(const CborValue *it)
\n-
361{ return it->remaining == 0; }
\n-
362CBOR_INLINE_API const uint8_t *cbor_value_get_next_byte(const CborValue *it)
\n-
363{ return it->source.ptr; }
\n-
364CBOR_API CborError cbor_value_reparse(CborValue *it);
\n-
365CBOR_API CborError cbor_value_advance_fixed(CborValue *it);
\n-
366CBOR_API CborError cbor_value_advance(CborValue *it);
\n-
367CBOR_INLINE_API bool cbor_value_is_container(const CborValue *it)
\n-
368{ return it->type == CborArrayType || it->type == CborMapType; }
\n-
369CBOR_API CborError cbor_value_enter_container(const CborValue *it, CborValue *recursed);
\n-
370CBOR_API CborError cbor_value_leave_container(CborValue *it, const CborValue *recursed);
\n-
371
\n-
372CBOR_PRIVATE_API uint64_t _cbor_value_decode_int64_internal(const CborValue *value);
\n-
373CBOR_INLINE_API uint64_t _cbor_value_extract_int64_helper(const CborValue *value)
\n-
374{
\n-
375 return value->flags & CborIteratorFlag_IntegerValueTooLarge ?
\n-
376 _cbor_value_decode_int64_internal(value) : value->extra;
\n-
377}
\n-
378
\n-
379CBOR_INLINE_API bool cbor_value_is_valid(const CborValue *value)
\n-
380{ return value && value->type != CborInvalidType; }
\n-
381CBOR_INLINE_API CborType cbor_value_get_type(const CborValue *value)
\n-
382{ return (CborType)value->type; }
\n-
383
\n-
384/* Null & undefined type */
\n-
385CBOR_INLINE_API bool cbor_value_is_null(const CborValue *value)
\n-
386{ return value->type == CborNullType; }
\n-
387CBOR_INLINE_API bool cbor_value_is_undefined(const CborValue *value)
\n-
388{ return value->type == CborUndefinedType; }
\n-
389
\n-
390/* Booleans */
\n-
391CBOR_INLINE_API bool cbor_value_is_boolean(const CborValue *value)
\n-
392{ return value->type == CborBooleanType; }
\n-
393CBOR_INLINE_API CborError cbor_value_get_boolean(const CborValue *value, bool *result)
\n-
394{
\n-
395 assert(cbor_value_is_boolean(value));
\n-
396 *result = !!value->extra;
\n-
397 return CborNoError;
\n-
398}
\n-
399
\n-
400/* Simple types */
\n-
401CBOR_INLINE_API bool cbor_value_is_simple_type(const CborValue *value)
\n-
402{ return value->type == CborSimpleType; }
\n-
403CBOR_INLINE_API CborError cbor_value_get_simple_type(const CborValue *value, uint8_t *result)
\n-
404{
\n-
405 assert(cbor_value_is_simple_type(value));
\n-
406 *result = (uint8_t)value->extra;
\n-
407 return CborNoError;
\n-
408}
\n-
409
\n-
410/* Integers */
\n-
411CBOR_INLINE_API bool cbor_value_is_integer(const CborValue *value)
\n-
412{ return value->type == CborIntegerType; }
\n-
413CBOR_INLINE_API bool cbor_value_is_unsigned_integer(const CborValue *value)
\n-
414{ return cbor_value_is_integer(value) && (value->flags & CborIteratorFlag_NegativeInteger) == 0; }
\n-
415CBOR_INLINE_API bool cbor_value_is_negative_integer(const CborValue *value)
\n-
416{ return cbor_value_is_integer(value) && (value->flags & CborIteratorFlag_NegativeInteger); }
\n-
417
\n-
418CBOR_INLINE_API CborError cbor_value_get_raw_integer(const CborValue *value, uint64_t *result)
\n-
419{
\n-
420 assert(cbor_value_is_integer(value));
\n-
421 *result = _cbor_value_extract_int64_helper(value);
\n-
422 return CborNoError;
\n-
423}
\n-
424
\n-
425CBOR_INLINE_API CborError cbor_value_get_uint64(const CborValue *value, uint64_t *result)
\n-
426{
\n-
427 assert(cbor_value_is_unsigned_integer(value));
\n-
428 *result = _cbor_value_extract_int64_helper(value);
\n-
429 return CborNoError;
\n-
430}
\n-
431
\n-
432CBOR_INLINE_API CborError cbor_value_get_int64(const CborValue *value, int64_t *result)
\n-
433{
\n-
434 assert(cbor_value_is_integer(value));
\n-
435 *result = (int64_t) _cbor_value_extract_int64_helper(value);
\n-
436 if (value->flags & CborIteratorFlag_NegativeInteger)
\n-
437 *result = -*result - 1;
\n-
438 return CborNoError;
\n-
439}
\n-
440
\n-
441CBOR_INLINE_API CborError cbor_value_get_int(const CborValue *value, int *result)
\n-
442{
\n-
443 assert(cbor_value_is_integer(value));
\n-
444 *result = (int) _cbor_value_extract_int64_helper(value);
\n-
445 if (value->flags & CborIteratorFlag_NegativeInteger)
\n-
446 *result = -*result - 1;
\n-
447 return CborNoError;
\n-
448}
\n-
449
\n-
450CBOR_API CborError cbor_value_get_int64_checked(const CborValue *value, int64_t *result);
\n-
451CBOR_API CborError cbor_value_get_int_checked(const CborValue *value, int *result);
\n-
452
\n-
453CBOR_INLINE_API bool cbor_value_is_length_known(const CborValue *value)
\n-
454{ return (value->flags & CborIteratorFlag_UnknownLength) == 0; }
\n-
455
\n-
456/* Tags */
\n-
457CBOR_INLINE_API bool cbor_value_is_tag(const CborValue *value)
\n-
458{ return value->type == CborTagType; }
\n-
459CBOR_INLINE_API CborError cbor_value_get_tag(const CborValue *value, CborTag *result)
\n-
460{
\n-
461 assert(cbor_value_is_tag(value));
\n-
462 *result = _cbor_value_extract_int64_helper(value);
\n-
463 return CborNoError;
\n-
464}
\n-
465CBOR_API CborError cbor_value_skip_tag(CborValue *it);
\n-
466
\n-
467/* Strings */
\n-
468CBOR_INLINE_API bool cbor_value_is_byte_string(const CborValue *value)
\n-
469{ return value->type == CborByteStringType; }
\n-
470CBOR_INLINE_API bool cbor_value_is_text_string(const CborValue *value)
\n-
471{ return value->type == CborTextStringType; }
\n-
472
\n-
473CBOR_INLINE_API CborError cbor_value_get_string_length(const CborValue *value, size_t *length)
\n-
474{
\n-
475 uint64_t v;
\n-
476 assert(cbor_value_is_byte_string(value) || cbor_value_is_text_string(value));
\n-
477 if (!cbor_value_is_length_known(value))
\n-
478 return CborErrorUnknownLength;
\n-
479 v = _cbor_value_extract_int64_helper(value);
\n-
480 *length = (size_t)v;
\n-
481 if (*length != v)
\n-
482 return CborErrorDataTooLarge;
\n-
483 return CborNoError;
\n-
484}
\n-
485
\n-
486CBOR_PRIVATE_API CborError _cbor_value_copy_string(const CborValue *value, void *buffer,
\n-
487 size_t *buflen, CborValue *next);
\n-
488CBOR_PRIVATE_API CborError _cbor_value_dup_string(const CborValue *value, void **buffer,
\n-
489 size_t *buflen, CborValue *next);
\n-
490
\n-
491CBOR_API CborError cbor_value_calculate_string_length(const CborValue *value, size_t *length);
\n-
492
\n-
493CBOR_INLINE_API CborError cbor_value_copy_text_string(const CborValue *value, char *buffer,
\n-
494 size_t *buflen, CborValue *next)
\n-
495{
\n-
496 assert(cbor_value_is_text_string(value));
\n-
497 return _cbor_value_copy_string(value, buffer, buflen, next);
\n-
498}
\n-
499CBOR_INLINE_API CborError cbor_value_copy_byte_string(const CborValue *value, uint8_t *buffer,
\n-
500 size_t *buflen, CborValue *next)
\n-
501{
\n-
502 assert(cbor_value_is_byte_string(value));
\n-
503 return _cbor_value_copy_string(value, buffer, buflen, next);
\n-
504}
\n-
505
\n-
506CBOR_INLINE_API CborError cbor_value_dup_text_string(const CborValue *value, char **buffer,
\n-
507 size_t *buflen, CborValue *next)
\n-
508{
\n-
509 assert(cbor_value_is_text_string(value));
\n-
510 return _cbor_value_dup_string(value, (void **)buffer, buflen, next);
\n-
511}
\n-
512CBOR_INLINE_API CborError cbor_value_dup_byte_string(const CborValue *value, uint8_t **buffer,
\n-
513 size_t *buflen, CborValue *next)
\n-
514{
\n-
515 assert(cbor_value_is_byte_string(value));
\n-
516 return _cbor_value_dup_string(value, (void **)buffer, buflen, next);
\n-
517}
\n-
518
\n-
519CBOR_PRIVATE_API CborError _cbor_value_get_string_chunk_size(const CborValue *value, size_t *len);
\n-
520CBOR_INLINE_API CborError cbor_value_get_string_chunk_size(const CborValue *value, size_t *len)
\n-
521{
\n-
522 assert(value->flags & CborIteratorFlag_IteratingStringChunks);
\n-
523 return _cbor_value_get_string_chunk_size(value, len);
\n-
524}
\n-
525
\n-
526CBOR_INLINE_API bool cbor_value_string_iteration_at_end(const CborValue *value)
\n-
527{
\n-
528 size_t dummy;
\n-
529 return cbor_value_get_string_chunk_size(value, &dummy) == CborErrorNoMoreStringChunks;
\n-
530}
\n-
531
\n-
532CBOR_PRIVATE_API CborError _cbor_value_begin_string_iteration(CborValue *value);
\n-
533CBOR_INLINE_API CborError cbor_value_begin_string_iteration(CborValue *value)
\n-
534{
\n-
535 assert(cbor_value_is_text_string(value) || cbor_value_is_byte_string(value));
\n-
536 assert(!(value->flags & CborIteratorFlag_IteratingStringChunks));
\n-
537 return _cbor_value_begin_string_iteration(value);
\n-
538}
\n-
539
\n-
540CBOR_PRIVATE_API CborError _cbor_value_finish_string_iteration(CborValue *value);
\n-
541CBOR_INLINE_API CborError cbor_value_finish_string_iteration(CborValue *value)
\n-
542{
\n-
543 assert(cbor_value_string_iteration_at_end(value));
\n-
544 return _cbor_value_finish_string_iteration(value);
\n-
545}
\n-
546
\n-
547CBOR_PRIVATE_API CborError _cbor_value_get_string_chunk(const CborValue *value, const void **bufferptr,
\n-
548 size_t *len, CborValue *next);
\n-
549CBOR_INLINE_API CborError cbor_value_get_text_string_chunk(const CborValue *value, const char **bufferptr,
\n-
550 size_t *len, CborValue *next)
\n-
551{
\n-
552 assert(cbor_value_is_text_string(value));
\n-
553 return _cbor_value_get_string_chunk(value, (const void **)bufferptr, len, next);
\n-
554}
\n-
555CBOR_INLINE_API CborError cbor_value_get_byte_string_chunk(const CborValue *value, const uint8_t **bufferptr,
\n-
556 size_t *len, CborValue *next)
\n-
557{
\n-
558 assert(cbor_value_is_byte_string(value));
\n-
559 return _cbor_value_get_string_chunk(value, (const void **)bufferptr, len, next);
\n-
560}
\n-
561
\n-
562CBOR_API CborError cbor_value_text_string_equals(const CborValue *value, const char *string, bool *result);
\n-
563
\n-
564/* Maps and arrays */
\n-
565CBOR_INLINE_API bool cbor_value_is_array(const CborValue *value)
\n-
566{ return value->type == CborArrayType; }
\n-
567CBOR_INLINE_API bool cbor_value_is_map(const CborValue *value)
\n-
568{ return value->type == CborMapType; }
\n-
569
\n-
570CBOR_INLINE_API CborError cbor_value_get_array_length(const CborValue *value, size_t *length)
\n-
571{
\n-
572 uint64_t v;
\n-
573 assert(cbor_value_is_array(value));
\n-
574 if (!cbor_value_is_length_known(value))
\n-
575 return CborErrorUnknownLength;
\n-
576 v = _cbor_value_extract_int64_helper(value);
\n-
577 *length = (size_t)v;
\n-
578 if (*length != v)
\n-
579 return CborErrorDataTooLarge;
\n-
580 return CborNoError;
\n-
581}
\n-
582
\n-
583CBOR_INLINE_API CborError cbor_value_get_map_length(const CborValue *value, size_t *length)
\n-
584{
\n-
585 uint64_t v;
\n-
586 assert(cbor_value_is_map(value));
\n-
587 if (!cbor_value_is_length_known(value))
\n-
588 return CborErrorUnknownLength;
\n-
589 v = _cbor_value_extract_int64_helper(value);
\n-
590 *length = (size_t)v;
\n-
591 if (*length != v)
\n-
592 return CborErrorDataTooLarge;
\n-
593 return CborNoError;
\n-
594}
\n-
595
\n-
596CBOR_API CborError cbor_value_map_find_value(const CborValue *map, const char *string, CborValue *element);
\n-
597
\n-
598/* Floating point */
\n-
599CBOR_INLINE_API bool cbor_value_is_half_float(const CborValue *value)
\n-
600{ return value->type == CborHalfFloatType; }
\n-
601CBOR_API CborError cbor_value_get_half_float_as_float(const CborValue *value, float *result);
\n-
602CBOR_INLINE_API CborError cbor_value_get_half_float(const CborValue *value, void *result)
\n-
603{
\n-
604 assert(cbor_value_is_half_float(value));
\n-
605 assert((value->flags & CborIteratorFlag_IntegerValueTooLarge) == 0);
\n-
606
\n-
607 /* size has already been computed */
\n-
608 memcpy(result, &value->extra, sizeof(value->extra));
\n-
609 return CborNoError;
\n-
610}
\n-
611
\n-
612CBOR_INLINE_API bool cbor_value_is_float(const CborValue *value)
\n-
613{ return value->type == CborFloatType; }
\n-
614CBOR_INLINE_API CborError cbor_value_get_float(const CborValue *value, float *result)
\n-
615{
\n-
616 uint32_t data;
\n-
617 assert(cbor_value_is_float(value));
\n-
618 assert(value->flags & CborIteratorFlag_IntegerValueTooLarge);
\n-
619 data = (uint32_t)_cbor_value_decode_int64_internal(value);
\n-
620 memcpy(result, &data, sizeof(*result));
\n-
621 return CborNoError;
\n-
622}
\n-
623
\n-
624CBOR_INLINE_API bool cbor_value_is_double(const CborValue *value)
\n-
625{ return value->type == CborDoubleType; }
\n-
626CBOR_INLINE_API CborError cbor_value_get_double(const CborValue *value, double *result)
\n-
627{
\n-
628 uint64_t data;
\n-
629 assert(cbor_value_is_double(value));
\n-
630 assert(value->flags & CborIteratorFlag_IntegerValueTooLarge);
\n-
631 data = _cbor_value_decode_int64_internal(value);
\n-
632 memcpy(result, &data, sizeof(*result));
\n-
633 return CborNoError;
\n-
634}
\n-
635
\n-
636/* Validation API */
\n-
637#ifndef CBOR_NO_VALIDATION_API
\n-
638
\n-
639enum CborValidationFlags {
\n-
640 /* Bit mapping:
\n-
641 * bits 0-7 (8 bits): canonical format
\n-
642 * bits 8-11 (4 bits): canonical format & strict mode
\n-
643 * bits 12-20 (8 bits): strict mode
\n-
644 * bits 21-31 (10 bits): other
\n-
645 */
\n-
646
\n-
647 CborValidateShortestIntegrals = 0x0001,
\n-
648 CborValidateShortestFloatingPoint = 0x0002,
\n-
649 CborValidateShortestNumbers = CborValidateShortestIntegrals | CborValidateShortestFloatingPoint,
\n-
650 CborValidateNoIndeterminateLength = 0x0100,
\n-
651 CborValidateMapIsSorted = 0x0200 | CborValidateNoIndeterminateLength,
\n-
652
\n-
653 CborValidateCanonicalFormat = 0x0fff,
\n-
654
\n-
655 CborValidateMapKeysAreUnique = 0x1000 | CborValidateMapIsSorted,
\n-
656 CborValidateTagUse = 0x2000,
\n-
657 CborValidateUtf8 = 0x4000,
\n-
658
\n-
659 CborValidateStrictMode = 0xfff00,
\n-
660
\n-
661 CborValidateMapKeysAreString = 0x100000,
\n-
662 CborValidateNoUndefined = 0x200000,
\n-
663 CborValidateNoTags = 0x400000,
\n-
664 CborValidateFiniteFloatingPoint = 0x800000,
\n-
665 /* unused = 0x1000000, */
\n-
666 /* unused = 0x2000000, */
\n-
667
\n-
668 CborValidateNoUnknownSimpleTypesSA = 0x4000000,
\n-
669 CborValidateNoUnknownSimpleTypes = 0x8000000 | CborValidateNoUnknownSimpleTypesSA,
\n-
670 CborValidateNoUnknownTagsSA = 0x10000000,
\n-
671 CborValidateNoUnknownTagsSR = 0x20000000 | CborValidateNoUnknownTagsSA,
\n-
672 CborValidateNoUnknownTags = 0x40000000 | CborValidateNoUnknownTagsSR,
\n-
673
\n-
674 CborValidateCompleteData = (int)0x80000000,
\n-
675
\n-
676 CborValidateStrictest = (int)~0U,
\n-
677 CborValidateBasic = 0
\n-
678};
\n-
679
\n-
680CBOR_API CborError cbor_value_validate(const CborValue *it, uint32_t flags);
\n-
681#endif /* CBOR_NO_VALIDATION_API */
\n-
682
\n-
683/* Human-readable (dump) API */
\n-
684#ifndef CBOR_NO_PRETTY_API
\n-
685
\n-
686enum CborPrettyFlags {
\n-
687 CborPrettyNumericEncodingIndicators = 0x01,
\n-
688 CborPrettyTextualEncodingIndicators = 0,
\n-
689
\n-
690 CborPrettyIndicateIndeterminateLength = 0x02,
\n-
691 CborPrettyIndicateIndetermineLength = CborPrettyIndicateIndeterminateLength, /* deprecated */
\n-
692 CborPrettyIndicateOverlongNumbers = 0x04,
\n-
693
\n-
694 CborPrettyShowStringFragments = 0x100,
\n-
695 CborPrettyMergeStringFragments = 0,
\n-
696
\n-
697 CborPrettyDefaultFlags = CborPrettyIndicateIndeterminateLength
\n-
698};
\n-
699
\n-
700typedef CborError (*CborStreamFunction)(void *token, const char *fmt, ...)
\n-
701#ifdef __GNUC__
\n-
702 __attribute__((__format__(printf, 2, 3)))
\n-
703#endif
\n-
704;
\n-
705
\n-
706CBOR_API CborError cbor_value_to_pretty_stream(CborStreamFunction streamFunction, void *token, CborValue *value, int flags);
\n-
707
\n-
708/* The following API requires a hosted C implementation (uses FILE*) */
\n-
709#if !defined(__STDC_HOSTED__) || __STDC_HOSTED__-0 == 1
\n-
710CBOR_API CborError cbor_value_to_pretty_advance_flags(FILE *out, CborValue *value, int flags);
\n-
711CBOR_API CborError cbor_value_to_pretty_advance(FILE *out, CborValue *value);
\n-
712CBOR_INLINE_API CborError cbor_value_to_pretty(FILE *out, const CborValue *value)
\n-
713{
\n-
714 CborValue copy = *value;
\n-
715 return cbor_value_to_pretty_advance_flags(out, &copy, CborPrettyDefaultFlags);
\n-
716}
\n-
717#endif /* __STDC_HOSTED__ check */
\n-
718
\n-
719#endif /* CBOR_NO_PRETTY_API */
\n-
720
\n-
721#endif /* CBOR_NO_PARSER_API */
\n-
722
\n-
723#ifdef __cplusplus
\n-
724}
\n-
725#endif
\n-
726
\n-
727#endif /* CBOR_H */
\n-
728
\n-
CborError cbor_value_to_pretty(FILE *out, const CborValue *value)
Converts the current CBOR type pointed to by value to its textual representation and writes it to the...
Definition cbor.h:712
\n-
CborError cbor_value_dup_text_string(const CborValue *value, char **buffer, size_t *buflen, CborValue *next)
Allocates memory for the string pointed by value and copies it into this buffer.
Definition cbor.h:506
\n-
CBOR_API CborError cbor_value_get_half_float_as_float(const CborValue *value, float *result)
Retrieves the CBOR half-precision floating point (16-bit) value that value points to,...
Definition cborparser_float.c:45
\n-
CBOR_API CborError cbor_value_to_pretty_advance_flags(FILE *out, CborValue *value, int flags)
Converts the current CBOR type pointed to by value to its textual representation and writes it to the...
Definition cborpretty_stdio.c:83
\n-
CborError cbor_value_dup_byte_string(const CborValue *value, uint8_t **buffer, size_t *buflen, CborValue *next)
Allocates memory for the string pointed by value and copies it into this buffer.
Definition cbor.h:512
\n-
CBOR_API CborError cbor_value_to_pretty_advance(FILE *out, CborValue *value)
Converts the current CBOR type pointed to by value to its textual representation and writes it to the...
Definition cborpretty_stdio.c:63
\n-
CBOR_API const char * cbor_error_string(CborError error)
Returns the error string corresponding to the CBOR error condition error.
Definition cborerrorstrings.c:80
\n-
CBOR_API CborError cbor_encode_negative_int(CborEncoder *encoder, uint64_t absolute_value)
Appends the negative 64-bit integer whose absolute value is absolute_value to the CBOR stream provide...
Definition cborencoder.c:369
\n-
CBOR_API CborError cbor_encode_byte_string(CborEncoder *encoder, const uint8_t *string, size_t length)
Appends the byte string string of length length to the CBOR stream provided by encoder.
Definition cborencoder.c:471
\n-
CBOR_API void cbor_encoder_init(CborEncoder *encoder, uint8_t *buffer, size_t size, int flags)
Initializes a CborEncoder structure encoder by pointing it to buffer buffer of size size.
Definition cborencoder.c:204
\n-
CBOR_API CborError cbor_encode_uint(CborEncoder *encoder, uint64_t value)
Appends the unsigned 64-bit integer value to the CBOR stream provided by encoder.
Definition cborencoder.c:356
\n-
CBOR_API CborError cbor_encode_text_string(CborEncoder *encoder, const char *string, size_t length)
Appends the text string string of length length to the CBOR stream provided by encoder.
Definition cborencoder.c:483
\n-
CBOR_API CborError cbor_encoder_close_container(CborEncoder *parentEncoder, const CborEncoder *containerEncoder)
Closes the CBOR container (array or map) provided by containerEncoder and updates the CBOR stream pro...
Definition cborencoder.c:574
\n-
CBOR_API CborError cbor_encode_tag(CborEncoder *encoder, CborTag tag)
Appends the CBOR tag tag to the CBOR stream provided by encoder.
Definition cborencoder.c:440
\n-
CBOR_API CborError cbor_encode_simple_value(CborEncoder *encoder, uint8_t value)
Appends the CBOR Simple Type of value value to the CBOR stream provided by encoder.
Definition cborencoder.c:396
\n-
CBOR_API CborError cbor_encoder_create_array(CborEncoder *parentEncoder, CborEncoder *arrayEncoder, size_t length)
Creates a CBOR array in the CBOR stream provided by parentEncoder and initializes arrayEncoder so tha...
Definition cborencoder.c:531
\n-
CBOR_API CborError cbor_encoder_close_container_checked(CborEncoder *parentEncoder, const CborEncoder *containerEncoder)
Definition cborencoder_close_container_checked.c:53
\n-
CBOR_API CborError cbor_encoder_create_map(CborEncoder *parentEncoder, CborEncoder *mapEncoder, size_t length)
Creates a CBOR map in the CBOR stream provided by parentEncoder and initializes mapEncoder so that it...
Definition cborencoder.c:555
\n-
CBOR_API CborError cbor_encode_int(CborEncoder *encoder, int64_t value)
Appends the signed 64-bit integer value to the CBOR stream provided by encoder.
Definition cborencoder.c:380
\n-
CBOR_API CborError cbor_encode_floating_point(CborEncoder *encoder, CborType fpType, const void *value)
Appends the floating-point value of type fpType and pointed to by value to the CBOR stream provided b...
Definition cborencoder.c:417
\n-
CBOR_API CborError cbor_value_enter_container(const CborValue *it, CborValue *recursed)
Creates a CborValue iterator pointing to the first element of the container represented by it and sav...
Definition cborparser.c:578
\n-
CBOR_API CborError cbor_value_validate_basic(const CborValue *it)
Performs a basic validation of the CBOR stream pointed by it and returns the error it found.
Definition cborparser.c:442
\n-
CBOR_API CborError cbor_value_skip_tag(CborValue *it)
Advances the CBOR value it until it no longer points to a tag.
Definition cborparser.c:551
\n-
CBOR_API CborError cbor_value_validate(const CborValue *it, uint32_t flags)
Performs a full validation, controlled by the flags options, of the CBOR stream pointed by it and ret...
Definition cborvalidation.c:645
\n-
CBOR_API CborError cbor_value_leave_container(CborValue *it, const CborValue *recursed)
Updates it to point to the next element after the container.
Definition cborparser.c:627
\n-
CBOR_API CborError cbor_value_get_int64_checked(const CborValue *value, int64_t *result)
Retrieves the CBOR integer value that value points to and stores it in result.
Definition cborparser.c:812
\n-
CBOR_API CborError cbor_parser_init(const uint8_t *buffer, size_t size, uint32_t flags, CborParser *parser, CborValue *it)
Initializes the CBOR parser for parsing size bytes beginning at buffer.
Definition cborparser.c:345
\n-
CBOR_API CborError cbor_value_advance_fixed(CborValue *it)
Advances the CBOR value it by one fixed-size position.
Definition cborparser.c:463
\n-
CBOR_API CborError cbor_value_text_string_equals(const CborValue *value, const char *string, bool *result)
Compares the entry value with the string string and stores the result in result.
Definition cborparser.c:1323
\n-
CBOR_API CborError cbor_value_calculate_string_length(const CborValue *value, size_t *length)
Calculates the length of the byte or text string that value points to and stores it in len.
Definition cborparser.c:963
\n-
CBOR_API CborError cbor_value_advance(CborValue *it)
Advances the CBOR value it by one element, skipping over containers.
Definition cborparser.c:515
\n-
CBOR_API CborError cbor_value_map_find_value(const CborValue *map, const char *string, CborValue *element)
Attempts to find the value in map map that corresponds to the text string entry string.
Definition cborparser.c:1411
\n-
CBOR_API CborError cbor_value_get_int_checked(const CborValue *value, int *result)
Retrieves the CBOR integer value that value points to and stores it in result.
Definition cborparser.c:852
\n-
CBOR_API CborError cbor_value_to_pretty_stream(CborStreamFunction streamFunction, void *token, CborValue *value, int flags)
Converts the current CBOR type pointed by value to its textual representation and writes it to the st...
Definition cborpretty.c:578
\n-
Structure used to encode to CBOR.
Definition cbor.h:227
\n-
This type contains one value parsed from the CBOR stream.
Definition cbor.h:341
\n+
25#if defined(CBOR_CUSTOM_ALLOC_INCLUDE)
\n+
26# include CBOR_CUSTOM_ALLOC_INCLUDE
\n+
27#else
\n+
28# include <stdlib.h>
\n+
29# define cbor_malloc malloc
\n+
30# define cbor_free free
\n+
31#endif
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,19 +1,18 @@\n TinyCBOR 0.6.0 API\n * _\bM_\ba_\bi_\bn_\b\u00a0_\bP_\ba_\bg_\be\n * _\bT_\bo_\bp_\bi_\bc_\bs\n * _\bD_\ba_\bt_\ba_\b\u00a0_\bS_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\bs\n * _\bF_\bi_\bl_\be_\bs\n * _\bF_\bi_\bl_\be_\b\u00a0_\bL_\bi_\bs_\bt\n * _\bG_\bl_\bo_\bb_\ba_\bl_\bs\n-cbor.h\n-_\bG_\bo_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\bf_\bi_\bl_\be_\b.\n+memory.h\n 1/****************************************************************************\n 2**\n-3** Copyright (C) 2021 Intel Corporation\n+3** Copyright (C) 2016 Intel Corporation\n 4**\n 5** Permission is hereby granted, free of charge, to any person obtaining a\n copy\n 6** of this software and associated documentation files (the \"Software\"), to\n deal\n 7** in the Software without restriction, including without limitation the\n rights\n@@ -32,989 +31,16 @@\n 19** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM,\n 20** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n 21** THE SOFTWARE.\n 22**\n 23****************************************************************************/\n 24\n-25#ifndef CBOR_H\n-26#define CBOR_H\n-27\n-28#ifndef assert\n-29#include \n-30#endif\n-31#include \n-32#include \n-33#include \n-34#include \n-35#include \n-36\n-37#ifdef CBOR_EXTERNAL_CFG\n-38#include \"cbor_cfg.h\"\n-39#endif\n-40\n-41#include \"tinycbor-version.h\"\n-42\n-43#define TINYCBOR_VERSION ((TINYCBOR_VERSION_MAJOR << 16) |\n-(TINYCBOR_VERSION_MINOR << 8) | TINYCBOR_VERSION_PATCH)\n-44\n-45#ifdef __cplusplus\n-46extern \"C\" {\n-47#else\n-48#include \n-49#endif\n-50\n-51#ifndef SIZE_MAX\n-52/* Some systems fail to define SIZE_MAX in , even though C99\n-requires it...\n-53 * Conversion from signed to unsigned is defined in 6.3.1.3 (Signed and\n-unsigned integers) p2,\n-54 * which says: \"the value is converted by repeatedly adding or subtracting\n-one more than the\n-55 * maximum value that can be represented in the new type until the value is\n-in the range of the\n-56 * new type.\"\n-57 * So -1 gets converted to size_t by adding SIZE_MAX + 1, which results in\n-SIZE_MAX.\n-58 */\n-59# define SIZE_MAX ((size_t)-1)\n-60#endif\n-61\n-62#ifndef CBOR_API\n-63# define CBOR_API\n-64#endif\n-65#ifndef CBOR_PRIVATE_API\n-66# define CBOR_PRIVATE_API\n-67#endif\n-68#ifndef CBOR_INLINE_API\n-69# if defined(__cplusplus)\n-70# define CBOR_INLINE inline\n-71# define CBOR_INLINE_API inline\n-72# else\n-73# define CBOR_INLINE_API static CBOR_INLINE\n-74# if defined(_MSC_VER)\n-75# define CBOR_INLINE __inline\n-76# elif defined(__GNUC__)\n-77# define CBOR_INLINE __inline__\n-78# elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n-79# define CBOR_INLINE inline\n-80# else\n-81# define CBOR_INLINE\n-82# endif\n-83# endif\n-84#endif\n-85\n-86typedef enum CborType {\n-87 CborIntegerType = 0x00,\n-88 CborByteStringType = 0x40,\n-89 CborTextStringType = 0x60,\n-90 CborArrayType = 0x80,\n-91 CborMapType = 0xa0,\n-92 CborTagType = 0xc0,\n-93 CborSimpleType = 0xe0,\n-94 CborBooleanType = 0xf5,\n-95 CborNullType = 0xf6,\n-96 CborUndefinedType = 0xf7,\n-97 CborHalfFloatType = 0xf9,\n-98 CborFloatType = 0xfa,\n-99 CborDoubleType = 0xfb,\n-100\n-101 CborInvalidType = 0xff /* equivalent to the break byte, so it will never be\n-used */\n-102} CborType;\n-103\n-104typedef uint64_t CborTag;\n-105typedef enum CborKnownTags {\n-106 CborDateTimeStringTag = 0,\n-107 CborUnixTime_tTag = 1,\n-108 CborPositiveBignumTag = 2,\n-109 CborNegativeBignumTag = 3,\n-110 CborDecimalTag = 4,\n-111 CborBigfloatTag = 5,\n-112 CborCOSE_Encrypt0Tag = 16,\n-113 CborCOSE_Mac0Tag = 17,\n-114 CborCOSE_Sign1Tag = 18,\n-115 CborExpectedBase64urlTag = 21,\n-116 CborExpectedBase64Tag = 22,\n-117 CborExpectedBase16Tag = 23,\n-118 CborEncodedCborTag = 24,\n-119 CborUrlTag = 32,\n-120 CborBase64urlTag = 33,\n-121 CborBase64Tag = 34,\n-122 CborRegularExpressionTag = 35,\n-123 CborMimeMessageTag = 36,\n-124 CborCOSE_EncryptTag = 96,\n-125 CborCOSE_MacTag = 97,\n-126 CborCOSE_SignTag = 98,\n-127 CborSignatureTag = 55799\n-128} CborKnownTags;\n-129\n-130/* #define the constants so we can check with #ifdef */\n-131#define CborDateTimeStringTag CborDateTimeStringTag\n-132#define CborUnixTime_tTag CborUnixTime_tTag\n-133#define CborPositiveBignumTag CborPositiveBignumTag\n-134#define CborNegativeBignumTag CborNegativeBignumTag\n-135#define CborDecimalTag CborDecimalTag\n-136#define CborBigfloatTag CborBigfloatTag\n-137#define CborCOSE_Encrypt0Tag CborCOSE_Encrypt0Tag\n-138#define CborCOSE_Mac0Tag CborCOSE_Mac0Tag\n-139#define CborCOSE_Sign1Tag CborCOSE_Sign1Tag\n-140#define CborExpectedBase64urlTag CborExpectedBase64urlTag\n-141#define CborExpectedBase64Tag CborExpectedBase64Tag\n-142#define CborExpectedBase16Tag CborExpectedBase16Tag\n-143#define CborEncodedCborTag CborEncodedCborTag\n-144#define CborUrlTag CborUrlTag\n-145#define CborBase64urlTag CborBase64urlTag\n-146#define CborBase64Tag CborBase64Tag\n-147#define CborRegularExpressionTag CborRegularExpressionTag\n-148#define CborMimeMessageTag CborMimeMessageTag\n-149#define CborCOSE_EncryptTag CborCOSE_EncryptTag\n-150#define CborCOSE_MacTag CborCOSE_MacTag\n-151#define CborCOSE_SignTag CborCOSE_SignTag\n-152#define CborSignatureTag CborSignatureTag\n-153\n-154/* Error API */\n-155\n-156typedef enum CborError {\n-157 CborNoError = 0,\n-158\n-159 /* errors in all modes */\n-160 CborUnknownError,\n-161 CborErrorUnknownLength, /* request for length in array, map, or string with\n-indeterminate length */\n-162 CborErrorAdvancePastEOF,\n-163 CborErrorIO,\n-164\n-165 /* parser errors streaming errors */\n-166 CborErrorGarbageAtEnd = 256,\n-167 CborErrorUnexpectedEOF,\n-168 CborErrorUnexpectedBreak,\n-169 CborErrorUnknownType, /* can only happen in major type 7 */\n-170 CborErrorIllegalType, /* type not allowed here */\n-171 CborErrorIllegalNumber,\n-172 CborErrorIllegalSimpleType, /* types of value less than 32 encoded in two\n-bytes */\n-173 CborErrorNoMoreStringChunks,\n-174\n-175 /* parser errors in strict mode parsing only */\n-176 CborErrorUnknownSimpleType = 512,\n-177 CborErrorUnknownTag,\n-178 CborErrorInappropriateTagForType,\n-179 CborErrorDuplicateObjectKeys,\n-180 CborErrorInvalidUtf8TextString,\n-181 CborErrorExcludedType,\n-182 CborErrorExcludedValue,\n-183 CborErrorImproperValue,\n-184 CborErrorOverlongEncoding,\n-185 CborErrorMapKeyNotString,\n-186 CborErrorMapNotSorted,\n-187 CborErrorMapKeysNotUnique,\n-188\n-189 /* encoder errors */\n-190 CborErrorTooManyItems = 768,\n-191 CborErrorTooFewItems,\n-192\n-193 /* internal implementation errors */\n-194 CborErrorDataTooLarge = 1024,\n-195 CborErrorNestingTooDeep,\n-196 CborErrorUnsupportedType,\n-197 CborErrorUnimplementedValidation,\n-198\n-199 /* errors in converting to JSON */\n-200 CborErrorJsonObjectKeyIsAggregate = 1280,\n-201 CborErrorJsonObjectKeyNotString,\n-202 CborErrorJsonNotImplemented,\n-203\n-204 CborErrorOutOfMemory = (int) (~0U / 2 + 1),\n-205 CborErrorInternalError = (int) (~0U / 2) /* INT_MAX on two's complement\n-machines */\n-206} CborError;\n-207\n-208CBOR_API const char *_\bc_\bb_\bo_\br_\b__\be_\br_\br_\bo_\br_\b__\bs_\bt_\br_\bi_\bn_\bg(CborError error);\n-209\n-210/* Encoder API */\n-211\n-212typedef enum CborEncoderAppendType\n-213{\n-214 CborEncoderAppendCborData = 0,\n-215 CborEncoderAppendStringData = 1\n-216} CborEncoderAppendType;\n-217\n-218typedef CborError (*CborEncoderWriteFunction)(void *, const void *, size_t,\n-CborEncoderAppendType);\n-219\n-220enum CborEncoderFlags\n-221{\n-222 CborIteratorFlag_WriterFunction = 0x01,\n-223 CborIteratorFlag_ContainerIsMap_ = 0x20\n-224};\n-225\n-_\b2_\b2_\b6struct _\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br\n-227{\n-228 union {\n-229 uint8_t *ptr;\n-230 ptrdiff_t bytes_needed;\n-231 CborEncoderWriteFunction writer;\n-232 } data;\n-233 uint8_t *end;\n-234 size_t remaining;\n-235 int flags;\n-236};\n-237typedef struct _\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br _\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br;\n-238\n-239static const size_t CborIndefiniteLength = SIZE_MAX;\n-240\n-241#ifndef CBOR_NO_ENCODER_API\n-242CBOR_API void _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bi_\bn_\bi_\bt(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, uint8_t *buffer,\n-size_t size, int flags);\n-243CBOR_API void cbor_encoder_init_writer(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder,\n-CborEncoderWriteFunction writer, void *);\n-244CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bu_\bi_\bn_\bt(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, uint64_t value);\n-245CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bi_\bn_\bt(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, int64_t value);\n-246CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bn_\be_\bg_\ba_\bt_\bi_\bv_\be_\b__\bi_\bn_\bt(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, uint64_t\n-absolute_value);\n-247CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bs_\bi_\bm_\bp_\bl_\be_\b__\bv_\ba_\bl_\bu_\be(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, uint8_t\n-value);\n-248CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bt_\ba_\bg(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, CborTag tag);\n-249CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bt_\be_\bx_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, const char\n-*string, size_t length);\n-250CBOR_INLINE_API CborError cbor_encode_text_stringz(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder,\n-const char *string)\n-251{ return _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bt_\be_\bx_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg(encoder, string, strlen(string)); }\n-252CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bb_\by_\bt_\be_\b__\bs_\bt_\br_\bi_\bn_\bg(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, const\n-uint8_t *string, size_t length);\n-253CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bf_\bl_\bo_\ba_\bt_\bi_\bn_\bg_\b__\bp_\bo_\bi_\bn_\bt(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, CborType\n-fpType, const void *value);\n-254\n-255CBOR_INLINE_API CborError cbor_encode_boolean(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, bool\n-value)\n-256{ return _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bs_\bi_\bm_\bp_\bl_\be_\b__\bv_\ba_\bl_\bu_\be(encoder, (int)value - 1 + (CborBooleanType\n-& 0x1f)); }\n-257CBOR_INLINE_API CborError cbor_encode_null(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder)\n-258{ return _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bs_\bi_\bm_\bp_\bl_\be_\b__\bv_\ba_\bl_\bu_\be(encoder, CborNullType & 0x1f); }\n-259CBOR_INLINE_API CborError cbor_encode_undefined(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder)\n-260{ return _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bs_\bi_\bm_\bp_\bl_\be_\b__\bv_\ba_\bl_\bu_\be(encoder, CborUndefinedType & 0x1f); }\n-261\n-262CBOR_INLINE_API CborError cbor_encode_half_float(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, const\n-void *value)\n-263{ return _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bf_\bl_\bo_\ba_\bt_\bi_\bn_\bg_\b__\bp_\bo_\bi_\bn_\bt(encoder, CborHalfFloatType, value); }\n-264CBOR_API CborError cbor_encode_float_as_half_float(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder,\n-float value);\n-265CBOR_INLINE_API CborError cbor_encode_float(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, float\n-value)\n-266{ return _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bf_\bl_\bo_\ba_\bt_\bi_\bn_\bg_\b__\bp_\bo_\bi_\bn_\bt(encoder, CborFloatType, &value); }\n-267CBOR_INLINE_API CborError cbor_encode_double(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *encoder, double\n-value)\n-268{ return _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bf_\bl_\bo_\ba_\bt_\bi_\bn_\bg_\b__\bp_\bo_\bi_\bn_\bt(encoder, CborDoubleType, &value); }\n-269\n-270CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bc_\br_\be_\ba_\bt_\be_\b__\ba_\br_\br_\ba_\by(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *parentEncoder,\n-_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *arrayEncoder, size_t length);\n-271CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bc_\br_\be_\ba_\bt_\be_\b__\bm_\ba_\bp(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *parentEncoder,\n-_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *mapEncoder, size_t length);\n-272CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bc_\bl_\bo_\bs_\be_\b__\bc_\bo_\bn_\bt_\ba_\bi_\bn_\be_\br(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *parentEncoder,\n-const _\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *containerEncoder);\n-273CBOR_API CborError _\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bc_\bl_\bo_\bs_\be_\b__\bc_\bo_\bn_\bt_\ba_\bi_\bn_\be_\br_\b__\bc_\bh_\be_\bc_\bk_\be_\bd(_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br\n-*parentEncoder, const _\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br *containerEncoder);\n-274\n-275CBOR_INLINE_API uint8_t *_cbor_encoder_get_buffer_pointer(const _\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br\n-*encoder)\n-276{\n-277 return encoder->data.ptr;\n-278}\n-279\n-280CBOR_INLINE_API size_t cbor_encoder_get_buffer_size(const _\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br\n-*encoder, const uint8_t *buffer)\n-281{\n-282 return (size_t)(encoder->data.ptr - buffer);\n-283}\n-284\n-285CBOR_INLINE_API size_t cbor_encoder_get_extra_bytes_needed(const _\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br\n-*encoder)\n-286{\n-287 return encoder->end ? 0 : (size_t)encoder->data.bytes_needed;\n-288}\n-289#endif /* CBOR_NO_ENCODER_API */\n-290\n-291/* Parser API */\n-292\n-293enum CborParserGlobalFlags\n-294{\n-295 CborParserFlag_ExternalSource = 0x01\n-296};\n-297\n-298enum CborParserIteratorFlags\n-299{\n-300 /* used for all types, but not during string chunk iteration\n-301 * (values are static-asserted, don't change) */\n-302 CborIteratorFlag_IntegerValueIs64Bit = 0x01,\n-303 CborIteratorFlag_IntegerValueTooLarge = 0x02,\n-304\n-305 /* used only for CborIntegerType */\n-306 CborIteratorFlag_NegativeInteger = 0x04,\n-307\n-308 /* used only during string iteration */\n-309 CborIteratorFlag_BeforeFirstStringChunk = 0x04,\n-310 CborIteratorFlag_IteratingStringChunks = 0x08,\n-311\n-312 /* used for arrays, maps and strings, including during chunk iteration */\n-313 CborIteratorFlag_UnknownLength = 0x10,\n-314\n-315 /* used for maps, but must be kept for all types\n-316 * (ContainerIsMap value must be CborMapType - CborArrayType) */\n-317 CborIteratorFlag_ContainerIsMap = 0x20,\n-318 CborIteratorFlag_NextIsMapKey = 0x40\n-319};\n-320\n-321struct _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be;\n-322struct CborParserOperations\n-323{\n-324 bool (*can_read_bytes)(void *token, size_t len);\n-325 void *(*read_bytes)(void *token, void *dst, size_t offset, size_t len);\n-326 void (*advance_bytes)(void *token, size_t len);\n-327 CborError (*transfer_string)(void *token, const void **userptr, size_t\n-offset, size_t len);\n-328};\n-329\n-330struct CborParser\n-331{\n-332 union {\n-333 const uint8_t *end;\n-334 const struct CborParserOperations *ops;\n-335 } source;\n-336 enum CborParserGlobalFlags flags;\n-337};\n-338typedef struct CborParser CborParser;\n-339\n-_\b3_\b4_\b0struct _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-341{\n-342 const CborParser *parser;\n-343 union {\n-344 const uint8_t *ptr;\n-345 void *token;\n-346 } source;\n-347 uint32_t remaining;\n-348 uint16_t extra;\n-349 uint8_t type;\n-350 uint8_t flags;\n-351};\n-352typedef struct _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be;\n-353\n-354#ifndef CBOR_NO_PARSER_API\n-355CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bp_\ba_\br_\bs_\be_\br_\b__\bi_\bn_\bi_\bt(const uint8_t *buffer, size_t size,\n-uint32_t flags, CborParser *parser, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it);\n-356CBOR_API CborError cbor_parser_init_reader(const struct CborParserOperations\n-*ops, CborParser *parser, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it, void *token);\n-357\n-358CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be_\b__\bb_\ba_\bs_\bi_\bc(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it);\n-359\n-360CBOR_INLINE_API bool cbor_value_at_end(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it)\n-361{ return it->remaining == 0; }\n-362CBOR_INLINE_API const uint8_t *cbor_value_get_next_byte(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it)\n-363{ return it->source.ptr; }\n-364CBOR_API CborError cbor_value_reparse(_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it);\n-365CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be_\b__\bf_\bi_\bx_\be_\bd(_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it);\n-366CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be(_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it);\n-367CBOR_INLINE_API bool cbor_value_is_container(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it)\n-368{ return it->type == CborArrayType || it->type == CborMapType; }\n-369CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\be_\bn_\bt_\be_\br_\b__\bc_\bo_\bn_\bt_\ba_\bi_\bn_\be_\br(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*recursed);\n-370CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bl_\be_\ba_\bv_\be_\b__\bc_\bo_\bn_\bt_\ba_\bi_\bn_\be_\br(_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it, const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*recursed);\n-371\n-372CBOR_PRIVATE_API uint64_t _cbor_value_decode_int64_internal(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value);\n-373CBOR_INLINE_API uint64_t _cbor_value_extract_int64_helper(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value)\n-374{\n-375 return value->flags & CborIteratorFlag_IntegerValueTooLarge ?\n-376 _cbor_value_decode_int64_internal(value) : value->extra;\n-377}\n-378\n-379CBOR_INLINE_API bool cbor_value_is_valid(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-380{ return value && value->type != CborInvalidType; }\n-381CBOR_INLINE_API CborType cbor_value_get_type(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-382{ return (CborType)value->type; }\n-383\n-384/* Null & undefined type */\n-385CBOR_INLINE_API bool cbor_value_is_null(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-386{ return value->type == CborNullType; }\n-387CBOR_INLINE_API bool cbor_value_is_undefined(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-388{ return value->type == CborUndefinedType; }\n-389\n-390/* Booleans */\n-391CBOR_INLINE_API bool cbor_value_is_boolean(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-392{ return value->type == CborBooleanType; }\n-393CBOR_INLINE_API CborError cbor_value_get_boolean(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-bool *result)\n-394{\n-395 assert(cbor_value_is_boolean(value));\n-396 *result = !!value->extra;\n-397 return CborNoError;\n-398}\n-399\n-400/* Simple types */\n-401CBOR_INLINE_API bool cbor_value_is_simple_type(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-402{ return value->type == CborSimpleType; }\n-403CBOR_INLINE_API CborError cbor_value_get_simple_type(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-uint8_t *result)\n-404{\n-405 assert(cbor_value_is_simple_type(value));\n-406 *result = (uint8_t)value->extra;\n-407 return CborNoError;\n-408}\n-409\n-410/* Integers */\n-411CBOR_INLINE_API bool cbor_value_is_integer(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-412{ return value->type == CborIntegerType; }\n-413CBOR_INLINE_API bool cbor_value_is_unsigned_integer(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-414{ return cbor_value_is_integer(value) && (value->flags &\n-CborIteratorFlag_NegativeInteger) == 0; }\n-415CBOR_INLINE_API bool cbor_value_is_negative_integer(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-416{ return cbor_value_is_integer(value) && (value->flags &\n-CborIteratorFlag_NegativeInteger); }\n-417\n-418CBOR_INLINE_API CborError cbor_value_get_raw_integer(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-uint64_t *result)\n-419{\n-420 assert(cbor_value_is_integer(value));\n-421 *result = _cbor_value_extract_int64_helper(value);\n-422 return CborNoError;\n-423}\n-424\n-425CBOR_INLINE_API CborError cbor_value_get_uint64(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-uint64_t *result)\n-426{\n-427 assert(cbor_value_is_unsigned_integer(value));\n-428 *result = _cbor_value_extract_int64_helper(value);\n-429 return CborNoError;\n-430}\n-431\n-432CBOR_INLINE_API CborError cbor_value_get_int64(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-int64_t *result)\n-433{\n-434 assert(cbor_value_is_integer(value));\n-435 *result = (int64_t) _cbor_value_extract_int64_helper(value);\n-436 if (value->flags & CborIteratorFlag_NegativeInteger)\n-437 *result = -*result - 1;\n-438 return CborNoError;\n-439}\n-440\n-441CBOR_INLINE_API CborError cbor_value_get_int(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value, int\n-*result)\n-442{\n-443 assert(cbor_value_is_integer(value));\n-444 *result = (int) _cbor_value_extract_int64_helper(value);\n-445 if (value->flags & CborIteratorFlag_NegativeInteger)\n-446 *result = -*result - 1;\n-447 return CborNoError;\n-448}\n-449\n-450CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bg_\be_\bt_\b__\bi_\bn_\bt_\b6_\b4_\b__\bc_\bh_\be_\bc_\bk_\be_\bd(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-int64_t *result);\n-451CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bg_\be_\bt_\b__\bi_\bn_\bt_\b__\bc_\bh_\be_\bc_\bk_\be_\bd(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value, int\n-*result);\n-452\n-453CBOR_INLINE_API bool cbor_value_is_length_known(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-454{ return (value->flags & CborIteratorFlag_UnknownLength) == 0; }\n-455\n-456/* Tags */\n-457CBOR_INLINE_API bool cbor_value_is_tag(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-458{ return value->type == CborTagType; }\n-459CBOR_INLINE_API CborError cbor_value_get_tag(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value, CborTag\n-*result)\n-460{\n-461 assert(cbor_value_is_tag(value));\n-462 *result = _cbor_value_extract_int64_helper(value);\n-463 return CborNoError;\n-464}\n-465CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bs_\bk_\bi_\bp_\b__\bt_\ba_\bg(_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it);\n-466\n-467/* Strings */\n-468CBOR_INLINE_API bool cbor_value_is_byte_string(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-469{ return value->type == CborByteStringType; }\n-470CBOR_INLINE_API bool cbor_value_is_text_string(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-471{ return value->type == CborTextStringType; }\n-472\n-473CBOR_INLINE_API CborError cbor_value_get_string_length(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, size_t *length)\n-474{\n-475 uint64_t v;\n-476 assert(cbor_value_is_byte_string(value) || cbor_value_is_text_string\n-(value));\n-477 if (!cbor_value_is_length_known(value))\n-478 return CborErrorUnknownLength;\n-479 v = _cbor_value_extract_int64_helper(value);\n-480 *length = (size_t)v;\n-481 if (*length != v)\n-482 return CborErrorDataTooLarge;\n-483 return CborNoError;\n-484}\n-485\n-486CBOR_PRIVATE_API CborError _cbor_value_copy_string(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-void *buffer,\n-487 size_t *buflen, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *next);\n-488CBOR_PRIVATE_API CborError _cbor_value_dup_string(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-void **buffer,\n-489 size_t *buflen, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *next);\n-490\n-491CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bc_\ba_\bl_\bc_\bu_\bl_\ba_\bt_\be_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, size_t *length);\n-492\n-493CBOR_INLINE_API CborError cbor_value_copy_text_string(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, char *buffer,\n-494 size_t *buflen, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *next)\n-495{\n-496 assert(cbor_value_is_text_string(value));\n-497 return _cbor_value_copy_string(value, buffer, buflen, next);\n-498}\n-499CBOR_INLINE_API CborError cbor_value_copy_byte_string(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, uint8_t *buffer,\n-500 size_t *buflen, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *next)\n-501{\n-502 assert(cbor_value_is_byte_string(value));\n-503 return _cbor_value_copy_string(value, buffer, buflen, next);\n-504}\n-505\n-_\b5_\b0_\b6CBOR_INLINE_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bd_\bu_\bp_\b__\bt_\be_\bx_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-char **buffer,\n-507 size_t *buflen, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *next)\n-508{\n-509 assert(cbor_value_is_text_string(value));\n-510 return _cbor_value_dup_string(value, (void **)buffer, buflen, next);\n-511}\n-_\b5_\b1_\b2CBOR_INLINE_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bd_\bu_\bp_\b__\bb_\by_\bt_\be_\b__\bs_\bt_\br_\bi_\bn_\bg(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-uint8_t **buffer,\n-513 size_t *buflen, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *next)\n-514{\n-515 assert(cbor_value_is_byte_string(value));\n-516 return _cbor_value_dup_string(value, (void **)buffer, buflen, next);\n-517}\n-518\n-519CBOR_PRIVATE_API CborError _cbor_value_get_string_chunk_size(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, size_t *len);\n-520CBOR_INLINE_API CborError cbor_value_get_string_chunk_size(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, size_t *len)\n-521{\n-522 assert(value->flags & CborIteratorFlag_IteratingStringChunks);\n-523 return _cbor_value_get_string_chunk_size(value, len);\n-524}\n-525\n-526CBOR_INLINE_API bool cbor_value_string_iteration_at_end(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value)\n-527{\n-528 size_t dummy;\n-529 return cbor_value_get_string_chunk_size(value, &dummy) ==\n-CborErrorNoMoreStringChunks;\n-530}\n-531\n-532CBOR_PRIVATE_API CborError _cbor_value_begin_string_iteration(_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value);\n-533CBOR_INLINE_API CborError cbor_value_begin_string_iteration(_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value)\n-534{\n-535 assert(cbor_value_is_text_string(value) || cbor_value_is_byte_string\n-(value));\n-536 assert(!(value->flags & CborIteratorFlag_IteratingStringChunks));\n-537 return _cbor_value_begin_string_iteration(value);\n-538}\n-539\n-540CBOR_PRIVATE_API CborError _cbor_value_finish_string_iteration(_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value);\n-541CBOR_INLINE_API CborError cbor_value_finish_string_iteration(_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value)\n-542{\n-543 assert(cbor_value_string_iteration_at_end(value));\n-544 return _cbor_value_finish_string_iteration(value);\n-545}\n-546\n-547CBOR_PRIVATE_API CborError _cbor_value_get_string_chunk(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, const void **bufferptr,\n-548 size_t *len, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *next);\n-549CBOR_INLINE_API CborError cbor_value_get_text_string_chunk(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, const char **bufferptr,\n-550 size_t *len, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *next)\n-551{\n-552 assert(cbor_value_is_text_string(value));\n-553 return _cbor_value_get_string_chunk(value, (const void **)bufferptr, len,\n-next);\n-554}\n-555CBOR_INLINE_API CborError cbor_value_get_byte_string_chunk(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, const uint8_t **bufferptr,\n-556 size_t *len, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *next)\n-557{\n-558 assert(cbor_value_is_byte_string(value));\n-559 return _cbor_value_get_string_chunk(value, (const void **)bufferptr, len,\n-next);\n-560}\n-561\n-562CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\be_\bx_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\be_\bq_\bu_\ba_\bl_\bs(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-const char *string, bool *result);\n-563\n-564/* Maps and arrays */\n-565CBOR_INLINE_API bool cbor_value_is_array(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-566{ return value->type == CborArrayType; }\n-567CBOR_INLINE_API bool cbor_value_is_map(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-568{ return value->type == CborMapType; }\n-569\n-570CBOR_INLINE_API CborError cbor_value_get_array_length(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, size_t *length)\n-571{\n-572 uint64_t v;\n-573 assert(cbor_value_is_array(value));\n-574 if (!cbor_value_is_length_known(value))\n-575 return CborErrorUnknownLength;\n-576 v = _cbor_value_extract_int64_helper(value);\n-577 *length = (size_t)v;\n-578 if (*length != v)\n-579 return CborErrorDataTooLarge;\n-580 return CborNoError;\n-581}\n-582\n-583CBOR_INLINE_API CborError cbor_value_get_map_length(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-size_t *length)\n-584{\n-585 uint64_t v;\n-586 assert(cbor_value_is_map(value));\n-587 if (!cbor_value_is_length_known(value))\n-588 return CborErrorUnknownLength;\n-589 v = _cbor_value_extract_int64_helper(value);\n-590 *length = (size_t)v;\n-591 if (*length != v)\n-592 return CborErrorDataTooLarge;\n-593 return CborNoError;\n-594}\n-595\n-596CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bm_\ba_\bp_\b__\bf_\bi_\bn_\bd_\b__\bv_\ba_\bl_\bu_\be(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *map, const\n-char *string, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *element);\n-597\n-598/* Floating point */\n-599CBOR_INLINE_API bool cbor_value_is_half_float(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-600{ return value->type == CborHalfFloatType; }\n-601CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bg_\be_\bt_\b__\bh_\ba_\bl_\bf_\b__\bf_\bl_\bo_\ba_\bt_\b__\ba_\bs_\b__\bf_\bl_\bo_\ba_\bt(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, float *result);\n-602CBOR_INLINE_API CborError cbor_value_get_half_float(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-void *result)\n-603{\n-604 assert(cbor_value_is_half_float(value));\n-605 assert((value->flags & CborIteratorFlag_IntegerValueTooLarge) == 0);\n-606\n-607 /* size has already been computed */\n-608 memcpy(result, &value->extra, sizeof(value->extra));\n-609 return CborNoError;\n-610}\n-611\n-612CBOR_INLINE_API bool cbor_value_is_float(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-613{ return value->type == CborFloatType; }\n-614CBOR_INLINE_API CborError cbor_value_get_float(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value, float\n-*result)\n-615{\n-616 uint32_t data;\n-617 assert(cbor_value_is_float(value));\n-618 assert(value->flags & CborIteratorFlag_IntegerValueTooLarge);\n-619 data = (uint32_t)_cbor_value_decode_int64_internal(value);\n-620 memcpy(result, &data, sizeof(*result));\n-621 return CborNoError;\n-622}\n-623\n-624CBOR_INLINE_API bool cbor_value_is_double(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value)\n-625{ return value->type == CborDoubleType; }\n-626CBOR_INLINE_API CborError cbor_value_get_double(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n-double *result)\n-627{\n-628 uint64_t data;\n-629 assert(cbor_value_is_double(value));\n-630 assert(value->flags & CborIteratorFlag_IntegerValueTooLarge);\n-631 data = _cbor_value_decode_int64_internal(value);\n-632 memcpy(result, &data, sizeof(*result));\n-633 return CborNoError;\n-634}\n-635\n-636/* Validation API */\n-637#ifndef CBOR_NO_VALIDATION_API\n-638\n-639enum CborValidationFlags {\n-640 /* Bit mapping:\n-641 * bits 0-7 (8 bits): canonical format\n-642 * bits 8-11 (4 bits): canonical format & strict mode\n-643 * bits 12-20 (8 bits): strict mode\n-644 * bits 21-31 (10 bits): other\n-645 */\n-646\n-647 CborValidateShortestIntegrals = 0x0001,\n-648 CborValidateShortestFloatingPoint = 0x0002,\n-649 CborValidateShortestNumbers = CborValidateShortestIntegrals |\n-CborValidateShortestFloatingPoint,\n-650 CborValidateNoIndeterminateLength = 0x0100,\n-651 CborValidateMapIsSorted = 0x0200 | CborValidateNoIndeterminateLength,\n-652\n-653 CborValidateCanonicalFormat = 0x0fff,\n-654\n-655 CborValidateMapKeysAreUnique = 0x1000 | CborValidateMapIsSorted,\n-656 CborValidateTagUse = 0x2000,\n-657 CborValidateUtf8 = 0x4000,\n-658\n-659 CborValidateStrictMode = 0xfff00,\n-660\n-661 CborValidateMapKeysAreString = 0x100000,\n-662 CborValidateNoUndefined = 0x200000,\n-663 CborValidateNoTags = 0x400000,\n-664 CborValidateFiniteFloatingPoint = 0x800000,\n-665 /* unused = 0x1000000, */\n-666 /* unused = 0x2000000, */\n-667\n-668 CborValidateNoUnknownSimpleTypesSA = 0x4000000,\n-669 CborValidateNoUnknownSimpleTypes = 0x8000000 |\n-CborValidateNoUnknownSimpleTypesSA,\n-670 CborValidateNoUnknownTagsSA = 0x10000000,\n-671 CborValidateNoUnknownTagsSR = 0x20000000 | CborValidateNoUnknownTagsSA,\n-672 CborValidateNoUnknownTags = 0x40000000 | CborValidateNoUnknownTagsSR,\n-673\n-674 CborValidateCompleteData = (int)0x80000000,\n-675\n-676 CborValidateStrictest = (int)~0U,\n-677 CborValidateBasic = 0\n-678};\n-679\n-680CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be(const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *it, uint32_t flags);\n-681#endif /* CBOR_NO_VALIDATION_API */\n-682\n-683/* Human-readable (dump) API */\n-684#ifndef CBOR_NO_PRETTY_API\n-685\n-686enum CborPrettyFlags {\n-687 CborPrettyNumericEncodingIndicators = 0x01,\n-688 CborPrettyTextualEncodingIndicators = 0,\n-689\n-690 CborPrettyIndicateIndeterminateLength = 0x02,\n-691 CborPrettyIndicateIndetermineLength =\n-CborPrettyIndicateIndeterminateLength, /* deprecated */\n-692 CborPrettyIndicateOverlongNumbers = 0x04,\n-693\n-694 CborPrettyShowStringFragments = 0x100,\n-695 CborPrettyMergeStringFragments = 0,\n-696\n-697 CborPrettyDefaultFlags = CborPrettyIndicateIndeterminateLength\n-698};\n-699\n-700typedef CborError (*CborStreamFunction)(void *token, const char *fmt, ...)\n-701#ifdef __GNUC__\n-702 __attribute__((__format__(printf, 2, 3)))\n-703#endif\n-704;\n-705\n-706CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bp_\br_\be_\bt_\bt_\by_\b__\bs_\bt_\br_\be_\ba_\bm(CborStreamFunction\n-streamFunction, void *token, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value, int flags);\n-707\n-708/* The following API requires a hosted C implementation (uses FILE*) */\n-709#if !defined(__STDC_HOSTED__) || __STDC_HOSTED__-0 == 1\n-710CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bp_\br_\be_\bt_\bt_\by_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs(FILE *out, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value, int flags);\n-711CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bp_\br_\be_\bt_\bt_\by_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be(FILE *out, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value);\n-_\b7_\b1_\b2CBOR_INLINE_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bp_\br_\be_\bt_\bt_\by(FILE *out, const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-*value)\n-713{\n-714 _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be copy = *value;\n-715 return _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bp_\br_\be_\bt_\bt_\by_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs(out, ©,\n-CborPrettyDefaultFlags);\n-716}\n-717#endif /* __STDC_HOSTED__ check */\n-718\n-719#endif /* CBOR_NO_PRETTY_API */\n-720\n-721#endif /* CBOR_NO_PARSER_API */\n-722\n-723#ifdef __cplusplus\n-724}\n-725#endif\n-726\n-727#endif /* CBOR_H */\n-728\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bp_\br_\be_\bt_\bt_\by\n-CborError cbor_value_to_pretty(FILE *out, const CborValue *value)\n-Converts the current CBOR type pointed to by value to its textual\n-representation and writes it to the...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cbor.h:712\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bd_\bu_\bp_\b__\bt_\be_\bx_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg\n-CborError cbor_value_dup_text_string(const CborValue *value, char **buffer,\n-size_t *buflen, CborValue *next)\n-Allocates memory for the string pointed by value and copies it into this\n-buffer.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cbor.h:506\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bg_\be_\bt_\b__\bh_\ba_\bl_\bf_\b__\bf_\bl_\bo_\ba_\bt_\b__\ba_\bs_\b__\bf_\bl_\bo_\ba_\bt\n-CBOR_API CborError cbor_value_get_half_float_as_float(const CborValue *value,\n-float *result)\n-Retrieves the CBOR half-precision floating point (16-bit) value that value\n-points to,...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser_float.c:45\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bp_\br_\be_\bt_\bt_\by_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs\n-CBOR_API CborError cbor_value_to_pretty_advance_flags(FILE *out, CborValue\n-*value, int flags)\n-Converts the current CBOR type pointed to by value to its textual\n-representation and writes it to the...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborpretty_stdio.c:83\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bd_\bu_\bp_\b__\bb_\by_\bt_\be_\b__\bs_\bt_\br_\bi_\bn_\bg\n-CborError cbor_value_dup_byte_string(const CborValue *value, uint8_t **buffer,\n-size_t *buflen, CborValue *next)\n-Allocates memory for the string pointed by value and copies it into this\n-buffer.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cbor.h:512\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bp_\br_\be_\bt_\bt_\by_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be\n-CBOR_API CborError cbor_value_to_pretty_advance(FILE *out, CborValue *value)\n-Converts the current CBOR type pointed to by value to its textual\n-representation and writes it to the...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborpretty_stdio.c:63\n-_\bc_\bb_\bo_\br_\b__\be_\br_\br_\bo_\br_\b__\bs_\bt_\br_\bi_\bn_\bg\n-CBOR_API const char * cbor_error_string(CborError error)\n-Returns the error string corresponding to the CBOR error condition error.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborerrorstrings.c:80\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bn_\be_\bg_\ba_\bt_\bi_\bv_\be_\b__\bi_\bn_\bt\n-CBOR_API CborError cbor_encode_negative_int(CborEncoder *encoder, uint64_t\n-absolute_value)\n-Appends the negative 64-bit integer whose absolute value is absolute_value to\n-the CBOR stream provide...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:369\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bb_\by_\bt_\be_\b__\bs_\bt_\br_\bi_\bn_\bg\n-CBOR_API CborError cbor_encode_byte_string(CborEncoder *encoder, const uint8_t\n-*string, size_t length)\n-Appends the byte string string of length length to the CBOR stream provided by\n-encoder.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:471\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bi_\bn_\bi_\bt\n-CBOR_API void cbor_encoder_init(CborEncoder *encoder, uint8_t *buffer, size_t\n-size, int flags)\n-Initializes a CborEncoder structure encoder by pointing it to buffer buffer of\n-size size.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:204\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bu_\bi_\bn_\bt\n-CBOR_API CborError cbor_encode_uint(CborEncoder *encoder, uint64_t value)\n-Appends the unsigned 64-bit integer value to the CBOR stream provided by\n-encoder.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:356\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bt_\be_\bx_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg\n-CBOR_API CborError cbor_encode_text_string(CborEncoder *encoder, const char\n-*string, size_t length)\n-Appends the text string string of length length to the CBOR stream provided by\n-encoder.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:483\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bc_\bl_\bo_\bs_\be_\b__\bc_\bo_\bn_\bt_\ba_\bi_\bn_\be_\br\n-CBOR_API CborError cbor_encoder_close_container(CborEncoder *parentEncoder,\n-const CborEncoder *containerEncoder)\n-Closes the CBOR container (array or map) provided by containerEncoder and\n-updates the CBOR stream pro...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:574\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bt_\ba_\bg\n-CBOR_API CborError cbor_encode_tag(CborEncoder *encoder, CborTag tag)\n-Appends the CBOR tag tag to the CBOR stream provided by encoder.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:440\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bs_\bi_\bm_\bp_\bl_\be_\b__\bv_\ba_\bl_\bu_\be\n-CBOR_API CborError cbor_encode_simple_value(CborEncoder *encoder, uint8_t\n-value)\n-Appends the CBOR Simple Type of value value to the CBOR stream provided by\n-encoder.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:396\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bc_\br_\be_\ba_\bt_\be_\b__\ba_\br_\br_\ba_\by\n-CBOR_API CborError cbor_encoder_create_array(CborEncoder *parentEncoder,\n-CborEncoder *arrayEncoder, size_t length)\n-Creates a CBOR array in the CBOR stream provided by parentEncoder and\n-initializes arrayEncoder so tha...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:531\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bc_\bl_\bo_\bs_\be_\b__\bc_\bo_\bn_\bt_\ba_\bi_\bn_\be_\br_\b__\bc_\bh_\be_\bc_\bk_\be_\bd\n-CBOR_API CborError cbor_encoder_close_container_checked(CborEncoder\n-*parentEncoder, const CborEncoder *containerEncoder)\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder_close_container_checked.c:53\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\br_\b__\bc_\br_\be_\ba_\bt_\be_\b__\bm_\ba_\bp\n-CBOR_API CborError cbor_encoder_create_map(CborEncoder *parentEncoder,\n-CborEncoder *mapEncoder, size_t length)\n-Creates a CBOR map in the CBOR stream provided by parentEncoder and initializes\n-mapEncoder so that it...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:555\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bi_\bn_\bt\n-CBOR_API CborError cbor_encode_int(CborEncoder *encoder, int64_t value)\n-Appends the signed 64-bit integer value to the CBOR stream provided by encoder.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:380\n-_\bc_\bb_\bo_\br_\b__\be_\bn_\bc_\bo_\bd_\be_\b__\bf_\bl_\bo_\ba_\bt_\bi_\bn_\bg_\b__\bp_\bo_\bi_\bn_\bt\n-CBOR_API CborError cbor_encode_floating_point(CborEncoder *encoder, CborType\n-fpType, const void *value)\n-Appends the floating-point value of type fpType and pointed to by value to the\n-CBOR stream provided b...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborencoder.c:417\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\be_\bn_\bt_\be_\br_\b__\bc_\bo_\bn_\bt_\ba_\bi_\bn_\be_\br\n-CBOR_API CborError cbor_value_enter_container(const CborValue *it, CborValue\n-*recursed)\n-Creates a CborValue iterator pointing to the first element of the container\n-represented by it and sav...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:578\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be_\b__\bb_\ba_\bs_\bi_\bc\n-CBOR_API CborError cbor_value_validate_basic(const CborValue *it)\n-Performs a basic validation of the CBOR stream pointed by it and returns the\n-error it found.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:442\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bs_\bk_\bi_\bp_\b__\bt_\ba_\bg\n-CBOR_API CborError cbor_value_skip_tag(CborValue *it)\n-Advances the CBOR value it until it no longer points to a tag.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:551\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be\n-CBOR_API CborError cbor_value_validate(const CborValue *it, uint32_t flags)\n-Performs a full validation, controlled by the flags options, of the CBOR stream\n-pointed by it and ret...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborvalidation.c:645\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bl_\be_\ba_\bv_\be_\b__\bc_\bo_\bn_\bt_\ba_\bi_\bn_\be_\br\n-CBOR_API CborError cbor_value_leave_container(CborValue *it, const CborValue\n-*recursed)\n-Updates it to point to the next element after the container.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:627\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bg_\be_\bt_\b__\bi_\bn_\bt_\b6_\b4_\b__\bc_\bh_\be_\bc_\bk_\be_\bd\n-CBOR_API CborError cbor_value_get_int64_checked(const CborValue *value, int64_t\n-*result)\n-Retrieves the CBOR integer value that value points to and stores it in result.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:812\n-_\bc_\bb_\bo_\br_\b__\bp_\ba_\br_\bs_\be_\br_\b__\bi_\bn_\bi_\bt\n-CBOR_API CborError cbor_parser_init(const uint8_t *buffer, size_t size,\n-uint32_t flags, CborParser *parser, CborValue *it)\n-Initializes the CBOR parser for parsing size bytes beginning at buffer.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:345\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be_\b__\bf_\bi_\bx_\be_\bd\n-CBOR_API CborError cbor_value_advance_fixed(CborValue *it)\n-Advances the CBOR value it by one fixed-size position.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:463\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\be_\bx_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\be_\bq_\bu_\ba_\bl_\bs\n-CBOR_API CborError cbor_value_text_string_equals(const CborValue *value, const\n-char *string, bool *result)\n-Compares the entry value with the string string and stores the result in\n-result.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:1323\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bc_\ba_\bl_\bc_\bu_\bl_\ba_\bt_\be_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh\n-CBOR_API CborError cbor_value_calculate_string_length(const CborValue *value,\n-size_t *length)\n-Calculates the length of the byte or text string that value points to and\n-stores it in len.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:963\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be\n-CBOR_API CborError cbor_value_advance(CborValue *it)\n-Advances the CBOR value it by one element, skipping over containers.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:515\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bm_\ba_\bp_\b__\bf_\bi_\bn_\bd_\b__\bv_\ba_\bl_\bu_\be\n-CBOR_API CborError cbor_value_map_find_value(const CborValue *map, const char\n-*string, CborValue *element)\n-Attempts to find the value in map map that corresponds to the text string entry\n-string.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:1411\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bg_\be_\bt_\b__\bi_\bn_\bt_\b__\bc_\bh_\be_\bc_\bk_\be_\bd\n-CBOR_API CborError cbor_value_get_int_checked(const CborValue *value, int\n-*result)\n-Retrieves the CBOR integer value that value points to and stores it in result.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborparser.c:852\n-_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bp_\br_\be_\bt_\bt_\by_\b__\bs_\bt_\br_\be_\ba_\bm\n-CBOR_API CborError cbor_value_to_pretty_stream(CborStreamFunction\n-streamFunction, void *token, CborValue *value, int flags)\n-Converts the current CBOR type pointed by value to its textual representation\n-and writes it to the st...\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cborpretty.c:578\n-_\bC_\bb_\bo_\br_\bE_\bn_\bc_\bo_\bd_\be_\br\n-Structure used to encode to CBOR.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cbor.h:227\n-_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n-This type contains one value parsed from the CBOR stream.\n-D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cbor.h:341\n+25#if defined(CBOR_CUSTOM_ALLOC_INCLUDE)\n+26# include CBOR_CUSTOM_ALLOC_INCLUDE\n+27#else\n+28# include \n+29# define cbor_malloc malloc\n+30# define cbor_free free\n+31#endif\n ===============================================================================\n Generated by\u00a0_\b[_\bd_\bo_\bx_\by_\bg_\be_\bn_\b] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libtinycbor-dev/html/a00038_source.html", "source2": "./usr/share/doc/libtinycbor-dev/html/a00038_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-TinyCBOR 0.6.0 API: memory.h Source File\n+TinyCBOR 0.6.0 API: cborjson.h Source File\n \n \n \n \n \n \n
\n@@ -39,20 +39,20 @@\n \n
\n
\n
\n-
memory.h
\n+
cborjson.h
\n
\n
\n-
1/****************************************************************************
\n+Go to the documentation of this file.
1/****************************************************************************
\n
2**
\n-
3** Copyright (C) 2016 Intel Corporation
\n+
3** Copyright (C) 2015 Intel Corporation
\n
4**
\n
5** Permission is hereby granted, free of charge, to any person obtaining a copy
\n
6** of this software and associated documentation files (the "Software"), to deal
\n
7** in the Software without restriction, including without limitation the rights
\n
8** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\n
9** copies of the Software, and to permit persons to whom the Software is
\n
10** furnished to do so, subject to the following conditions:
\n@@ -66,21 +66,55 @@\n
18** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\n
19** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\n
20** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\n
21** THE SOFTWARE.
\n
22**
\n
23****************************************************************************/
\n
24
\n-
25#if defined(CBOR_CUSTOM_ALLOC_INCLUDE)
\n-
26# include CBOR_CUSTOM_ALLOC_INCLUDE
\n-
27#else
\n-
28# include <stdlib.h>
\n-
29# define cbor_malloc malloc
\n-
30# define cbor_free free
\n-
31#endif
\n+
25#ifndef CBORJSON_H
\n+
26#define CBORJSON_H
\n+
27
\n+
28#include "cbor.h"
\n+
29
\n+
30#ifdef __cplusplus
\n+
31extern "C" {
\n+
32#endif
\n+
33
\n+
34/* Conversion to JSON */
\n+
35enum CborToJsonFlags
\n+
36{
\n+
37 CborConvertAddMetadata = 1,
\n+
38 CborConvertTagsToObjects = 2,
\n+
39 CborConvertIgnoreTags = 0,
\n+
40
\n+
41 CborConvertObeyByteStringTags = 0,
\n+
42 CborConvertByteStringsToBase64Url = 4,
\n+
43
\n+
44 CborConvertRequireMapStringKeys = 0,
\n+
45 CborConvertStringifyMapKeys = 8,
\n+
46
\n+
47 CborConvertDefaultFlags = 0
\n+
48};
\n+
49
\n+
50CBOR_API CborError cbor_value_to_json_advance(FILE *out, CborValue *value, int flags);
\n+
51CBOR_INLINE_API CborError cbor_value_to_json(FILE *out, const CborValue *value, int flags)
\n+
52{
\n+
53 CborValue copy = *value;
\n+
54 return cbor_value_to_json_advance(out, &copy, flags);
\n+
55}
\n+
56
\n+
57#ifdef __cplusplus
\n+
58}
\n+
59#endif
\n+
60
\n+
61#endif /* CBORJSON_H */
\n+
62
\n+
> The <cbor.h> is the main header in TinyCBOR and defines the constants used by most functions as wel...
\n+
CborError cbor_value_to_json_advance(FILE *out, CborValue *value, int flags)
Converts the current CBOR type pointed to by value to JSON and writes that to the out stream.
Definition cbortojson.c:704
\n+
This type contains one value parsed from the CBOR stream.
Definition cbor.h:341
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,18 +1,19 @@\n TinyCBOR 0.6.0 API\n * _\bM_\ba_\bi_\bn_\b\u00a0_\bP_\ba_\bg_\be\n * _\bT_\bo_\bp_\bi_\bc_\bs\n * _\bD_\ba_\bt_\ba_\b\u00a0_\bS_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\bs\n * _\bF_\bi_\bl_\be_\bs\n * _\bF_\bi_\bl_\be_\b\u00a0_\bL_\bi_\bs_\bt\n * _\bG_\bl_\bo_\bb_\ba_\bl_\bs\n-memory.h\n+cborjson.h\n+_\bG_\bo_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\bf_\bi_\bl_\be_\b.\n 1/****************************************************************************\n 2**\n-3** Copyright (C) 2016 Intel Corporation\n+3** Copyright (C) 2015 Intel Corporation\n 4**\n 5** Permission is hereby granted, free of charge, to any person obtaining a\n copy\n 6** of this software and associated documentation files (the \"Software\"), to\n deal\n 7** in the Software without restriction, including without limitation the\n rights\n@@ -31,16 +32,60 @@\n 19** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM,\n 20** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n 21** THE SOFTWARE.\n 22**\n 23****************************************************************************/\n 24\n-25#if defined(CBOR_CUSTOM_ALLOC_INCLUDE)\n-26# include CBOR_CUSTOM_ALLOC_INCLUDE\n-27#else\n-28# include \n-29# define cbor_malloc malloc\n-30# define cbor_free free\n-31#endif\n+25#ifndef CBORJSON_H\n+26#define CBORJSON_H\n+27\n+28#include \"_\bc_\bb_\bo_\br_\b._\bh\"\n+29\n+30#ifdef __cplusplus\n+31extern \"C\" {\n+32#endif\n+33\n+34/* Conversion to JSON */\n+35enum CborToJsonFlags\n+36{\n+37 CborConvertAddMetadata = 1,\n+38 CborConvertTagsToObjects = 2,\n+39 CborConvertIgnoreTags = 0,\n+40\n+41 CborConvertObeyByteStringTags = 0,\n+42 CborConvertByteStringsToBase64Url = 4,\n+43\n+44 CborConvertRequireMapStringKeys = 0,\n+45 CborConvertStringifyMapKeys = 8,\n+46\n+47 CborConvertDefaultFlags = 0\n+48};\n+49\n+50CBOR_API CborError _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bj_\bs_\bo_\bn_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be(FILE *out, _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be *value,\n+int flags);\n+51CBOR_INLINE_API CborError cbor_value_to_json(FILE *out, const _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n+*value, int flags)\n+52{\n+53 _\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be copy = *value;\n+54 return _\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bj_\bs_\bo_\bn_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be(out, ©, flags);\n+55}\n+56\n+57#ifdef __cplusplus\n+58}\n+59#endif\n+60\n+61#endif /* CBORJSON_H */\n+62\n+_\bc_\bb_\bo_\br_\b._\bh\n+> The is the main header in TinyCBOR and defines the constants used by\n+most functions as wel...\n+_\bc_\bb_\bo_\br_\b__\bv_\ba_\bl_\bu_\be_\b__\bt_\bo_\b__\bj_\bs_\bo_\bn_\b__\ba_\bd_\bv_\ba_\bn_\bc_\be\n+CborError cbor_value_to_json_advance(FILE *out, CborValue *value, int flags)\n+Converts the current CBOR type pointed to by value to JSON and writes that to\n+the out stream.\n+D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cbortojson.c:704\n+_\bC_\bb_\bo_\br_\bV_\ba_\bl_\bu_\be\n+This type contains one value parsed from the CBOR stream.\n+D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bn cbor.h:341\n ===============================================================================\n Generated by\u00a0_\b[_\bd_\bo_\bx_\by_\bg_\be_\bn_\b] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libtinycbor-dev/html/a00057.html", "source2": "./usr/share/doc/libtinycbor-dev/html/a00057.html", "unified_diff": "@@ -115,17 +115,17 @@\n
\n \n

Converts the current CBOR type pointed by value to its textual representation and writes it to the stream by calling the streamFunction.

\n

If an error occurs, this function returns an error code similar to Parsing CBOR streams.

\n

The textual representation can be controlled by the flags parameter (see CborPrettyFlags for more information).

\n

If no error ocurred, this function advances value to the next element. Often, concatenating the text representation of multiple elements can be done by appending a comma to the output stream in between calls to this function.

\n

The streamFunction function will be called with the token value as the first parameter and a printf-style format string as the second, with a variable number of further parameters.

\n-
See also
cbor_value_to_pretty(), cbor_value_to_json_advance()
\n+
See also
cbor_value_to_pretty(), cbor_value_to_json_advance()
\n \n-

Referenced by cbor_value_to_pretty_advance(), and cbor_value_to_pretty_advance_flags().

\n+

Referenced by cbor_value_to_pretty_advance(), and cbor_value_to_pretty_advance_flags().

\n \n
\n \n \n \n
\n Generated by \"doxygen\"/ 1.9.8\n"}, {"source1": "./usr/share/doc/libtinycbor-dev/html/a00058.html", "source2": "./usr/share/doc/libtinycbor-dev/html/a00058.html", "unified_diff": "@@ -106,15 +106,15 @@\n \n \n
\n \n

Converts the current CBOR type pointed to by value to JSON and writes that to the out stream.

\n

If an error occurs, this function returns an error code similar to CborParsing. The flags parameter indicates one or more of the flags from CborToJsonFlags that control the conversion.

\n

If no error ocurred, this function advances value to the next element.

\n-
See also
cbor_value_to_json(), cbor_value_to_pretty_advance()
\n+
See also
cbor_value_to_json(), cbor_value_to_pretty_advance()
\n \n
\n \n \n \n
\n Generated by \"doxygen\"/ 1.9.8\n"}, {"source1": "./usr/share/doc/libtinycbor-dev/html/files.html", "source2": "./usr/share/doc/libtinycbor-dev/html/files.html", "unified_diff": "@@ -44,18 +44,18 @@\n \n
\n
File List
\n
\n
\n
Here is a list of all documented files with brief descriptions:
\n \n-\n-\n-\n-\n+\n+\n+\n+\n
 cbor.h> The <cbor.h> is the main header in TinyCBOR and defines the constants used by most functions as well as the structures for encoding (CborEncoder) and decoding (CborValue)
 cborjson.h> The <cborjson.h> file contains the routines that are used to convert a CBOR data stream into JSON
 memory.h
 tinycbor-version.h
 cbor.h> The <cbor.h> is the main header in TinyCBOR and defines the constants used by most functions as well as the structures for encoding (CborEncoder) and decoding (CborValue)
 cborjson.h> The <cborjson.h> file contains the routines that are used to convert a CBOR data stream into JSON
 memory.h
 tinycbor-version.h
\n
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n"}, {"source1": "./usr/share/doc/libtinycbor-dev/html/globals.html", "source2": "./usr/share/doc/libtinycbor-dev/html/globals.html", "unified_diff": "@@ -81,28 +81,28 @@\n \n \n \n

- v -

    \n
  • cbor_value_advance() : cbor.h
  • \n
  • cbor_value_advance_fixed() : cbor.h
  • \n
  • cbor_value_calculate_string_length() : cbor.h
  • \n-
  • cbor_value_dup_byte_string() : cbor.h
  • \n-
  • cbor_value_dup_text_string() : cbor.h
  • \n+
  • cbor_value_dup_byte_string() : cbor.h
  • \n+
  • cbor_value_dup_text_string() : cbor.h
  • \n
  • cbor_value_enter_container() : cbor.h
  • \n-
  • cbor_value_get_half_float_as_float() : cbor.h
  • \n+
  • cbor_value_get_half_float_as_float() : cbor.h
  • \n
  • cbor_value_get_int64_checked() : cbor.h
  • \n
  • cbor_value_get_int_checked() : cbor.h
  • \n
  • cbor_value_leave_container() : cbor.h
  • \n
  • cbor_value_map_find_value() : cbor.h
  • \n
  • cbor_value_skip_tag() : cbor.h
  • \n
  • cbor_value_text_string_equals() : cbor.h
  • \n
  • cbor_value_to_json_advance() : cborjson.h
  • \n-
  • cbor_value_to_pretty() : cbor.h
  • \n-
  • cbor_value_to_pretty_advance() : cbor.h
  • \n-
  • cbor_value_to_pretty_advance_flags() : cbor.h
  • \n+
  • cbor_value_to_pretty() : cbor.h
  • \n+
  • cbor_value_to_pretty_advance() : cbor.h
  • \n+
  • cbor_value_to_pretty_advance_flags() : cbor.h
  • \n
  • cbor_value_to_pretty_stream() : cbor.h
  • \n
  • cbor_value_validate() : cbor.h
  • \n
  • cbor_value_validate_basic() : cbor.h
  • \n
\n \n \n
\n"}, {"source1": "./usr/share/doc/libtinycbor-dev/html/globals_func.html", "source2": "./usr/share/doc/libtinycbor-dev/html/globals_func.html", "unified_diff": "@@ -81,28 +81,28 @@\n \n \n \n

- v -

    \n
  • cbor_value_advance() : cbor.h
  • \n
  • cbor_value_advance_fixed() : cbor.h
  • \n
  • cbor_value_calculate_string_length() : cbor.h
  • \n-
  • cbor_value_dup_byte_string() : cbor.h
  • \n-
  • cbor_value_dup_text_string() : cbor.h
  • \n+
  • cbor_value_dup_byte_string() : cbor.h
  • \n+
  • cbor_value_dup_text_string() : cbor.h
  • \n
  • cbor_value_enter_container() : cbor.h
  • \n-
  • cbor_value_get_half_float_as_float() : cbor.h
  • \n+
  • cbor_value_get_half_float_as_float() : cbor.h
  • \n
  • cbor_value_get_int64_checked() : cbor.h
  • \n
  • cbor_value_get_int_checked() : cbor.h
  • \n
  • cbor_value_leave_container() : cbor.h
  • \n
  • cbor_value_map_find_value() : cbor.h
  • \n
  • cbor_value_skip_tag() : cbor.h
  • \n
  • cbor_value_text_string_equals() : cbor.h
  • \n
  • cbor_value_to_json_advance() : cborjson.h
  • \n-
  • cbor_value_to_pretty() : cbor.h
  • \n-
  • cbor_value_to_pretty_advance() : cbor.h
  • \n-
  • cbor_value_to_pretty_advance_flags() : cbor.h
  • \n+
  • cbor_value_to_pretty() : cbor.h
  • \n+
  • cbor_value_to_pretty_advance() : cbor.h
  • \n+
  • cbor_value_to_pretty_advance_flags() : cbor.h
  • \n
  • cbor_value_to_pretty_stream() : cbor.h
  • \n
  • cbor_value_validate() : cbor.h
  • \n
  • cbor_value_validate_basic() : cbor.h
  • \n
\n \n \n
\n"}, {"source1": "./usr/share/doc/libtinycbor-dev/html/index.hhc.gz", "source2": "./usr/share/doc/libtinycbor-dev/html/index.hhc.gz", "unified_diff": null, "details": [{"source1": "index.hhc", "source2": "index.hhc", "unified_diff": "@@ -72,15 +72,15 @@\n \n
  • \n \n
  • \n
      \n
    • \n
        \n-
      • \n+
      • \n
          \n
        • \n
        • \n
        • \n
        • \n
        • \n
        • \n@@ -92,37 +92,37 @@\n
        • \n
        • \n
        • \n
        • \n
        • \n
        • \n
        • \n-
        • \n-
        • \n+
        • \n+
        • \n
        • \n-
        • \n+
        • \n
        • \n
        • \n
        • \n
        • \n
        • \n
        • \n-
        • \n-
        • \n-
        • \n+
        • \n+
        • \n+
        • \n
        • \n
        • \n
        • \n
        \n-
      • \n+
      • \n
          \n
        • \n
        \n-
      • \n-
      • \n+
      • \n+
      • \n
      \n
    • \n
        \n
      • \n
      • \n
      \n
    \n"}]}, {"source1": "./usr/share/doc/libtinycbor-dev/html/index.hhk.gz", "source2": "./usr/share/doc/libtinycbor-dev/html/index.hhk.gz", "unified_diff": null, "details": [{"source1": "index.hhk", "source2": "index.hhk", "unified_diff": "@@ -122,37 +122,37 @@\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n-
  • \n+
  • \n
      \n-
    • \n+
    • \n
    \n-
  • \n+
  • \n
      \n-
    • \n+
    • \n
    \n-
  • \n+
  • \n
      \n-
    • \n+
    • \n
    \n-
  • \n+
  • \n
      \n-
    • \n+
    • \n
    \n-
  • \n+
  • \n
      \n-
    • \n+
    • \n
    \n-
  • \n+
  • \n
      \n-
    • \n+
    • \n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n@@ -166,27 +166,27 @@\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n-
  • \n-
  • \n+
  • \n+
  • \n
  • \n-
  • \n+
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n-
  • \n-
  • \n-
  • \n+
  • \n+
  • \n+
  • \n
  • \n
  • \n
  • \n \n \n \n"}]}, {"source1": "./usr/share/doc/libtinycbor-dev/html/index.hhp", "source2": "./usr/share/doc/libtinycbor-dev/html/index.hhp", "unified_diff": "@@ -10,20 +10,20 @@\n Create CHI file=YES\n Title=TinyCBOR 0.6.0 API\n \n [WINDOWS]\n main=\"TinyCBOR 0.6.0 API\",\"index.hhc\",\"index.hhk\",\"index.html\",\"index.html\",,,,,0x23520,,0x70387e,,,,,,,,0\n \n [FILES]\n-a00014.html\n a00014_source.html\n+a00026.html\n+a00026_source.html\n+a00035_source.html\n+a00038.html\n a00038_source.html\n-a00041.html\n-a00041_source.html\n-a00047_source.html\n a00054.html\n a00055.html\n a00056.html\n a00057.html\n a00058.html\n a00062.html\n a00082.html\n"}, {"source1": "./usr/share/doc/libtinycbor-dev/html/a00014.html", "source2": "./usr/share/doc/libtinycbor-dev/html/a00026.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -46,26 +46,26 @@\n \n
    cbor.h File Reference
    \n \n
    \n \n-

    > The <cbor.h> is the main header in TinyCBOR and defines the constants used by most functions as well as the structures for encoding (CborEncoder) and decoding (CborValue). \n+

    > The <cbor.h> is the main header in TinyCBOR and defines the constants used by most functions as well as the structures for encoding (CborEncoder) and decoding (CborValue). \n More...

    \n
    #include <assert.h>
    \n #include <limits.h>
    \n #include <stddef.h>
    \n #include <stdint.h>
    \n #include <string.h>
    \n #include <stdio.h>
    \n #include "tinycbor-version.h"
    \n #include <stdbool.h>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

    \n \n \n \n \n \n \n@@ -142,48 +142,48 @@\n \n \n \n \n \n \n \n-\n+\n \n \n-\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n-\n+\n \n \n-\n+\n \n \n

    \n Data Structures

    struct  CborEncoder
     Structure used to encode to CBOR. More...
     
    struct  CborValue
     
    CBOR_API CborError cbor_value_skip_tag (CborValue *it)
     Advances the CBOR value it until it no longer points to a tag.
     
    CBOR_API CborError cbor_value_calculate_string_length (const CborValue *value, size_t *length)
     Calculates the length of the byte or text string that value points to and stores it in len.
     
    CborError cbor_value_dup_text_string (const CborValue *value, char **buffer, size_t *buflen, CborValue *next)
    CborError cbor_value_dup_text_string (const CborValue *value, char **buffer, size_t *buflen, CborValue *next)
     Allocates memory for the string pointed by value and copies it into this buffer.
     
    CborError cbor_value_dup_byte_string (const CborValue *value, uint8_t **buffer, size_t *buflen, CborValue *next)
    CborError cbor_value_dup_byte_string (const CborValue *value, uint8_t **buffer, size_t *buflen, CborValue *next)
     Allocates memory for the string pointed by value and copies it into this buffer.
     
    CBOR_API CborError cbor_value_text_string_equals (const CborValue *value, const char *string, bool *result)
     Compares the entry value with the string string and stores the result in result.
     
    CBOR_API CborError cbor_value_map_find_value (const CborValue *map, const char *string, CborValue *element)
     Attempts to find the value in map map that corresponds to the text string entry string.
     
    CBOR_API CborError cbor_value_get_half_float_as_float (const CborValue *value, float *result)
    CBOR_API CborError cbor_value_get_half_float_as_float (const CborValue *value, float *result)
     Retrieves the CBOR half-precision floating point (16-bit) value that value points to, converts it to the float and store it in result.
     
    CBOR_API CborError cbor_value_validate (const CborValue *it, uint32_t flags)
     Performs a full validation, controlled by the flags options, of the CBOR stream pointed by it and returns the error it found.
     
    CBOR_API CborError cbor_value_to_pretty_stream (CborStreamFunction streamFunction, void *token, CborValue *value, int flags)
     Converts the current CBOR type pointed by value to its textual representation and writes it to the stream by calling the streamFunction.
     
    CBOR_API CborError cbor_value_to_pretty_advance_flags (FILE *out, CborValue *value, int flags)
    CBOR_API CborError cbor_value_to_pretty_advance_flags (FILE *out, CborValue *value, int flags)
     Converts the current CBOR type pointed to by value to its textual representation and writes it to the out stream.
     
    CBOR_API CborError cbor_value_to_pretty_advance (FILE *out, CborValue *value)
    CBOR_API CborError cbor_value_to_pretty_advance (FILE *out, CborValue *value)
     Converts the current CBOR type pointed to by value to its textual representation and writes it to the out stream.
     
    CborError cbor_value_to_pretty (FILE *out, const CborValue *value)
    CborError cbor_value_to_pretty (FILE *out, const CborValue *value)
     Converts the current CBOR type pointed to by value to its textual representation and writes it to the out stream.
     
    \n

    Detailed Description

    \n-

    > The <cbor.h> is the main header in TinyCBOR and defines the constants used by most functions as well as the structures for encoding (CborEncoder) and decoding (CborValue).

    \n-
    See also
    <cborjson.h>
    \n+

    > The <cbor.h> is the main header in TinyCBOR and defines the constants used by most functions as well as the structures for encoding (CborEncoder) and decoding (CborValue).

    \n+
    See also
    <cborjson.h>
    \n

    Function Documentation

    \n \n

    ◆ cbor_value_dup_byte_string()

    \n \n
    \n
    \n \n@@ -222,15 +222,15 @@\n

    Allocates memory for the string pointed by value and copies it into this buffer.

    \n

    The pointer to the buffer is stored in buffer and the number of bytes copied is stored in buflen (those variables must not be NULL).

    \n

    If the iterator value does not point to a byte string, the behaviour is undefined, so checking with cbor_value_get_type or cbor_value_is_byte_string is recommended.

    \n

    If malloc returns a NULL pointer, this function will return error condition CborErrorOutOfMemory.

    \n

    On success, *buffer will contain a valid pointer that must be freed by calling free(). This is the case even for zero-length strings.

    \n

    The next pointer, if not null, will be updated to point to the next item after this string. If value points to the last item, then next will be invalid.

    \n

    This function may not run in constant time (it will run in O(n) time on the number of chunks). It requires constant memory (O(1)) in addition to the malloc'ed block.

    \n-
    See also
    cbor_value_get_text_string_chunk(), cbor_value_copy_byte_string(), cbor_value_dup_text_string()
    \n+
    See also
    cbor_value_get_text_string_chunk(), cbor_value_copy_byte_string(), cbor_value_dup_text_string()
    \n \n \n \n \n

    ◆ cbor_value_dup_text_string()

    \n \n
    \n@@ -272,15 +272,15 @@\n

    The pointer to the buffer is stored in buffer and the number of bytes copied is stored in buflen (those variables must not be NULL).

    \n

    If the iterator value does not point to a text string, the behaviour is undefined, so checking with cbor_value_get_type or cbor_value_is_text_string is recommended.

    \n

    If malloc returns a NULL pointer, this function will return error condition CborErrorOutOfMemory.

    \n

    On success, *buffer will contain a valid pointer that must be freed by calling free(). This is the case even for zero-length strings.

    \n

    The next pointer, if not null, will be updated to point to the next item after this string. If value points to the last item, then next will be invalid.

    \n

    This function may not run in constant time (it will run in O(n) time on the number of chunks). It requires constant memory (O(1)) in addition to the malloc'ed block.

    \n
    Note
    This function does not perform UTF-8 validation on the incoming text string.
    \n-
    See also
    cbor_value_get_text_string_chunk(), cbor_value_copy_text_string(), cbor_value_dup_byte_string()
    \n+
    See also
    cbor_value_get_text_string_chunk(), cbor_value_copy_text_string(), cbor_value_dup_byte_string()
    \n \n
    \n \n \n

    ◆ cbor_value_get_half_float_as_float()

    \n \n
    \n@@ -305,15 +305,15 @@\n \n
    \n
    \n \n

    Retrieves the CBOR half-precision floating point (16-bit) value that value points to, converts it to the float and store it in result.

    \n

    If the iterator value does not point to a half-precision floating point value, the behavior is undefined, so checking with cbor_value_get_type or with cbor_value_is_half_float is recommended.

    See also
    cbor_value_get_type(), cbor_value_is_valid(), cbor_value_is_half_float(), cbor_value_get_half_float(), cbor_value_get_float()
    \n \n-

    Referenced by cbor_value_get_half_float_as_float().

    \n+

    Referenced by cbor_value_get_half_float_as_float().

    \n \n
    \n
    \n \n

    ◆ cbor_value_to_pretty()

    \n \n
    \n@@ -370,17 +370,17 @@\n \n \n
    \n \n

    Converts the current CBOR type pointed to by value to its textual representation and writes it to the out stream.

    \n

    If an error occurs, this function returns an error code similar to CborParsing.

    \n

    If no error ocurred, this function advances value to the next element. Often, concatenating the text representation of multiple elements can be done by appending a comma to the output stream in between calls to this function.

    \n-
    See also
    cbor_value_to_pretty(), cbor_value_to_pretty_stream(), cbor_value_to_json_advance()
    \n+
    See also
    cbor_value_to_pretty(), cbor_value_to_pretty_stream(), cbor_value_to_json_advance()
    \n \n-

    Referenced by cbor_value_to_pretty_advance().

    \n+

    Referenced by cbor_value_to_pretty_advance().

    \n \n
    \n
    \n \n

    ◆ cbor_value_to_pretty_advance_flags()

    \n \n
    \n@@ -412,17 +412,17 @@\n \n
    \n \n

    Converts the current CBOR type pointed to by value to its textual representation and writes it to the out stream.

    \n

    If an error occurs, this function returns an error code similar to CborParsing.

    \n

    The textual representation can be controlled by the flags parameter (see CborPrettyFlags for more information).

    \n

    If no error ocurred, this function advances value to the next element. Often, concatenating the text representation of multiple elements can be done by appending a comma to the output stream in between calls to this function.

    \n-
    See also
    cbor_value_to_pretty_stream(), cbor_value_to_pretty(), cbor_value_to_json_advance()
    \n+
    See also
    cbor_value_to_pretty_stream(), cbor_value_to_pretty(), cbor_value_to_json_advance()
    \n \n-

    Referenced by cbor_value_to_pretty(), and cbor_value_to_pretty_advance_flags().

    \n+

    Referenced by cbor_value_to_pretty(), and cbor_value_to_pretty_advance_flags().

    \n \n
    \n
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n"}, {"source1": "./usr/share/doc/libtinycbor-dev/html/a00041.html", "source2": "./usr/share/doc/libtinycbor-dev/html/a00038.html", "comments": ["Files 98% similar despite different names"], "unified_diff": "@@ -45,29 +45,29 @@\n
    \n \n
    cborjson.h File Reference
    \n
    \n
    \n \n-

    > The <cborjson.h> file contains the routines that are used to convert a CBOR data stream into JSON. \n+

    > The <cborjson.h> file contains the routines that are used to convert a CBOR data stream into JSON. \n More...

    \n-
    #include "cbor.h"
    \n+
    #include "cbor.h"
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

    \n \n \n \n \n \n

    \n Functions

    CborError cbor_value_to_json_advance (FILE *out, CborValue *value, int flags)
     Converts the current CBOR type pointed to by value to JSON and writes that to the out stream.
     
    \n

    Detailed Description

    \n-

    > The <cborjson.h> file contains the routines that are used to convert a CBOR data stream into JSON.

    \n-
    See also
    <cbor.h>
    \n+

    > The <cborjson.h> file contains the routines that are used to convert a CBOR data stream into JSON.

    \n+
    See also
    <cbor.h>
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libtinycbor-dev/html/a00047_source.html", "source2": "./usr/share/doc/libtinycbor-dev/html/a00035_source.html", "comments": ["Files identical despite different names"], "unified_diff": null}]}]}]}]}