|
ReactOS 0.4.16-dev-2546-g56481e1
|
#include "tif_config.h"#include "tif_hash_set.h"#include <assert.h>#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>
Go to the source code of this file.
Classes | |
| struct | _TIFFList |
| struct | _TIFFHashSet |
Typedefs | |
| typedef struct _TIFFList | TIFFList |
Variables | |
| static const int | anPrimes [] |
List element structure.
Definition at line 40 of file tif_hash_set.c.
|
static |
Definition at line 226 of file tif_hash_set.c.
Referenced by TIFFHashSetDestroy().
| 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().
Equality function for arbitrary pointers
| elt1 | the first arbitrary pointer to compare |
| elt2 | the second arbitrary pointer to compare |
Definition at line 108 of file tif_hash_set.c.
Referenced by TIFFHashSetNew().
|
static |
Definition at line 409 of file tif_hash_set.c.
Referenced by TIFFHashSetInsert(), and TIFFHashSetLookup().
|
static |
Definition at line 190 of file tif_hash_set.c.
Referenced by TIFFHashSetInsert().
Hash function for an arbitrary pointer
| elt | the arbitrary pointer to hash |
Definition at line 90 of file tif_hash_set.c.
Referenced by TIFFHashSetNew().
| 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().
|
static |
Definition at line 366 of file tif_hash_set.c.
Referenced by TIFFHashSetInsert(), and TIFFHashSetRemoveInternal().
| 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().
|
static |
Definition at line 516 of file tif_hash_set.c.
Referenced by TIFFHashSetRemove().
|
static |
Definition at line 208 of file tif_hash_set.c.
Referenced by TIFFHashSetClearInternal(), and TIFFHashSetRemoveInternal().
| 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().
Destroy a list. Caller responsible for freeing data objects contained in list elements.
| psList | pointer to list head. |
Definition at line 260 of file tif_hash_set.c.
Referenced by TIFFHashSetDestroy().
Definition at line 72 of file tif_hash_set.c.
Referenced by TIFFHashSetRehash().