home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / TIME.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-18  |  3.9 KB  |  155 lines

  1. /*  time.h
  2.  
  3.     Struct and function declarations for dealing with time.
  4.  
  5. */
  6.  
  7. /* $Copyright: 1987$ */
  8. /* $Revision:   8.7  $ */
  9.  
  10. #ifndef __TIME_H
  11. #define __TIME_H
  12.  
  13. #if !defined(___DEFS_H)
  14. #include <_defs.h>
  15. #endif
  16.  
  17. #if !defined(RC_INVOKED)
  18.  
  19. #if defined(__STDC__)
  20. #pragma warn -nak
  21. #endif
  22.  
  23. #pragma pack(push, 1)
  24.  
  25. #endif  /* !RC_INVOKED */
  26.  
  27.  
  28. #ifndef _SIZE_T
  29. #define _SIZE_T
  30. typedef unsigned size_t;
  31. #endif
  32.  
  33. #ifndef __cplusplus
  34. #if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
  35. #define _WCHAR_T
  36. #define _WCHAR_T_DEFINED  /* For WINDOWS.H */
  37. typedef unsigned short wchar_t;
  38. #endif
  39. #endif
  40.  
  41. #ifndef  _TIME_T
  42. #define  _TIME_T
  43. typedef long time_t;
  44. #endif
  45.  
  46. #ifndef  _CLOCK_T
  47. #define  _CLOCK_T
  48. typedef long clock_t;
  49. #endif
  50.  
  51. #define CLOCKS_PER_SEC 1000.0
  52. #define CLK_TCK        1000.0
  53.  
  54. struct tm
  55. {
  56.   int   tm_sec;
  57.   int   tm_min;
  58.   int   tm_hour;
  59.   int   tm_mday;
  60.   int   tm_mon;
  61.   int   tm_year;
  62.   int   tm_wday;
  63.   int   tm_yday;
  64.   int   tm_isdst;
  65. };
  66.  
  67. #ifdef __cplusplus
  68. extern "C" {
  69. #endif
  70. char _FAR * _RTLENTRY _EXPFUNC   asctime(const struct tm _FAR *__tblock);
  71. char _FAR * _RTLENTRY _EXPFUNC   ctime(const time_t _FAR *__time);
  72. double      _RTLENTRY _EXPFUNC32 difftime(time_t __time2, time_t __time1);
  73. struct tm _FAR * _RTLENTRY _EXPFUNC gmtime(const time_t _FAR *__timer);
  74. struct tm _FAR * _RTLENTRY _EXPFUNC localtime(const time_t _FAR *__timer);
  75. time_t      _RTLENTRY _EXPFUNC32 time(time_t _FAR *__timer);
  76. time_t      _RTLENTRY _EXPFUNC   mktime(struct tm _FAR *__timeptr);
  77. clock_t     _RTLENTRY _EXPFUNC32 clock(void);
  78. size_t      _RTLENTRY _EXPFUNC   strftime(char _FAR *__s, size_t __maxsize,
  79.                                           const char _FAR *__fmt, const struct tm _FAR *__t);
  80. size_t      _RTLENTRY _EXPFUNC   _lstrftim(char _FAR *__s, size_t __maxsize,
  81.                                             const char _FAR *__fmt, const struct tm _FAR *__t);
  82. #if defined(__FLAT__)
  83. wchar_t   * _RTLENTRY _EXPFUNC   _wasctime(const struct tm *__tblock);
  84. wchar_t   * _RTLENTRY _EXPFUNC   _wctime(const time_t *__time);
  85. wchar_t   * _RTLENTRY _EXPFUNC   _wstrdate(wchar_t *datestr);
  86. wchar_t   * _RTLENTRY _EXPFUNC   _wstrtime(wchar_t *timestr);
  87. size_t      _RTLENTRY _EXPFUNC   wcsftime(wchar_t *__s, size_t __maxsize,
  88.                                           const wchar_t *__fmt, const struct tm *__t);
  89. #endif
  90.  
  91.  
  92. /* NOTE: The old daylight, timezone, tzname definitions are no longer used.
  93.          If you need them for backwards compatibility, you'll have to proto-
  94.          type them yourself, and include obsolete.lib
  95. */
  96.  
  97. #if !defined(_RTLDLL) || defined(__FLAT__)
  98.  
  99. extern int               _RTLENTRY _EXPDATA _daylight;
  100. extern long              _RTLENTRY _EXPDATA _timezone;
  101. extern char _FAR * const _RTLENTRY _EXPDATA _tzname[2];
  102. #if defined(__FLAT__)
  103. extern wchar_t   * const _RTLENTRY _EXPDATA _wtzname[2];
  104. #endif
  105.  
  106. #else
  107.  
  108. int  _FAR *        _RTLENTRY _EXPFUNC __getDaylight(void);
  109. long _FAR *        _RTLENTRY _EXPFUNC __getTimezone(void);
  110. char _FAR * _FAR * _RTLENTRY _EXPFUNC __getTzname(void);
  111.  
  112. #define _daylight (*__getDaylight())
  113. #define _tzname   ( __getTzname())
  114. #define _timezone (*__getTimezone())
  115.  
  116. #endif  /* _RTLDLL */
  117.  
  118. int         _RTLENTRY           stime(time_t _FAR *__tp);
  119. void        _RTLENTRY  _EXPFUNC tzset(void);
  120. #if defined(__FLAT__)
  121. void        _RTLENTRY  _EXPFUNC _wtzset(void);
  122. #endif
  123. char _FAR * _RTLENTRY  _EXPFUNC _strdate(char _FAR *datestr);
  124. char _FAR * _RTLENTRY  _EXPFUNC _strtime(char _FAR *timestr);
  125.  
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129.  
  130.  
  131. #if !defined(__STDC__)
  132.  
  133. #if defined( __USELOCALES__ )
  134.  
  135. //#define strftime   _lstrftime until a locale and non-locale version is implemented
  136.  
  137. #endif
  138.  
  139. #endif  /* __STDC__  */
  140.  
  141.  
  142. #if !defined(RC_INVOKED)
  143.  
  144. /* restore default packing */
  145. #pragma pack(pop)
  146.  
  147. #if defined(__STDC__)
  148. #pragma warn .nak
  149. #endif
  150.  
  151. #endif  /* !RC_INVOKED */
  152.  
  153.  
  154. #endif  /* __TIME_H */
  155.