gobj_unlink_nodes()
#
The gobj_unlink_nodes()
function removes the relationship between a parent and child node in a hierarchical data structure managed by a hgobj
.
Prototype
int gobj_unlink_nodes(
hgobj gobj,
const char *hook,
const char *parent_topic_name,
json_t *parent_record,
const char *child_topic_name,
json_t *child_record,
hgobj src
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The |
|
|
The name of the relationship (hook) to be removed. |
|
|
The topic name of the parent node. |
|
|
A JSON object containing the parent node’s data. This parameter is owned and will be decremented. |
|
|
The topic name of the child node. |
|
|
A JSON object containing the child node’s data. This parameter is owned and will be decremented. |
|
|
The source |
Return Value
Returns 0
on success, or -1
if an error occurs (e.g., if gobj
is NULL
or destroyed, or if mt_unlink_nodes
is not defined).
Notes
[‘The function checks if gobj
is valid before proceeding.’, “If mt_unlink_nodes
is not defined in the hgobj
’s gclass, an error is logged and -1
is returned.”, ‘Both parent_record
and child_record
are decremented after use.’]
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples