1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/LTIME/CTIME.C Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,69 @@
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 +* <<ctime>>---convert time to local and format as string
1.20 +* INDEX
1.21 +* ctime
1.22 +* ANSI_SYNOPSIS
1.23 +* #include <time.h>
1.24 +* char *ctime(time_t <[clock]>);
1.25 +* char *ctime_r(time_t <[clock]>, char *<[buf]>);
1.26 +* TRAD_SYNOPSIS
1.27 +* #include <time.h>
1.28 +* char *ctime(<[clock]>)
1.29 +* time_t <[clock]>;
1.30 +* char *ctime_r(<[clock]>, <[buf]>)
1.31 +* time_t <[clock]>;
1.32 +* char *<[buf]>;
1.33 +* Convert the time value at <[clock]> to local time (like <<localtime>>)
1.34 +* and format it into a string of the form
1.35 +* . Wed Jun 15 11:38:07 1988\n\0
1.36 +* (like <<asctime>>).
1.37 +* RETURNS
1.38 +* A pointer to the string containing a formatted timestamp.
1.39 +* PORTABILITY
1.40 +* ANSI C requires <<ctime>>.
1.41 +* <<ctime>> requires no supporting OS subroutines.
1.42 +*
1.43 +*
1.44 +*/
1.45 +
1.46 +
1.47 +
1.48 +#include <time.h>
1.49 +#include <sys/reent.h>
1.50 +
1.51 +#ifndef _REENT_ONLY
1.52 +
1.53 +/**
1.54 +Convert time_t value to string.
1.55 +Converts tim_p to a string containing time
1.56 +and date adjusted to local time zone in readable format.
1.57 +@return A pointer to the string containing the date
1.58 +and time information in readable format.
1.59 +The string pointed is statically allocated
1.60 +and shared by ctime and asctime functions.
1.61 +Each time one of these functions is called
1.62 +the content of the string is overwritten.
1.63 +@param tim_p pointer to a time_t value,
1.64 +usually returned by time function.
1.65 +*/
1.66 +EXPORT_C char *
1.67 +ctime (const time_t * tim_p)
1.68 +{
1.69 + return ctime_r (tim_p, _REENT->_asctime);
1.70 +}
1.71 +
1.72 +#endif