|
CToon C 0.6.1
A C99 TOON/JSON serialization library
|
#include <ctoon.h>

Data Fields | |
| ctoon_mut_val * | ctn |
| ctoon_mut_val * | pre |
| ctoon_mut_val * | old |
A context for TOON pointer operation.
This struct stores the context of TOON Pointer operation result. The struct can be used with three helper functions: ctx_append(), ctx_replace(), and ctx_remove(), which perform the corresponding operations on the container without re-parsing the TOON Pointer.
For example:
| ctoon_mut_val* ctoon_ptr_ctx::ctn |
The container (parent) of the target value. It can be either an array or an object. If the target location has no value, but all its parent containers exist, and the target location can be used to insert a new value, then ctn is the parent container of the target location. Otherwise, ctn is NULL.
| ctoon_mut_val* ctoon_ptr_ctx::old |
| ctoon_mut_val* ctoon_ptr_ctx::pre |
The previous sibling of the target value. It can be either a value in an array or a key in an object. As the container is a circular linked list of elements, pre is the previous node of the target value. If the operation is add or set, then pre is the previous node of the new value, not the original target value. If the target value does not exist, pre is NULL.