New function and bug fix

git-svn-id: svn://svn.cc65.org/cc65/trunk@2609 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-11-04 18:59:12 +00:00
parent 37393c645e
commit b34d2df08b
3 changed files with 40 additions and 13 deletions

View File

@@ -109,10 +109,20 @@ INLINE void InitHashNode (HashNode* N, void* Entry)
N->Entry = Entry;
}
#else
#define InitHashNode(N, Entry) \
(N)->Next = 0; \
(N)->Owner = 0; \
(N)->Entry = (Entry)
#define InitHashNode(N, E) \
(N)->Next = 0, \
(N)->Owner = 0, \
(N)->Entry = (E)
#endif
#if defined(HAVE_INLINE)
INLINE void* HN_GetEntry (HashNode* N)
/* Get the entry from a hash node */
{
return N->Entry;
}
#else
#define HN_GetEntry(N) (N)->Entry
#endif
@@ -175,6 +185,11 @@ void FreeHashTable (HashTable* T);
HashNode* HT_Find (const HashTable* T, const void* Key);
/* Find the node with the given key*/
HashNode* HT_FindHash (const HashTable* T, const void* Key, unsigned Hash);
/* Find the node with the given key. Differs from HT_Find in that the hash
* for the key is precalculated and passed to the function.
*/
void* HT_FindEntry (const HashTable* T, const void* Key);
/* Find the node with the given key and return the corresponding entry */