home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / armlinux / alpha / PARTITIONS / USR_GZ / usr / include / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-14  |  2.7 KB  |  110 lines

  1. /* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. /*
  20.  *    ANSI Standard: 4.12 DATE and TIME    <time.h>
  21.  */
  22.  
  23. #ifndef _TIME_H
  24. #define _TIME_H
  25.  
  26. #include <features.h>
  27.  
  28. #ifndef _TIME_T
  29. #define _TIME_T
  30. typedef long time_t;
  31. #endif
  32.  
  33. #ifndef _CLOCK_T
  34. #define _CLOCK_T
  35. typedef long clock_t;
  36. #endif
  37.  
  38. #ifndef _SIZE_T
  39. #define _SIZE_T
  40. typedef unsigned int size_t;
  41. #endif
  42.  
  43. #ifndef NULL
  44. #ifdef __cplusplus
  45. #define NULL    0
  46. #else
  47. #define NULL    ((void *) 0)
  48. #endif
  49. #endif
  50.  
  51. #define CLOCKS_PER_SEC    100
  52. #define CLK_TCK        100    /* That must be the same as HZ ???? */
  53.  
  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. };
  65.  
  66. #define    __isleap(year)    \
  67.   ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
  68.  
  69. extern char *tzname[2];
  70. extern int daylight;
  71. extern long int timezone;
  72.  
  73. __BEGIN_DECLS
  74.  
  75. extern int    stime __P ((time_t* __tptr));
  76.  
  77. extern clock_t    clock __P ((void));
  78. extern time_t    time __P ((time_t * __tp));
  79. extern __CONSTVALUE double difftime __P ((time_t __time2,
  80.                       time_t __time1)) __CONSTVALUE2;
  81. extern time_t    mktime __P ((struct tm * __tp));
  82.  
  83. extern char *    asctime __P ((__const struct tm * __tp));
  84. extern char *    ctime __P ((__const time_t * __tp));
  85. extern size_t    strftime __P ((char * __s, size_t __smax,
  86.             __const char * __fmt, __const struct tm * __tp));
  87. extern char *    strptime __P ((char * __s, __const char * __fmt,
  88.             struct tm * __tm));
  89.  
  90. extern void    tzset __P ((void));
  91.  
  92. extern struct tm*    gmtime __P ((__const time_t *__tp));
  93. extern struct tm*    localtime __P ((__const time_t * __tp));
  94.  
  95. #ifdef __USE_MISC
  96. /* Miscellaneous functions many Unices inherited from the public domain
  97.   localtime package.  These are included only for compatibility.  */
  98.  
  99. /* Like `mktime', but for TP represents Universal Time, not local time.  */
  100. extern time_t timegm __P ((struct tm *__tp));
  101.     
  102. /* Another name for `mktime'.  */
  103. extern time_t timelocal __P ((struct tm *__tp));
  104.  
  105. #endif
  106.  
  107. __END_DECLS
  108.  
  109. #endif
  110.