#ifndef __DIRENT_LOADED #define __DIRENT_LOADED /**************************************************************************** ** ** - Directory manipulation functions ** ***************************************************************************** ** ** Header introduced by the ISO POSIX-1 Standard ** ** Definitions in this header file may not be available on all versions of ** OpenVMS. See the DEC C Runtime Library reference manual for specifics. ** ***************************************************************************** ** ** Copyright 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** If the user has used /pointer_size=short or /pointer_size=long, we will ** begin in a 32-bit pointer size context. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** The type ino_t is an _XOPEN_SOURCE extension. */ #if defined _XOPEN_SOURCE || !defined _POSIX_C_SOURCE # ifndef __INO_T # define __INO_T typedef __ino_t ino_t; # endif #endif /* ** The definition of the dirent structure has extensions when being compiled ** using _XOPEN_SOURCE. */ #pragma __member_alignment __save #pragma __member_alignment struct dirent { char d_name[256]; /* name of entry */ # if defined _XOPEN_SOURCE || !defined _POSIX_C_SOURCE __ino_t d_ino[3]; /* file serial number (vms-style inode) */ # endif }; #pragma __member_alignment __restore /* ** Data structure returned by opendir() function. A pointer to one of ** these is returned by opendir() and is used by the the other routines. ** The contents of this structure do not have to be visible to users. */ typedef struct _dirdesc DIR; /* ** Define a private typedef used to indicate a short pointer to a DIR ** structure which is always returned by the CRTL. */ typedef DIR * __DIR_ptr32; typedef struct dirent * __struct_dirent_ptr32; /* ** The only pointer permitted to be a 64 bit pointer is the name of the ** directory being opened. All structure pointers are pointers to DEC ** C RTL allocated memory. We will define a 64 bit character pointer to ** be used in the function prototypes. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 #endif /* ** If on OpenVMS V7.0 or higher, provide function prototypes ** (dirent functions have been added in version V7.0 of VMS) */ #if __CRTL_VER >= 70000000 __DIR_ptr32 opendir (const char *dirname); __struct_dirent_ptr32 readdir (DIR * dirp); void rewinddir (DIR *dirp); int closedir (DIR *dirp); /* ** X/Open extensions */ #if defined _XOPEN_SOURCE || !defined _POSIX_C_SOURCE void seekdir (DIR *dirp, long int loc); long int telldir (DIR *dirp); #endif #endif /* if __CRTL_VER >= 70000000 */ #if __CRTL_VER > 70300000 # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 # endif int readdir_r(DIR * __dirp, struct dirent *__entry, struct dirent **__result); # if __INITIAL_POINTER_SIZE # pragma __pointer_size 32 int _readdir_r32(DIR * __dirp, struct dirent *__entry, struct dirent **__result); # pragma __pointer_size 64 int _readdir_r64(DIR * __dirp, struct dirent *__entry, struct dirent **__result); # endif #endif /* if __CRTL_VER > 70300000 */ /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __DIRENT_LOADED */