diff -r 000000000000 -r bde4ae8d615e os/ossrv/genericopenlibs/cstdlib/LTIME/GMTIME.C --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/ossrv/genericopenlibs/cstdlib/LTIME/GMTIME.C Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* FUNCTION +* <>---convert time to UTC traditional form +* INDEX +* gmtime +* ANSI_SYNOPSIS +* #include +* struct tm *gmtime(const time_t *<[clock]>); +* struct tm *gmtime_r(const time_t *<[clock]>, struct tm *<[res]>); +* TRAD_SYNOPSIS +* #include +* struct tm *gmtime(<[clock]>) +* const time_t *<[clock]>; +* struct tm *gmtime_r(<[clock]>, <[res]>) +* const time_t *<[clock]>; +* struct tm *<[res]>; +* <> assumes the time at <[clock]> represents a local time. +* <> converts it to UTC (Universal Coordinated Time, also known in some +* countries as GMT, Greenwich Mean time), then converts the +* representation from the arithmetic representation to +* the traditional representation defined by <>. +* <> constructs the traditional time representation in static +* storage; each call to <> or <> will overwrite the +* information generated by previous calls to either function. +* RETURNS +* A pointer to the traditional time representation (<>). +* PORTABILITY +* ANSI C requires <>. +* <> requires no supporting OS subroutines. +* +* +*/ + + + +#include +#include + +#ifndef _REENT_ONLY + +/** +Convert time_t value to tm structure as UTC time. +Converts timer to tm structure adjusting to +UTC (formerly known as GMT) timezone. +@return A pointer to a tm structure. +This structure is statically allocated and shared by gmtime, +localtime and ctime functions. +Each time one of these functions is called the content of +the structure is overwritten. +@param tim_p pointer to a time_t value, +usually returned by time function. +*/ +EXPORT_C struct tm * +gmtime (const time_t * tim_p) +{ + return gmtime_r (tim_p, &(_REENT->_struct_tm)); +} + +#endif