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
/* Set a view path from dict to view.
18
** Written by Kiem-Phong Vo (5/25/96)
23
static Void_t* dtvsearch(Dt_t* dt, reg Void_t* obj, reg int type)
25
static Void_t* dtvsearch(dt,obj,type)
36
/* these operations only happen at the top level */
37
if(type&(DT_INSERT|DT_DELETE|DT_CLEAR|DT_RENEW))
38
return (*(dt->meth->searchf))(dt,obj,type);
40
if(!obj && !(type&(DT_FIRST|DT_LAST)) )
43
if(type&(DT_MATCH|DT_SEARCH|DT_FIRST|DT_LAST))
44
{ for(d = dt; d; d = d->view)
45
{ if((o = (*(d->meth->searchf))(d,obj,type)) )
51
dt->walk = NIL(Dt_t*);
55
/* must be (DT_NEXT|DT_PREV) */
56
if(!dt->walk || !(here = dt->walk->data->here) ||
57
obj != OBJ(here,dt->walk->disc->link) )
58
{ for(d = dt; d; d = d->view)
59
{ if((o = (*(d->meth->searchf))(d,obj,DT_SEARCH)) )
65
dt->walk = NIL(Dt_t*);
69
do_adj: for(d = dt->walk, o = (*(d->meth->searchf))(d,obj,type); ; )
72
here = (d->meth->type&(DT_SET|DT_BAG)) ?
73
d->data->here : NIL(Dtlink_t*);
75
for(p = dt; ; p = p->view)
78
if(p == d) /* this object is uncovered */
81
/* see if it is covered */
82
if(here && (p->meth->type&(DT_SET|DT_BAG)) &&
83
(disc == (dc = p->disc) ||
84
(disc->key == dc->key && disc->size == dc->size &&
85
disc->link == dc->link && disc->hashf == dc->hashf)))
86
{ if((*(p->meth->searchf))(p,here,DT_VSEARCH) )
90
{ if((*(p->meth->searchf))(p,o,DT_SEARCH) )
95
o = (*(d->meth->searchf))(d,o,type);
98
if(!(d = dt->walk = d->view) )
102
o = (*(d->meth->searchf))(d,NIL(Void_t*),DT_FIRST);
103
else /* if(type&DT_PREV) */
104
o = (*(d->meth->searchf))(d,NIL(Void_t*),DT_LAST);
109
Dt_t* dtview(reg Dt_t* dt, reg Dt_t* view)
111
Dt_t* dtview(dt,view)
122
/* make sure there won't be a cycle */
123
for(d = view; d; d = d->view)
127
/* no more viewing lower dictionary */
130
dt->view = dt->walk = NIL(Dt_t*);
133
{ dt->searchf = dt->meth->searchf;
139
dt->searchf = dtvsearch;