nodesystem/src/main.c

34 lines
1.0 KiB
C

#include<stdio.h>
#include "node.h"
int main(int argc, char** argv){
NOD_Node* node = NOD_CreateNode("Main Node");
NOD_Node* child1 = NOD_CreateNode("First child");
NOD_Node* child1child1 = NOD_CreateNode("Child of first child");
NOD_Node* child2 = NOD_CreateNode("Second child");
NOD_Node* child3 = NOD_CreateNode("Third child");
NOD_Node* child3child1 = NOD_CreateNode("First child of third child");
NOD_Node* child3child2 = NOD_CreateNode("Second child of third child");
NOD_NodeAddChild(node, child1);
NOD_NodeAddChild(child1, child1child1);
NOD_NodeAddChild(node, child2);
NOD_NodeAddChild(node, child3);
NOD_NodeAddChild(child3, child3child1);
NOD_NodeAddChild(child3, child3child2);
NOD_NodeUnparent(child2);
NOD_PrintNodeTree(node);
NOD_DestroyNode(node);
NOD_DestroyNode(child1);
NOD_DestroyNode(child1child1);
NOD_DestroyNode(child2);
NOD_DestroyNode(child3);
NOD_DestroyNode(child3child1);
NOD_DestroyNode(child3child2);
return 0;
}