home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Headers / ansi / time.h < prev   
Text File  |  1995-01-23  |  3KB  |  124 lines

  1. /*
  2.  * Copyright (c) 1983, 1987 Regents of the University of California.
  3.  * All rights reserved.  The Berkeley software License Agreement
  4.  * specifies the terms and conditions for redistribution.
  5.  *
  6.  *    @(#)time.h    1.2 (Berkeley) 3/4/87
  7.  */
  8.  
  9. /* Copyright (c) 1988,1992 NeXT, Inc. - 9/8/88 CCH */
  10.  
  11. #ifndef _ANSI_TIME_H
  12. #define _ANSI_TIME_H
  13.  
  14. #include <standards.h>
  15.  
  16. #ifndef __STRICT_BSD__
  17.  
  18. #ifdef _NEXT_SOURCE
  19. #import <stddef.h>
  20. #define CLK_TCK 64
  21. #endif /* _NEXT_SOURCE */
  22.  
  23. #if defined(_NEXT_SOURCE) || defined(__STRICT_ANSI__)
  24. #ifndef _CLOCK_T
  25. #define _CLOCK_T    
  26. typedef unsigned long int clock_t;
  27. #endif /* _CLOCK_T */
  28. #ifndef _TIME_T
  29. #define _TIME_T
  30. typedef long time_t;
  31. #endif /* _TIME_T */
  32. #endif  /* _NEXT_SOURCE || __STRICT_ANSI__ */
  33.  
  34. #if defined(__STRICT_ANSI__)
  35. #ifndef _SIZE_T
  36. #define _SIZE_T
  37. typedef unsigned long size_t;
  38. #endif  /* _SIZE_T */
  39. #endif  /* __STRICT_ANSI__ */
  40.  
  41. #endif /* !__STRICT_BSD__ */
  42.  
  43. #if defined(__STRICT_ANSI__)
  44. #ifndef NULL
  45. #define NULL ((void *)0)
  46. #endif  /* NULL */
  47. #endif  /* __STRICT_ANSI__ */
  48.  
  49. /*
  50.  * Structure returned by gmtime and localtime calls (see ctime(3)).
  51.  */
  52.  
  53. #if defined(_NEXT_SOURCE) || defined(__STRICT_ANSI__)
  54. struct tm {
  55.     int tm_sec;
  56.     int tm_min;
  57.     int tm_hour;
  58.     int tm_mday;
  59.     int tm_mon;
  60.     int tm_year;
  61.     int tm_wday;
  62.     int tm_yday;
  63.     int tm_isdst;
  64. #ifdef _NEXT_SOURCE    
  65.     long tm_gmtoff;
  66.     char *tm_zone;
  67. #endif  /* _NEXT_SOURCE */
  68. };
  69. #endif    /* __STRICT_ANSI__ || _NEXT_SOURCE */
  70.  
  71. #ifdef __STRICT_BSD__
  72. extern    struct tm *gmtime(), *localtime();
  73. extern    char *asctime(), *ctime();
  74. #elif !defined(KERNEL)
  75. /*
  76.  * Don't let these function declarations be visible to the
  77.  * kernel.  The declaration of the time() function collides
  78.  * with the definition of the time kernel variable.
  79.  */
  80. #ifdef __STDC__
  81.  
  82. /* ANSI C functions */
  83. clock_t clock(void);
  84. double difftime(time_t time1, time_t time0);
  85. time_t mktime(struct tm *timeptr);
  86. size_t strftime(char *s, size_t maxsize,
  87. const char *format, const struct tm *timeptr);
  88.  
  89. /* BSD and ANSI C functions */
  90. time_t time(time_t *timer);
  91. char *asctime(const struct tm *timeptr);
  92. char *ctime(const time_t *timer);
  93. struct tm *gmtime(const time_t *timer);
  94. struct tm *localtime(const time_t *timer);
  95. #else
  96.  
  97. /* ANSI C functions */
  98. clock_t clock();
  99. double difftime();
  100. time_t mktime();
  101. size_t strftime();
  102.  
  103. /* BSD and ANSI C functions */
  104. time_t time();
  105. char *asctime();
  106. char *ctime();
  107. struct tm *gmtime();
  108. struct tm *localtime();
  109. #endif  /*__STDC__ */
  110. #endif /* __STRICT_BSD__ */
  111.  
  112. #ifdef _POSIX_SOURCE
  113. #ifdef __STDC__
  114. void tzset(void);
  115. #else
  116. void tzset();
  117. #endif    /* __STDC__ */
  118.  
  119. extern char *tzname[2];
  120.  
  121. #endif   /* _POSIX_SOURCE */
  122.  
  123. #endif /* _ANSI_TIME_H */
  124.