2
This software may only be used by you under license from AT&T Corp.
3
("AT&T"). A copy of AT&T's Source Code Agreement is available at
4
AT&T's Internet website having the URL:
5
<http://www.research.att.com/sw/tools/graphviz/license/source.html>
6
If you received this software without first entering into a license
7
with AT&T, you have an infringing copy of this software and cannot use
8
it without violating AT&T's intellectual property rights.
16
/* Renew the object at the current finger.
18
** Written by Kiem-Phong Vo (5/25/96)
22
Void_t* dtrenew(Dt_t* dt, reg Void_t* obj)
24
Void_t* dtrenew(dt, obj)
30
reg Dtlink_t *e, *t, **s;
31
reg Dtdisc_t* disc = dt->disc;
35
if(!(e = dt->data->here) || OBJ(e,disc->link) != obj)
38
if(dt->data->type&(DT_STACK|DT_QUEUE|DT_LIST))
40
else if(dt->data->type&(DT_OSET|DT_OBAG) )
41
{ if(!e->right ) /* make left child the new root */
42
dt->data->here = e->left;
43
else /* make right child the new root */
44
{ dt->data->here = e->right;
46
/* merge left subtree to right subtree */
48
{ for(t = e->right; t->left; t = t->left)
54
else /*if(dt->data->type&(DT_SET|DT_BAG))*/
55
{ s = dt->data->htab + HINDEX(dt->data->ntab,e->hash);
59
{ for(; t->right != e; t = t->right)
63
key = KEY(obj,disc->key,disc->size);
64
e->hash = HASH(dt,key,disc,disc->size);
65
dt->data->here = NIL(Dtlink_t*);
69
return (*dt->meth->searchf)(dt,(Void_t*)e,DT_RENEW) ? obj : NIL(Void_t*);