#ifndef __TIME_LOADED #define __TIME_LOADED /**************************************************************************** ** ** - Date and Time ** ***************************************************************************** ** ** Header introduced by the ANSI C 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 /* ** Member align structures */ #pragma __member_alignment __save #pragma __member_alignment /* ** Disable messages */ #pragma __message __save #pragma __message __disable (__MISALGNDSTRCT) #pragma __message __disable (__MISALGNDMEM) /* ** Create 'private' typedefs that are sensitive to pointer size and must ** use 32 bit pointers. */ typedef struct tm * __struct_tm_ptr32; /* ** ANSI Standard Definitions & Typedefs */ #define CLOCKS_PER_SEC 100 #ifndef NULL # define NULL __NULL #endif #ifndef __SIZE_T # define __SIZE_T 1 typedef __size_t size_t; #endif #ifndef __TIME_T # define __TIME_T typedef __time_t time_t; #endif #ifndef __CLOCK_T # define __CLOCK_T 1 typedef long int clock_t; #endif struct tm { int tm_sec; /* seconds after the minute [0, 61] */ int tm_min; /* minutes after the hour [0, 59] */ int tm_hour; /* hours since midnight [0, 23] */ int tm_mday; /* day of the month [1, 31] */ int tm_mon; /* months since January [0, 11] */ int tm_year; /* years since 1900 */ int tm_wday; /* days since Sunday [0, 6] */ int tm_yday; /* days since January 1 [0, 365] */ int tm_isdst; /* Daylight Saving Time flag */ #if __CRTL_VER >= 70000000 && !defined _ANSI_C_SOURCE && !defined _DECC_V4_SOURCE long tm_gmtoff; /* offset from UTC in seconds */ char *tm_zone; /* timezone abbreviation */ #endif }; /* ** ISO POSIX-1 Standard Definitions & Typedefs */ #if defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE /* ** Number of clock ticks per second returned by the times () ** function. (To be Withdrawn) */ # define CLK_TCK 100 /* ** tzname is the name of the current timezone, ** it is not visible if compiling for a local ** time based compatibility mode. */ # if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # pragma __extern_model __save # pragma __extern_model __strict_refdef extern char *tzname[2]; # pragma __extern_model __restore # endif # endif #endif /* ** X/Open extension definitions and typedefs, ** these variables are not visible if compiling ** in a local time based compatibility mode. */ #if defined _XOPEN_SOURCE || !defined _ANSI_C_SOURCE # if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # pragma __extern_model __save # pragma __extern_model __strict_refdef extern int daylight; extern long int timezone; # pragma __extern_model __restore # endif # endif #endif /* ** DEC C extension definitions and typedefs */ #ifndef _ANSI_C_SOURCE typedef struct tm tm_t; /* ** struct timeb is defined by XPG4 V2 to be in */ # ifndef __TIMEB_STR_LOADED # define __TIMEB_STR_LOADED 1 struct timeb { __time_t time; unsigned short millitm; short timezone; short dstflag; }; # endif # ifndef __TIMEB_T # define __TIMEB_T typedef struct timeb timeb_t; # endif # if __CRTL_VER >= 70000000 && !defined _DECC_V4_SOURCE # ifndef __TMS # define __TMS struct tms { clock_t tms_utime; /* user CPU time */ clock_t tms_stime; /* system CPU time */ clock_t tms_cutime; /* user CPU of terminated child processes */ clock_t tms_cstime; /* system CPU of terminated child processes */ }; # endif # endif # ifndef __TBUFFER_T # define __TBUFFER_T 1 typedef struct tbuffer { int proc_user_time; int proc_system_time; int child_user_time; int child_system_time; } tbuffer_t; # endif #endif /* ** We are done defining things which must always be 32 bit pointers. If the ** user has used /pointer_size=32 or /pointer_size=64, we will allow 64 bit ** pointers to be used in function calls. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 #endif /* ** Create 'private' typedefs that are sensitive to pointer size and must ** use long pointers. Protect identically in all header files. */ typedef struct tm * __struct_tm_ptr64; /* ** ANSI Function prototypes -- full 64 bit support */ clock_t clock (void); double difftime (__time_t __time1, __time_t __time0); __char_ptr32 asctime (const struct tm *__timeptr); #if defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE __char_ptr32 asctime_r(const struct tm *tm, __char_ptr32 __buf); #endif /* ** Beginning in OpenVMS Version 7.0 mktime, time, ctime, strftime ** have two implementations. One implementation is provided ** for compatibility and deals with time in terms of local time, ** the other __utc_* deals with time in terms of UTC. */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utc_" # else # define mktime(__p1) __utc_mktime(__p1) # define time(__p1) __utc_time(__p1) # define ctime(__p1) __utc_ctime(__p1) # define strftime(__p1,__p2,__p3,__p4) __utc_strftime(__p1,__p2,__p3,__p4) # endif # endif #endif /* __CRTL_VER >= 70000000 */ __time_t mktime (struct tm *__timeptr); __time_t time (__time_t *__timer); __char_ptr32 ctime (const __time_t *__timer); __size_t strftime (char *__s, __size_t __maxsize, const char *__format, const struct tm *__timeptr); /* ** Disable extern_prefix if we enabled it earlier */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif # endif #endif /* ** Beginning in OpenVMS Version 7.2, we have added and implementation ** of the ctime_r function. There are both local time and utc time ** implementations. */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utc_" # else # define ctime_r(__p1,__p2) __utc_ctime_r(__p1,__p2) # endif # endif __char_ptr32 ctime_r (const __time_t *__timer, __char_ptr32 __buf); # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif # endif #endif /* __CRTL_VER >= 70000000 */ /* ** Beginning in OpenVMS Version 7.0 gmtime and localtime have three ** implementations. One implementation is provided for compatibility and deals ** with time in terms of local time. Two implementations __utc* deal with ** time in terms of UTC. __utctz_* implementations provide support for the ** additional tm_gmtoff and tm_zone fields of the tm structure; the _utc_* ** implementations deal with the ANSI definition of the tm structure. */ #if __CRTL_VER >= 70000000 # if !defined _ANSI_C_SOURCE && !defined _DECC_V4_SOURCE && !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utctz_" # else # define gmtime(__p1) __utctz_gmtime(__p1) # define localtime(__p1) __utctz_localtime(__p1) # endif # elif !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utc_" # else # define gmtime(__p1) __utc_gmtime(__p1) # define localtime(__p1) __utc_localtime(__p1) # endif # endif #endif /* __CRTL_VER >= 70000000 */ __struct_tm_ptr32 localtime (const __time_t *__timer); __struct_tm_ptr32 gmtime (const __time_t *__timer); /* ** Disable extern_prefix if we enabled it earlier */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif # endif #endif /* ** Beginning in OpenVMS Version 7.2, we have added gmtime_t and localtime_t ** implementations. The same three interfaces are supported for each as ** described above. */ #if __CRTL_VER >= 70000000 # if !defined _ANSI_C_SOURCE && !defined _DECC_V4_SOURCE && !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utctz_" # else # define gmtime_r(__p1,__p2) __utctz_gmtime_r(__p1,__p2) # define localtime_r(__p1,__p2) __utctz_localtime_r(__p1,__p2) # endif # elif !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utc_" # else # define gmtime_r(__p1,__p2) __utc_gmtime_r(__p1,__p2) # define localtime_r(__p1,__p2) __utc_localtime_r(__p1,__p2) # endif # endif __struct_tm_ptr32 gmtime_r (const __time_t *__timer, __struct_tm_ptr32 __result); __struct_tm_ptr32 localtime_r (const __time_t *__timer, __struct_tm_ptr32 __result); # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif # endif #endif /* ** ISO POSIX-1 Function prototypes -- full 64 bit support */ #if defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE # if __CRTL_VER >= 70000000 && !defined _VMS_V6_SOURCE void tzset (void); # endif # endif /* ** The following functions have interfaces of XXX, _XXX32, and _XXX64 due only ** to the fact that the return argument is a pointer that is relative to one ** of the arguments. */ #if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 #endif #if defined _XOPEN_SOURCE || !defined _ANSI_C_SOURCE # if __CRTL_VER >= 60200000 char *strptime (const char *__buf, __const_char_ptr64 __fmt, __struct_tm_ptr64 __tm); # endif #endif #if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 64 #endif /* ** DEC C Extensions */ #ifndef _ANSI_C_SOURCE /* ** Beginning in OpenVMS Version 7.0 ftime has two implementations. One ** implementation is provided for compatibility and deals with time in terms ** of local time, the other __utc_ftime deals with time in terms of UTC. */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utc_" # else # define ftime(__p1) __utc_ftime(__p1) # endif # endif #endif /* __CRTL_VER >= 70000000 */ int ftime (struct timeb *__timeptr); /* ** Disable extern_prefix if we enabled it earlier */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif # endif #endif # if __CRTL_VER >= 70000000 && !defined _DECC_V4_SOURCE clock_t times(struct tms *buffer); # else void times (tbuffer_t *__buffer); /* */ # endif # if __INITIAL_POINTER_SIZE # pragma __pointer_size 32 char * _strptime32 (const char *, __const_char_ptr64, __struct_tm_ptr64); # pragma __pointer_size 64 char * _strptime64 (const char *, const char *, struct tm *); # endif #endif /**************************************************************************** ** ** - time types ** ** The following is the equivalent of . It is merged into ** since DEC C on OpenVMS systems does not distinguish ** the two header files. */ #if defined _XOPEN_SOURCE_EXTENDED || (!defined _ANSI_C_SOURCE && !defined _DECC_V4_SOURCE) /* ** Values for the which argument of getitimer() and setitimer(). */ # define ITIMER_REAL 0 /* Real time */ # define ITIMER_VIRTUAL 1 /* Per-process time */ # define ITIMER_PROF 2 /* Per-process user time */ # ifndef __TIMEVAL # define __TIMEVAL 1 struct timeval { __time_t tv_sec; /* seconds since Jan. 1, 1970 */ long tv_usec; /* microseconds */ }; # endif struct itimerval { struct timeval it_interval; /* timer interval */ struct timeval it_value; /* current value */ }; /* ** Select () examines I/O descriptor sets which are stored as ** bit fields in arrays of integers. The following macros are ** provided for manipulating such descriptor sets. */ /* FD_SETSIZE may be defined by the user. It is normally ** equal to the maximum number of descriptors supported by ** the system. Here it is set to the minimum maximum supported ** by the system. In order to accomodate programs which use ** a larger number of open files with select, increase this size ** within a program by providing a larger definition of FD_SETSIZE ** before including or */ # if !defined __FD_SET # define __FD_SET 1 # ifndef FD_SETSIZE # define FD_SETSIZE 1024 # endif typedef long fd_mask; # define NBBY 8 /* bits per byte */ # define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ # define FD_SET(__n, __p) ((__p)->fds_bits[(__n)/NFDBITS] |= (1 << ((__n) % NFDBITS))) # define FD_CLR(__n, __p) ((__p)->fds_bits[(__n)/NFDBITS] &= ~(1 << ((__n) % NFDBITS))) # define FD_ISSET(__n, __p) ((__p)->fds_bits[(__n)/NFDBITS] & (1 << ((__n) % NFDBITS))) # define __howmany(__x, __y) (((__x)+((__y)-1))/(__y)) typedef struct fd_set { /* descriptor set */ fd_mask fds_bits[__howmany(FD_SETSIZE, NFDBITS)]; } fd_set; # if defined __ALPHA # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 # endif void *__MEMSET(void *__s, int __c, __size_t __n); # define FD_ZERO(__p) __MEMSET((__p), 0, sizeof(*(__p))) # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 64 # endif # else void _MOVC5(unsigned short __srclen, const char *__src, char __fill, unsigned short __destlen, char *__dest, ...); # define FD_ZERO(__p) _MOVC5(0, 0, 0, sizeof(*(__p)), (char *)(__p)) # endif # endif /* ** We are done defining things which must always be 32 bit pointers. If the ** user has used /pointer_size=32 or /pointer_size=64, we will allow 64 bit ** pointers to be used in function calls. */ # if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 # endif /* ** Note that gettimeofday() is UTC based, so it is not visible if ** compiling in a local time based compatibility mode. */ #if __CRTL_VER >= 70000000 int getitimer (int __which, struct itimerval *__value); int setitimer (int __which, const struct itimerval *__value, struct itimerval *__ovalue); # if !defined _VMS_V6_SOURCE int gettimeofday (struct timeval *__tp, void *__tzp); # endif #endif int select (int __nfds, fd_set *__readfds, fd_set *__writefds, fd_set *__exceptfds, struct timeval *__timeout); #endif #if __CRTL_VER >= 70300000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utc_" # else # define utimes(__p1,__p2) __utc_utimes(__p1,__p2) # endif # endif int utimes(const char *__path, const struct timeval __times[2]); # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif # endif #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __message __restore #pragma __member_alignment __restore #pragma __standard #endif /* __TIME_LOADED */ #ifndef __TIMEB_LOADED #define __TIMEB_LOADED 1 /**************************************************************************** ** ** - ftime() return structure definition ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4, Version 2 ***************************************************************************** ** ** 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 __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** Member align structures */ #pragma __member_alignment __save #pragma __member_alignment /* ** Disable certain messages */ #pragma __message __save #pragma __message __disable (__MISALGNDSTRCT) #pragma __message __disable (__MISALGNDMEM) /* ** Define the time_t structure */ #ifndef __TIME_T # define __TIME_T 1 typedef __time_t time_t; #endif /* ** Define the timeb structure */ #ifndef __TIMEB_STR_LOADED # define __TIMEB_STR_LOADED 1 struct timeb { __time_t time; unsigned short millitm; short timezone; short dstflag; }; #endif /* ** DEC C extensions */ #if !defined _XOPEN_SOURCE_EXTENDED && !defined __TIMEB_T # define __TIMEB_T typedef struct timeb timeb_t; #endif /* ** Function prototypes */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 #endif /* ** Beginning in OpenVMS Version 7.0 ftime has two implementations. One ** implementation is provided for compatibility and deals with time in terms ** of local time, the other __utc_ftime deals with time in terms of UTC. */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utc_" # else # define ftime(__p1) __utc_ftime(__p1) # endif # endif #endif /* __CRTL_VER >= 70000000 */ int ftime (struct timeb *__timeptr); /* ** Disable extern_prefix if we enabled it earlier */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif # endif #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __message __restore #pragma __member_alignment __restore #pragma __standard #endif /* __TIMEB_LOADED */ #ifndef __TIMERS_LOADED #define __TIMERS_LOADED 1 /**************************************************************************** ** ** - Clock and timer functions ** ***************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** 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 #include #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 64 #endif /* ** Constants for Functions */ #define TIMEOFDAY 1 /* time of day clock type */ /* ** Typedef */ #ifndef _TIMESPEC_T_ # define _TIMESPEC_T_ typedef struct timespec { unsigned long tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ } timespec_t; #endif /* ** Functions added in OpenVMS V7.0, Note, that getclock is UTC ** based so it is not visible if compiling in a local time based ** compatibility mode. */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE int getclock(int clock_type, struct timespec *tp); # endif #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __TIMERS_LOADED */ #ifndef __TIMES_LOADED #define __TIMES_LOADED 1 /**************************************************************************** ** ** - file access and modification times structure ** ***************************************************************************** ** Header introduced by the ISO POSIX-1 Standard ***************************************************************************** ** ** 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 __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 64 #endif /* ** Member align structures */ #pragma __member_alignment __save #pragma __member_alignment /****************************************************************************** ** ** This header file either defines the ISO POSIX-1 structures and prototypes ** or defines the DEC C specific structures and prototypes. The ISO POSIX-1 ** support was added in OpenVMS V7.0. The user could still access the old ** interface by defining _DECC_V4_SOURCE ** *******************************************************************************/ #if __CRTL_VER >= 70000000 && (defined _POSIX_C_SOURCE || !defined _DECC_V4_SOURCE) /************************************************************************** ** ISO POSIX-1 definitions of structures and prototypes ***************************************************************************/ # ifndef __CLOCK_T # define __CLOCK_T typedef int clock_t; # endif # ifndef __TMS # define __TMS struct tms { clock_t tms_utime; /* user CPU time */ clock_t tms_stime; /* system CPU time */ clock_t tms_cutime; /* user CPU of terminated child processes */ clock_t tms_cstime; /* system CPU of terminated child processes */ }; # endif clock_t times (struct tms *__buffer); #else /************************************************************************** ** DEC C specific (prior to OpenVMS V7.0) ***************************************************************************/ # ifndef __TBUFFER_T # define __TBUFFER_T 1 typedef struct tbuffer { int proc_user_time; int proc_system_time; int child_user_time; int child_system_time; } tbuffer_t; # endif void times (tbuffer_t *__buffer); /* */ #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __member_alignment __restore #pragma __standard #endif /* __TIMES_LOADED */