Example #1
0
void HashSet_insert (T set, Poly_t x)
{
  if (Hash_lookup (set->hash, x))
    return;

  Hash_insert (set->hash, x, (Poly_t)1);
  return;
}
static retcode_t hash_find(Iterator_t It, tb_Key_t key) {
	hashIter_t hi = (hashIter_t)__getIterCtx(It);
	tb_hash_node_t node;
	int i;
	if(hi == NULL) return TB_ERR;
  if((node = Hash_lookup(hi->H, key, &i))) {
		if(node) {
			hi->cur_node = (node);
			hi->cur_ndx = 0;
			hi->dup_ndx = 0;
			return TB_OK;
		} else {
			hi->cur_node = NULL;
		}
	}
	return TB_ERR;
}
Example #3
0
int HashSet_exists (T set, Poly_t x)
{
  Assert_ASSERT(set);
  
  return (int)Hash_lookup (set->hash, x);
}