gwenhywfar 5.10.1
Macros | Functions
tree2.c File Reference
#include "tree2_p.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
Include dependency graph for tree2.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG
 

Functions

void GWEN_Tree2_AddChild (GWEN_TREE2_ELEMENT *where, GWEN_TREE2_ELEMENT *el)
 
void GWEN_Tree2_InsertChild (GWEN_TREE2_ELEMENT *where, GWEN_TREE2_ELEMENT *el)
 
void GWEN_Tree2_Replace (GWEN_TREE2_ELEMENT *elToReplace, GWEN_TREE2_ELEMENT *elReplacement)
 
void GWEN_Tree2_Unlink (GWEN_TREE2_ELEMENT *el)
 
void GWEN_Tree2Element_free (GWEN_TREE2_ELEMENT *el)
 
void * GWEN_Tree2Element_GetBelow (const GWEN_TREE2_ELEMENT *el)
 
void * GWEN_Tree2Element_GetFirstChild (const GWEN_TREE2_ELEMENT *el)
 
void * GWEN_Tree2Element_GetLastChild (const GWEN_TREE2_ELEMENT *el)
 
void * GWEN_Tree2Element_GetNext (const GWEN_TREE2_ELEMENT *el)
 
void * GWEN_Tree2Element_GetParent (const GWEN_TREE2_ELEMENT *el)
 
void * GWEN_Tree2Element_GetPrevious (const GWEN_TREE2_ELEMENT *el)
 
GWEN_TREE2_ELEMENTGWEN_Tree2Element_new (void *d)
 

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 30 of file tree2.c.

Function Documentation

◆ GWEN_Tree2_AddChild()

void GWEN_Tree2_AddChild ( GWEN_TREE2_ELEMENT where,
GWEN_TREE2_ELEMENT el 
)

Add a child below the given element.

Definition at line 122 of file tree2.c.

References NULL.

◆ GWEN_Tree2_InsertChild()

void GWEN_Tree2_InsertChild ( GWEN_TREE2_ELEMENT where,
GWEN_TREE2_ELEMENT el 
)

Insert a child below the given element.

Definition at line 137 of file tree2.c.

References NULL.

◆ GWEN_Tree2_Replace()

void GWEN_Tree2_Replace ( GWEN_TREE2_ELEMENT elToReplace,
GWEN_TREE2_ELEMENT elReplacement 
)

Replaces a tree element with another one, so the replacement takes the place of the given element. The given element to replace is unlinked in the process and can be free'd. The replacement MUST NOT be part of any tree.

Definition at line 90 of file tree2.c.

References NULL.

◆ GWEN_Tree2_Unlink()

void GWEN_Tree2_Unlink ( GWEN_TREE2_ELEMENT el)

Unlinks (removes) a tree element from the tree it used to belong to. The tree element is not free'd or anything, it is only removed from the tree it used to belong to. (This operation is also called "remove" elsewhere.)

Definition at line 64 of file tree2.c.

References NULL.

◆ GWEN_Tree2Element_free()

void GWEN_Tree2Element_free ( GWEN_TREE2_ELEMENT el)

Free (delete) a list element structure.

Definition at line 51 of file tree2.c.

References DBG_ERROR, GWEN_FREE_OBJECT, and GWEN_LOGDOMAIN.

◆ GWEN_Tree2Element_GetBelow()

void * GWEN_Tree2Element_GetBelow ( const GWEN_TREE2_ELEMENT el)

Returns the element which is logically below the given one. The order of search is this:

  • first child of the given element
  • next neighbour of the given element
  • loop for every parent: check next neighbour of the given element's parent (if any)

Definition at line 168 of file tree2.c.

References NULL.

◆ GWEN_Tree2Element_GetFirstChild()

void * GWEN_Tree2Element_GetFirstChild ( const GWEN_TREE2_ELEMENT el)

Returns the first child of the given element.

Definition at line 189 of file tree2.c.

References NULL.

◆ GWEN_Tree2Element_GetLastChild()

void * GWEN_Tree2Element_GetLastChild ( const GWEN_TREE2_ELEMENT el)

Returns the last child of the given element.

Definition at line 198 of file tree2.c.

References NULL.

◆ GWEN_Tree2Element_GetNext()

void * GWEN_Tree2Element_GetNext ( const GWEN_TREE2_ELEMENT el)

Returns the data pointer of the list element that is the next one (successor) to the given one in its list. If there is no such prepending list element, returns NULL.

Definition at line 159 of file tree2.c.

◆ GWEN_Tree2Element_GetParent()

void * GWEN_Tree2Element_GetParent ( const GWEN_TREE2_ELEMENT el)

Definition at line 207 of file tree2.c.

References NULL.

◆ GWEN_Tree2Element_GetPrevious()

void * GWEN_Tree2Element_GetPrevious ( const GWEN_TREE2_ELEMENT el)

Returns the data pointer of the list element that is the previous (predecessor) to the given one in its list. If there is no such prepending list element, returns NULL.

Definition at line 150 of file tree2.c.

◆ GWEN_Tree2Element_new()

GWEN_TREE2_ELEMENT * GWEN_Tree2Element_new ( void *  d)

Allocate (create) a new list element structure.

Definition at line 39 of file tree2.c.

References GWEN_NEW_OBJECT.