/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1989-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> *
* Eduardo Krell <ekrell@adexus.cl> *
* *
***********************************************************************/
#pragma prototyped
/*
* 3d directory(3)
*
* NOTE: there are 3 limitations to this implementation
*
* (1) opendir() allocates one file descriptor for each directory
* view and these remain open until closedir()
*
* (2) telldir() offsets are encoded with the directory view level
* and TELLDIR() offset, and the directory view level takes
* TABBITS bits, so TELLDIR() offsets are limited to (32-TABBITS)
* bits, but that would be one big physical directory
*
* (3) if dirent.d_type supported then directory stat.st_nlink is
* inflated to foil viewpath subdirectory counting that would
* skip lower view subdirs not reflected in the top level st_nlink
*/
#include <ast_std.h>
#include "dir_3d.h"
#if !_dir_ok
#endif
static int intercepted;
DIR*
{
register char* path;
register int n;
int oerrno;
long visits = 0;
return 0;
intercepted++;
else
{
intercepted = 0;
return 0;
}
{
}
else
{
path[n] = '/';
path[n] = 0;
{
{
}
}
{
intercepted = 0;
return 0;
}
}
intercepted = 0;
return dirp;
}
int
{
if (dirp)
{
if (intercepted++)
{
intercepted--;
}
else
intercepted--;
}
return 0;
}
struct dirent*
{
if (intercepted++)
{
intercepted--;
}
for (;;)
{
{
{
intercepted--;
return 0;
}
}
#ifdef D_FILENO
{
/*
* skip opaque and hidden entries
*/
if (*s++ == '.' && *s++ == '.' && *s++ == '.')
{
/*
* the following for old opaque
*/
continue;
}
}
#endif
/*
* NOTE: this (slimey) method assumes READDIR() returns . first
*/
{
continue;
}
#ifdef D_FILENO
continue;
#endif
intercepted--;
}
/*NOTREACHED*/
}
void
{
register int n;
int lev;
if (intercepted++)
{
intercepted--;
return;
}
if (pos)
{
break;
}
else
{
n = 0;
}
{
}
intercepted--;
}
long
{
if (intercepted++)
{
intercepted--;
}
}
void
{
}
#if !_nosys_readdir64
struct dirent64*
{
if (intercepted++)
{
intercepted--;
}
for (;;)
{
{
{
intercepted--;
return 0;
}
}
#ifdef D_FILENO
{
/*
* skip opaque and hidden entries
*/
if (*s++ == '.' && *s++ == '.' && *s++ == '.')
{
/*
* the following for old opaque
*/
continue;
}
}
#endif
/*
* NOTE: this (slimey) method assumes READDIR() returns . first
*/
{
continue;
}
#ifdef D_FILENO
continue;
#endif
intercepted--;
return dp;
}
/*NOTREACHED*/
}
void
{
register int n;
int lev;
if (intercepted++)
{
intercepted--;
return;
}
if (pos)
{
break;
}
else
{
n = 0;
{
}
}
{
}
intercepted--;
}
{
if (intercepted)
}
void
{
}
#endif
#include "dirlib.h"
#if defined(SYS3D_opendir)
#endif
#if defined(SYS3D_readdir)
#endif
#if defined(SYS3D_seekdir)
#endif
#if defined(SYS3D_telldir)
#endif
#if defined(SYS3D_closedir)
#endif
#ifndef DIRBLKSIZ
#ifdef DIRBLK
#else
#ifdef DIRBUF
#else
#endif
#endif
#endif
#include "getdents.c"
#include "opendir.c"
#include "readdir.c"
#include "telldir.c"
#include "seekdir.c"
#if !_nosys_readdir64
#if defined(SYS3D_readdir64)
#endif
#if !_nosys_seekdir64
#if defined(SYS3D_seekdir64)
#endif
#endif
#if !_nosys_telldir64
#if defined(SYS3D_telldir64)
#endif
#endif
#include "readdir.c"
#if !_nosys_telldir64
#include "telldir.c"
#endif
#if !_nosys_seekdir64
#include "seekdir.c"
#endif
#endif
#endif