![]() |
CMR
1.3.0
|
Go to the source code of this file.
Macros | |
| #define | RANGE_SIGNED_HASH (LLONG_MAX/2) |
Typedefs | |
| typedef struct _CMR_LINEARHASHTABLE_ARRAY | CMR_LINEARHASHTABLE_ARRAY |
| typedef size_t | CMR_LINEARHASHTABLE_BUCKET |
| typedef size_t | CMR_LINEARHASHTABLE_HASH |
| typedef struct _CMR_LISTHASHTABLE | CMR_LISTHASHTABLE |
| typedef size_t | CMR_LISTHASHTABLE_VALUE |
| typedef size_t | CMR_LISTHASHTABLE_HASH |
| typedef size_t | CMR_LISTHASHTABLE_BUCKET |
| typedef size_t | CMR_LISTHASHTABLE_ENTRY |
| #define RANGE_SIGNED_HASH (LLONG_MAX/2) |
| typedef struct _CMR_LINEARHASHTABLE_ARRAY CMR_LINEARHASHTABLE_ARRAY |
| typedef size_t CMR_LINEARHASHTABLE_BUCKET |
| typedef size_t CMR_LINEARHASHTABLE_HASH |
| typedef struct _CMR_LISTHASHTABLE CMR_LISTHASHTABLE |
| typedef size_t CMR_LISTHASHTABLE_BUCKET |
| typedef size_t CMR_LISTHASHTABLE_ENTRY |
| typedef size_t CMR_LISTHASHTABLE_HASH |
| typedef size_t CMR_LISTHASHTABLE_VALUE |
| CMR_ERROR CMRlinearhashtableArrayCreate | ( | CMR * | cmr, |
| CMR_LINEARHASHTABLE_ARRAY ** | phashtable, | ||
| size_t | initialSize, | ||
| size_t | initialKeyMemory | ||
| ) |
| cmr | CMR environment. |
| phashtable | Pointer for storing the hash table. |
| initialSize | Initial size of hash table. |
| initialKeyMemory | Initial memory for keys. |
| bool CMRlinearhashtableArrayFind | ( | CMR_LINEARHASHTABLE_ARRAY * | hashtable, |
| const void * | keyArray, | ||
| size_t | keyLength, | ||
| CMR_LINEARHASHTABLE_BUCKET * | pbucket, | ||
| CMR_LINEARHASHTABLE_HASH * | phash | ||
| ) |
| hashtable | Hash table. |
| keyArray | First byte of key array. |
| keyLength | Length of key array in bytes. |
| pbucket | Pointer for storing the bucket. |
| phash | Pointer for storing the hash. |
| CMR_ERROR CMRlinearhashtableArrayFree | ( | CMR * | cmr, |
| CMR_LINEARHASHTABLE_ARRAY ** | phashtable | ||
| ) |
| cmr | CMR environment. |
| phashtable | Pointer to the hash table. |
| CMR_ERROR CMRlinearhashtableArrayInsert | ( | CMR * | cmr, |
| CMR_LINEARHASHTABLE_ARRAY * | hashtable, | ||
| const void * | keyArray, | ||
| size_t | keyLength, | ||
| const void * | value | ||
| ) |
| cmr | CMR environment. |
| hashtable | Hash table. |
| keyArray | First byte of key array. |
| keyLength | Length of key array. |
| value | Value to be set. |
| CMR_ERROR CMRlinearhashtableArrayInsertBucketHash | ( | CMR * | cmr, |
| CMR_LINEARHASHTABLE_ARRAY * | hashtable, | ||
| const void * | keyArray, | ||
| size_t | keyLength, | ||
| CMR_LINEARHASHTABLE_BUCKET | bucket, | ||
| CMR_LINEARHASHTABLE_HASH | hash, | ||
| const void * | value | ||
| ) |
| cmr | CMR environment. |
| hashtable | Hash table. |
| keyArray | First byte of key array. |
| keyLength | Length of key array. |
| bucket | Known bucket of key, determined by CMRlinearhashtableArrayFind. |
| hash | Known hash of key, determined by CMRlinearhashtableArrayFind. |
| value | Value to be set. |
| const void * CMRlinearhashtableArrayKey | ( | CMR_LINEARHASHTABLE_ARRAY * | hashtable, |
| CMR_LINEARHASHTABLE_BUCKET | bucket, | ||
| size_t * | pKeyLength | ||
| ) |
| hashtable | Hash table. |
| bucket | Bucket. |
| pKeyLength | Length of key array. |
| const void * CMRlinearhashtableArrayValue | ( | CMR_LINEARHASHTABLE_ARRAY * | hashtable, |
| CMR_LINEARHASHTABLE_BUCKET | bucket | ||
| ) |
| hashtable | Hash table. |
| bucket | Bucket. |
| CMR_ERROR CMRlisthashtableCreate | ( | CMR * | cmr, |
| CMR_LISTHASHTABLE ** | phashtable, | ||
| size_t | initialNumBuckets, | ||
| size_t | initialMemNodes | ||
| ) |
| cmr | CMR environment. |
| phashtable | Pointer for storing the hash table. |
| initialNumBuckets | Initial size of hash table. |
| initialMemNodes | Initial memory for actual entries.. |
| CMR_LISTHASHTABLE_ENTRY CMRlisthashtableFindFirst | ( | CMR_LISTHASHTABLE * | hashtable, |
| CMR_LISTHASHTABLE_HASH | hash | ||
| ) |
| hashtable | Hash table. |
| hash | Hash value. |
| CMR_LISTHASHTABLE_ENTRY CMRlisthashtableFindNext | ( | CMR_LISTHASHTABLE * | hashtable, |
| CMR_LISTHASHTABLE_HASH | hash, | ||
| CMR_LISTHASHTABLE_ENTRY | entry | ||
| ) |
| hashtable | Hash table. |
| hash | Hash value. |
| entry | Current entry. |
| CMR_ERROR CMRlisthashtableFree | ( | CMR * | cmr, |
| CMR_LISTHASHTABLE ** | phashtable | ||
| ) |
| cmr | CMR environment. |
| phashtable | Pointer to the hash table. |
| CMR_LISTHASHTABLE_HASH CMRlisthashtableHash | ( | CMR_LISTHASHTABLE * | hashtable, |
| CMR_LISTHASHTABLE_ENTRY | entry | ||
| ) |
| hashtable | Hash table. |
| entry | Entry. |
| CMR_ERROR CMRlisthashtableInsert | ( | CMR * | cmr, |
| CMR_LISTHASHTABLE * | hashtable, | ||
| CMR_LISTHASHTABLE_HASH | hash, | ||
| CMR_LISTHASHTABLE_VALUE | value, | ||
| CMR_LISTHASHTABLE_ENTRY * | pentry | ||
| ) |
Inserts value with hash into the hash table, even if an entry with the same hash exists.
| cmr | CMR environment. |
| hashtable | Hash table. |
| hash | Hash value. |
| value | Value to be set. |
| pentry | Pointer for storing the new entry. |
| size_t CMRlisthashtableNumBuckets | ( | CMR_LISTHASHTABLE * | hashtable | ) |
| hashtable | Hash table. |
| CMR_ERROR CMRlisthashtableRemove | ( | CMR * | cmr, |
| CMR_LISTHASHTABLE * | hashtable, | ||
| CMR_LISTHASHTABLE_ENTRY | entry | ||
| ) |
| cmr | CMR environment. |
| hashtable | Hash table. |
| entry | Entry to be removed. |
| CMR_LISTHASHTABLE_VALUE CMRlisthashtableValue | ( | CMR_LISTHASHTABLE * | hashtable, |
| CMR_LISTHASHTABLE_ENTRY | entry | ||
| ) |
| hashtable | Hash table. |
| entry | Entry. |
|
inlinestatic |
Returns the smallest power of 2 at least as large as x.
|
inlinestatic |
Projects value into the range [-RANGE_SIGNED_HASH, +RANGE_SIGNED_HASH] via a modulo computation.