/* add a new value into th ehash table */ BOOL hb_hashTableAdd( HB_HASH_TABLE_PTR pTable, void * pValue ) { HB_SIZE ulKey; PHB_HASH_ITEM pItem; ulKey = ( pTable->pKeyFunc )( pValue, NULL ); pItem = pTable->pItems[ ulKey ]; if( pItem ) { while( pItem->next ) pItem = pItem->next; pItem->next = hb_hashItemNew( ulKey, pValue ); } else { pTable->pItems[ ulKey ] = hb_hashItemNew( ulKey, pValue ); ++pTable->ulUsed; } ++pTable->ulCount; return TRUE; }
/* add a new value into th ehash table */ HB_BOOL hb_hashTableAdd( HB_HASH_TABLE_PTR pTable, const void * pKey, const void * pValue ) { HB_SIZE nKey; HB_HASH_ITEM_PTR pItem; nKey = ( pTable->pKeyFunc )( pTable, pKey, pValue ); pItem = pTable->pItems[ nKey ]; if( pItem ) { while( pItem->next ) pItem = pItem->next; pItem->next = hb_hashItemNew( nKey, pKey, pValue ); } else { pTable->pItems[ nKey ] = hb_hashItemNew( nKey, pKey, pValue ); ++pTable->nUsed; } ++pTable->nCount; return HB_TRUE; }