| 68 | } |
| 69 | |
| 70 | static xode _xode_insert(xode parent, const char* name, unsigned int type) |
| 71 | { |
| 72 | xode result; |
| 73 | |
| 74 | if(parent == NULL || name == NULL) return NULL; |
| 75 | |
| 76 | /* If parent->firstchild is NULL, simply create a new node for the first child */ |
| 77 | if (parent->firstchild == NULL) |
| 78 | { |
| 79 | result = _xode_new(parent->p, name, type); |
| 80 | parent->firstchild = result; |
| 81 | } |
| 82 | /* Otherwise, append this to the lastchild */ |
| 83 | else |
| 84 | { |
| 85 | result= _xode_appendsibling(parent->lastchild, name, type); |
| 86 | } |
| 87 | result->parent = parent; |
| 88 | parent->lastchild = result; |
| 89 | return result; |
| 90 | |
| 91 | } |
| 92 | |
| 93 | static xode _xode_search(xode firstsibling, const char* name, unsigned int type) |
| 94 | { |
no test coverage detected