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: * FUNCTION sl@0: * <>---format time as string sl@0: * INDEX sl@0: * asctime sl@0: * INDEX sl@0: * _asctime_r sl@0: * ANSI_SYNOPSIS sl@0: * #include sl@0: * char *asctime(const struct tm *<[clock]>); sl@0: * char *asctime_r(const struct tm *<[clock]>, char *<[buf]>); sl@0: * TRAD_SYNOPSIS sl@0: * #include sl@0: * char *asctime(<[clock]>) sl@0: * struct tm *<[clock]>; sl@0: * char *asctime_r(<[clock]>) sl@0: * struct tm *<[clock]>; sl@0: * char *<[buf]>; sl@0: * Format the time value at <[clock]> into a string of the form sl@0: * . Wed Jun 15 11:38:07 1988\n\0 sl@0: * The string is generated in a static buffer; each call to <> sl@0: * overwrites the string generated by previous calls. sl@0: * RETURNS sl@0: * A pointer to the string containing a formatted timestamp. sl@0: * PORTABILITY sl@0: * ANSI C requires <>. sl@0: * <> requires no supporting OS subroutines. sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include sl@0: #include sl@0: sl@0: #ifndef _REENT_ONLY sl@0: sl@0: /** sl@0: Convert tm structure to string. sl@0: Converts data pointed by tim_p to a string containing time and date in readable format. sl@0: @return A pointer to the string containing the date sl@0: and time information in readable format. sl@0: The string pointed is statically allocated and sl@0: shared by ctime and asctime functions. sl@0: Each time one of these functions is called the content of the string is overwritten. sl@0: @param tim_p Pointer to tm structure containing time and date information to be converted. sl@0: */ sl@0: EXPORT_C char * sl@0: asctime (const struct tm *tim_p) sl@0: { sl@0: return asctime_r (tim_p, _REENT->_asctime); sl@0: } sl@0: sl@0: #endif