static const void* HT_GetKey (void* Entry);
/* Given a pointer to the user entry data, return a pointer to the key. */
-static HashNode* HT_GetHashNode (void* Entry);
-/* Given a pointer to the user entry data, return a pointer to the hash node */
-
static int HT_Compare (const void* Key1, const void* Key2);
/* Compare two keys. The function must return a value less than zero if
* Key1 is smaller than Key2, zero if both are equal, and a value greater
static const HashFunctions HashFunc = {
HT_GenHash,
HT_GetKey,
- HT_GetHashNode,
HT_Compare
};
-static HashNode* HT_GetHashNode (void* Entry)
-/* Given a pointer to the user entry data, return a pointer to the hash node */
-{
- return &((FileEntry*) Entry)->Node;
-}
-
-
-
static int HT_Compare (const void* Key1, const void* Key2)
/* Compare two keys. The function must return a value less than zero if
* Key1 is smaller than Key2, zero if both are equal, and a value greater
FileEntry* F = xmalloc (sizeof (FileEntry));
/* Initialize the fields */
- InitHashNode (&F->Node, F);
+ InitHashNode (&F->Node);
F->Name = Name;
F->Index = CollCount (&FileTab) + 1; /* First file has index #1 */
F->Type = Type;
/* common */
#include "check.h"
-#include "hashstr.h"
+#include "hashfunc.h"
#include "hashtab.h"
#include "xmalloc.h"
static const void* HT_GetKey (void* Entry);
/* Given a pointer to the user entry data, return a pointer to the key */
-static HashNode* HT_GetHashNode (void* Entry);
-/* Given a pointer to the user entry data, return a pointer to the hash node */
-
static int HT_Compare (const void* Key1, const void* Key2);
/* Compare two keys. The function must return a value less than zero if
* Key1 is smaller than Key2, zero if both are equal, and a value greater
static const HashFunctions HashFunc = {
HT_GenHash,
HT_GetKey,
- HT_GetHashNode,
HT_Compare
};
-static HashNode* HT_GetHashNode (void* Entry)
-/* Given a pointer to the user entry data, return a pointer to the hash node */
-{
- return &((Macro*) Entry)->Node;
-}
-
-
-
static int HT_Compare (const void* Key1, const void* Key2)
/* Compare two keys. The function must return a value less than zero if
* Key1 is smaller than Key2, zero if both are equal, and a value greater
Macro* M = xmalloc (sizeof (Macro));
/* Initialize the macro struct */
- InitHashNode (&M->Node, M);
+ InitHashNode (&M->Node);
M->LocalCount = 0;
M->Locals = 0;
M->ParamCount = 0;