xref: /freebsd-src/contrib/libcbor/doc/source/api/decoding.rst (revision 10ff414c14eef433d8157f0c17904d740693933b)
1*10ff414cSEd MasteDecoding
2*10ff414cSEd Maste=============================
3*10ff414cSEd Maste
4*10ff414cSEd MasteThe following diagram illustrates the relationship among different parts of libcbor from the decoding standpoint.
5*10ff414cSEd Maste
6*10ff414cSEd Maste::
7*10ff414cSEd Maste
8*10ff414cSEd Maste    ┌──────────────────────────────────────────────────────────────────────────────────────────────┐
9*10ff414cSEd Maste    │                                                                                              │
10*10ff414cSEd Maste    │                                      Client application                                      │
11*10ff414cSEd Maste    │                                                                                              │
12*10ff414cSEd Maste    │                                                 ┌────────────────────────────────────────────┘
13*10ff414cSEd Maste    │                                                 │                     ↕
14*10ff414cSEd Maste    │                                                 │ ┌──────────────────────────────────────────┐
15*10ff414cSEd Maste    │                                                 │ │                                          │
16*10ff414cSEd Maste    │                                                 │ │          Manipulation routines           │
17*10ff414cSEd Maste    │                                                 │ │                                          │
18*10ff414cSEd Maste    │           ┌─────────────────────────────────────┘ └──────────────────────────────────────────┘
19*10ff414cSEd Maste    │           │     ↑    ↑                  ↑                              ↑
20*10ff414cSEd Maste    │           │     │    │    ┌─────────────╫──────────┬───────────────────┴─┐
21*10ff414cSEd Maste    │           │     │   CDS   │             ║          │                     │
22*10ff414cSEd Maste    │           │     │    │   PDS            ║         PDS                   PDS
23*10ff414cSEd Maste    │           │     ↓    ↓    ↓             ↓          ↓                     ↓
24*10ff414cSEd Maste    │           │ ┌─────────────────┐   ┌────────────────────┐   ┌────────────────────────────┐
25*10ff414cSEd Maste    │           │ │                 │   │                    │   │                            │
26*10ff414cSEd Maste    │           │ │  Custom driver  │ ↔ │  Streaming driver  │ ↔ │       Default driver       │ ↔ CD
27*10ff414cSEd Maste    │           │ │                 │   │                    │   │                            │
28*10ff414cSEd Maste    └───────────┘ └─────────────────┘   └────────────────────┘   └────────────────────────────┘
29*10ff414cSEd Maste          ↕                ↕                        ↕                           ↕
30*10ff414cSEd Maste    ┌──────────────────────────────────────────────────────────────────────────────────────────────┐
31*10ff414cSEd Maste    │                                                                                              │
32*10ff414cSEd Maste    │                            Stateless event─driven decoder                                    │
33*10ff414cSEd Maste    │                                                                                              │
34*10ff414cSEd Maste    └──────────────────────────────────────────────────────────────────────────────────────────────┘
35*10ff414cSEd Maste
36*10ff414cSEd Maste                  (PSD = Provided Data Structures, CDS = Custom Data Structures)
37*10ff414cSEd Maste
38*10ff414cSEd MasteThis section will deal with the API that is labeled as the "Default driver" in the diagram. That is, routines that
39*10ff414cSEd Mastedecode complete libcbor data items
40*10ff414cSEd Maste
41*10ff414cSEd Maste.. doxygenfunction:: cbor_load
42*10ff414cSEd Maste
43*10ff414cSEd MasteAssociated data structures
44*10ff414cSEd Maste~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45*10ff414cSEd Maste
46*10ff414cSEd Maste.. doxygenenum:: cbor_error_code
47*10ff414cSEd Maste
48*10ff414cSEd Maste.. doxygenstruct:: cbor_load_result
49*10ff414cSEd Maste    :members:
50*10ff414cSEd Maste
51*10ff414cSEd Maste.. doxygenstruct:: cbor_error
52*10ff414cSEd Maste    :members:
53*10ff414cSEd Maste
54