/* HPUX_ID: @(#)B11.23_LR $Revision: ../hdr/time.h@@/main/i80/11 $ */ #ifndef _TIME_INCLUDED #define _TIME_INCLUDED #include #ifndef _FAST_SHLIB_CALLS # if defined(_HP_SHLIB_CALLS) && !defined(__LP64__) # define _FAST_SHLIB_CALLS # endif #endif /* _FAST_SHLIB_CALLS */ /* * For CASPEC, include tm_* macros and identifiers here * But for all other cases, maintain definitions in sys/time.h */ #ifdef _INCLUDE_HPUX_SOURCE #ifdef __INCLUDE_FROM_TIME_H #undef __INCLUDE_FROM_TIME_H #endif /* __INCLUDE_FROM_TIME_H */ #define __INCLUDE_FROM_TIME_H #include # ifndef _GET_EXPIRATION_TIME # define _GET_EXPIRATION_TIME # if defined(__ia64) /* pragmas needed to support -B protected */ # pragma extern get_expiration_time # endif /* __ia64 */ # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL get_expiration_time # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION get_expiration_time # pragma HP_LONG_RETURN get_expiration_time # endif /* _FAST_SHLIB_CALLS */ extern int get_expiration_time __((struct timespec *,struct timespec *)); # endif /* _GET_EXPIRATION_TIME */ # undef __INCLUDE_FROM_TIME_H #if !defined(__STDC_32_MODE__) typedef int64_t hrtime_t; /* not defined for true ANSI-C name space */ #endif # ifdef __cplusplus extern "C" { # endif /* __cplusplus */ #if !defined(__STDC_32_MODE__) # ifdef _PROTOTYPES extern hrtime_t gethrtime(void); #else extern hrtime_t gethrtime(); #endif /* _PROTOTYPES */ #endif # ifdef __cplusplus } # endif /* __cplusplus */ # if defined(__ia64) /* pragmas needed to support -B protected */ #if !defined(__STDC_32_MODE__) # ifndef _GETHRTIME # pragma extern gethrtime # endif /** _GETHRTIME **/ # endif /* ia64*/ #endif #else /* _INCLUDE_HPUX_SOURCE */ /* ANSI C time constants, types, and structures */ # ifdef _INCLUDE__STDC__ # ifndef CLOCKS_PER_SEC # define CLOCKS_PER_SEC 1000000 # endif # ifndef __NULL_INCLUDED # include # endif /* _NULL_INCLUDED */ /*** ** clock_t and time_t only need to be 32-bits, and are restricted ** to being 32-bits in sys/types.h, however time.h has ** namespace restrictions that do not allow sys/_inttypes.h ** to be included here. Therefore we can not use uint32_t, ** but will have to rely on the knowledge that we are LP64. **/ # ifndef _CLOCK_T # define _CLOCK_T # ifdef __ILP64__ Error: ILP64 not supported for clock_t in time.h # else /** __ILP64__ **/ _NAMESPACE_STD_START typedef unsigned int clock_t; _NAMESPACE_STD_END # endif /* __ILP64__ */ # endif /* _CLOCK_T */ # ifndef _TIME_T_INCLUDED # include # endif /* _TIME_T_INCLUDED */ # ifndef _SIZE_T_INCLUDED # include # endif /* _SIZE_T_INCLUDED */ /* Structure used with gmtime(), localtime(), mktime(), strftime(). */ # ifndef _STRUCT_TM # define _STRUCT_TM _NAMESPACE_STD_START struct tm { int tm_sec; /* second (0-61, allows for leap seconds) */ int tm_min; /* minute (0-59) */ int tm_hour; /* hour (0-23) */ int tm_mday; /* day of the month (1-31) */ int tm_mon; /* month (0-11) */ int tm_year; /* years since 1900 */ int tm_wday; /* day of the week (0-6) */ int tm_yday; /* day of the year (0-365) */ int tm_isdst; /* non-0 if daylight savings time is in effect */ }; _NAMESPACE_STD_END # endif /* _STRUCT_TM */ # endif /* _INCLUDE__STDC__ */ /* * CLK_TCK is needed by the kernel, and also in the POSIX namespace. */ # ifdef _INCLUDE_POSIX_SOURCE # ifndef CLK_TCK # define CLK_TCK 100 # endif /* CLK_TCK */ # endif /* Function prototypes and external variable declarations */ /* from time.h */ # ifndef _KERNEL # ifdef __cplusplus extern "C" { # endif /* __cplusplus */ # ifdef _INCLUDE__STDC__ # if defined(__ia64) /* pragmas needed to support -B protected */ # ifndef _DIFFTIME # pragma extern difftime # endif /** _DIFFTIME **/ # ifndef _MKTIME # pragma extern mktime # endif /** _MKTIME **/ # ifndef _TIME # pragma extern time # endif /** _TIME **/ # ifndef _ASCTIME # pragma extern asctime # endif /** _ASCTIME **/ # ifndef _CTIME # pragma extern ctime # endif /** _CTIME **/ # ifndef _GMTIME # pragma extern gmtime # endif /** _GMTIME **/ # ifndef _LOCALTIME # pragma extern localtime # endif /** _LOCALTIME **/ # ifndef _STRFTIME # pragma extern strftime # endif /** _STRFTIME **/ # ifdef _REENTRANT # ifndef _ASCTIME_R # pragma extern asctime_r # endif /* _ASCTIME_R */ # ifndef _GMTIME_R # pragma extern gmtime_r # endif /* _GMTIME_R */ # ifndef _LOCALTIME_R # pragma extern localtime_r # endif /* _LOCALTIME_R */ # endif /* _REENTRANT */ # endif /* __ia64 */ # ifdef _PROTOTYPES _NAMESPACE_STD_START # ifndef _DIFFTIME # define _DIFFTIME extern double difftime(time_t, time_t); # endif /** _DIFFTIME **/ # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL mktime # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION mktime # pragma HP_LONG_RETURN mktime # endif /* _FAST_SHLIB_CALLS */ # ifndef _MKTIME # define _MKTIME extern time_t mktime(struct tm *); # endif /** _MKTIME **/ # ifndef _TIME # define _TIME # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL time # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHILB_CALLS # pragma HP_NO_RELOCATION time # pragma HP_LONG_RETURN time # endif /* _FAST_SHLIB_CALLS */ extern time_t time(time_t *); # endif /* _TIME */ # ifndef _ASCTIME # define _ASCTIME extern char *asctime(const struct tm *); # endif /* _ASCTIME */ # ifndef _CTIME # define _CTIME extern char *ctime(const time_t *); # endif # ifndef _GMTIME # define _GMTIME extern struct tm *gmtime(const time_t *); # endif # ifndef _LOCALTIME # define _LOCALTIME extern struct tm *localtime(const time_t *); # endif # ifndef _STRFTIME # define _STRFTIME # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL strftime # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION strftime # pragma HP_LONG_RETURN strftime # endif /* _FAST_SHLIB_CALLS */ extern size_t strftime(char *, size_t, const char *, const struct tm *); # endif _NAMESPACE_STD_END /* namespace std } */ # ifdef _REENTRANT # ifndef _ASCTIME_R # define _ASCTIME_R # ifndef _PTHREADS_DRAFT4 extern char *asctime_r(const __struct_tm *, char *); # else /* _PTHREADS_DRAFT4 */ extern int asctime_r(const __struct_tm *, char *, int); # endif /* _PTHREADS_DRAFT4 */ # endif # ifndef _CTIME_R # define _CTIME_R # ifndef _PTHREADS_DRAFT4 extern char *ctime_r(const __time_t *, char *); # else /* _PTHREADS_DRAFT4 */ extern int ctime_r(const __time_t *, char *, int); # endif /* _PTHREADS_DRAFT4 */ # endif # ifndef _GMTIME_R # define _GMTIME_R # ifndef _PTHREADS_DRAFT4 extern __struct_tm *gmtime_r(const __time_t *, __struct_tm *); # else /* _PTHREADS_DRAFT4 */ extern int gmtime_r(const __time_t *, __struct_tm *); # endif /* _PTHREADS_DRAFT4 */ # endif # ifndef _LOCALTIME_R # define _LOCALTIME_R # ifndef _PTHREADS_DRAFT4 extern __struct_tm *localtime_r(const __time_t *, __struct_tm *); # else /* _PTHREADS_DRAFT4 */ extern int localtime_r(const __time_t *, __struct_tm *); # endif /* _PTHREADS_DRAFT4 */ # endif # endif # else /* not _PROTOTYPES */ # ifndef _DIFFTIME # define _DIFFTIME extern double difftime(); # endif # ifndef _MKTIME # define _MKTIME # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL mktime # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION mktime # pragma HP_LONG_RETURN mktime # endif /* _FAST_SHLIB_CALLS */ extern time_t mktime(); # endif # ifndef _TIME # define _TIME # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL time # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION time # pragma HP_LONG_RETURN time # endif /* _FAST_SHLIB_CALLS */ extern time_t time(); # endif # ifndef _ASCTIME # define _ASCTIME extern char *asctime(); # endif # ifndef _CTIME # define _CTIME extern char *ctime(); # endif # ifndef _GMTIME # define _GMTIME extern struct tm *gmtime(); # endif # ifndef _LOCALTIME # define _LOCALTIME extern struct tm *localtime(); # endif # ifndef _STRFTIME # define _STRFTIME # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL strftime # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION strftime # pragma HP_LONG_RETURN strftime # endif /* _FAST_SHLIB_CALLS */ extern size_t strftime(); # endif # ifdef _REENTRANT # ifndef _ASCTIME_R # define _ASCTIME_R # ifndef _PTHREADS_DRAFT4 extern char *asctime_r(); # else /* _PTHREADS_DRAFT4 */ extern int asctime_r(); # endif /* _PTHREADS_DRAFT4 */ # endif # ifndef _CTIME_R # define _CTIME_R # ifndef _PTHREADS_DRAFT4 extern char *ctime_r(); # else /* _PTHREADS_DRAFT4 */ extern int ctime_r(); # endif /* _PTHREADS_DRAFT4 */ # endif # ifndef _GMTIME_R # define _GMTIMRE_R # ifndef _PTHREADS_DRAFT4 extern struct tm *gmtime_r(); # else /* _PTHREADS_DRAFT4 */ extern int gmtime_r(); # endif /* _PTHREADS_DRAFT4 */ # endif # ifndef _LOCALTIME_R # define _LOCALTIME_R # ifndef _PTHREADS_DRAFT4 extern struct tm *localtime_r(); # else /* _PTHREADS_DRAFT4 */ extern int localtime_r(); # endif /* _PTHREADS_DRAFT4 */ # endif # endif # endif /* not _PROTOTYPES */ # ifdef _CLASSIC_ANSI_TYPES # ifndef _CLOCK # ifndef __LP64__ # define _CLOCK # if defined(__ia64) /* pragmas needed to support -B protected */ # pragma extern clock # endif /* __ia64 */ # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL clock # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION clock # pragma HP_LONG_RETURN clock # endif /* _FAST_SHLIB_CALLS */ extern long clock(); # endif /* !__LP64 */ # endif /* !_CLOCK */ # else /* not _CLASSIC_ANSI_TYPES */ # if defined(__ia64) /* pragmas needed to support -B protected */ # pragma extern clock # endif /* __ia64 */ # ifdef _PROTOTYPES # ifndef _CLOCK # define _CLOCK # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL clock # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION clock # pragma HP_LONG_RETURN clock # endif /* _FAST_SHLIB_CALLS */ _NAMESPACE_STD_START extern clock_t clock(void); _NAMESPACE_STD_END # endif # else /* not _PROTOTYPES */ # ifndef _CLOCK # define _CLOCK extern clock_t clock(); # endif # endif /* not _PROTOTYPES */ # endif /* not _CLASSIC_ANSI_TYPES */ #endif /* _INCLUDE__STDC__ */ #ifdef _INCLUDE_POSIX_SOURCE #if defined(__ia64) /* pragmas needed to support -B protected */ # ifndef _TZSET # pragma extern tzset # endif /* _TZSET */ # ifndef _TZNAME # pragma extern tzname # endif /* _TZNAME */ #endif /* __ia64 */ # ifdef _PROTOTYPES # ifndef _TZSET # define _TZSET extern void tzset(void); # endif # else /* not _PROTOTYPES */ # ifndef _TZSET # define _TZSET extern void tzset(); # endif # endif /* not _PROTOTYPES */ # ifndef _TZNAME # define _TZNAME extern char *tzname[2]; # endif #endif /* _INCLUDE_POSIX_SOURCE */ #ifdef _INCLUDE_XOPEN_SOURCE # if defined(__ia64) /* pragmas needed to support -B protected */ # ifndef _STRPTIME # pragma extern strptime # endif /* _STRPTIME */ # ifndef _TIMEZONE # pragma extern timezone # endif /* _TIMEZONE */ # ifndef _DAYLIGHT # pragma extern daylight # endif /* _DAYLIGHT */ # endif /* __ia64 */ # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL strptime # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION strptime # pragma HP_LONG_RETURN strptime # endif /* _FAST_SHLIB_CALLS */ # ifdef _PROTOTYPES # ifndef _STRPTIME # define _STRPTIME extern char *strptime(const char *, const char *, __struct_tm *); # endif # else /* not _PROTOTYPES */ # ifndef _STRPTIME # define _STRPTIME extern char *strptime(); # endif # endif /* not _PROTOTYPES */ # ifndef _TIMEZONE # define _TIMEZONE extern long timezone; # endif # ifndef _DAYLIGHT # define _DAYLIGHT extern int daylight; # endif #endif /* _INCLUDE_XOPEN_SOURCE */ #ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED # if defined(__ia64) /* pragmas needed to support -B protected */ # ifndef _GETDATE # pragma extern getdate # endif /* _GETDATE */ # endif /* __ia64 */ # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL getdate # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION getdate # pragma HP_LONG_RETURN getdate # endif /* _FAST_SHLIB_CALLS */ # ifdef _PROTOTYPES # ifndef _GETDATE # define _GETDATE extern __struct_tm *getdate(const char *); # endif # else /* !_PROTOTYPES */ # ifndef _GETDATE # define _GETDATE extern struct tm *getdate(); # endif # endif /* !_PROTOTYPES */ # ifndef _GETDATE_ERR # define _GETDATE_ERR # if defined(_REENTRANT) && !defined(_PTHREADS_DRAFT4) # if defined(__ia64) /* pragmas needed to support -B protected */ # pragma extern __getdate_error # endif /* __ia64 */ # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL __getdate_error # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION __getdate_error # pragma HP_LONG_RETURN __getdate_error # endif /* _FAST_SHLIB_CALLS */ int * __getdate_error __((void)) ; #define getdate_err (*__getdate_error()) #else # if defined(__ia64) /* pragmas needed to support -B protected */ # pragma extern getdate_err # endif /* __ia64 */ extern int getdate_err; #endif /* defined(_REENTRANT) && !defined(_PTHREADS_DRAFT4) */ # endif #endif /* _INCLUDE_XOPEN_SOURCE_EXTENDED */ #ifdef _INCLUDE_HPUX_SOURCE # ifndef _GET_EXPIRATION_TIME # define _GET_EXPIRATION_TIME # if defined(__ia64) /* pragmas needed to support -B protected */ # pragma extern get_expiration_time # endif /* __ia64 */ # ifdef _HP_SHLIB_CALLS # pragma HP_DEFINED_EXTERNAL get_expiration_time # endif /* _HP_SHLIB_CALLS */ # ifdef _FAST_SHLIB_CALLS # pragma HP_NO_RELOCATION get_expiration_time # pragma HP_LONG_RETURN get_expiration_time # endif /* _FAST_SHLIB_CALLS */ extern int get_expiration_time __((struct timespec *,struct timespec *)); # endif # ifdef _PTHREADS_DRAFT4 # if defined(__ia64) /* pragmas needed to support -B protected */ # pragma extern getdate_r # endif /* __ia64 */ # ifdef _PROTOTYPES # ifndef _GETDATE_R # define _GETDATE_R extern int getdate_r(const char *, __struct_tm *, int *); # endif # else /* !_PROTOTYPES */ # ifndef _GETDATE_R # define _GETDATE_R extern int getdate_r(); # endif # endif /* !_PROTOTYPES */ # endif /* _PTHREADS_DRAFT4 */ #endif /* _INCLUDE_HPUX_SOURCE */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* not _KERNEL */ # endif /* _INCLUDE_HPUX_SOURCE */ #endif /* _TIME_INCLUDED */