sl@0: /* sl@0: * Copyright (c) 1989, 1993 sl@0: * The Regents of the University of California. All rights reserved. sl@0: * (c) UNIX System Laboratories, Inc. sl@0: * All or some portions of this file are derived from material licensed sl@0: * to the University of California by American Telephone and Telegraph sl@0: * Co. or Unix System Laboratories, Inc. and are reproduced herein with sl@0: * the permission of UNIX System Laboratories, Inc. sl@0: * sl@0: * Redistribution and use in source and binary forms, with or without sl@0: * modification, are permitted provided that the following conditions sl@0: * are met: sl@0: * 1. Redistributions of source code must retain the above copyright sl@0: * notice, this list of conditions and the following disclaimer. sl@0: * 2. Redistributions in binary form must reproduce the above copyright sl@0: * notice, this list of conditions and the following disclaimer in the sl@0: * documentation and/or other materials provided with the distribution. sl@0: * 4. Neither the name of the University nor the names of its contributors sl@0: * may be used to endorse or promote products derived from this software sl@0: * without specific prior written permission. sl@0: * sl@0: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND sl@0: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE sl@0: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE sl@0: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE sl@0: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL sl@0: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS sl@0: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) sl@0: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT sl@0: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY sl@0: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF sl@0: * SUCH DAMAGE. sl@0: * sl@0: * @(#)time.h 8.3 (Berkeley) 1/21/94 sl@0: * © Portions Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. sl@0: */ sl@0: sl@0: /* sl@0: * $FreeBSD: src/include/time.h,v 1.32 2005/04/02 12:33:27 das Exp $ sl@0: */ sl@0: sl@0: #ifndef _TIME_H_ sl@0: #define _TIME_H_ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #ifdef __SYMBIAN32__ sl@0: #include sl@0: #endif sl@0: sl@0: #if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE sl@0: /* sl@0: * Frequency of the clock ticks reported by times(). Deprecated - use sl@0: * sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.) sl@0: */ sl@0: #ifdef __SYMBIAN32__ sl@0: #define CLK_TCK 128 sl@0: #endif //__SYMBIAN32__ sl@0: #endif sl@0: sl@0: /* Frequency of the clock ticks reported by clock(). */ sl@0: #ifndef __SYMBIAN32__ sl@0: #define CLOCKS_PER_SEC 128 sl@0: #endif //__SYMBIAN32__ sl@0: sl@0: #ifndef _CLOCK_T_DECLARED sl@0: typedef __clock_t clock_t; sl@0: #define _CLOCK_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _TIME_T_DECLARED sl@0: typedef __time_t time_t; sl@0: #define _TIME_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _SIZE_T_DECLARED sl@0: typedef __size_t size_t; sl@0: #define _SIZE_T_DECLARED sl@0: #endif sl@0: sl@0: #if __POSIX_VISIBLE >= 199309 sl@0: /* sl@0: * New in POSIX 1003.1b-1993. sl@0: */ sl@0: #ifndef _CLOCKID_T_DECLARED sl@0: typedef __clockid_t clockid_t; sl@0: #define _CLOCKID_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _TIMER_T_DECLARED sl@0: typedef __timer_t timer_t; sl@0: #define _TIMER_T_DECLARED sl@0: #endif sl@0: sl@0: #include sl@0: sl@0: /* POSIX.1b structure for timer start values and intervals. */ sl@0: struct itimerspec sl@0: { sl@0: struct timespec it_interval; sl@0: struct timespec it_value; sl@0: }; sl@0: sl@0: /* We can use a simple forward declaration. */ sl@0: struct sigevent; sl@0: #endif /* __POSIX_VISIBLE >= 199309 */ sl@0: sl@0: /* These macros are also in sys/time.h. */ sl@0: #if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 sl@0: #define CLOCK_REALTIME 0 sl@0: #ifdef __BSD_VISIBLE sl@0: #define CLOCK_VIRTUAL 1 sl@0: #define CLOCK_PROF 2 sl@0: #endif sl@0: #define CLOCK_MONOTONIC 4 sl@0: #endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */ sl@0: sl@0: #if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 sl@0: #if __BSD_VISIBLE sl@0: #define TIMER_RELTIME 0x0 /* relative timer */ sl@0: #endif sl@0: #define TIMER_ABSTIME 0x1 /* absolute timer */ sl@0: #endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */ sl@0: sl@0: struct tm { sl@0: int tm_sec; /* seconds after the minute [0-60] */ sl@0: int tm_min; /* minutes after the hour [0-59] */ sl@0: int tm_hour; /* hours since midnight [0-23] */ sl@0: int tm_mday; /* day of the month [1-31] */ sl@0: int tm_mon; /* months since January [0-11] */ sl@0: int tm_year; /* years since 1900 */ sl@0: int tm_wday; /* days since Sunday [0-6] */ sl@0: int tm_yday; /* days since January 1 [0-365] */ sl@0: int tm_isdst; /* Daylight Savings Time flag */ sl@0: long tm_gmtoff; /* offset from UTC in seconds */ sl@0: char *tm_zone; /* timezone abbreviation */ sl@0: }; sl@0: sl@0: #if __POSIX_VISIBLE sl@0: extern char *tzname[]; sl@0: #endif sl@0: sl@0: __BEGIN_DECLS sl@0: #ifdef __SYMBIAN32__ sl@0: #ifdef __WINSCW__ sl@0: #ifndef __SOFTFP sl@0: #define __SOFTFP sl@0: #endif /* __SOFTFP */ sl@0: #endif//__WINSCW__ sl@0: IMPORT_C char*** __tzname(void); sl@0: #define tzname (*__tzname()) sl@0: #endif //__SYMBIAN32__ sl@0: sl@0: IMPORT_C sl@0: char *asctime(const struct tm *); sl@0: IMPORT_C sl@0: clock_t clock(void); sl@0: IMPORT_C sl@0: char *ctime(const time_t *); sl@0: IMPORT_C sl@0: double difftime(time_t, time_t) __SOFTFP; sl@0: /* XXX missing: getdate() */ sl@0: IMPORT_C sl@0: struct tm *gmtime(const time_t *); sl@0: IMPORT_C sl@0: struct tm *localtime(const time_t *); sl@0: IMPORT_C sl@0: time_t mktime(struct tm *); sl@0: IMPORT_C sl@0: size_t strftime(char * __restrict, size_t, const char * __restrict, sl@0: const struct tm * __restrict); sl@0: IMPORT_C sl@0: time_t time(time_t *); sl@0: sl@0: #if __POSIX_VISIBLE sl@0: IMPORT_C sl@0: void tzset(void); sl@0: #endif sl@0: sl@0: #if __POSIX_VISIBLE >= 199309 sl@0: IMPORT_C sl@0: int clock_getres(clockid_t, struct timespec *); sl@0: IMPORT_C sl@0: int clock_gettime(clockid_t, struct timespec *); sl@0: IMPORT_C sl@0: int clock_settime(clockid_t, const struct timespec *); sl@0: /* XXX missing: clock_nanosleep() */ sl@0: IMPORT_C sl@0: int nanosleep(const struct timespec *, struct timespec *); sl@0: sl@0: //////////////////////////LIBRT: START///////////////////////////////// sl@0: sl@0: /* Create new per-process timer using CLOCK_ID. */ sl@0: IMPORT_C int timer_create (clockid_t __clock_id, sl@0: struct sigevent *__restrict __evp, sl@0: timer_t *__restrict __timerid); sl@0: sl@0: /* Delete timer TIMERID. */ sl@0: IMPORT_C int timer_delete (timer_t __timerid); sl@0: sl@0: /* Set timer TIMERID to VALUE, returning old value in OVLAUE. */ sl@0: IMPORT_C int timer_settime (timer_t __timerid, int __flags, sl@0: const struct itimerspec *__restrict __value, sl@0: struct itimerspec *__restrict __ovalue); sl@0: sl@0: /* Get current value of timer TIMERID and store it in VLAUE. */ sl@0: IMPORT_C int timer_gettime (timer_t __timerid, struct itimerspec *__value); sl@0: sl@0: /* Get expiration overrun for timer TIMERID. */ sl@0: IMPORT_C int timer_getoverrun (timer_t __timerid); sl@0: sl@0: IMPORT_C int clock_nanosleep(clockid_t clock_id, int flags, sl@0: const struct timespec *rqtp, struct timespec *rmtp); sl@0: //////////////////////////LIBRT: END///////////////////////////////// sl@0: sl@0: #endif /* __POSIX_VISIBLE >= 199309 */ sl@0: sl@0: #ifdef __SYMBIAN32__ sl@0: IMPORT_C sl@0: int clock_getcpuclockid(pid_t , clockid_t *); sl@0: #endif //__SYMBIAN32__ sl@0: sl@0: sl@0: #if __POSIX_VISIBLE >= 199506 sl@0: IMPORT_C sl@0: char *asctime_r(const struct tm *, char *); sl@0: IMPORT_C sl@0: char *ctime_r(const time_t *, char *); sl@0: IMPORT_C sl@0: struct tm *gmtime_r(const time_t *, struct tm *); sl@0: IMPORT_C sl@0: struct tm *localtime_r(const time_t *, struct tm *); sl@0: #endif sl@0: sl@0: #if __XSI_VISIBLE sl@0: IMPORT_C sl@0: char *strptime(const char * __restrict, const char * __restrict, sl@0: struct tm * __restrict); sl@0: #endif sl@0: sl@0: #if __BSD_VISIBLE sl@0: char *timezone(int, int); /* XXX XSI conflict */ sl@0: #ifndef __SYMBIAN32__ sl@0: void tzsetwall(void); sl@0: #endif //__SYMBIAN32__ sl@0: time_t timelocal(struct tm * const); sl@0: IMPORT_C time_t timegm(struct tm * const); sl@0: #endif /* __BSD_VISIBLE */ sl@0: __END_DECLS sl@0: sl@0: #endif /* !_TIME_H_ */