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