Woolz Image Processing  Version 1.8.3
AlcHashTable.c File Reference

A general purpose hash table. More...

Functions

AlcHashTableAlcHashTableNew (size_t tableSz, int(*keyCmp)(void *, void *), unsigned(*hashFn)(void *), AlcErrno *dstErr)
 Creates a hash table data structure which is required by all the other AlcHashTable functions. More...
 
AlcHashItemAlcHashItemNew (void *entry, void(*freeFn)(void *), void *key, AlcErrno *dstErr)
 Creates a hash item data structure for building into an AlcHashTable. More...
 
AlcErrno AlcHashTableFree (AlcHashTable *hTbl)
 Free's the given hash table data structure and any hash table items. More...
 
AlcErrno AlcHashTableEntryInsert (AlcHashTable *hTbl, void *key, void *entry, void(*freeFn)(void *))
 Inserts the given entry into the hash table. More...
 
AlcErrno AlcHashItemUnlink (AlcHashTable *hTbl, AlcHashItem *rItem, int freeItem)
 Removes the item from the hash table, but does not free the item unless the freeItem flag is set. More...
 
AlcErrno AlcHashItemInsert (AlcHashTable *hTbl, AlcHashItem *newItem)
 Inserts a new item into the hash table. First find the table list head by generating an index from the key using the hash function, then insert the entry into the sorted list. More...
 
AlcErrno AlcHashItemFree (AlcHashItem *item)
 Free's the list item which has already been removed from the list. More...
 
size_t AlcHashTableCount (AlcHashTable *hTbl, AlcErrno *dstErr)
 Returns the number of items in the list. More...
 
AlcHashItemAlcHashTableIterate (AlcHashTable *hTbl, AlcDirection dir, int(*iterFn)(AlcHashTable *, AlcHashItem *, void *), void *iterData, AlcErrno *dstErr)
 Iterates the given function through all entries of the hash table, starting with either the first or last item. The iteration proceeds towards either the last or first item in the table. The iterated function must take the form. More...
 
AlcErrno AlcHashTableUnlinkAll (AlcHashTable *hTbl, int(*testFn)(AlcHashTable *, AlcHashItem *, void *), void *fnData, int freeItems)
 Unlinks all items which are matched by the given match function. If the match pointer function is NULL then all the items are unlinked. The test function should return non-zero to unlink the item passed to it. More...
 
AlcHashItemAlcHashItemGet (AlcHashTable *hTbl, void *key, AlcErrno *dstErr)
 Gets the item from the hash table with the matching key, it's not an error if a matching item isn't found. More...
 
int AlcHashItemOrder (AlcHashTable *hTbl, AlcHashItem *item0, AlcHashItem *item1)
 Finds the order in which the given items would occur in the hash table. More...
 

Detailed Description

A general purpose hash table.

Author
Bill Hill
Date
November 1999
Version
Id
9b9cbaa7355b4c173a9b66cd816861bb53d3daca
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.