Woolz Image Processing  Version 1.7.5
HGUDlpList.h File Reference

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...
 
HGUDlpListHGUDlpListCreate (HGUDlpListState(*lockFn)(void *, HGUDlpListState))
 
HGUDlpListHGUDlpListDup (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...
 
HGUDlpListItemHGUDlpListInsert (HGUDlpList *list, HGUDlpListItem *before, void *entry, void(*freeFn)(void *))
 Inserts the given entry into the list before the given item. More...
 
HGUDlpListItemHGUDlpListAppend (HGUDlpList *list, HGUDlpListItem *after, void *entry, void(*freeFn)(void *))
 Appends the given entry into the list after the given item. More...
 
HGUDlpListItemHGUDlpListExchange (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...
 
HGUDlpListItemHGUDlpListDeleteAll (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...
 
HGUDlpListItemHGUDlpListDelete (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...
 
HGUDlpListItemHGUDlpListRemoveAll (HGUDlpList *list)
 
HGUDlpListItemHGUDlpListRemove (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...
 
HGUDlpListItemHGUDlpListIterate (HGUDlpList *list, HGUDlpListItem *item, HGUDlpListDirection dir, int(*iterFn)(HGUDlpList *, HGUDlpListItem *, void *), void *iterData)
 
HGUDlpListItemHGUDlpListHead (HGUDlpList *list)
 Returns the head list item. More...
 
HGUDlpListItemHGUDlpListTail (HGUDlpList *list)
 Returns the tail list item. More...
 
HGUDlpListItemHGUDlpListNext (HGUDlpList *list, HGUDlpListItem *item)
 Returns the next list item. More...
 
HGUDlpListItemHGUDlpListPrev (HGUDlpList *list, HGUDlpListItem *item)
 Returns the prev list item. More...
 
HGUDlpListItemHGUDlpListNth (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...
 

Detailed Description

Data structures and functions for doubly linked lists linked lists of pointers.

Author
Bill Hill
Date
March 1999
Version
Id
3ef0e2c8562fa955c61e9e757fc9e672c10da307
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

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 Documentation

Opaque handle for doubly linked list item.

Opaque handle for doubly linked list of pointers.

Function Documentation

HGUDlpList* HGUDlpListCreate ( HGUDlpListState(*)(void *, HGUDlpListState lockFn)
HGUDlpListItem* HGUDlpListRemoveAll ( HGUDlpList list)
HGUDlpListItem* HGUDlpListIterate ( HGUDlpList list,
HGUDlpListItem item,
HGUDlpListDirection  dir,
int(*)(HGUDlpList *, HGUDlpListItem *, void *)  iterFn,
void *  iterData 
)