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