/***********************************************************************
* *
* 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> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* include style search support
*/
#include <ast.h>
#include <error.h>
#include <ls.h>
{
} Dir_t;
static struct /* directory list state */
{
} state;
/*
* append dir to pathfind() include list
*/
int
{
{
return 0;
return -1;
else
}
return 0;
}
/*
* return path to name using pathinclude() list
* path placed in <buf,size>
* if lib!=0 then pathpath() attempted after include search
* if type!=0 and name has no '.' then file.type also attempted
* any *: prefix in lib is ignored (discipline library dictionary support)
*/
char*
{
register char* s;
type = 0;
/*
* always check the unadorned path first
* this handles . and absolute paths
*/
{
return buf;
}
if (type)
{
return buf;
}
if (*name == '/')
return 0;
/*
* check the directory of the including file
* on the assumption that error_info.file is properly stacked
*/
{
return buf;
if (type)
{
return buf;
}
}
/*
* check the include dir list
*/
{
return buf;
if (type)
{
return buf;
}
}
/*
* finally a lib related search on PATH
*/
if (lib)
{
lib = (const char*)s + 1;
return buf;
if (type)
{
return buf;
}
}
return 0;
}