/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1989-2012 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> *
* Eduardo Krell <ekrell@adexus.cl> *
* *
***********************************************************************/
#pragma prototyped
#include "3d.h"
/*
* get next view for path sp
*/
char*
{
register char* cp;
register char* tmp;
register int shift;
int vpathlen;
message((-4, "pathnext: ++ %s%s%s [0x%08x]", sp, extra ? " + " : state.null, extra ? extra : state.null, visits ? *visits : 0L));
/*
* check for next layer and previous visit
*/
{
return 0;
}
if (!(vpath = search(state.path.table ? state.path.table : &state.vpath, sp, shift, (const char*)visits, T_PREFIX)))
{
return 0;
}
/*
* we found a viewpath entry
* check if stuff after extra needs to be shifted
*/
if (shift < 0)
{
/*
* shift left
*/
}
else if (shift > 0)
{
/*
* shift right extra
*/
if (extra)
{
}
/*
* shift right cp
*/
{
}
}
/*
* insert vpath
*/
if (extra)
message((-4, "pathnext: -- %s [level=%d visits=0x%08x]", cp, state.path.level, visits ? *visits : 0L));
return sp;
}
/*
* search for the instance name for path sp
* and place in instname
* 0 returned when instances exhausted
* if create is non-zero, use name before the first slash as instance
* name, and do not check existence.
*/
int
{
register char* cp;
register char* mp;
register char* mapnext;
register int size;
int maps;
char* mapend;
maps = 0;
{
while (*--cp != '/');
}
for (;;)
{
{
/*
* look for next vmap
*/
{
{
while (*--cp != '/');
}
goto match;
}
if (!create)
{
maps++;
goto found;
}
return 0;
if (create)
{
return 0;
maps++;
goto found;
}
}
if (*mapnext == '/')
break;
maps++;
goto found;
}
/*NOTREACHED*/
if (maps > 1)
return 1;
}