add_jtree_path()

add_jtree_path()#

The add_jtree_path() function appends a child node to a parent node in a hierarchical JSON tree structure.

Prototype

int add_jtree_path(
    json_t *parent,  // not owned
    json_t *child    // not owned
);

Parameters

Key

Type

Description

parent

json_t *

A pointer to the parent JSON node. This parameter is not owned by the function.

child

json_t *

A pointer to the child JSON node to be added. This parameter is not owned by the function.


Return Value

Returns 0 on success, or a negative error code if the operation fails.

Notes

The function does not take ownership of the parent or child nodes, meaning the caller is responsible for managing their memory.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples