Hashentry *h = _search(htab, ptr); Hashentry **tabptr;  assert(htab && ptr);  if (h) free((void *) h->ptr); else { h = (Hashentry *) malloc(sizeof(Hashentry)); if (h == NULL) { return NULL; } tabptr = &htab->tab[(*htab->hash) (ptr) % htab->sz]; h->next = *tabptr; *tabptr = h; h->prev = tabptr; if (h->next) h->next->prev = &h->next; } h->ptr = ptr; return h;
return _add (htab, ptr, TRUE);
hashtabadd(Hashtab * htab, void *ptr){    Hashentry *h = _search(htab, ptr);    Hashentry **tabptr;    assert(htab && ptr);    if (h)	free((void *) h->ptr);    else {	h = (Hashentry *) malloc(sizeof(Hashentry));	if (h == NULL) {	    return NULL;	}	tabptr = &htab->tab[(*htab->hash) (ptr) % htab->sz];	h->next = *tabptr;	*tabptr = h;	h->prev = tabptr;	if (h->next)	    h->next->prev = &h->next;    }    h->ptr = ptr;    return h;}