nodesystem/src/node.h

26 lines
541 B
C

#ifndef __NODE_H_
#define __NODE_H_
typedef struct node{
char* name;
/** childc keeps track of allocated space,
not amount of children. For that use
NOD_NodeChildCount */
int childc;
struct node** childv;
struct node* parent;
} NOD_Node;
NOD_Node* NOD_CreateNode(char* name);
void NOD_DestroyNode(NOD_Node* node);
void NOD_NodeAddChild(NOD_Node* parent, NOD_Node* child);
void NOD_NodeUnparent(NOD_Node* child);
void NOD_PrintNodeTree(NOD_Node* node);
int NOD_NodeChildCount(NOD_Node* node);
#endif // __NODE_H_