Woolz Image Processing
Version 1.8.3
|
Data structures and functions for doubly linked lists linked lists of pointers. More...
Go to the source code of this file.
Typedefs | |
typedef enum _HGUDlpListDirection | HGUDlpListDirection |
typedef enum _HGUDlpListState | HGUDlpListState |
typedef void | HGUDlpListItem |
Opaque handle for doubly linked list item. More... | |
typedef void | HGUDlpList |
Opaque handle for doubly linked list of pointers. More... | |
Enumerations | |
enum | _HGUDlpListDirection { HGU_DLPLIST_DIR_TOHEAD, HGU_DLPLIST_DIR_TOTAIL } |
List traversal direction; Typedef: HGUDlpListDirection. More... | |
enum | _HGUDlpListState { HGU_DLPLIST_STATE_EMPTY = (0), HGU_DLPLIST_STATE_ERROR = (0), HGU_DLPLIST_STATE_UNLOCK = (1), HGU_DLPLIST_STATE_LOCK = (1<<1), HGU_DLPLIST_STATE_CREATE = (1<<2), HGU_DLPLIST_STATE_DESTROY = (1<<3) } |
State of list locking mechanism. Typedef: HGUDlpListState. More... | |
Functions | |
int | HGUDlpListSort (HGUDlpList *list, int(*entryCompFn)(void *, void *)) |
Sorts the entire list using the given entry comparison function. More... | |
int | HGUDlpListItemIsHead (HGUDlpList *list, HGUDlpListItem *item) |
Looks to see if the given item is at the head of the given list. More... | |
int | HGUDlpListItemIsTail (HGUDlpList *list, HGUDlpListItem *item) |
Looks to see if the given item is at the tail of the given list. More... | |
int | HGUDlpListCount (HGUDlpList *list) |
Returns the number of items in the list. More... | |
int | HGUDlpListOffset (HGUDlpList *list, HGUDlpListItem *item, HGUDlpListDirection dir) |
Counts the number of items from the given item to the item with a NULL next/prev item, which is at the head or tail of list. The offset between an item and itself is defined to be zero. More... | |
void | HGUDlpListDestroy (HGUDlpList *list) |
Destroys the given list list data structure and any list items. More... | |
void * | HGUDlpListEntryGet (HGUDlpList *list, HGUDlpListItem *item) |
Returns the list items entry. More... | |
void * | HGUDlpListEntrySet (HGUDlpList *list, HGUDlpListItem *item, void *entry) |
Sets the given items entry and returns the previous entry. Entries are NEVER freed by this function. More... | |
HGUDlpList * | HGUDlpListCreate (HGUDlpListState(*lockFn)(void *, HGUDlpListState)) |
HGUDlpList * | HGUDlpListDup (HGUDlpList *list) |
Duplicates a list data structure, but NOT its items. Ie head and tail are both NULL and the item count is zero, only the lock function is common. More... | |
HGUDlpListItem * | HGUDlpListInsert (HGUDlpList *list, HGUDlpListItem *before, void *entry, void(*freeFn)(void *)) |
Inserts the given entry into the list before the given item. More... | |
HGUDlpListItem * | HGUDlpListAppend (HGUDlpList *list, HGUDlpListItem *after, void *entry, void(*freeFn)(void *)) |
Appends the given entry into the list after the given item. More... | |
HGUDlpListItem * | HGUDlpListExchange (HGUDlpList *list, HGUDlpListItem *item0, HGUDlpListItem *item1) |
Exchanges the two given list item entries and not the items, so that head is still head and tail is still tail. More... | |
HGUDlpListItem * | HGUDlpListDeleteAll (HGUDlpList *list) |
Deletes all list items from the head on down to and including the tail. Where delete implies both the removal of items from the list and freeing the entries using the item's free functions (unless either the free function or the entry is NULL). More... | |
HGUDlpListItem * | HGUDlpListDelete (HGUDlpList *list, HGUDlpListItem *item) |
Deletes the given list item from the list with the given list. Where delete implies both the removal of an item, the freeing of the item AND (when neither the free function or the entry are NULL) it's entry too. More... | |
HGUDlpListItem * | HGUDlpListRemoveAll (HGUDlpList *list) |
HGUDlpListItem * | HGUDlpListRemove (HGUDlpList *list, HGUDlpListItem *item) |
Removes the item from the list withe the given list. Where remove implies the removal of the item from the list and the freeing of the item EXCEPT for its entry. More... | |
HGUDlpListItem * | HGUDlpListIterate (HGUDlpList *list, HGUDlpListItem *item, HGUDlpListDirection dir, int(*iterFn)(HGUDlpList *, HGUDlpListItem *, void *), void *iterData) |
Iterates the given function through the list, starting with the supplied given item. The iteration may proceed toward either the head or tail of the list. The iterated function must take the form of: More... | |
HGUDlpListItem * | HGUDlpListHead (HGUDlpList *list) |
Returns the head list item. More... | |
HGUDlpListItem * | HGUDlpListTail (HGUDlpList *list) |
Returns the tail list item. More... | |
HGUDlpListItem * | HGUDlpListNext (HGUDlpList *list, HGUDlpListItem *item) |
Returns the next list item. More... | |
HGUDlpListItem * | HGUDlpListPrev (HGUDlpList *list, HGUDlpListItem *item) |
Returns the prev list item. More... | |
HGUDlpListItem * | HGUDlpListNth (HGUDlpList *list, HGUDlpListItem *item, HGUDlpListDirection dir, int num) |
Finds the n'th item from the given item in the list. The n'th item from the head or tail can be found by calling the function with item == NULL, in which case the direction of approach is optimised. More... | |
Data structures and functions for doubly linked lists linked lists of pointers.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
typedef enum _HGUDlpListDirection HGUDlpListDirection |
typedef enum _HGUDlpListState HGUDlpListState |
Opaque handle for doubly linked list item.
Opaque handle for doubly linked list of pointers.
HGUDlpList* HGUDlpListCreate | ( | HGUDlpListState(*)(void *, HGUDlpListState) | lockFn | ) |
HGUDlpListItem* HGUDlpListRemoveAll | ( | HGUDlpList * | list | ) |