2000-03-28 22:04:39 +00:00
|
|
|
/*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
|
|
|
* Copyright (C) 1997-2001, International Business Machines
|
2000-03-28 22:04:39 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-03-28 22:04:39 +00:00
|
|
|
* Date Name Description
|
|
|
|
* 03/22/00 aliu Creation.
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-03-28 22:04:39 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "uhash.h"
|
|
|
|
#include "unicode/unistr.h"
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* PUBLIC UnicodeString support functions for UHashtable
|
|
|
|
********************************************************************/
|
|
|
|
|
|
|
|
U_CAPI int32_t
|
|
|
|
uhash_hashUnicodeString(const void *key) {
|
|
|
|
return (key == NULL) ? 0 : ((UnicodeString*)key)->hashCode();
|
|
|
|
}
|
|
|
|
|
|
|
|
U_CAPI void
|
|
|
|
uhash_deleteUnicodeString(void *obj) {
|
|
|
|
delete (UnicodeString*) obj;
|
|
|
|
}
|
|
|
|
|
2000-05-18 22:08:39 +00:00
|
|
|
U_CAPI UBool
|
2000-03-28 22:04:39 +00:00
|
|
|
uhash_compareUnicodeString(const void *key1, const void *key2) {
|
|
|
|
if (key1 == key2) {
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
if (key1 == NULL || key2 == NULL) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return *((UnicodeString*) key1) == *((UnicodeString*) key2);
|
|
|
|
}
|