home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6574.LZX / include / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-04  |  2.2 KB  |  106 lines

  1. /* Copyright (c) 1992-1993 SAS Institute, Inc., Cary, NC USA */
  2. /* All Rights Reserved */
  3.  
  4. #ifndef _TIME_H
  5. #define _TIME_H 1
  6.  
  7. #ifndef _COMMNULL_H
  8. #include <sys/commnull.h>
  9. #endif
  10.  
  11. #ifndef _COMMSIZE_H
  12. #include <sys/commsize.h>
  13. #endif
  14.  
  15. #ifndef _COMMTIME_H
  16. #include <sys/commtime.h>
  17. #endif
  18.  
  19. #define CLOCKS_PER_SEC  1000
  20. #define CLK_TCK  CLOCKS_PER_SEC
  21.  
  22. typedef unsigned long clock_t;
  23.  
  24. /**
  25. *
  26. * This structure contains the unpacked time as returned by "gmtime".
  27. *
  28. */
  29.  
  30. struct tm {
  31.     int tm_sec;      /* seconds after the minute */
  32.     int tm_min;          /* minutes after the hour */
  33.     int tm_hour;         /* hours since midnight */
  34.     int tm_mday;         /* day of the month */
  35.     int tm_mon;          /* months since January */
  36.     int tm_year;         /* years since 1900 */
  37.     int tm_wday;         /* days since Sunday */
  38.     int tm_yday;         /* days since January 1 */
  39.     int tm_isdst;        /* Daylight Savings Time flag */
  40. };
  41.  
  42.  
  43. /***
  44. *
  45. *     ANSI time functions.
  46. *
  47. ***/
  48.  
  49. extern clock_t clock(void);
  50. extern double difftime(time_t, time_t);
  51. extern time_t mktime(struct tm *);
  52. extern time_t time(time_t *);
  53.  
  54. extern char *asctime(const struct tm *);
  55. extern char *ctime(const time_t *);
  56. extern struct tm *gmtime(const time_t *);
  57. extern struct tm *localtime(const time_t *);
  58. extern size_t strftime(char *, size_t, const char *, const struct tm *);
  59.  
  60.  
  61. #ifndef _STRICT_ANSI
  62.  
  63. /***
  64. *
  65. *     SAS time functions
  66. *
  67. ***/
  68.  
  69. void getclk(unsigned char *);
  70. int  chgclk(const unsigned char *);
  71.  
  72. void utunpk(long, char *);
  73. long utpack(const char *);
  74. int timer(unsigned int *);
  75. int datecmp(const struct DateStamp *, const struct DateStamp *);
  76.  
  77. time_t __datecvt(const struct DateStamp *);
  78. struct DateStamp *__timecvt(time_t);
  79.  
  80. /* for UNIX compatibility */
  81. extern void      __tzset(void);
  82. #define timezone __timezone   
  83. #define tzname   __tzname   
  84. #define daylight __daylight   
  85. #define tzset    __tzset
  86.  
  87.  
  88. #define TZ  "CST6"      /* Used if TZ env. var. is not set */
  89. #define DAY0  4         /* Jan 1, 1970 is a Thursday */
  90.  
  91. #endif /* _STRICT_ANSI */
  92.  
  93. /***
  94. *     SAS external variables
  95. ***/
  96.  
  97. extern int  __daylight;
  98. extern long __timezone;
  99. extern char *__tzname[2];
  100. extern char __tzstn[4];
  101. extern char __tzdtn[4];
  102. extern char *_TZ;
  103.  
  104.  
  105. #endif
  106.