Architecture — cJSON Qualification¶
Requirement: The cJSON parser implements a recursive-descent algorithm operating on a UTF-8 byte stream. Control flow passes through tokenizer, value parser, and object/array constructors. ARCH_PARSER_FLOW
|
Requirement: The cJSON printer traverses an in-memory cJSON object graph, emitting formatted or unformatted JSON text through a bounded output buffer. ARCH_PRINTER_FLOW
|
Requirement: Memory management uses the standard C malloc/free allocator by default, with an optional hook mechanism (cJSON_InitHooks) that allows integration with a safety-qualified memory allocator. ARCH_MEMORY_MODEL
|
Requirement: The cJSON data model is a tagged union (cJSON struct) supporting six value types: null, boolean, number, string, array, object. Arrays are linked lists of cJSON items; objects are linked lists of cJSON items with associated string keys. ARCH_DATA_MODEL
|
Requirement: The cJSON module boundary is defined by cJSON.h. All public API functions are marked CJSON_PUBLIC. Internal helpers (parse_, print_, ensure_, etc.) are static and not part of the external interface. The cJSON_Utils extension provides JSON Patch and JSON Pointer operations on top of the core API. ARCH_MODULE_BOUNDARY
|
Component Architecture (PlantUML)¶
The cJSON core (
The cJSON Utils ( All components interface with the C standard library for string and memory operations. |
Parser Flow (PlantUML)¶
Data Model (PlantUML)¶
Safety Architecture — Freedom from Interference¶
FFI measures in cJSON:
Integrator responsibilities:
|