bool runic_node_set_right(runic_obj_t* parent, runic_obj_t child);¶
The above function signature outlines the operation regarding pointer assignment of the root node. The function takes the offset of child and assigns it as the right element of parent. A subsequent call to runic_node_right() with the same parent argument will return a copy of child.
Arguments:¶
parent – A
runic_obj_tof typeNODEthat was returned as a result of a successful runic_alloc, runic_root, node_left or node_right operation. Meaning, this object will have an initializedbasepointer and anoffsetgreater than or equal toDEFAULT_ROOTas defined in dependencies. Using an uninitializedparentis an invalid operation and the program will likely returnfalse.child – A
runic_obj_tthat was returned as a result of a successful runic_alloc, runic_root, node_left or node_right operation. Meaning, this object will have an initializedbasepointer and anoffsetgreater than or equal toDEFAULT_ROOTas defined in dependencies. Using an uninitializedchildis an invalid operation and the program will likely returnfalse.
Returns:¶
On a success, child is assigned as the right element for parent, and the function returns true. On a failure, the function returns false.