sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Struct and function declarations for dealing with time. sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: #ifndef _TIME_H_ sl@0: #define _TIME_H_ sl@0: sl@0: #ifdef __cplusplus sl@0: extern "C" { sl@0: #endif sl@0: sl@0: #include "_ansi.h" sl@0: sl@0: #ifndef NULL sl@0: #define NULL 0L sl@0: #endif sl@0: sl@0: #include /* Get _CLOCK_T_ and _TIME_T_. */ sl@0: sl@0: #define __need_size_t sl@0: #include sl@0: sl@0: #ifndef __clock_t_defined sl@0: typedef _CLOCK_T_ clock_t; sl@0: #define __clock_t_defined sl@0: #endif sl@0: sl@0: #ifndef __time_t_defined sl@0: #ifndef _TIME_T_DEFINED sl@0: #define __time_t_defined sl@0: #define _TIME_T_DEFINED sl@0: typedef _TIME_T_ time_t; sl@0: #endif //__time_t_defined sl@0: #endif //_TIME_T_DEFINED sl@0: sl@0: #ifndef __ARMCC__ sl@0: #define __SOFTFP sl@0: #endif sl@0: sl@0: struct tm sl@0: { sl@0: int tm_sec; /* seconds (0-59) */ sl@0: int tm_min; /* minutes (0-59) */ sl@0: int tm_hour; /* hours since midnight (0-23) */ sl@0: int tm_mday; /* day of month (1-31) */ sl@0: int tm_mon; /* month (0-11, January = 0) */ sl@0: int tm_year; /* years since 1900 */ sl@0: int tm_wday; /* day of week (0-6, Sunday = 0) */ sl@0: int tm_yday; /* day of year (0-365, Jan 1st = 0) */ sl@0: int tm_isdst; /* negative means dst status unknown */ sl@0: }; sl@0: sl@0: IMPORT_C clock_t clock (void); sl@0: IMPORT_C double difftime (time_t _time2, time_t _time1) __SOFTFP; sl@0: IMPORT_C time_t mktime (struct tm *_timeptr); sl@0: IMPORT_C time_t time (time_t *_timer); sl@0: IMPORT_C size_t strftime (char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t); sl@0: #ifndef _REENT_ONLY sl@0: IMPORT_C char* asctime (const struct tm *_tblock); sl@0: IMPORT_C char* ctime (const time_t *_time); sl@0: IMPORT_C struct tm* gmtime (const time_t *_timer); sl@0: IMPORT_C struct tm* localtime (const time_t *_timer); sl@0: #endif sl@0: sl@0: /** sl@0: Re-entrant versions of the functions that return pointers to sl@0: a statically allocated buffer. These are internal to the STDLIB sl@0: implementation and not standard ANSI functions sl@0: */ sl@0: IMPORT_C char* asctime_r (const struct tm *, char *); sl@0: IMPORT_C char* ctime_r (const time_t *, char *); sl@0: IMPORT_C struct tm* gmtime_r (const time_t *, struct tm *); sl@0: IMPORT_C struct tm* localtime_r (const time_t *, struct tm *); sl@0: sl@0: #ifdef __cplusplus sl@0: } sl@0: #endif sl@0: #endif /* _TIME_H_ */