mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2025-02-25 18:55:24 -06:00
lib: update tc_assignable
This commit is contained in:
parent
2c570133f9
commit
8afe7956cb
@ -39,13 +39,12 @@ void tc_assignable_node_destroy(tc_assignable_node_t *node) {
|
||||
}
|
||||
|
||||
int8_t tc_assignable_node_add_child(tc_assignable_node_t *parent, tc_assignable_node_t *child) {
|
||||
parent->children_count++;
|
||||
if ((parent->children_nodes = realloc(parent->children_nodes, parent->children_count * sizeof(parent))) == NULL) {
|
||||
return TC_ENOMEM;
|
||||
}
|
||||
parent->children_nodes[parent->children_count - 1] = child;
|
||||
child->parent = parent;
|
||||
return TC_SUCCESS;
|
||||
parent->children_count++;
|
||||
if ((parent->children_nodes = realloc(parent->children_nodes, parent->children_count * sizeof(parent))) == NULL) {
|
||||
return TC_ENOMEM;
|
||||
}
|
||||
parent->children_nodes[parent->children_count - 1] = child;
|
||||
return TC_SUCCESS;
|
||||
}
|
||||
|
||||
void tc_assignable_node_set_data(tc_assignable_node_t* node, char* unit, char* name, int8_t (*assign_callback)(tc_variant_t, const tc_assignable_node_t*)) {
|
||||
|
Loading…
Reference in New Issue
Block a user