home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / d / djdev108.zip / INCLUDE / TIME.H < prev    next >
C/C++ Source or Header  |  1992-08-15  |  3KB  |  82 lines

  1. /*
  2.  * Copyright (c) 1989 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted provided
  6.  * that: (1) source distributions retain this entire copyright notice and
  7.  * comment, and (2) distributions including binaries display the following
  8.  * acknowledgement:  ``This product includes software developed by the
  9.  * University of California, Berkeley and its contributors'' in the
  10.  * documentation or other materials provided with the distribution and in
  11.  * all advertising materials mentioning features or use of this software.
  12.  * Neither the name of the University nor the names of its contributors may
  13.  * be used to endorse or promote products derived from this software without
  14.  * specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  16.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  17.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  *
  19.  *      @(#)time.h      5.6 (Berkeley) 6/23/90
  20.  */
  21.  
  22. #ifndef _TIME_H_
  23. #define _TIME_H_
  24.  
  25. #include <sys/types.h>
  26.  
  27. #define CLOCKS_PER_SEC 1000000
  28.  
  29. #ifndef NULL
  30. #define NULL    0
  31. #endif
  32.  
  33. #ifdef  _CLOCK_T_
  34. typedef _CLOCK_T_       clock_t;
  35. #undef  _CLOCK_T_
  36. #else
  37. #define clock_t long
  38. #endif
  39.  
  40. #ifdef  _TIME_T_
  41. typedef _TIME_T_        time_t;
  42. #undef  _TIME_T_
  43. #endif
  44.  
  45. #ifdef  _SIZE_T_
  46. typedef _SIZE_T_        size_t;
  47. #undef  _SIZE_T_
  48. #endif
  49.  
  50. struct tm {
  51.         int     tm_sec;         /* seconds after the minute [0-60] */
  52.         int     tm_min;         /* minutes after the hour [0-59] */
  53.         int     tm_hour;        /* hours since midnight [0-23] */
  54.         int     tm_mday;        /* day of the month [1-31] */
  55.         int     tm_mon;         /* months since January [0-11] */
  56.         int     tm_year;        /* years since 1900 */
  57.         int     tm_wday;        /* days since Sunday [0-6] */
  58.         int     tm_yday;        /* days since January 1 [0-365] */
  59.         int     tm_isdst;       /* Daylight Savings Time flag */
  60.         long    tm_gmtoff;      /* offset from CUT in seconds */
  61.         char    *tm_zone;       /* timezone abbreviation */
  62. };
  63.  
  64. #ifdef __cplusplus
  65. extern "C" {
  66. #endif
  67. extern struct tm *gmtime(const time_t *);
  68. extern struct tm *localtime(const time_t *);
  69. extern time_t mktime(const struct tm *);
  70. extern unsigned long time(unsigned long *);
  71. extern double difftime(const time_t, const time_t);
  72. extern char *asctime(const struct tm *);
  73. extern char *ctime(const time_t *);
  74. extern char *timezone(int , int);
  75. extern void tzset(void);
  76. extern void tzsetwall(void);
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80.  
  81. #endif
  82.