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