31 lines
666 B
C
31 lines
666 B
C
#ifndef __NODE_H_
|
|
#define __NODE_H_
|
|
|
|
typedef struct node{
|
|
char *name;
|
|
char *type;
|
|
|
|
/** childc keeps track of allocated space,
|
|
not amount of children. For that use
|
|
NOD_NodeChildCount */
|
|
int childc;
|
|
struct node* *childv;
|
|
struct node *parent;
|
|
|
|
void* data;
|
|
|
|
} NOD_Node;
|
|
|
|
NOD_Node *NOD_CreateNode(char *name);
|
|
NOD_Node *NOD_CreateNodeEX(char *type, char *name);
|
|
void NOD_DestroyNode(NOD_Node *node);
|
|
void NOD_DestroyNodeBranch(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_
|