time.h

Go to the documentation of this file.
00001 /* The <time.h> header is used by the procedures that deal with time.
00002  * Handling time is surprisingly complicated, what with GMT, local time
00003  * and other factors.  Although the Bishop of Ussher (1581-1656) once
00004  * calculated that based on the Bible, the world began on 12 Oct. 4004 BC
00005  * at 9 o'clock in the morning, in the UNIX world time begins at midnight, 
00006  * 1 Jan. 1970 GMT.  Before that, all was NULL and (void).
00007  */
00008 
00009 #ifndef _TIME_H
00010 #define _TIME_H
00011 
00012 #define CLOCKS_PER_SEC    60    /* MINIX always uses 60 Hz, even in Europe */
00013 
00014 #ifdef _POSIX_SOURCE
00015 #define CLK_TCK CLOCKS_PER_SEC  /* obsolescent mame for CLOCKS_PER_SEC */
00016 #endif
00017 
00018 #define NULL    ((void *)0)
00019 
00020 #ifndef _SIZE_T
00021 #define _SIZE_T
00022 typedef unsigned int size_t;
00023 #endif
00024 
00025 #ifndef _TIME_T
00026 #define _TIME_T
00027 typedef long time_t;            /* time in sec since 1 Jan 1970 0000 GMT */
00028 #endif
00029 
00030 #ifndef _CLOCK_T
00031 #define _CLOCK_T
00032 typedef long clock_t;           /* time in ticks since process started */
00033 #endif
00034 
00035 struct tm {
00036   int tm_sec;                   /* seconds after the minute [0, 59] */
00037   int tm_min;                   /* minutes after the hour [0, 59] */
00038   int tm_hour;                  /* hours since midnight [0, 23] */
00039   int tm_mday;                  /* day of the month [1, 31] */
00040   int tm_mon;                   /* months since January [0, 11] */
00041   int tm_year;                  /* years since 1900 */
00042   int tm_wday;                  /* days since Sunday [0, 6] */
00043   int tm_yday;                  /* days since January 1 [0, 365] */
00044   int tm_isdst;                 /* Daylight Saving Time flag */
00045 };
00046 
00047 extern char *tzname[];
00048 
00049 /* Function Prototypes. */
00050 #ifndef _ANSI_H
00051 #include <ansi.h>
00052 #endif
00053 
00054 _PROTOTYPE( clock_t clock, (void)                                       );
00055 _PROTOTYPE( double difftime, (time_t _time1, time_t _time0)             );
00056 _PROTOTYPE( time_t mktime, (struct tm *_timeptr)                        );
00057 _PROTOTYPE( time_t time, (time_t *_timeptr)                             );
00058 _PROTOTYPE( char *asctime, (const struct tm *_timeptr)                  );
00059 _PROTOTYPE( char *ctime, (const time_t *_timer)                 );
00060 _PROTOTYPE( struct tm *gmtime, (const time_t *_timer)                   );
00061 _PROTOTYPE( struct tm *localtime, (const time_t *_timer)                );
00062 _PROTOTYPE( size_t strftime, (char *_s, size_t _max, const char *_fmt,
00063                                 const struct tm *_timep)                );
00064 
00065 #ifdef _POSIX_SOURCE
00066 _PROTOTYPE( void tzset, (void)                                          );
00067 #endif
00068 
00069 #ifdef _MINIX
00070 _PROTOTYPE( int stime, (time_t *_top)                                   );
00071 #endif
00072 
00073 extern long timezone;
00074 
00075 #endif /* _TIME_H */

Generated on Fri Apr 14 22:57:22 2006 for minix by  doxygen 1.4.6