epoc32/include/libc/time.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/libc/time.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/libc/time.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,105 @@
     1.4 -time.h
     1.5 +/*
     1.6 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:
    1.19 +* Struct and function declarations for dealing with time.
    1.20 +* 
    1.21 +*
    1.22 +*/
    1.23 +
    1.24 +
    1.25 +
    1.26 +
    1.27 +
    1.28 +
    1.29 +
    1.30 +/**
    1.31 + @file
    1.32 + @publishedAll
    1.33 + @released
    1.34 +*/
    1.35 +
    1.36 +#ifndef _TIME_H_
    1.37 +#define _TIME_H_
    1.38 +
    1.39 +#ifdef __cplusplus
    1.40 +extern "C" {
    1.41 +#endif
    1.42 +
    1.43 +#include "_ansi.h"
    1.44 +
    1.45 +#ifndef NULL
    1.46 +#define	NULL	0L
    1.47 +#endif
    1.48 +
    1.49 +#include <machine/types.h>	/* Get _CLOCK_T_ and _TIME_T_.  */
    1.50 +
    1.51 +#define __need_size_t
    1.52 +#include <stddef.h>
    1.53 +
    1.54 +#ifndef __clock_t_defined
    1.55 +typedef _CLOCK_T_ clock_t;
    1.56 +#define __clock_t_defined
    1.57 +#endif
    1.58 +
    1.59 +#ifndef __time_t_defined
    1.60 +#ifndef _TIME_T_DEFINED
    1.61 +#define __time_t_defined
    1.62 +#define _TIME_T_DEFINED
    1.63 +typedef _TIME_T_ time_t;
    1.64 +#endif //__time_t_defined
    1.65 +#endif //_TIME_T_DEFINED
    1.66 +
    1.67 +#ifndef __ARMCC__
    1.68 +#define __SOFTFP
    1.69 +#endif
    1.70 +
    1.71 +struct tm
    1.72 +{
    1.73 +  int	tm_sec;		/* seconds (0-59) */
    1.74 +  int	tm_min;		/* minutes (0-59) */
    1.75 +  int	tm_hour;	/* hours since midnight (0-23) */
    1.76 +  int	tm_mday;	/* day of month (1-31) */
    1.77 +  int	tm_mon;		/* month (0-11, January = 0) */
    1.78 +  int	tm_year;	/* years since 1900 */
    1.79 +  int	tm_wday;	/* day of week (0-6, Sunday = 0) */
    1.80 +  int	tm_yday;	/* day of year (0-365, Jan 1st = 0) */
    1.81 +  int	tm_isdst;	/* negative means dst status unknown */
    1.82 +};
    1.83 +
    1.84 +IMPORT_C clock_t	clock		(void);
    1.85 +IMPORT_C double		difftime	(time_t _time2, time_t _time1) __SOFTFP;
    1.86 +IMPORT_C time_t		mktime		(struct tm *_timeptr);
    1.87 +IMPORT_C time_t		time		(time_t *_timer);
    1.88 +IMPORT_C size_t		strftime	(char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t);
    1.89 +#ifndef _REENT_ONLY
    1.90 +IMPORT_C char*		asctime		(const struct tm *_tblock);
    1.91 +IMPORT_C char*		ctime		(const time_t *_time);
    1.92 +IMPORT_C struct tm*	gmtime		(const time_t *_timer);
    1.93 +IMPORT_C struct tm*	localtime	(const time_t *_timer);
    1.94 +#endif
    1.95 +
    1.96 +/**
    1.97 +Re-entrant versions of the functions that return pointers to
    1.98 +a statically allocated buffer. These are internal to the STDLIB
    1.99 +implementation and not standard ANSI functions
   1.100 +*/
   1.101 +IMPORT_C char*		asctime_r	(const struct tm *, char *);
   1.102 +IMPORT_C char*		ctime_r		(const time_t *, char *);
   1.103 +IMPORT_C struct tm*	gmtime_r	(const time_t *, struct tm *);
   1.104 +IMPORT_C struct tm*	localtime_r	(const time_t *, struct tm *);
   1.105 +
   1.106 +#ifdef __cplusplus
   1.107 +}
   1.108 +#endif
   1.109 +#endif /* _TIME_H_ */