home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  4.3 KB  |  170 lines

  1. /*  time.h
  2.  
  3.     Struct and function declarations for dealing with time.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 10.0
  9.  *
  10.  *      Copyright (c) 1987, 2000 by Inprise Corporation
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. /* $Revision:   9.9  $ */
  16.  
  17. #ifndef __TIME_H
  18. #define __TIME_H
  19. #define _INC_TIME  /* MSC Guard name */
  20.  
  21. #ifndef ___STDDEF_H
  22. #include <_stddef.h>
  23. #endif
  24.  
  25. #ifdef __cplusplus
  26. namespace std {
  27. #endif /* __cplusplus */
  28.  
  29. #if !defined(RC_INVOKED)
  30.  
  31. #if defined(__STDC__)
  32. #pragma warn -nak
  33. #endif
  34.  
  35. #pragma pack(push, 1)
  36.  
  37. #endif  /* !RC_INVOKED */
  38.  
  39.  
  40. #ifndef  _TIME_T
  41. typedef long time_t;
  42. #ifdef __cplusplus
  43. #  define _TIME_T std::time_t
  44. #else
  45. #  define _TIME_T time_t
  46. #endif /* __cplusplus */
  47. #endif
  48.  
  49. #ifndef  _CLOCK_T
  50. #define  _CLOCK_T
  51. typedef long clock_t;
  52. #endif
  53.  
  54. #define CLOCKS_PER_SEC 1000.0
  55. #define CLK_TCK        1000.0
  56.  
  57. struct tm
  58. {
  59.   int   tm_sec;
  60.   int   tm_min;
  61.   int   tm_hour;
  62.   int   tm_mday;
  63.   int   tm_mon;
  64.   int   tm_year;
  65.   int   tm_wday;
  66.   int   tm_yday;
  67.   int   tm_isdst;
  68. };
  69.  
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. char  *     _RTLENTRY _EXPFUNC asctime(const struct tm *__tblock);
  74. char  *     _RTLENTRY _EXPFUNC ctime(const time_t *__time);
  75. double      _RTLENTRY _EXPFUNC difftime(time_t __time2, time_t __time1);
  76. struct tm * _RTLENTRY _EXPFUNC gmtime(const time_t *__timer);
  77. struct tm * _RTLENTRY _EXPFUNC localtime(const time_t *__timer);
  78. time_t      _RTLENTRY _EXPFUNC time(time_t *__timer);
  79. time_t      _RTLENTRY _EXPFUNC mktime(struct tm *__timeptr);
  80. clock_t     _RTLENTRY _EXPFUNC clock(void);
  81. _SIZE_T     _RTLENTRY _EXPFUNC strftime(char *__s, _SIZE_T __maxsize,
  82.                                         const char *__fmt, const struct tm *__t);
  83. _SIZE_T     _RTLENTRY _EXPFUNC _lstrftim(char  *__s, _SIZE_T __maxsize,
  84.                                           const char *__fmt, const struct tm *__t);
  85. wchar_t   * _RTLENTRY _EXPFUNC _wasctime(const struct tm *__tblock);
  86. wchar_t   * _RTLENTRY _EXPFUNC _wctime(const time_t *__time);
  87. wchar_t   * _RTLENTRY _EXPFUNC _wstrdate(wchar_t *__datestr);
  88. wchar_t   * _RTLENTRY _EXPFUNC _wstrtime(wchar_t *__timestr);
  89. _SIZE_T     _RTLENTRY _EXPFUNC wcsftime(wchar_t *__s, _SIZE_T __maxsize,
  90.                                         const wchar_t *__fmt, const struct tm *__t);
  91. void        _RTLENTRY _EXPFUNC _wtzset(void);
  92.  
  93. extern int               _RTLENTRY _EXPDATA _daylight;
  94. extern long              _RTLENTRY _EXPDATA _timezone;
  95. extern char *    const   _RTLENTRY _EXPDATA _tzname[2];
  96. extern wchar_t * const   _RTLENTRY _EXPDATA _wtzname[2];
  97.  
  98. int         _RTLENTRY          stime(time_t *__tp);
  99. void        _RTLENTRY _EXPFUNC _tzset(void);
  100. char  *     _RTLENTRY _EXPFUNC _strdate(char *__datestr);
  101. char  *     _RTLENTRY _EXPFUNC _strtime(char *__timestr);
  102.  
  103. #if !defined(__STDC__)
  104. void        _RTLENTRY  _EXPFUNC tzset(void);
  105.  
  106. /* MSC compatible routines: */
  107. unsigned int _RTLENTRY _EXPFUNC _getsystime(struct tm *__timeptr);
  108. unsigned int _RTLENTRY _EXPFUNC _setsystime(struct tm *__timeptr, unsigned int __ms);
  109.  
  110. #endif  /* __STDC__  */
  111.  
  112. #ifdef __cplusplus
  113. }
  114. #endif
  115.  
  116.  
  117. #if !defined(RC_INVOKED)
  118.  
  119. /* restore default packing */
  120. #pragma pack(pop)
  121.  
  122. #if defined(__STDC__)
  123. #pragma warn .nak
  124. #endif
  125.  
  126. #endif  /* !RC_INVOKED */
  127.  
  128. #ifdef __cplusplus
  129. } // std
  130. #endif
  131.  
  132. #endif  /* __TIME_H */
  133.  
  134. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__TIME_H_USING_LIST)
  135. #define __TIME_H_USING_LIST
  136.      using std::time_t;
  137.      using std::clock_t;
  138.      using std::tm;
  139.      using std::asctime;
  140.      using std::ctime;
  141.      using std::difftime;
  142.      using std::gmtime;
  143.      using std::localtime;
  144.      using std::time;
  145.      using std::mktime;
  146.      using std::clock;
  147.      using std::strftime;
  148.      using std::_lstrftim;
  149.      using std::_wasctime;
  150.      using std::_wctime;
  151.      using std::_wstrdate;
  152.      using std::_wstrtime;
  153.      using std::wcsftime;
  154.      using std::_wtzset;
  155.      using std::stime;
  156.      using std::_tzset;
  157.      using std::_strdate;
  158.      using std::_strtime;
  159.      using std::_daylight;
  160.      using std::_timezone;
  161.      using std::_tzname;
  162.      using std::_wtzname;
  163. #if !defined(__STDC__)
  164.      using std::tzset;
  165.      using std::_getsystime;
  166.      using std::_setsystime;
  167. #endif
  168. #endif /* __USING_CNAME__ */
  169.  
  170.