00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _TIME_H
00010 #define _TIME_H
00011
00012 #define CLOCKS_PER_SEC 60
00013
00014 #ifdef _POSIX_SOURCE
00015 #define CLK_TCK 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;
00028 #endif
00029
00030 #ifndef _CLOCK_T
00031 #define _CLOCK_T
00032 typedef long clock_t;
00033 #endif
00034
00035 struct tm {
00036 int tm_sec;
00037 int tm_min;
00038 int tm_hour;
00039 int tm_mday;
00040 int tm_mon;
00041 int tm_year;
00042 int tm_wday;
00043 int tm_yday;
00044 int tm_isdst;
00045 };
00046
00047 extern char *tzname[];
00048
00049
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( struct tm *localtime_r, (const time_t *const timep,
00063 struct tm *tmp) );
00064 _PROTOTYPE( size_t strftime, (char *_s, size_t _max, const char *_fmt,
00065 const struct tm *_timep) );
00066
00067 #ifdef _POSIX_SOURCE
00068 _PROTOTYPE( void tzset, (void) );
00069 #endif
00070
00071 #ifdef _MINIX
00072 _PROTOTYPE( int stime, (time_t *_top) );
00073 #endif
00074
00075 extern long timezone;
00076
00077 #ifdef _POSIX_SOURCE
00078 struct timespec
00079 {
00080 time_t tv_sec;
00081 long tv_nsec;
00082 };
00083
00084 int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
00085 #endif
00086
00087 #endif