dirent revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
893N/Aset prototyped
2362N/A
893N/Aset nodefine
893N/Alib stat64 -D_LARGEFILE64_SOURCE
893N/Atyp off64_t -D_LARGEFILE64_SOURCE
893N/Aset define
2362N/A
893N/Alib opendir
2362N/Ahdr dirent,ndir
893N/Asys dir
893N/Anxt dirent
893N/A
893N/Atst botch_d_ino_dirent64 -D_LARGEFILE64_SOURCE note{ dirent64.d_ino vs. readdir64 mismatch }end compile{
893N/A #if !__arm__
893N/A )
893N/A #endif
893N/A #include <dirent.h>
893N/A int
893N/A main()
893N/A {
2362N/A struct dirent64 ent;
2362N/A char aha[5-((int)sizeof(ent.d_ino))];
2362N/A return sizeof(aha);
893N/A }
893N/A}end
893N/A
893N/Aif ( ! _lib_opendir ) {
893N/A /*
893N/A * <dirent.h> for systems with no opendir()
893N/A */
893N/A
893N/A #ifndef _DIRENT_H
893N/A #define _DIRENT_H
893N/A
893N/A typedef struct
893N/A {
893N/A int dd_fd; /* file descriptor */
893N/A #ifdef _DIR_PRIVATE_
893N/A _DIR_PRIVATE_
893N/A #endif
893N/A } DIR;
893N/A
893N/A struct dirent
893N/A {
893N/A long d_fileno; /* entry serial number */
893N/A int d_reclen; /* entry length */
893N/A int d_namlen; /* entry name length */
893N/A char d_name[1]; /* entry name */
893N/A };
893N/A
893N/A #ifndef _DIR_PRIVATE_
893N/A
893N/A #ifdef rewinddir
893N/A #undef rewinddir
893N/A #define rewinddir(p) seekdir(p,0L)
893N/A #endif
893N/A
893N/A extern DIR* opendir(const char*);
893N/A extern void closedir(DIR*);
893N/A extern struct dirent* readdir(DIR*);
893N/A extern void seekdir(DIR*, long);
893N/A extern long telldir(DIR*);
893N/A
893N/A #endif
893N/A
893N/A #endif
893N/A}
893N/Aelif ( _nxt_dirent && _lib_stat64 && _typ_off64_t && _botch_d_ino_dirent64 ) pass{
893N/Acat <<!
893N/A /*
893N/A * <dirent.h> for [fl]stat64 and off64_t with sizeof(ino64_t)==4
893N/A */
893N/A
893N/A #ifndef _AST_STD_H
893N/A
893N/A #include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
893N/A
893N/A #else
893N/A
893N/A #ifndef _DIR64_H
893N/A #define _DIR64_H
893N/A
893N/A #include <ast_std.h>
893N/A
893N/A #if _typ_off64_t
893N/A #undef off_t
893N/A #endif
893N/A
893N/A #undef __ino64_t
893N/A #define __ino64_t int64_t
893N/A
893N/A #include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
893N/A
893N/A #undef __ino64_t
893N/A #define __ino64_t __ino64_t
893N/A
893N/A #if _typ_off64_t
893N/A #define off_t off64_t
893N/A #endif
893N/A
893N/A #if _lib_readdir64 && _typ_struct_dirent64
893N/A #ifndef dirent
893N/A #define dirent dirent64
893N/A #endif
893N/A #ifndef readdir
893N/A #define readdir readdir64
893N/A #endif
893N/A #endif
893N/A
893N/A #endif
893N/A
893N/A #endif
893N/A!
893N/A}end
893N/Aelif ( _nxt_dirent && _lib_stat64 && _typ_off64_t ) pass{
893N/Acat <<!
893N/A /*
893N/A * <dirent.h> for [fl]stat64 and off64_t
893N/A */
893N/A
893N/A #ifndef _AST_STD_H
893N/A
893N/A #include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
893N/A
893N/A #else
893N/A
893N/A #ifndef _DIR64_H
893N/A #define _DIR64_H
893N/A
893N/A #include <ast_std.h>
893N/A
893N/A #if _typ_off64_t
893N/A #undef off_t
893N/A #endif
893N/A
893N/A #include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
893N/A
893N/A #if _typ_off64_t
893N/A #define off_t off64_t
893N/A #endif
893N/A
893N/A #if _lib_readdir64 && _typ_struct_dirent64
893N/A #ifndef dirent
893N/A #define dirent dirent64
893N/A #endif
893N/A #ifndef readdir
893N/A #define readdir readdir64
893N/A #endif
893N/A #endif
893N/A
893N/A #endif
893N/A
893N/A #endif
893N/A!
893N/A}end
893N/Aelif ( _nxt_dirent && _hdr_dirent ) pass{
893N/Acat <<!
893N/A /*
893N/A * <dirent.h> for systems with ok <dirent.h>
893N/A */
893N/A
893N/A #ifndef _DIRENT_H
893N/A
893N/A #include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
893N/A
893N/A #ifndef _DIRENT_H
893N/A #define _DIRENT_H
893N/A #endif
893N/A
893N/A #endif
893N/A!
893N/A}end
893N/Aelif ( _hdr_ndir ) {
893N/A /*
893N/A * <dirent.h> for systems with opendir() and <ndir.h>
893N/A */
#ifndef _DIRENT_H
#define _DIRENT_H
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide closedir opendir readdir seekdir telldir
#else
#define closedir ______closedir
#define opendir ______opendir
#define readdir ______readdir
#define seekdir ______seekdir
#define telldir ______telldir
#endif
#include <ndir.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide closedir opendir readdir seekdir telldir
#else
#undef closedir
#undef opendir
#undef readdir
#undef seekdir
#undef telldir
#endif
#ifndef dirent
#define dirent direct
#endif
#if !defined(d_fileno) && !defined(d_ino)
#define d_fileno d_ino
#endif
#ifdef rewinddir
#undef rewinddir
#define rewinddir(p) seekdir(p,0L)
#endif
extern DIR* opendir(const char*);
extern void closedir(DIR*);
extern struct dirent* readdir(DIR*);
extern void seekdir(DIR*, long);
extern long telldir(DIR*);
#endif
}
elif ( _sys_dir ) {
/*
* <dirent.h> for systems with opendir() and no <ndir.h>
*/
#ifndef _DIRENT_H
#define _DIRENT_H
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide closedir opendir readdir seekdir telldir
#else
#define closedir ______closedir
#define opendir ______opendir
#define readdir ______readdir
#define seekdir ______seekdir
#define telldir ______telldir
#endif
#include <sys/dir.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide closedir opendir readdir seekdir telldir
#else
#undef closedir
#undef opendir
#undef readdir
#undef seekdir
#undef telldir
#endif
#ifndef dirent
#define dirent direct
#endif
#if !defined(d_fileno) && !defined(d_ino)
#define d_fileno d_ino
#endif
#ifdef rewinddir
#undef rewinddir
#define rewinddir(p) seekdir(p,0L)
#endif
extern DIR* opendir(const char*);
extern void closedir(DIR*);
extern struct dirent* readdir(DIR*);
extern void seekdir(DIR*, long);
extern long telldir(DIR*);
#endif
}
endif