os/ossrv/genericopenlibs/cstdlib/LTIME/LCLTIME.C
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/LTIME/LCLTIME.C	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,70 @@
     1.4 +/*
     1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +* FUNCTION
    1.19 +* <<localtime>>---convert time to local representation
    1.20 +* INDEX
    1.21 +* localtime
    1.22 +* ANSI_SYNOPSIS
    1.23 +* #include <time.h>
    1.24 +* struct tm *localtime(time_t *<[clock]>);
    1.25 +* struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>);
    1.26 +* TRAD_SYNOPSIS
    1.27 +* #include <time.h>
    1.28 +* struct tm *localtime(<[clock]>)
    1.29 +* time_t *<[clock]>;
    1.30 +* struct tm *localtime(<[clock]>, <[res]>)
    1.31 +* time_t *<[clock]>;
    1.32 +* struct tm *<[res]>;
    1.33 +* <<localtime>> converts the time at <[clock]> into local time, then
    1.34 +* converts its representation from the arithmetic representation to the
    1.35 +* traditional representation defined by <<struct tm>>.
    1.36 +* <<localtime>> constructs the traditional time representation in static
    1.37 +* storage; each call to <<gmtime>> or <<localtime>> will overwrite the
    1.38 +* information generated by previous calls to either function.
    1.39 +* <<mktime>> is the inverse of <<localtime>>.
    1.40 +* RETURNS
    1.41 +* A pointer to the traditional time representation (<<struct tm>>).
    1.42 +* PORTABILITY
    1.43 +* ANSI C requires <<localtime>>.
    1.44 +* <<localtime>> requires no supporting OS subroutines.
    1.45 +* 
    1.46 +*
    1.47 +*/
    1.48 +
    1.49 +
    1.50 +
    1.51 +#include <time.h>
    1.52 +#include <sys/reent.h>
    1.53 +
    1.54 +#ifndef _REENT_ONLY
    1.55 +
    1.56 +/**
    1.57 +Convert time_t value to tm structure as local time.
    1.58 +Converts timer to tm structure adjusting to the local time zone.
    1.59 +@return A pointer to a tm structure.
    1.60 +This structure is statically allocated and shared by gmtime, 
    1.61 +localtime and ctime functions.
    1.62 +Each time one of these functions is called the content 
    1.63 +of the structure is overwritten.
    1.64 +@param tim_p pointer to a time_t value, 
    1.65 +usually returned by time function.
    1.66 +*/
    1.67 +EXPORT_C struct tm *
    1.68 +localtime (const time_t * tim_p)
    1.69 +{
    1.70 +  return localtime_r (tim_p, &(_REENT->_struct_tm));
    1.71 +}
    1.72 +
    1.73 +#endif