#include <stdio.h>#include <stdlib.h>Include dependency graph for dbLkList.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | _DbLkListNodeContent |
| each node in the list contains this struct More... | |
| struct | _DbLkListNode |
| a node in the list, has the content above and pointers to next and previous More... | |
| struct | _DbLkList |
| the list structure, holds pointer to tail and head, the number of elements, and callback functions More... | |
Typedefs | |
| typedef _DbLkList * | ListP |
| typedef void() | ListVisitFunction (ListP, void *object) |
| typedef void() | ListPrintFunction (ListP, void *object) |
| typedef void() | ListDeleteFunction (ListP, void *object) |
| typedef _DbLkListNodeContent | DbLkListNodeContent |
| each node in the list contains this struct | |
| typedef _DbLkListNode | DbLkListNode |
| a node in the list, has the content above and pointers to next and previous | |
| typedef _DbLkList | DbLkList |
| the list structure, holds pointer to tail and head, the number of elements, and callback functions | |
Enumerations | |
| enum | DbLkDestroyMode { DBLIST_DM_KEEP = 0, DBLIST_DM_FREE } |
| this types indicates if we shall free contents More... | |
| enum | DbLkTransMode { DBLIST_TM_FROM_HEAD, DBLIST_TM_FROM_TAIL } |
| the way we shall transverse the list More... | |
Functions | |
| DbLkList * | listCreate () |
| Initializes the empty list. | |
| void | listDestroy (DbLkList **list, DbLkDestroyMode mode) |
| Destroys the list. | |
| int | listPrepare (DbLkList *list, DbLkTransMode from) |
| prepares the list for itaration. | |
| int | listGetNext (DbLkList *list, void **object) |
| get next node | |
| int | listGetPrevious (DbLkList *list, void **object) |
| get previous node | |
| int | listInsertHead (DbLkList *list, void *object) |
| Inserts an object in the list, as the new head node. | |
| int | listInsertTail (DbLkList *list, void *object) |
| Inserts an object at the end of the list, as the new tail. | |
| int | listInsertAt (DbLkList *list, int position, void *object) |
| Inserts the object at the given position. | |
| int | listGetObjectAt (DbLkList *list, int position, void **objectPointerAddress) |
| Retrieves the object at the given position, but does not remove it from list. | |
| int | listRemoveObjectAt (DbLkList *list, int position, void **objectPointerAddress) |
| Retrieves the object at the given position, removing it from list. | |
| int | listRemoveObject (DbLkList *list, void *object) |
| Removes the given object from the list. | |
| int | listCat (DbLkList *destination, DbLkList **sourceAddress) |
| Concatenates 2 list. | |
| int | listGetHead (DbLkList *list, void **objectAddress) |
| Retrieves the first element in the list, ie, the head. | |
| int | listGetTail (DbLkList *list, void **objectAddress) |
| Retrieves the first element in the list, ie, the head. | |
| int | listRemoveHead (DbLkList *list, void **object) |
| Removes the list head, returning it at the object pointer argument. | |
| int | listRemoveTail (DbLkList *list, void **object) |
| Removes the list tail, returning it at the object pointer argument. | |
| void | listRegisterPrintFunction (DbLkList *list, ListPrintFunction *printFunction) |
| Registers a function to be called by the print function, in each list node. | |
| void | listPrint (DbLkList *list) |
| Prints the list, from head to tail. | |
| void | listVisit (DbLkList *list) |
| Visits the list, from head to tail, calling the registered function. | |
| void | listRegisterDeleteFunction (DbLkList *list, ListDeleteFunction *deleteFunction) |
| Registers a function to be called by the destroy function, in each list node. | |
|
|
the list structure, holds pointer to tail and head, the number of elements, and callback functions
|
|
|
a node in the list, has the content above and pointers to next and previous
|
|
|
each node in the list contains this struct
|
|
|
Definition at line 30 of file dbLkList.h. |
|
|
Definition at line 25 of file dbLkList.h. |
|
|
Definition at line 29 of file dbLkList.h. |
|
|
Definition at line 28 of file dbLkList.h. |
|
|
this types indicates if we shall free contents
Definition at line 18 of file dbLkList.h. |
|
|
the way we shall transverse the list
Definition at line 23 of file dbLkList.h. |
|
||||||||||||
|
Concatenates 2 list. The source list is freed, the destination will hold all elements from the other. Source list is concatenated at the end of the destination
Definition at line 285 of file dbLkList.c. References _DbLkList::head, _DbLkListNode::next, _DbLkList::numElements, _DbLkListNode::previous, and _DbLkList::tail. |
|
|
Initializes the empty list.
Definition at line 87 of file dbLkList.c. References _DbLkList::deleteFunction, _DbLkList::head, _DbLkList::lastVisited, _DbLkListNode::next, _DbLkList::numElements, _DbLkListNode::previous, _DbLkList::printFunction, _DbLkList::tail, and _DbLkList::visitFunction. Referenced by stCreate(), and trcCreateData(). |
|
||||||||||||
|
Destroys the list. If theres a registered free function, it will be called for each node
Definition at line 104 of file dbLkList.c. References DBLIST_DM_FREE, _DbLkList::deleteFunction, listRemoveObjectAt(), and _DbLkList::numElements. Referenced by stDestroy(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Retrieves the first element in the list, ie, the head. Does not remove from the list
Definition at line 272 of file dbLkList.c. References _DbLkListNodeContent::content, _DbLkList::head, _DbLkListNode::next, _DbLkListNode::nodeContent, and _DbLkList::numElements. |
|
||||||||||||
|
get next node
Definition at line 138 of file dbLkList.c. References _DbLkListNodeContent::content, _DbLkList::lastVisited, _DbLkListNode::next, _DbLkListNode::nodeContent, and _DbLkList::tail. Referenced by stDestroy(). |
|
||||||||||||||||
|
Retrieves the object at the given position, but does not remove it from list.
Definition at line 200 of file dbLkList.c. References _DbLkListNodeContent::content, and _DbLkListNode::nodeContent. |
|
||||||||||||
|
get previous node
Definition at line 149 of file dbLkList.c. References _DbLkListNodeContent::content, _DbLkList::head, _DbLkList::lastVisited, _DbLkListNode::nodeContent, and _DbLkListNode::previous. |
|
||||||||||||
|
Retrieves the first element in the list, ie, the head. Does not remove from the list
Definition at line 264 of file dbLkList.c. References _DbLkListNodeContent::content, _DbLkListNode::nodeContent, _DbLkList::numElements, _DbLkListNode::previous, and _DbLkList::tail. Referenced by stGetTop(). |
|
||||||||||||||||
|
Inserts the object at the given position. If position does not exist and is less than 0, it will be a head insertion. Else is a tail insertion.
Definition at line 177 of file dbLkList.c. References listInsertHead(), listInsertTail(), _DbLkList::numElements, and _DbLkListNode::previous. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Inserts an object in the list, as the new head node.
Definition at line 168 of file dbLkList.c. References _DbLkList::head. Referenced by listInsertAt(). |
|
||||||||||||
|
Inserts an object at the end of the list, as the new tail.
Definition at line 172 of file dbLkList.c. References _DbLkListNode::previous, and _DbLkList::tail. Referenced by listInsertAt(), and stPush(). |
|
||||||||||||
|
prepares the list for itaration. Should be called before getNext or getPrevious
Definition at line 129 of file dbLkList.c. References DBLIST_TM_FROM_HEAD, _DbLkList::head, _DbLkList::lastVisited, _DbLkList::numElements, and _DbLkList::tail. Referenced by stDestroy(). |
|
|
Prints the list, from head to tail.
Definition at line 326 of file dbLkList.c. References _DbLkListNodeContent::content, _DbLkList::head, _DbLkListNode::next, _DbLkListNode::nodeContent, _DbLkList::numElements, and _DbLkList::printFunction. |
|
||||||||||||
|
Registers a function to be called by the destroy function, in each list node.
Definition at line 345 of file dbLkList.c. References _DbLkList::deleteFunction. |
|
||||||||||||
|
Registers a function to be called by the print function, in each list node. If this function is not registered, calls to listVisit will return immediately.
Definition at line 341 of file dbLkList.c. References _DbLkList::printFunction. |
|
||||||||||||
|
Removes the list head, returning it at the object pointer argument.
Definition at line 246 of file dbLkList.c. References _DbLkListNodeContent::content, _DbLkList::head, _DbLkListNode::next, _DbLkListNode::nodeContent, and _DbLkList::numElements. Referenced by trcFlush(). |
|
||||||||||||
|
Removes the given object from the list.
Definition at line 237 of file dbLkList.c. |
|
||||||||||||||||
|
Retrieves the object at the given position, removing it from list.
Definition at line 224 of file dbLkList.c. References _DbLkListNodeContent::content, and _DbLkListNode::nodeContent. Referenced by listDestroy(). |
|
||||||||||||
|
Removes the list tail, returning it at the object pointer argument.
Definition at line 255 of file dbLkList.c. References _DbLkListNodeContent::content, _DbLkListNode::nodeContent, _DbLkList::numElements, _DbLkListNode::previous, and _DbLkList::tail. Referenced by stPop(). |
|
|
Visits the list, from head to tail, calling the registered function. If none, return.
Definition at line 309 of file dbLkList.c. References _DbLkListNodeContent::content, _DbLkList::head, _DbLkListNode::next, _DbLkListNode::nodeContent, _DbLkList::numElements, and _DbLkList::visitFunction. |
1.4.6