time.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:3k
- /* $Id$ */
- /* time.h: ANSI X3.159 1989 library header, section 4.12 */
- /* Copyright (C) Codemist Ltd. */
- /* version 0.02 */
- /* Copyright (C) SGS-THOMSON Microelectronics Ltd. 1996 */
- #ifndef __time_h
- #define __time_h
- #ifdef __cplusplus
- extern "C" {
- #endif
- #ifndef __size_t
- #define __size_t 1
- typedef unsigned int size_t; /* from <stddef.h> */
- #endif
- #ifndef NULL
- # ifdef __cplusplus
- # define NULL 0
- # else
- # define NULL (void *)0
- # endif
- #endif
- #ifndef __clock_t
- #define __clock_t
- typedef unsigned int clock_t;
- #endif
- #ifndef __time_t
- #define __time_t
- typedef unsigned long time_t;
- #endif
- /*
- * CLOCKS_PER_SEC is 15625 (low priority clock)
- */
- #define CLOCKS_PER_SEC 15625
- struct tm {
- int tm_sec; /* seconds after the minute, 0 to 60
- (0 - 60 allows for the occasional leap second) */
- int tm_min; /* minutes after the hour, 0 to 59 */
- int tm_hour; /* hours since midnight, 0 to 23 */
- int tm_mday; /* day of the month, 1 to 31 */
- int tm_mon; /* months since January, 0 to 11 */
- int tm_year; /* years since 1900 */
- int tm_wday; /* days since Sunday, 0 to 6 */
- int tm_yday; /* days since January 1, 0 to 365 */
- int tm_isdst; /* Daylight Savings Time flag */
- };
- extern clock_t clock(void);
- extern double difftime(time_t /*time1*/, time_t /*time0*/);
- #pragma ST_nosideeffects(difftime)
- extern time_t mktime(struct tm * /*timeptr*/);
- extern char *asctime(const struct tm * /*timeptr*/);
- extern char *ctime(const time_t * /*timer*/);
- extern struct tm *gmtime(const time_t * /*timer*/);
- extern struct tm *localtime(const time_t * /*timer*/);
- extern size_t strftime(char * /*s*/, size_t /*maxsize*/,
- const char * /*format*/, const struct tm * /*timeptr*/);
- extern time_t time(time_t * /*timeptr*/);
- /*
- * {: INSbl17158: porting the OS21 implementation of STPT to OS20.
- */
- /* time_t defn exists above */
- /* POSIX 14.2.1 */
- struct timespec
- {
- time_t tv_sec; /* Seconds */
- long tv_nsec; /* Nanoseconds */
- };
- typedef int clockid_t;
- /* POSIX 14.1.4 */
- #define CLOCK_REALTIME ((clockid_t)7)
- /* POSIX 4.5.2 */
- /* time() denf exists above */
- /* POSIX 14.2.1 */
- int clock_settime(clockid_t clockid, const struct timespec* tp);
- int clock_gettime(clockid_t clockid, struct timespec* tp);
- int clock_getres(clockid_t clockid, struct timespec* res);
- /* POSIX 14.2.5 */
- int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
- /*
- * }: INSbl17158: porting the OS21 implementation of STPT to OS20.
- */
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* end of time.h */