30#define DISABLE_DEBUGLOG
33#include <gwenhywfar/misc.h>
34#include <gwenhywfar/debug.h>
69 el->prevElement->nextElement=el->nextElement;
73 el->nextElement->prevElement=el->prevElement;
77 if (el->parent->firstChild==el)
78 el->parent->firstChild=el->nextElement;
79 if (el->parent->lastChild==el)
80 el->parent->lastChild=el->prevElement;
92 elReplacement->nextElement=
NULL;
93 elReplacement->prevElement=
NULL;
94 elReplacement->parent=
NULL;
97 if (elToReplace->prevElement)
98 elToReplace->prevElement->nextElement=elReplacement;
99 elReplacement->prevElement=elToReplace->prevElement;
102 if (elToReplace->nextElement)
103 elToReplace->nextElement->prevElement=elReplacement;
104 elReplacement->nextElement=elToReplace->nextElement;
107 if (elToReplace->parent) {
108 elReplacement->parent=elToReplace->parent;
109 if (elToReplace->parent->firstChild==elToReplace)
110 elToReplace->parent->firstChild=elReplacement;
111 if (elToReplace->parent->lastChild==elToReplace)
112 elToReplace->parent->lastChild=elReplacement;
115 elToReplace->nextElement=
NULL;
116 elToReplace->prevElement=
NULL;
117 elToReplace->parent=
NULL;
124 if (where->firstChild==
NULL)
125 where->firstChild=el;
127 el->prevElement=where->lastChild;
128 if (where->lastChild)
129 where->lastChild->nextElement=el;
139 el->nextElement=where->firstChild;
140 where->firstChild=el;
142 if (where->lastChild==
NULL)
153 return el->prevElement->data;
162 return el->nextElement->data;
171 return el->firstChild->data;
172 else if (el->nextElement)
173 return el->nextElement->data;
176 while (el && el->parent) {
177 if (el->parent->nextElement)
178 return el->parent->nextElement->data;
192 return el->firstChild->data;
201 return el->lastChild->data;
210 return el->parent->data;
#define DBG_ERROR(dbg_logger, format, args...)
#define GWEN_FREE_OBJECT(varname)
#define GWEN_NEW_OBJECT(typ, varname)
void GWEN_Tree2_InsertChild(GWEN_TREE2_ELEMENT *where, GWEN_TREE2_ELEMENT *el)
GWEN_TREE2_ELEMENT * GWEN_Tree2Element_new(void *d)
void * GWEN_Tree2Element_GetFirstChild(const GWEN_TREE2_ELEMENT *el)
void GWEN_Tree2_Replace(GWEN_TREE2_ELEMENT *elToReplace, GWEN_TREE2_ELEMENT *elReplacement)
void * GWEN_Tree2Element_GetParent(const GWEN_TREE2_ELEMENT *el)
void GWEN_Tree2_AddChild(GWEN_TREE2_ELEMENT *where, GWEN_TREE2_ELEMENT *el)
void * GWEN_Tree2Element_GetNext(const GWEN_TREE2_ELEMENT *el)
void * GWEN_Tree2Element_GetBelow(const GWEN_TREE2_ELEMENT *el)
void * GWEN_Tree2Element_GetLastChild(const GWEN_TREE2_ELEMENT *el)
void * GWEN_Tree2Element_GetPrevious(const GWEN_TREE2_ELEMENT *el)
void GWEN_Tree2Element_free(GWEN_TREE2_ELEMENT *el)
void GWEN_Tree2_Unlink(GWEN_TREE2_ELEMENT *el)
struct GWEN_TREE2_ELEMENT GWEN_TREE2_ELEMENT