home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 6.ddi / MWHC.006 / 70 < prev    next >
Encoding:
Text File  |  1992-12-09  |  2.8 KB  |  107 lines

  1. /*
  2.  *   time.h -- ANSI 
  3.  *
  4.  *   Functions, types, and a macro for manipulating
  5.  *   representations of time.
  6.  *
  7.  *           Copyright (c) 1990, MetaWare Incorporated
  8.  */
  9.  
  10. #ifndef    _TIME_H
  11. #define    _TIME_H
  12. #pragma push_align_members(64);
  13.  
  14. #ifdef __CPLUSPLUS__
  15. extern "C" {
  16. #endif
  17.  
  18. #ifndef    NULL
  19. #define    NULL      ((void *)0)
  20. #endif
  21.  
  22. #if _AIX || _SUN || _VAX || _SOL
  23. #   define CLOCKS_PER_SEC 60  /*Formerly CLK_TCK in previous ANSI drafts*/
  24. #elif _ATT && _MC68        /*HP 9000    */
  25. #    define CLOCKS_PER_SEC 50    /*This may not be    true for all models!*/
  26. #elif _MSDOS || _HOB
  27. #   define CLOCKS_PER_SEC 100
  28. #elif (_ATT || _ATT4) && _I386
  29. #   define CLOCKS_PER_SEC 100
  30. #elif (_ATT || ATT4) &&    _I860
  31. #   define CLOCKS_PER_SEC 100    /* Assumes clock_period=53330 in kernel.cfg. */
  32. #elif (_NEXT)
  33. #   define CLOCKS_PER_SEC 64
  34. #else
  35. #   define CLOCKS_PER_SEC 1000    /*Formerly CLK_TCK in previous ANSI drafts*/
  36. #endif
  37.  
  38. #ifndef _SIZET_H
  39. #include <sizet.h>
  40. #endif
  41.  
  42. #if _IBMESA
  43. typedef         int    clock_t;
  44. #else
  45. typedef    long int    clock_t;
  46. #endif
  47. typedef    long int    time_t;
  48.  
  49. struct tm {
  50.     int tm_sec;    /*seconds after    the minute- 0..59*/
  51.     int tm_min;    /*minutes after    the hour- 0..59*/
  52.     int tm_hour;    /*hours since midnight- 0..23*/
  53.     int tm_mday;    /*day of the month-  1..31*/
  54.     int tm_mon;    /*month of the year- 0..11*/
  55.     int tm_year;    /*years since 1900*/
  56.     int tm_wday;    /*days since Sunday-  0..6*/
  57.     int tm_yday;    /*day of the year- 0..365*/
  58.     int tm_isdst;    /*daylight savings time- boolean  (0,1,-1)*/
  59.     };
  60.  
  61. /* Time    manipulation functions */
  62. extern clock_t    clock(void);
  63. extern double    difftime(time_t    __time1,time_t    __time0);
  64. extern time_t    mktime(struct tm *__timeptr);
  65. extern time_t    time(time_t *__timer);
  66.  
  67. /* Time    conversion functions */
  68. extern char *    asctime(const     struct    tm *__timeptr);
  69. extern char *    ctime(const time_t *__timer);
  70. extern struct tm * gmtime(const    time_t        *__timer);
  71. extern struct tm * localtime(const time_t   *__timer);
  72. extern size_t    strftime(char     *__s, size_t    __maxsize,
  73.             const  char *__format,     const struct    tm *__timeptr);
  74. #ifndef _MSDOS
  75. extern struct tm *_localtime( const time_t *__timer, struct tm *__tmbuf );
  76. extern char *_asctime( const struct tm *__timeptr, char *__buf );
  77. extern char *_ctime( const time_t *__timer, char *__buf );
  78. extern struct tm *_gmtime( const time_t *__timer, struct tm *__tmbuf );
  79. #endif
  80.  
  81. extern int _daylight;
  82. extern long _timezone;
  83. extern char *_tzname[2];
  84. extern void _tzset(void);
  85.  
  86. extern long _timezone_std;
  87. extern long _timezone_dst;
  88. #define _TZNAME_MAX 32
  89.  
  90. #if __HIGHC__ && (_MSDOS || _HOBBIT)
  91. extern void tzset(void);
  92. extern int daylight;
  93. extern long timezone;
  94. extern char * tzname[2];
  95. #endif /* __HIGHC__ */
  96.  
  97. #if _MSDOS
  98. extern char * _strdate(char *);
  99. extern char * _strtime(char *);
  100. #endif /* _MSDOS */
  101.  
  102. #ifdef __CPLUSPLUS__
  103. }
  104. #endif
  105. #pragma pop_align_members();
  106. #endif /*_TIME_H */
  107.