|
gwenhywfar 5.14.1
|
#include "tree_p.h"#include <gwenhywfar/misc.h>#include <gwenhywfar/debug.h>
Go to the source code of this file.
Macros | |
| #define | DISABLE_DEBUGLOG |
| void GWEN_Tree_Add | ( | GWEN_TREE * | l, |
| GWEN_TREE_ELEMENT * | el ) |
Adds (appends) a toplevel tree element. (This operation is also called "append" or "push_back" elsewhere.)
Definition at line 65 of file tree.c.
References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_TREE_ELEMENT, and NULL.
Referenced by GWEN_Tree_AddList().

| void GWEN_Tree_AddChild | ( | GWEN_TREE_ELEMENT * | where, |
| GWEN_TREE_ELEMENT * | el ) |
Add a child below the given element.
Definition at line 234 of file tree.c.
References DBG_ERROR, GWEN_LOGDOMAIN, and GWEN_TREE_ELEMENT.
Adds (appends) the second list to the end of the first list. (This operation is also called "append" or "concatenate" elsewhere.) The second list will be empty upon return.
Definition at line 91 of file tree.c.
References GWEN_Tree_Add(), GWEN_Tree_Del(), and GWEN_TREE_ELEMENT.

| void GWEN_Tree_Del | ( | GWEN_TREE_ELEMENT * | el | ) |
Deletes (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 list it used to belong to. (This operation is also called "remove" or "unlink" elsewhere.)
Definition at line 129 of file tree.c.
References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_TREE_ELEMENT, and NULL.
Referenced by GWEN_Tree_AddList(), and GWEN_TreeElement_free().

| void GWEN_Tree_free | ( | GWEN_TREE * | l | ) |
Free (delete) an existing list. The list elements are untouched by this function; they need to be freed beforehand.
Definition at line 48 of file tree.c.
References GWEN_FREE_OBJECT.
| int GWEN_Tree_GetCount | ( | const GWEN_TREE * | l | ) |
| void * GWEN_Tree_GetFirst | ( | const GWEN_TREE * | l | ) |
| void * GWEN_Tree_GetLast | ( | const GWEN_TREE * | l | ) |
| void GWEN_Tree_Insert | ( | GWEN_TREE * | l, |
| GWEN_TREE_ELEMENT * | el ) |
Inserts (prepends) a toplevel tree element at the beginning of the list. (This operation is also called "prepend" or "push_front" elsewhere.)
Definition at line 106 of file tree.c.
References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_TREE_ELEMENT, and NULL.
| void GWEN_Tree_InsertChild | ( | GWEN_TREE_ELEMENT * | where, |
| GWEN_TREE_ELEMENT * | el ) |
Insert a child below the given element.
Definition at line 260 of file tree.c.
References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_TREE_ELEMENT, and NULL.
| GWEN_TREE * GWEN_Tree_new | ( | void | ) |
Allocate (create) a new empty list.
Definition at line 39 of file tree.c.
References GWEN_NEW_OBJECT.
| void GWEN_Tree_Replace | ( | GWEN_TREE_ELEMENT * | elToReplace, |
| GWEN_TREE_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 173 of file tree.c.
References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_TREE_ELEMENT, and NULL.
| void GWEN_TreeElement_free | ( | GWEN_TREE_ELEMENT * | el | ) |
Free (delete) a list element structure.
Definition at line 316 of file tree.c.
References DBG_ERROR, GWEN_FREE_OBJECT, GWEN_LOGDOMAIN, GWEN_Tree_Del(), and GWEN_TREE_ELEMENT.

| void * GWEN_TreeElement_GetBelow | ( | const GWEN_TREE_ELEMENT * | el | ) |
Returns the element which is logically below the given one. The order of search is this:
Definition at line 349 of file tree.c.
References GWEN_TREE_ELEMENT, and NULL.
| uint32_t GWEN_TreeElement_GetChildrenCount | ( | const GWEN_TREE_ELEMENT * | el | ) |
Returns the number of children of the given element
Definition at line 397 of file tree.c.
References GWEN_TREE_ELEMENT.
| void * GWEN_TreeElement_GetFirstChild | ( | const GWEN_TREE_ELEMENT * | el | ) |
Returns the first child of the given element.
Definition at line 370 of file tree.c.
References GWEN_TREE_ELEMENT, and NULL.
| void * GWEN_TreeElement_GetLastChild | ( | const GWEN_TREE_ELEMENT * | el | ) |
Returns the last child of the given element.
Definition at line 379 of file tree.c.
References GWEN_TREE_ELEMENT, and NULL.
| void * GWEN_TreeElement_GetNext | ( | const GWEN_TREE_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 340 of file tree.c.
References GWEN_TREE_ELEMENT.
| void * GWEN_TreeElement_GetParent | ( | const GWEN_TREE_ELEMENT * | el | ) |
Definition at line 388 of file tree.c.
References GWEN_TREE_ELEMENT, and NULL.
| void * GWEN_TreeElement_GetPrevious | ( | const GWEN_TREE_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 331 of file tree.c.
References GWEN_TREE_ELEMENT.
| GWEN_TREE_ELEMENT * GWEN_TreeElement_new | ( | void * | d | ) |
Allocate (create) a new list element structure.
Definition at line 304 of file tree.c.
References GWEN_NEW_OBJECT, and GWEN_TREE_ELEMENT.