dtview.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#include "dthdr.h"
/* Set a view path from dict to view.
**
** Written by Kiem-Phong Vo (5/25/96)
*/
/* these operations must be done without viewpathing */
#if __STD_C
#else
#endif
{
int cmp;
Dt_t *d, *p;
if(type&DT_NOVIEWPATH)
/* these ops look for the first appearance of an object of the right type */
break;
return o;
}
continue;
if(n) /* get the right one among all dictionaries */
goto b_est;
}
else
{ b_est: /* current best element to fit op requirement */
p = d;
n = o;
}
}
return n;
}
/* unordered collections */
break;
if(!(obj = o) )
}
{ while(obj) /* keep moving until finding an uncovered object */
{ if(p == d) /* adjacent object is uncovered */
return obj;
break;
}
}
}
}
#if __STD_C
#else
#endif
{
/* make sure there won't be a cycle */
if(d == dt)
/* no more viewing lower dictionary */
d->nview -= 1;
if(!view)
return d;
}
/* ok */
return view;
}