home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
uccs
/
root.14
/
udk
/
usr
/
include
/
dirent.h
< prev
next >
Wrap
C/C++ Source or Header
|
1998-08-19
|
3KB
|
151 lines
/*
* Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE
* SANTA CRUZ OPERATION INC.
*
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*/
#ifndef _DIRENT_H
#define _DIRENT_H
#ident "@(#)sgs-head:common/head/dirent.h 1.6.1.10"
/*
* Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved.
* Portions of this document are derived from
* software developed by the University of
* California, Berkeley, and its contributors.
*/
#if !defined(_XOPEN_SOURCE) \
&& !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
#define MAXNAMLEN 512 /* maximum filename length */
#define DIRBUF 2048 /* buffer size for fs-indep. dirs */
#endif
typedef struct
{
#ifdef dd_fd
int __dd_fd; /* file descriptor */
#else
int dd_fd;
#endif
#ifdef dd_loc
int __dd_loc; /* offset in block */
#else
int dd_loc;
#endif
#ifdef dd_size
int __dd_size; /* amount of valid data */
#else
int dd_size;
#endif
#ifdef dd_buf
char *__dd_buf; /* directory block */
#else
char *dd_buf;
#endif
} DIR;
#ifndef _SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef _SYS_DIRENT_H
#include <sys/dirent.h>
#endif
#undef dirent /* it will be remapped below */
#ifdef __cplusplus
extern "C" {
#endif
extern DIR *opendir(const char *);
struct dirent *readdir(DIR *);
extern void rewinddir(DIR *);
extern int closedir(DIR *);
#if defined(_XOPEN_SOURCE) \
|| !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
extern long telldir(DIR *);
extern void seekdir(DIR *, long);
#define rewinddir(p) seekdir(p, 0)
#endif
#if defined(_LARGEFILE64_SOURCE) || defined(_FILE_OFFSET_BITS) \
|| !defined(_XOPEN_SOURCE) && !defined(_POSIX_SOURCE) \
&& !defined(_POSIX_C_SOURCE)
struct dirent32 *readdir32(DIR *);
struct dirent64 *readdir64(DIR *);
extern int _xreaddir_r(DIR *, struct dirent *, struct dirent **);
extern int _xreaddir32_r(DIR *, struct dirent32 *, struct dirent32 **);
extern int _xreaddir64_r(DIR *, struct dirent64 *, struct dirent64 **);
#ifdef _SIMPLE_R
struct dirent *readdir_r(DIR *, struct dirent *);
#elif !defined(_FILE_OFFSET_BITS)
#ifdef _EFTSAFE
#undef readdir_r
#define readdir_r(p,d,r) _xreaddir_r(p,d,r)
#undef readdir32_r
#define readdir32_r(p,d,r) _xreaddir32_r(p,d,r)
#undef readdir64_r
#define readdir64_r(p,d,r) _xreaddir64_r(p,d,r)
#else /*!_EFTSAFE*/
static int
readdir_r(DIR *__1, struct dirent *__2, struct dirent **__3)
{
return _xreaddir_r(__1, __2, __3);
}
#endif /*_EFTSAFE*/
#endif /*_SIMPLE_R*/
#endif /*defined(_LARGEFILE64_SOURCE) || ...*/
#ifdef __cplusplus
}
#endif
#if _FILE_OFFSET_BITS - 0 == 32
#undef dirent
#define dirent dirent32
#undef readdir
#define readdir readdir32
#ifndef _SIMPLE_R
#undef readdir_r
#define readdir_r _xreaddir32_r
#endif
#elif _FILE_OFFSET_BITS - 0 == 64
#undef dirent
#define dirent dirent64
#undef readdir
#define readdir readdir64
#ifndef _SIMPLE_R
#undef readdir_r
#define readdir_r _xreaddir64_r
#endif
#elif defined(_FILE_OFFSET_BITS)
#error "_FILE_OFFSET_BITS, if defined, must be 32 or 64"
#endif /*_FILE_OFFSET_BITS*/
#endif /*_DIRENT_H*/