|
ReactOS 0.4.16-dev-2546-g56481e1
|
#include <stdbool.h>

Go to the source code of this file.
Typedefs | |
| typedef struct _TIFFHashSet | TIFFHashSet |
| typedef unsigned long(* | TIFFHashSetHashFunc) (const void *elt) |
| typedef bool(* | TIFFHashSetEqualFunc) (const void *elt1, const void *elt2) |
| typedef void(* | TIFFHashSetFreeEltFunc) (void *elt) |
Functions | |
| TIFFHashSet * | TIFFHashSetNew (TIFFHashSetHashFunc fnHashFunc, TIFFHashSetEqualFunc fnEqualFunc, TIFFHashSetFreeEltFunc fnFreeEltFunc) |
| void | TIFFHashSetDestroy (TIFFHashSet *set) |
| int | TIFFHashSetSize (const TIFFHashSet *set) |
| bool | TIFFHashSetInsert (TIFFHashSet *set, void *elt) |
| void * | TIFFHashSetLookup (TIFFHashSet *set, const void *elt) |
| bool | TIFFHashSetRemove (TIFFHashSet *set, const void *elt) |
Hash set implementation.
An hash set is a data structure that holds elements that are unique according to a comparison function. Operations on the hash set, such as insertion, removal or lookup, are supposed to be fast if an efficient "hash" function is provided.
Definition in file tif_hash_set.h.
| typedef struct _TIFFHashSet TIFFHashSet |
Opaque type for a hash set
Definition at line 55 of file tif_hash_set.h.
TIFFHashSetEqualFunc
Definition at line 61 of file tif_hash_set.h.
TIFFHashSetFreeEltFunc
Definition at line 64 of file tif_hash_set.h.
TIFFHashSetHashFunc
Definition at line 58 of file tif_hash_set.h.
| void TIFFHashSetDestroy | ( | TIFFHashSet * | set | ) |
Destroys an allocated hash set.
This function also frees the elements if a free function was provided at the creation of the hash set.
| set | the hash set |
Definition at line 285 of file tif_hash_set.c.
Referenced by _TIFFCleanupIFDOffsetAndNumberMaps().
| bool TIFFHashSetInsert | ( | TIFFHashSet * | set, |
| void * | elt | ||
| ) |
Inserts an element into a hash set.
If the element was already inserted in the hash set, the previous element is replaced by the new element. If a free function was provided, it is used to free the previously inserted element
| set | the hash set |
| elt | the new element to insert in the hash set |
Definition at line 440 of file tif_hash_set.c.
Referenced by _TIFFCheckDirNumberAndOffset().
| void * TIFFHashSetLookup | ( | TIFFHashSet * | set, |
| const void * | elt | ||
| ) |
Returns the element found in the hash set corresponding to the element to look up The element must not be modified.
| set | the hash set |
| elt | the element to look up in the hash set |
Definition at line 502 of file tif_hash_set.c.
Referenced by _TIFFCheckDirNumberAndOffset(), _TIFFGetDirNumberFromOffset(), _TIFFGetOffsetFromDirNumber(), and _TIFFRemoveEntryFromDirectoryListByOffset().
| TIFFHashSet * TIFFHashSetNew | ( | TIFFHashSetHashFunc | fnHashFunc, |
| TIFFHashSetEqualFunc | fnEqualFunc, | ||
| TIFFHashSetFreeEltFunc | fnFreeEltFunc | ||
| ) |
Creates a new hash set
The hash function must return a hash value for the elements to insert. If fnHashFunc is NULL, TIFFHashSetHashPointer will be used.
The equal function must return if two elements are equal. If fnEqualFunc is NULL, TIFFHashSetEqualPointer will be used.
The free function is used to free elements inserted in the hash set, when the hash set is destroyed, when elements are removed or replaced. If fnFreeEltFunc is NULL, elements inserted into the hash set will not be freed.
| fnHashFunc | hash function. May be NULL. |
| fnEqualFunc | equal function. May be NULL. |
| fnFreeEltFunc | element free function. May be NULL. |
Definition at line 138 of file tif_hash_set.c.
Referenced by _TIFFCheckDirNumberAndOffset().
| bool TIFFHashSetRemove | ( | TIFFHashSet * | set, |
| const void * | elt | ||
| ) |
Removes an element from a hash set
| set | the hash set |
| elt | the new element to remove from the hash set |
Definition at line 577 of file tif_hash_set.c.
Referenced by _TIFFCheckDirNumberAndOffset(), and _TIFFRemoveEntryFromDirectoryListByOffset().
| int TIFFHashSetSize | ( | const TIFFHashSet * | set | ) |
Returns the number of elements inserted in the hash set
Note: this is not the internal size of the hash set
| set | the hash set |
Definition at line 180 of file tif_hash_set.c.
Referenced by _TIFFCheckDirNumberAndOffset().