os/ossrv/genericopenlibs/cstdlib/LINC/TIME.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/LINC/TIME.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,101 @@
     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 +* Struct and function declarations for dealing with time.
    1.19 +* 
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +
    1.25 +/**
    1.26 + @file
    1.27 + @publishedAll
    1.28 + @released
    1.29 +*/
    1.30 +
    1.31 +#ifndef _TIME_H_
    1.32 +#define _TIME_H_
    1.33 +
    1.34 +#ifdef __cplusplus
    1.35 +extern "C" {
    1.36 +#endif
    1.37 +
    1.38 +#include "_ansi.h"
    1.39 +
    1.40 +#ifndef NULL
    1.41 +#define	NULL	0L
    1.42 +#endif
    1.43 +
    1.44 +#include <libc/machine/types.h>	/* Get _CLOCK_T_ and _TIME_T_.  */
    1.45 +
    1.46 +#define __need_size_t
    1.47 +#include <stddef.h>
    1.48 +
    1.49 +#ifndef __clock_t_defined
    1.50 +typedef _CLOCK_T_ clock_t;
    1.51 +#define __clock_t_defined
    1.52 +#endif
    1.53 +
    1.54 +#ifndef __time_t_defined
    1.55 +#ifndef _TIME_T_DEFINED
    1.56 +#define __time_t_defined
    1.57 +#define _TIME_T_DEFINED
    1.58 +typedef _TIME_T_ time_t;
    1.59 +#endif //__time_t_defined
    1.60 +#endif //_TIME_T_DEFINED
    1.61 +
    1.62 +#ifndef __ARMCC__
    1.63 +#define __SOFTFP
    1.64 +#endif
    1.65 +
    1.66 +struct tm
    1.67 +{
    1.68 +  int	tm_sec;		/* seconds (0-59) */
    1.69 +  int	tm_min;		/* minutes (0-59) */
    1.70 +  int	tm_hour;	/* hours since midnight (0-23) */
    1.71 +  int	tm_mday;	/* day of month (1-31) */
    1.72 +  int	tm_mon;		/* month (0-11, January = 0) */
    1.73 +  int	tm_year;	/* years since 1900 */
    1.74 +  int	tm_wday;	/* day of week (0-6, Sunday = 0) */
    1.75 +  int	tm_yday;	/* day of year (0-365, Jan 1st = 0) */
    1.76 +  int	tm_isdst;	/* negative means dst status unknown */
    1.77 +};
    1.78 +
    1.79 +IMPORT_C clock_t	clock		(void);
    1.80 +IMPORT_C double		difftime	(time_t _time2, time_t _time1) __SOFTFP;
    1.81 +IMPORT_C time_t		mktime		(struct tm *_timeptr);
    1.82 +IMPORT_C time_t		time		(time_t *_timer);
    1.83 +IMPORT_C size_t		strftime	(char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t);
    1.84 +#ifndef _REENT_ONLY
    1.85 +IMPORT_C char*		asctime		(const struct tm *_tblock);
    1.86 +IMPORT_C char*		ctime		(const time_t *_time);
    1.87 +IMPORT_C struct tm*	gmtime		(const time_t *_timer);
    1.88 +IMPORT_C struct tm*	localtime	(const time_t *_timer);
    1.89 +#endif
    1.90 +
    1.91 +/**
    1.92 +Re-entrant versions of the functions that return pointers to
    1.93 +a statically allocated buffer. These are internal to the STDLIB
    1.94 +implementation and not standard ANSI functions
    1.95 +*/
    1.96 +IMPORT_C char*		asctime_r	(const struct tm *, char *);
    1.97 +IMPORT_C char*		ctime_r		(const time_t *, char *);
    1.98 +IMPORT_C struct tm*	gmtime_r	(const time_t *, struct tm *);
    1.99 +IMPORT_C struct tm*	localtime_r	(const time_t *, struct tm *);
   1.100 +
   1.101 +#ifdef __cplusplus
   1.102 +}
   1.103 +#endif
   1.104 +#endif /* _TIME_H_ */