home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / h.z / TIME.H < prev    next >
C/C++ Source or Header  |  1996-07-24  |  4KB  |  126 lines

  1. /*
  2.  *  time.h    Time functions
  3.  *
  4.  *  Copyright by WATCOM International Corp. 1988-1996.  All rights reserved.
  5.  */
  6. #ifndef _TIME_H_INCLUDED
  7. #define _TIME_H_INCLUDED
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. #ifndef _COMDEF_H_INCLUDED
  13.  #include <_comdef.h>
  14. #endif
  15.  
  16. #if defined(_M_IX86)
  17.   #pragma pack(__push,1);
  18. #else
  19.   #pragma pack(__push,8);
  20. #endif
  21.  
  22. #ifndef _WCHAR_T_DEFINED
  23. #define _WCHAR_T_DEFINED
  24. #define _WCHAR_T_DEFINED_
  25. #ifdef __cplusplus
  26. typedef long char wchar_t;
  27. #else
  28. typedef unsigned short wchar_t;
  29. #endif
  30. #endif
  31.  
  32. #ifndef _SIZE_T_DEFINED
  33. #define _SIZE_T_DEFINED
  34. #define _SIZE_T_DEFINED_
  35. typedef unsigned size_t;
  36. #endif
  37.  
  38. #ifndef NULL
  39.  #if defined(__SMALL__) || defined(__MEDIUM__) || defined(__386__) || defined(__AXP__) || defined(__PPC__)
  40.   #define NULL   0
  41.  #else
  42.   #define NULL   0L
  43.  #endif
  44. #endif
  45.  
  46. #ifndef _TIME_T_DEFINED
  47. #define _TIME_T_DEFINED
  48. #define _TIME_T_DEFINED_
  49. typedef unsigned long time_t; /* time value */
  50. #endif
  51.  
  52. #define CLK_TCK     1000
  53. #define CLOCKS_PER_SEC    1000
  54.  
  55. #ifndef _CLOCK_T_DEFINED
  56.  #define _CLOCK_T_DEFINED
  57.  typedef unsigned long    clock_t;
  58. #endif
  59.  
  60. struct    tm {
  61.     int  tm_sec;    /* seconds after the minute -- [0,61] */
  62.     int  tm_min;    /* minutes after the hour   -- [0,59] */
  63.     int  tm_hour;    /* hours after midnight     -- [0,23] */
  64.     int  tm_mday;    /* day of the month        -- [1,31] */
  65.     int  tm_mon;    /* months since January     -- [0,11] */
  66.     int  tm_year;    /* years since 1900              */
  67.     int  tm_wday;    /* days since Sunday        -- [0,6]  */
  68.     int  tm_yday;    /* days since January 1     -- [0,365]*/
  69.     int  tm_isdst;    /* Daylight Savings Time flag */
  70. };
  71.  
  72. _WCRTLINK extern char *asctime( const struct tm *__timeptr );
  73. _WCRTLINK extern clock_t clock( void );
  74. _WCRTLINK extern char *ctime( const time_t *__timer );
  75. _WMRTLINK extern double difftime( time_t __t1, time_t __t0 );
  76. _WCRTLINK extern struct tm *gmtime( const time_t *__timer );
  77. _WCRTLINK extern struct tm *localtime( const time_t *__timer );
  78. _WCRTLINK extern time_t mktime( struct tm *__timeptr );
  79. _WCRTLINK extern size_t strftime( char *__s, size_t __maxsiz, const char *__fmt,
  80.                   const struct tm *__tp );
  81. _WCRTLINK extern time_t time( time_t *__timer );
  82.  
  83. _WCRTLINK extern wchar_t *_wasctime( const struct tm * );
  84. _WCRTLINK extern wchar_t *_wctime( const time_t * );
  85. _WCRTLINK extern wchar_t *_wstrdate( wchar_t *__buf );
  86. _WCRTLINK extern wchar_t *_wstrtime( wchar_t *__buf );
  87. _WCRTLINK extern size_t    wcsftime( wchar_t *, size_t, const wchar_t *, 
  88.                      const struct tm * );
  89. _WCRTLINK extern size_t   _wstrftime_ms( wchar_t *, size_t, const char *, 
  90.                      const struct tm * );
  91.  
  92. #ifndef __cplusplus
  93. #define difftime(t1,t0) ((double)(t1)-(double)(t0))
  94. #endif
  95.  
  96. #if !defined(NO_EXT_KEYS) /* extensions enabled */
  97. _WCRTLINK extern char *_asctime( const struct tm *__timeptr, char *__buf );
  98. _WCRTLINK extern char *_ctime( const time_t *__timer, char *__buf );
  99. _WCRTLINK extern struct tm *_gmtime( const time_t *__timer, struct tm *__tmbuf );
  100. _WCRTLINK extern struct tm *_localtime( const time_t *__timer, 
  101.                     struct tm *__tmbuf );
  102. _WCRTLINK extern char *_strdate( char *__buf );
  103. _WCRTLINK extern char *_strtime( char *__buf );
  104. _WCRTLINK extern wchar_t *__wctime( const time_t *, wchar_t * );
  105. _WCRTLINK extern wchar_t *__wasctime( const struct tm *, wchar_t * );
  106. #endif
  107.  
  108. _WCRTLINK extern void tzset( void );
  109.  
  110. #if defined(__SW_BR) || defined(_RTDLL) 
  111.  #define tzname tzname_br
  112. #endif
  113. _WCRTLINK extern char    *tzname[2]; /*    time zone names */
  114. #if defined(__SW_BR) || defined(_RTDLL) 
  115.  #define timezone timezone_br
  116.  #define daylight daylight_br
  117. #endif
  118. _WCRTLINK extern long    timezone;    /* # of seconds from GMT */
  119. _WCRTLINK extern int    daylight;    /* d.s.t. indicator */
  120.  
  121. #pragma pack(__pop);
  122. #ifdef __cplusplus
  123. };
  124. #endif
  125. #endif
  126.