treedb_unlink_nodes()
#
The treedb_unlink_nodes()
function removes the hierarchical relationship between a parent and a child node in the tree database, identified by the specified hook.
Prototype
int treedb_unlink_nodes(
json_t *tranger,
const char *hook,
json_t *parent_node, // NOT owned, pure node
json_t *child_node // NOT owned, pure node
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A pointer to the tranger database instance. |
|
|
The name of the hook defining the relationship to be removed. |
|
|
A pointer to the parent node from which the child node will be unlinked. This node is not owned by the function. |
|
|
A pointer to the child node that will be unlinked from the parent node. This node is not owned by the function. |
Return Value
Returns 0
on success, or a negative error code if the unlinking operation fails.
Notes
The function does not take ownership of parent_node
or child_node
, meaning the caller is responsible for managing their memory. Ensure that the specified hook
exists before calling treedb_unlink_nodes()
.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples