home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / uccs / root.14 / udk / usr / include / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-19  |  2.9 KB  |  119 lines

  1. /*
  2.  * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3.  *                                                                         
  4.  *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5.  *                   SANTA CRUZ OPERATION INC.                             
  6.  *                                                                         
  7.  *   The copyright notice above does not evidence any actual or intended   
  8.  *   publication of such source code.                                      
  9.  */
  10.  
  11. #ifndef _TIME_H
  12. #define _TIME_H
  13. #ident    "@(#)sgs-head:common/head/time.h    1.18.1.12"
  14.  
  15. #ifndef NULL
  16. #   define NULL 0
  17. #endif
  18.  
  19. #ifndef _SIZE_T
  20. #   define _SIZE_T
  21.     typedef unsigned int size_t;
  22. #endif
  23. #ifndef _CLOCK_T
  24. #   define _CLOCK_T
  25.     typedef long clock_t;
  26. #endif
  27. #ifndef _TIME_T
  28. #   define _TIME_T
  29.     typedef long time_t;
  30. #endif
  31.  
  32. #define CLOCKS_PER_SEC    1000000
  33.  
  34. struct tm
  35. {
  36.     int    tm_sec;
  37.     int    tm_min;
  38.     int    tm_hour;
  39.     int    tm_mday;
  40.     int    tm_mon;
  41.     int    tm_year;
  42.     int    tm_wday;
  43.     int    tm_yday;
  44.     int    tm_isdst;
  45. };
  46.  
  47. #if defined(_POSIX_TIMERS) || _POSIX_C_SOURCE - 0 >= 199309 \
  48.     || (!defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) \
  49.     && !defined(_POSIX_C_SOURCE) && __STDC__ - 0 == 0)
  50. #ifndef _TIMESPEC
  51. #define _TIMESPEC
  52. struct timespec {
  53.     time_t         tv_sec;        /* seconds */
  54.     long        tv_nsec;    /* and nanoseconds */
  55. };
  56. #endif
  57. #endif
  58.  
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif
  62.  
  63. extern clock_t    clock(void);
  64. extern double    difftime(time_t, time_t);
  65. extern time_t    mktime(struct tm *);
  66. extern time_t    time(time_t *);
  67. extern char    *asctime(const struct tm *);
  68. extern char    *ctime (const time_t *);
  69. struct tm    *gmtime(const time_t *);
  70. struct tm    *localtime(const time_t *);
  71. extern size_t    strftime(char *, size_t, const char *, const struct tm *);
  72.  
  73. #if __STDC__ - 0 == 0 || defined(_XOPEN_SOURCE) \
  74.     || defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)
  75.  
  76. extern void    tzset(void);
  77. extern char    *tzname[];
  78. extern long    _sysconf(int);
  79.  
  80. #ifndef CLK_TCK
  81. #   define CLK_TCK _sysconf(3)    /* 3 is _SC_CLK_TCK */
  82. #endif
  83.  
  84. #endif
  85.  
  86. #if defined(_XOPEN_SOURCE) || (__STDC__ - 0 == 0 \
  87.     && !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE))
  88. extern long    timezone;
  89. extern int    daylight;
  90. extern char    *strptime(const char *, const char *, struct tm *);
  91. #endif
  92.  
  93. #if __STDC__ - 0 == 0 && !defined(_XOPEN_SOURCE) \
  94.     && !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
  95.  
  96. extern int    cftime(char *, const char *, const time_t *);
  97. extern int    ascftime(char *, const char *, const struct tm *);
  98. extern long    altzone;
  99. struct tm    *getdate(const char *);
  100. extern int    getdate_err;
  101. extern int    getdate_r(const char *, struct tm *);
  102. extern char    *asctime_r(const struct tm *, char *);
  103. extern char    *ctime_r(const time_t *, char *);
  104. struct tm    *localtime_r(const time_t *, struct tm *);
  105. struct tm    *gmtime_r(const time_t *, struct tm *);
  106.  
  107. #elif defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1
  108.  
  109. struct tm    *getdate(const char *);
  110. extern int    getdate_err;
  111.  
  112. #endif /*__STDC__ - 0 == 0 && ...*/
  113.  
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117.  
  118. #endif /*_TIME_H*/
  119.