libcbor  0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
streaming.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2017 Pavel Kalvoda <me@pavelkalvoda.com>
3  *
4  * libcbor is free software; you can redistribute it and/or modify
5  * it under the terms of the MIT license. See LICENSE for details.
6  */
7 
8 #include "streaming.h"
9 #include "internal/loaders.h"
10 
11 bool static _cbor_claim_bytes(size_t required,
12  size_t provided, struct cbor_decoder_result *result)
13 {
14  if (required > (provided - result->read)) {
15  /* We need to keep all the metadata if parsing is to be resumed */
16  result->read = 0;
17  result->status = CBOR_DECODER_NEDATA;
18  return false;
19  } else {
20  result->read += required;
21  return true;
22  }
23 }
24 
25 
26 struct cbor_decoder_result cbor_stream_decode(cbor_data source, size_t source_size,
27  const struct cbor_callbacks *callbacks,
28  void *context)
29 {
30  /* If we have no data, we cannot read even the MTB */
31  if (source_size < 1) {
32  return (struct cbor_decoder_result) {0, CBOR_DECODER_EBUFFER};
33  }
34 
35  /* If we have a byte, assume it's the MTB */
36  struct cbor_decoder_result result = {1, CBOR_DECODER_FINISHED};
37 
38  switch (*source) {
39  case 0x00: /* Fallthrough */
40  case 0x01: /* Fallthrough */
41  case 0x02: /* Fallthrough */
42  case 0x03: /* Fallthrough */
43  case 0x04: /* Fallthrough */
44  case 0x05: /* Fallthrough */
45  case 0x06: /* Fallthrough */
46  case 0x07: /* Fallthrough */
47  case 0x08: /* Fallthrough */
48  case 0x09: /* Fallthrough */
49  case 0x0A: /* Fallthrough */
50  case 0x0B: /* Fallthrough */
51  case 0x0C: /* Fallthrough */
52  case 0x0D: /* Fallthrough */
53  case 0x0E: /* Fallthrough */
54  case 0x0F: /* Fallthrough */
55  case 0x10: /* Fallthrough */
56  case 0x11: /* Fallthrough */
57  case 0x12: /* Fallthrough */
58  case 0x13: /* Fallthrough */
59  case 0x14: /* Fallthrough */
60  case 0x15: /* Fallthrough */
61  case 0x16: /* Fallthrough */
62  case 0x17:
63  /* Embedded one byte unsigned integer */
64  {
65  callbacks->uint8(context, _cbor_load_uint8(source));
66  return result;
67  }
68  case 0x18:
69  /* One byte unsigned integer */
70  {
71  if (_cbor_claim_bytes(1, source_size, &result)) {
72  callbacks->uint8(context, _cbor_load_uint8(source + 1));
73  }
74  return result;
75  }
76  case 0x19:
77  /* Two bytes unsigned integer */
78  {
79  if (_cbor_claim_bytes(2, source_size, &result)) {
80  callbacks->uint16(context, _cbor_load_uint16(source + 1));
81  }
82  return result;
83  }
84  case 0x1A:
85  /* Four bytes unsigned integer */
86  {
87  if (_cbor_claim_bytes(4, source_size, &result)) {
88  callbacks->uint32(context, _cbor_load_uint32(source + 1));
89  }
90  return result;
91  }
92  case 0x1B:
93  /* Eight bytes unsigned integer */
94  {
95  if (_cbor_claim_bytes(8, source_size, &result)) {
96  callbacks->uint64(context, _cbor_load_uint64(source + 1));
97  }
98  return result;
99  }
100  case 0x1C: /* Fallthrough */
101  case 0x1D: /* Fallthrough */
102  case 0x1E: /* Fallthrough */
103  case 0x1F:
104  /* Reserved */
105  {
106  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
107  }
108  case 0x20: /* Fallthrough */
109  case 0x21: /* Fallthrough */
110  case 0x22: /* Fallthrough */
111  case 0x23: /* Fallthrough */
112  case 0x24: /* Fallthrough */
113  case 0x25: /* Fallthrough */
114  case 0x26: /* Fallthrough */
115  case 0x27: /* Fallthrough */
116  case 0x28: /* Fallthrough */
117  case 0x29: /* Fallthrough */
118  case 0x2A: /* Fallthrough */
119  case 0x2B: /* Fallthrough */
120  case 0x2C: /* Fallthrough */
121  case 0x2D: /* Fallthrough */
122  case 0x2E: /* Fallthrough */
123  case 0x2F: /* Fallthrough */
124  case 0x30: /* Fallthrough */
125  case 0x31: /* Fallthrough */
126  case 0x32: /* Fallthrough */
127  case 0x33: /* Fallthrough */
128  case 0x34: /* Fallthrough */
129  case 0x35: /* Fallthrough */
130  case 0x36: /* Fallthrough */
131  case 0x37:
132  /* Embedded one byte negative integer */
133  {
134  callbacks->negint8(context, _cbor_load_uint8(source) - 0x20); /* 0x20 offset */
135  return result;
136  }
137  case 0x38:
138  /* One byte negative integer */
139  {
140  if (_cbor_claim_bytes(1, source_size, &result)) {
141  callbacks->negint8(context, _cbor_load_uint8(source + 1));
142  }
143  return result;
144  }
145  case 0x39:
146  /* Two bytes negative integer */
147  {
148  if (_cbor_claim_bytes(2, source_size, &result)) {
149  callbacks->negint16(context, _cbor_load_uint16(source + 1));
150  }
151  return result;
152  }
153  case 0x3A:
154  /* Four bytes negative integer */
155  {
156  if (_cbor_claim_bytes(4, source_size, &result)) {
157  callbacks->negint32(context, _cbor_load_uint32(source + 1));
158  }
159  return result;
160  }
161  case 0x3B:
162  /* Eight bytes negative integer */
163  {
164  if (_cbor_claim_bytes(8, source_size, &result)) {
165  callbacks->negint64(context, _cbor_load_uint64(source + 1));
166  }
167  return result;
168  }
169  case 0x3C: /* Fallthrough */
170  case 0x3D: /* Fallthrough */
171  case 0x3E: /* Fallthrough */
172  case 0x3F:
173  /* Reserved */
174  {
175  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
176  }
177  case 0x40: /* Fallthrough */
178  case 0x41: /* Fallthrough */
179  case 0x42: /* Fallthrough */
180  case 0x43: /* Fallthrough */
181  case 0x44: /* Fallthrough */
182  case 0x45: /* Fallthrough */
183  case 0x46: /* Fallthrough */
184  case 0x47: /* Fallthrough */
185  case 0x48: /* Fallthrough */
186  case 0x49: /* Fallthrough */
187  case 0x4A: /* Fallthrough */
188  case 0x4B: /* Fallthrough */
189  case 0x4C: /* Fallthrough */
190  case 0x4D: /* Fallthrough */
191  case 0x4E: /* Fallthrough */
192  case 0x4F: /* Fallthrough */
193  case 0x50: /* Fallthrough */
194  case 0x51: /* Fallthrough */
195  case 0x52: /* Fallthrough */
196  case 0x53: /* Fallthrough */
197  case 0x54: /* Fallthrough */
198  case 0x55: /* Fallthrough */
199  case 0x56: /* Fallthrough */
200  case 0x57:
201  /* Embedded length byte string */
202  {
203  size_t length = (size_t) _cbor_load_uint8(source) - 0x40; /* 0x40 offset */
204  if (_cbor_claim_bytes(length, source_size, &result)) {
205  callbacks->byte_string(context, source + 1, length);
206  }
207  return result;
208  }
209  case 0x58:
210  /* One byte length byte string */
211  // TODO template this?
212  {
213  if (_cbor_claim_bytes(1, source_size, &result)) {
214  size_t length = (size_t) _cbor_load_uint8(source + 1);
215  if (_cbor_claim_bytes(length, source_size, &result)) {
216  callbacks->byte_string(context, source + 1 + 1, length);
217  }
218  }
219  return result;
220  }
221  case 0x59:
222  /* Two bytes length byte string */
223  {
224  if (_cbor_claim_bytes(2, source_size, &result)) {
225  size_t length = (size_t) _cbor_load_uint16(source + 1);
226  if (_cbor_claim_bytes(length, source_size, &result)) {
227  callbacks->byte_string(context, source + 1 + 2, length);
228  }
229  }
230  return result;
231  }
232  case 0x5A:
233  /* Four bytes length byte string */
234  {
235  if (_cbor_claim_bytes(4, source_size, &result)) {
236  size_t length = (size_t) _cbor_load_uint32(source + 1);
237  if (_cbor_claim_bytes(length, source_size, &result)) {
238  callbacks->byte_string(context, source + 1 + 4, length);
239  }
240  }
241  return result;
242  }
243  case 0x5B:
244  /* Eight bytes length byte string */
245  {
246  if (_cbor_claim_bytes(8, source_size, &result)) {
247  size_t length = (size_t) _cbor_load_uint64(source + 1);
248  if (_cbor_claim_bytes(length, source_size, &result)) {
249  callbacks->byte_string(context, source + 1 + 8, length);
250  }
251  }
252  return result;
253  }
254  case 0x5C: /* Fallthrough */
255  case 0x5D: /* Fallthrough */
256  case 0x5E:
257  /* Reserved */
258  {
259  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
260  }
261  case 0x5F:
262  /* Indefinite byte string */
263  {
264  callbacks->byte_string_start(context);
265  return result;
266  }
267  case 0x60: /* Fallthrough */
268  case 0x61: /* Fallthrough */
269  case 0x62: /* Fallthrough */
270  case 0x63: /* Fallthrough */
271  case 0x64: /* Fallthrough */
272  case 0x65: /* Fallthrough */
273  case 0x66: /* Fallthrough */
274  case 0x67: /* Fallthrough */
275  case 0x68: /* Fallthrough */
276  case 0x69: /* Fallthrough */
277  case 0x6A: /* Fallthrough */
278  case 0x6B: /* Fallthrough */
279  case 0x6C: /* Fallthrough */
280  case 0x6D: /* Fallthrough */
281  case 0x6E: /* Fallthrough */
282  case 0x6F: /* Fallthrough */
283  case 0x70: /* Fallthrough */
284  case 0x71: /* Fallthrough */
285  case 0x72: /* Fallthrough */
286  case 0x73: /* Fallthrough */
287  case 0x74: /* Fallthrough */
288  case 0x75: /* Fallthrough */
289  case 0x76: /* Fallthrough */
290  case 0x77:
291  /* Embedded one byte length string */
292  {
293  size_t length = (size_t) _cbor_load_uint8(source) - 0x60; /* 0x60 offset */
294  if (_cbor_claim_bytes(length, source_size, &result)) {
295  callbacks->string(context, source + 1, length);
296  }
297  return result;
298  }
299  case 0x78:
300  /* One byte length string */
301  {
302  if (_cbor_claim_bytes(1, source_size, &result)) {
303  size_t length = (size_t) _cbor_load_uint8(source + 1);
304  if (_cbor_claim_bytes(length, source_size, &result)) {
305  callbacks->string(context, source + 1 + 1, length);
306  }
307  }
308  return result;
309  }
310  case 0x79:
311  /* Two bytes length string */
312  {
313  if (_cbor_claim_bytes(2, source_size, &result)) {
314  size_t length = (size_t) _cbor_load_uint16(source + 1);
315  if (_cbor_claim_bytes(length, source_size, &result)) {
316  callbacks->string(context, source + 1 + 2, length);
317  }
318  }
319  return result;
320  }
321  case 0x7A:
322  /* Four bytes length string */
323  {
324  if (_cbor_claim_bytes(4, source_size, &result)) {
325  size_t length = (size_t) _cbor_load_uint32(source + 1);
326  if (_cbor_claim_bytes(length, source_size, &result)) {
327  callbacks->string(context, source + 1 + 4, length);
328  }
329  }
330  return result;
331  }
332  case 0x7B:
333  /* Eight bytes length string */
334  {
335  if (_cbor_claim_bytes(8, source_size, &result)) {
336  size_t length = (size_t) _cbor_load_uint64(source + 1);
337  if (_cbor_claim_bytes(length, source_size, &result)) {
338  callbacks->string(context, source + 1 + 8, length);
339  }
340  }
341  return result;
342  }
343  case 0x7C: /* Fallthrough */
344  case 0x7D: /* Fallthrough */
345  case 0x7E:
346  /* Reserved */
347  {
348  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
349  }
350  case 0x7F:
351  /* Indefinite length string */
352  {
353  callbacks->string_start(context);
354  return result;
355  }
356  case 0x80: /* Fallthrough */
357  case 0x81: /* Fallthrough */
358  case 0x82: /* Fallthrough */
359  case 0x83: /* Fallthrough */
360  case 0x84: /* Fallthrough */
361  case 0x85: /* Fallthrough */
362  case 0x86: /* Fallthrough */
363  case 0x87: /* Fallthrough */
364  case 0x88: /* Fallthrough */
365  case 0x89: /* Fallthrough */
366  case 0x8A: /* Fallthrough */
367  case 0x8B: /* Fallthrough */
368  case 0x8C: /* Fallthrough */
369  case 0x8D: /* Fallthrough */
370  case 0x8E: /* Fallthrough */
371  case 0x8F: /* Fallthrough */
372  case 0x90: /* Fallthrough */
373  case 0x91: /* Fallthrough */
374  case 0x92: /* Fallthrough */
375  case 0x93: /* Fallthrough */
376  case 0x94: /* Fallthrough */
377  case 0x95: /* Fallthrough */
378  case 0x96: /* Fallthrough */
379  case 0x97:
380  /* Embedded one byte length array */
381  {
382  callbacks->array_start(context, (size_t) _cbor_load_uint8(source) - 0x80); /* 0x40 offset */
383  return result;
384  }
385  case 0x98:
386  /* One byte length array */
387  {
388  if (_cbor_claim_bytes(1, source_size, &result)) {
389  callbacks->array_start(context, (size_t) _cbor_load_uint8(source + 1));
390  }
391  return result;
392  }
393  case 0x99:
394  /* Two bytes length string */
395  {
396  if (_cbor_claim_bytes(2, source_size, &result)) {
397  callbacks->array_start(context, (size_t) _cbor_load_uint16(source + 1));
398  }
399  return result;
400  }
401  case 0x9A:
402  /* Four bytes length string */
403  {
404  if (_cbor_claim_bytes(4, source_size, &result)) {
405  callbacks->array_start(context, (size_t) _cbor_load_uint32(source + 1));
406  }
407  return result;
408  }
409  case 0x9B:
410  /* Eight bytes length string */
411  {
412  if (_cbor_claim_bytes(8, source_size, &result)) {
413  callbacks->array_start(context, (size_t) _cbor_load_uint64(source + 1));
414  }
415  return result;
416  }
417  case 0x9C: /* Fallthrough */
418  case 0x9D: /* Fallthrough */
419  case 0x9E:
420  /* Reserved */
421  {
422  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
423  }
424  case 0x9F:
425  /* Indefinite length array */
426  {
427  callbacks->indef_array_start(context);
428  return result;
429  }
430  case 0xA0: /* Fallthrough */
431  case 0xA1: /* Fallthrough */
432  case 0xA2: /* Fallthrough */
433  case 0xA3: /* Fallthrough */
434  case 0xA4: /* Fallthrough */
435  case 0xA5: /* Fallthrough */
436  case 0xA6: /* Fallthrough */
437  case 0xA7: /* Fallthrough */
438  case 0xA8: /* Fallthrough */
439  case 0xA9: /* Fallthrough */
440  case 0xAA: /* Fallthrough */
441  case 0xAB: /* Fallthrough */
442  case 0xAC: /* Fallthrough */
443  case 0xAD: /* Fallthrough */
444  case 0xAE: /* Fallthrough */
445  case 0xAF: /* Fallthrough */
446  case 0xB0: /* Fallthrough */
447  case 0xB1: /* Fallthrough */
448  case 0xB2: /* Fallthrough */
449  case 0xB3: /* Fallthrough */
450  case 0xB4: /* Fallthrough */
451  case 0xB5: /* Fallthrough */
452  case 0xB6: /* Fallthrough */
453  case 0xB7:
454  /* Embedded one byte length map */
455  {
456  callbacks->map_start(context, (size_t) _cbor_load_uint8(source) - 0xA0); /* 0xA0 offset */
457  return result;
458  }
459  case 0xB8:
460  /* One byte length map */
461  {
462  if (_cbor_claim_bytes(1, source_size, &result)) {
463  callbacks->map_start(context, (size_t) _cbor_load_uint8(source + 1));
464  }
465  return result;
466  }
467  case 0xB9:
468  /* Two bytes length map */
469  {
470  if (_cbor_claim_bytes(2, source_size, &result)) {
471  callbacks->map_start(context, (size_t) _cbor_load_uint16(source + 1));
472  }
473  return result;
474  }
475  case 0xBA:
476  /* Four bytes length map */
477  {
478  if (_cbor_claim_bytes(4, source_size, &result)) {
479  callbacks->map_start(context, (size_t) _cbor_load_uint32(source + 1));
480  }
481  return result;
482  }
483  case 0xBB:
484  /* Eight bytes length map */
485  {
486  if (_cbor_claim_bytes(8, source_size, &result)) {
487  callbacks->map_start(context, (size_t) _cbor_load_uint64(source + 1));
488  }
489  return result;
490  }
491  case 0xBC: /* Fallthrough */
492  case 0xBD: /* Fallthrough */
493  case 0xBE:
494  /* Reserved */
495  {
496  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
497  }
498  case 0xBF:
499  /* Indefinite length map */
500  {
501  callbacks->indef_map_start(context);
502  return result;
503  }
504  case 0xC0:
505  /* Text date/time - RFC 3339 tag, fallthrough */
506  case 0xC1:
507  /* Epoch date tag, fallthrough */
508  case 0xC2:
509  /* Positive bignum tag, fallthrough */
510  case 0xC3:
511  /* Negative bignum tag, fallthrough */
512  case 0xC4:
513  /* Fraction, fallthrough */
514  case 0xC5:
515  /* Big float */
516  {
517  callbacks->tag(context, _cbor_load_uint8(source) - 0xC0); /* 0xC0 offset */
518  return result;
519  }
520  case 0xC6: /* Fallthrough */
521  case 0xC7: /* Fallthrough */
522  case 0xC8: /* Fallthrough */
523  case 0xC9: /* Fallthrough */
524  case 0xCA: /* Fallthrough */
525  case 0xCB: /* Fallthrough */
526  case 0xCC: /* Fallthrough */
527  case 0xCD: /* Fallthrough */
528  case 0xCE: /* Fallthrough */
529  case 0xCF: /* Fallthrough */
530  case 0xD0: /* Fallthrough */
531  case 0xD1: /* Fallthrough */
532  case 0xD2: /* Fallthrough */
533  case 0xD3: /* Fallthrough */
534  case 0xD4: /* Unassigned tag value */
535  {
536  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
537  }
538  case 0xD5: /* Expected b64url conversion tag - fallthrough */
539  case 0xD6: /* Expected b64 conversion tag - fallthrough */
540  case 0xD7: /* Expected b16 conversion tag */
541  {
542  callbacks->tag(context, _cbor_load_uint8(source) - 0xC0); /* 0xC0 offset */
543  return result;
544  }
545  case 0xD8: /* 1B tag */
546  {
547  if (_cbor_claim_bytes(1, source_size, &result)) {
548  callbacks->tag(context, _cbor_load_uint8(source + 1));
549  }
550  return result;
551  }
552  case 0xD9: /* 2B tag */
553  {
554  if (_cbor_claim_bytes(2, source_size, &result)) {
555  callbacks->tag(context, _cbor_load_uint16(source + 1));
556  }
557  return result;
558  }
559  case 0xDA: /* 4B tag */
560  {
561  if (_cbor_claim_bytes(4, source_size, &result)) {
562  callbacks->tag(context, _cbor_load_uint32(source + 1));
563  }
564  return result;
565  }
566  case 0xDB: /* 8B tag */
567  {
568  if (_cbor_claim_bytes(8, source_size, &result)) {
569  callbacks->tag(context, _cbor_load_uint64(source + 1));
570  }
571  return result;
572  }
573  case 0xDC: /* Fallthrough */
574  case 0xDD: /* Fallthrough */
575  case 0xDE: /* Fallthrough */
576  case 0xDF: /* Reserved */
577  {
578  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
579  }
580  case 0xE0: /* Fallthrough */
581  case 0xE1: /* Fallthrough */
582  case 0xE2: /* Fallthrough */
583  case 0xE3: /* Fallthrough */
584  case 0xE4: /* Fallthrough */
585  case 0xE5: /* Fallthrough */
586  case 0xE6: /* Fallthrough */
587  case 0xE7: /* Fallthrough */
588  case 0xE8: /* Fallthrough */
589  case 0xE9: /* Fallthrough */
590  case 0xEA: /* Fallthrough */
591  case 0xEB: /* Fallthrough */
592  case 0xEC: /* Fallthrough */
593  case 0xED: /* Fallthrough */
594  case 0xEE: /* Fallthrough */
595  case 0xEF: /* Fallthrough */
596  case 0xF0: /* Fallthrough */
597  case 0xF1: /* Fallthrough */
598  case 0xF2: /* Fallthrough */
599  case 0xF3: /* Simple value - unassigned */
600  {
601  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
602  }
603  case 0xF4:
604  /* False */
605  {
606  callbacks->boolean(context, false);
607  return result;
608  }
609  case 0xF5:
610  /* True */
611  {
612  callbacks->boolean(context, true);
613  return result;
614  }
615  case 0xF6:
616  /* Null */
617  {
618  callbacks->null(context);
619  return result;
620  }
621  case 0xF7:
622  /* Undefined */
623  {
624  callbacks->undefined(context);
625  return result;
626  }
627  case 0xF8:
628  /* 1B simple value, unassigned */
629  {
630  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
631  }
632  case 0xF9:
633  /* 2B float */
634  {
635  if (_cbor_claim_bytes(2, source_size, &result)) {
636  callbacks->float2(context, _cbor_load_half(source + 1));
637  }
638  return result;
639  }
640  case 0xFA:
641  /* 4B float */
642  {
643  if (_cbor_claim_bytes(4, source_size, &result)) {
644  callbacks->float4(context, _cbor_load_float(source + 1));
645  }
646  return result;
647  }
648  case 0xFB:
649  /* 8B float */
650  {
651  if (_cbor_claim_bytes(8, source_size, &result)) {
652  callbacks->float8(context, _cbor_load_double(source + 1));
653  }
654  return result;
655  }
656  case 0xFC: /* Fallthrough */
657  case 0xFD: /* Fallthrough */
658  case 0xFE:
659  /* Reserved */
660  {
661  return (struct cbor_decoder_result) {0, CBOR_DECODER_ERROR};
662  }
663  case 0xFF:
664  /* Break */
665  {
666  callbacks->indef_break(context);
667  return result;
668  }
669  default: /* Never happens - this shuts up the compiler */
670  {
671  return result;
672  }
673  }
674 }
675 
676 
677 
678 
679 
680 
681 
682 
683 
684 
double _cbor_load_double(cbor_data source)
Definition: loaders.c:95
Malformed or reserved MTB/value.
Definition: data.h:197
OK, finished.
Definition: data.h:194
size_t read
Bytes read.
Definition: data.h:203
float _cbor_load_float(cbor_data source)
Definition: loaders.c:89
double _cbor_load_half(cbor_data source)
Definition: loaders.c:83
uint16_t _cbor_load_uint16(const unsigned char *source)
Definition: loaders.c:20
uint8_t _cbor_load_uint8(cbor_data source)
Definition: loaders.c:15
uint32_t _cbor_load_uint32(const unsigned char *source)
Definition: loaders.c:34
Streaming decoder result.
Definition: data.h:201
const unsigned char * cbor_data
Definition: data.h:20
enum cbor_decoder_status status
The result.
Definition: data.h:205
Callback bundle – passed to the decoder.
Definition: callbacks.h:48
Not enough data - mismatch with MTB.
Definition: data.h:195
Buffer manipulation problem.
Definition: data.h:196
struct cbor_decoder_result cbor_stream_decode(cbor_data source, size_t source_size, const struct cbor_callbacks *callbacks, void *context)
Stateless decoder.
Definition: streaming.c:26
uint64_t _cbor_load_uint64(const unsigned char *source)
Definition: loaders.c:50