/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2010 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* 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
*
* ftwalk on top of fts
*/
#include <ast.h>
#include <ftwalk.h>
static struct
{
} state;
/*
* why does fts take FTSENT** instead of FTSENT*
*/
static int
{
}
/*
* the real thing -- well it used to be
*/
int
{
register FTS* f;
register FTSENT* e;
register int children;
register int rv;
int oi;
int ns;
int os;
int nd;
FTSENT* x;
flags ^= FTS_ONEPATH;
flags |= FTS_NOPREORDER;
else
flags |= FTS_NOPOSTORDER;
flags |= FTS_SEEDOT;
{
return -1;
return -1;
e->parent = e;
free(e);
return rv;
}
rv = 0;
if (children && (e = fts_children(f, 0)))
{
nd = 0;
for (x = e; x; x = x->link)
{
break;
}
while (nd > 0)
for (x = e; x; x = x->link)
}
{
nd = 0;
switch (e->info)
{
case FTS_D:
case FTS_DNX:
if (children)
for (x = fts_children(f, 0); x; x = x->link)
{
break;
}
break;
case FTS_DOT:
continue;
case FTS_ERR:
case FTS_SLNONE:
break;
case FTS_NSOK:
break;
}
while (nd > 0)
}
fts_close(f);
return rv;
}