const char *message);
unsigned long (*HashKey) (const char *key);
unsigned long (*ReHashKey) (const char *key, int Level);
+ int (*CmpKey) (const char *s1, const char *s2);
};
/* XXX make a portable version of this. This depends on the pointer being
if (nocase) {
hamt->HashKey = HashKey_nocase;
hamt->ReHashKey = ReHashKey_nocase;
+ hamt->CmpKey = strcasecmp;
} else {
hamt->HashKey = HashKey;
hamt->ReHashKey = ReHashKey;
+ hamt->CmpKey = strcmp;
}
return hamt;
for (;;) {
if (!(IsSubTrie(node))) {
if (node->BitMapKey == key
- && strcmp(((HAMTEntry *)(node->BaseValue))->str, str) == 0) {
+ && hamt->CmpKey(((HAMTEntry *)(node->BaseValue))->str,
+ str) == 0) {
/*@-branchstate@*/
if (*replace) {
deletefunc(((HAMTEntry *)(node->BaseValue))->data);
for (;;) {
if (!(IsSubTrie(node))) {
- if (node->BitMapKey == key)
+ if (node->BitMapKey == key
+ && hamt->CmpKey(((HAMTEntry *)(node->BaseValue))->str,
+ str) == 0)
return ((HAMTEntry *)(node->BaseValue))->data;
else
return NULL;