|
cMCP 0.4.1
Model Context Protocol library in pure C11
|
Opaque-by-convention JSON tree node. More...
#include <cmcp_json.h>
Data Fields | ||
| cmcp_json_type_t | type | |
| union { | ||
| int b | ||
| long long i | ||
| double d | ||
| struct { | ||
| char * s | ||
| size_t len | ||
| } str | ||
| struct { | ||
| cmcp_json_t ** items | ||
| size_t len | ||
| size_t cap | ||
| } arr | ||
| struct { | ||
| char ** keys | ||
| size_t * key_lens | ||
| cmcp_json_t ** values | ||
| size_t len | ||
| size_t cap | ||
| } obj | ||
| }; | ||
Opaque-by-convention JSON tree node.
Treat as opaque except via the accessor functions below; struct layout is exposed for efficient construction in hot paths only.
union members (b, i, d, str.s, arr.items, obj.keys, ...) directly from outside the library. The struct layout is published only so the library's own hot paths can stack-build and pun cheaply; it is NOT part of the SemVer-stable public surface and may grow new tags, reorder fields, or change union shape in a minor release. The accessors are. Code that pokes the union will silently break on those bumps; code that uses the accessors will not. Definition at line 55 of file cmcp_json.h.
| cmcp_json_type_t cmcp_json_t::type |
Definition at line 56 of file cmcp_json.h.
| int cmcp_json_t::b |
Definition at line 58 of file cmcp_json.h.
| long long cmcp_json_t::i |
Definition at line 59 of file cmcp_json.h.
| double cmcp_json_t::d |
Definition at line 60 of file cmcp_json.h.
| char* cmcp_json_t::s |
Definition at line 62 of file cmcp_json.h.
| size_t cmcp_json_t::len |
Definition at line 63 of file cmcp_json.h.
| struct { ... } cmcp_json_t::str |
| cmcp_json_t** cmcp_json_t::items |
Definition at line 66 of file cmcp_json.h.
| size_t cmcp_json_t::cap |
Definition at line 68 of file cmcp_json.h.
| struct { ... } cmcp_json_t::arr |
| char** cmcp_json_t::keys |
Definition at line 71 of file cmcp_json.h.
| size_t* cmcp_json_t::key_lens |
Definition at line 72 of file cmcp_json.h.
| cmcp_json_t** cmcp_json_t::values |
Definition at line 73 of file cmcp_json.h.
| struct { ... } cmcp_json_t::obj |
| union { ... } cmcp_json_t |