#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. ** ***************************************************************************** ** * ** HPE CONFIDENTIAL. This software is confidential proprietary software * ** licensed by Hewlett Packard Enterprise Development, LP, and is not * ** authorized to be used, duplicated or disclosed to anyone without the * ** prior written permission of HPE. * ** Copyright 2019 Hewlett Packard Enterprise Development, LP * ** * ** VMS SOFTWARE, INC. CONFIDENTIAL. This software is confidential * ** proprietary software licensed by VMS Software, Inc., and is not * ** authorized to be used, duplicated or disclosed to anyone without * ** the prior written permission of VMS Software, Inc. * ** Copyright 2019-2023 VMS Software, Inc. * ** * ***************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** Save the users pointer context */ #if __INITIAL_POINTER_SIZE || defined(__clang__) # pragma __required_pointer_size __save # pragma __required_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 #if !defined(_USE_STD_STAT) /* 3 word array */ __ino_t d_ino[3]; /* file serial number (vms-style inode) */ #else /* quadword */ __ino_t d_ino; #endif # 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 || defined(__clang__) # pragma __required_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 __required_pointer_size 32 # endif int readdir_r(DIR * __dirp, struct dirent *__entry, struct dirent **__result); # if __INITIAL_POINTER_SIZE || defined(__clang__) # pragma __required_pointer_size 32 int _readdir_r32(DIR * __dirp, struct dirent *__entry, struct dirent **__result); # pragma __required_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 || defined(__clang__) # pragma __required_pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __DIRENT_LOADED */