cMCP 0.4.1
Model Context Protocol library in pure C11
Loading...
Searching...
No Matches
Data Fields
cmcp_json_t Struct Reference

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 
 
};  
 

Detailed Description

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.

Warning
Host code MUST go through the typed accessors:

Definition at line 55 of file cmcp_json.h.

Field Documentation

◆ type

cmcp_json_type_t cmcp_json_t::type

Definition at line 56 of file cmcp_json.h.

◆ b

int cmcp_json_t::b

Definition at line 58 of file cmcp_json.h.

◆ i

long long cmcp_json_t::i

Definition at line 59 of file cmcp_json.h.

◆ d

double cmcp_json_t::d

Definition at line 60 of file cmcp_json.h.

◆ s

char* cmcp_json_t::s

Definition at line 62 of file cmcp_json.h.

◆ len

size_t cmcp_json_t::len

Definition at line 63 of file cmcp_json.h.

◆ [struct]

struct { ... } cmcp_json_t::str

◆ items

cmcp_json_t** cmcp_json_t::items

Definition at line 66 of file cmcp_json.h.

◆ cap

size_t cmcp_json_t::cap

Definition at line 68 of file cmcp_json.h.

◆ [struct]

struct { ... } cmcp_json_t::arr

◆ keys

char** cmcp_json_t::keys

Definition at line 71 of file cmcp_json.h.

◆ key_lens

size_t* cmcp_json_t::key_lens

Definition at line 72 of file cmcp_json.h.

◆ values

cmcp_json_t** cmcp_json_t::values

Definition at line 73 of file cmcp_json.h.

◆ [struct]

struct { ... } cmcp_json_t::obj

◆ [union]

union { ... } cmcp_json_t

The documentation for this struct was generated from the following file: