/***********************************************************************
* *
* 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
*
* return 1 if path exisis
* maintains a cache to minimize stat(2) calls
* path is modified in-place but restored on return
* path components checked in pairs to cut stat()'s
* in half by checking ENOTDIR vs. ENOENT
* case ignorance infection unavoidable here
*/
#include "lclib.h"
#include <ls.h>
#include <error.h>
typedef struct Tree_s
{
int mode;
} Tree_t;
int
{
register char* s;
register char* e;
register Tree_t* p;
register Tree_t* t;
register int c;
char* ee;
int cc;
int x;
int (*cmp)(const char*, const char*);
t = &tree;
while (c)
{
p = t;
for (s = e; *e && *e != '/'; e++);
c = *e;
*e = 0;
if (!t)
{
{
*e = c;
return 0;
}
p->tree = t;
if (c)
{
*e = c;
*ee = 0;
}
else
ee = 0;
if (ee)
{
e = ee;
c = cc;
{
*e = c;
return 0;
}
t->tree = p;
t = p;
}
if (x)
{
*e = c;
return 0;
}
t->mode |= PATH_WRITE;
t->mode |= PATH_EXECUTE;
t->mode |= PATH_REGULAR;
}
*e++ = c;
return 0;
}
}