genericopenlibs/cstdlib/LINC/TIME.H
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Struct and function declarations for dealing with time.
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file
       
    24  @publishedAll
       
    25  @released
       
    26 */
       
    27 
       
    28 #ifndef _TIME_H_
       
    29 #define _TIME_H_
       
    30 
       
    31 #ifdef __cplusplus
       
    32 extern "C" {
       
    33 #endif
       
    34 
       
    35 #include "_ansi.h"
       
    36 
       
    37 #ifndef NULL
       
    38 #define	NULL	0L
       
    39 #endif
       
    40 
       
    41 #include <libc/machine/types.h>	/* Get _CLOCK_T_ and _TIME_T_.  */
       
    42 
       
    43 #define __need_size_t
       
    44 #include <stddef.h>
       
    45 
       
    46 #ifndef __clock_t_defined
       
    47 typedef _CLOCK_T_ clock_t;
       
    48 #define __clock_t_defined
       
    49 #endif
       
    50 
       
    51 #ifndef __time_t_defined
       
    52 #ifndef _TIME_T_DEFINED
       
    53 #define __time_t_defined
       
    54 #define _TIME_T_DEFINED
       
    55 typedef _TIME_T_ time_t;
       
    56 #endif //__time_t_defined
       
    57 #endif //_TIME_T_DEFINED
       
    58 
       
    59 #ifndef __ARMCC__
       
    60 #define __SOFTFP
       
    61 #endif
       
    62 
       
    63 struct tm
       
    64 {
       
    65   int	tm_sec;		/* seconds (0-59) */
       
    66   int	tm_min;		/* minutes (0-59) */
       
    67   int	tm_hour;	/* hours since midnight (0-23) */
       
    68   int	tm_mday;	/* day of month (1-31) */
       
    69   int	tm_mon;		/* month (0-11, January = 0) */
       
    70   int	tm_year;	/* years since 1900 */
       
    71   int	tm_wday;	/* day of week (0-6, Sunday = 0) */
       
    72   int	tm_yday;	/* day of year (0-365, Jan 1st = 0) */
       
    73   int	tm_isdst;	/* negative means dst status unknown */
       
    74 };
       
    75 
       
    76 IMPORT_C clock_t	clock		(void);
       
    77 IMPORT_C double		difftime	(time_t _time2, time_t _time1) __SOFTFP;
       
    78 IMPORT_C time_t		mktime		(struct tm *_timeptr);
       
    79 IMPORT_C time_t		time		(time_t *_timer);
       
    80 IMPORT_C size_t		strftime	(char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t);
       
    81 #ifndef _REENT_ONLY
       
    82 IMPORT_C char*		asctime		(const struct tm *_tblock);
       
    83 IMPORT_C char*		ctime		(const time_t *_time);
       
    84 IMPORT_C struct tm*	gmtime		(const time_t *_timer);
       
    85 IMPORT_C struct tm*	localtime	(const time_t *_timer);
       
    86 #endif
       
    87 
       
    88 /**
       
    89 Re-entrant versions of the functions that return pointers to
       
    90 a statically allocated buffer. These are internal to the STDLIB
       
    91 implementation and not standard ANSI functions
       
    92 */
       
    93 IMPORT_C char*		asctime_r	(const struct tm *, char *);
       
    94 IMPORT_C char*		ctime_r		(const time_t *, char *);
       
    95 IMPORT_C struct tm*	gmtime_r	(const time_t *, struct tm *);
       
    96 IMPORT_C struct tm*	localtime_r	(const time_t *, struct tm *);
       
    97 
       
    98 #ifdef __cplusplus
       
    99 }
       
   100 #endif
       
   101 #endif /* _TIME_H_ */