home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s038 / 10.ddi / 017.LIF / TIME.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-02  |  1.9 KB  |  80 lines

  1. /* time.h - basic struct for time(), asctime(), localtime()
  2.  * $Version: 1.1 $
  3.  * Copyright (c) 1988-91 Intel Corporation, ALL RIGHTS RESERVED.
  4.  */
  5. /*
  6.  * Change by Mick 91 December 3.  Cosmetic change to time_t
  7.  * definition.
  8.  */
  9.  
  10. #ifndef _timeh
  11. #define _timeh
  12. /*lint -library */
  13.  
  14. #pragma fixedparams("asctime",   "clock",  "ctime",    "difftime", "gmtime")
  15. #pragma fixedparams("localtime", "mktime", "strftime", "time",     "tzset")
  16.  
  17. #ifndef NULL
  18. #define NULL ((void *)0)
  19. #endif
  20.  
  21. #ifndef _size_t
  22. #define _size_t
  23. typedef unsigned size_t;
  24. #endif
  25.  
  26. #ifndef _time_t
  27. #define _time_t
  28.  
  29. /* Define time_t as 32 bits long in all cases. */
  30. #if _ARCHITECTURE_ >= 386
  31. typedef unsigned time_t;
  32. #else
  33. typedef unsigned long time_t;
  34. #endif /*  _ARCHITECTURE_  */
  35.  
  36. #endif
  37.  
  38. typedef unsigned long clock_t;
  39.  
  40. #define CLK_TCK        1000
  41. #define CLOCKS_PER_SEC 1000
  42.  
  43. #ifndef _reenth
  44. #pragma align (tm)
  45. #endif
  46. struct tm {
  47.     int tm_sec;               /* seconds     (0-59) */
  48.     int tm_min;               /* minutes     (0-59) */
  49.     int tm_hour;              /* hours       (0-23) */
  50.     int tm_mday;              /* days        (1-31) */
  51.     int tm_mon;               /* months      (0-11) */
  52.     int tm_year;              /* year        (minus 1900) */
  53.     int tm_wday;              /* day of week (sun = 0) */
  54.     int tm_yday;              /* day of year (0-365)   */
  55.     int tm_isdst;             /* non-zero if DST       */
  56. };
  57.  
  58. /*
  59.  * Function prototypes:
  60.  */
  61. char      *asctime(const struct tm *);
  62. clock_t    clock(void);
  63. char      *ctime(const time_t *);
  64. double     difftime(time_t, time_t);
  65. struct tm *gmtime(const time_t *);
  66. struct tm *localtime(const time_t *);
  67. time_t     mktime(struct tm *);
  68. size_t     strftime(char *, size_t, const char *, const struct tm *);
  69. time_t     time(time_t *);
  70. void       tzset(void);
  71.  
  72. #include <reent.h>
  73.  
  74. #define daylight    (_tzset_ptr()->_daylight)
  75. #define timezone    (_tzset_ptr()->_timezone)
  76. #define tzname        (_tzset_ptr()->_tzname)
  77.  
  78. #endif /* _timeh */
  79.  
  80.