treedb_node_jtree()

treedb_node_jtree()#

treedb_node_jtree() constructs a hierarchical tree representation of child nodes linked through a specified hook.

Prototype

json_t *treedb_node_jtree(
    json_t      *tranger,
    const char  *hook,
    const char  *rename_hook,
    json_t      *node,
    json_t      *jn_filter,
    json_t      *jn_options
);

Parameters

Key

Type

Description

tranger

json_t *

Pointer to the tranger database instance.

hook

const char *

Hook name used to establish parent-child relationships.

rename_hook

const char *

Optional new name for the hook in the resulting tree.

node

json_t *

Pointer to the parent node from which the tree is built. Not owned.

jn_filter

json_t *

Filter criteria for selecting child nodes. Not owned.

jn_options

json_t *

Options for controlling the structure of the resulting tree, including fkey and hook options.


Return Value

A JSON object representing the hierarchical tree of child nodes. The caller must decrement the reference count when done.

Notes

The function recursively traverses child nodes using the specified hook. The rename_hook parameter allows renaming the hook in the output tree.

Prototype

// Not applicable in JS

Prototype

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