epoc32/include/libc/time.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000 (2010-03-16)
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 
    24 
    25 
    26 /**
    27  @file
    28  @publishedAll
    29  @released
    30 */
    31 
    32 #ifndef _TIME_H_
    33 #define _TIME_H_
    34 
    35 #ifdef __cplusplus
    36 extern "C" {
    37 #endif
    38 
    39 #include "_ansi.h"
    40 
    41 #ifndef NULL
    42 #define	NULL	0L
    43 #endif
    44 
    45 #include <machine/types.h>	/* Get _CLOCK_T_ and _TIME_T_.  */
    46 
    47 #define __need_size_t
    48 #include <stddef.h>
    49 
    50 #ifndef __clock_t_defined
    51 typedef _CLOCK_T_ clock_t;
    52 #define __clock_t_defined
    53 #endif
    54 
    55 #ifndef __time_t_defined
    56 #ifndef _TIME_T_DEFINED
    57 #define __time_t_defined
    58 #define _TIME_T_DEFINED
    59 typedef _TIME_T_ time_t;
    60 #endif //__time_t_defined
    61 #endif //_TIME_T_DEFINED
    62 
    63 #ifndef __ARMCC__
    64 #define __SOFTFP
    65 #endif
    66 
    67 struct tm
    68 {
    69   int	tm_sec;		/* seconds (0-59) */
    70   int	tm_min;		/* minutes (0-59) */
    71   int	tm_hour;	/* hours since midnight (0-23) */
    72   int	tm_mday;	/* day of month (1-31) */
    73   int	tm_mon;		/* month (0-11, January = 0) */
    74   int	tm_year;	/* years since 1900 */
    75   int	tm_wday;	/* day of week (0-6, Sunday = 0) */
    76   int	tm_yday;	/* day of year (0-365, Jan 1st = 0) */
    77   int	tm_isdst;	/* negative means dst status unknown */
    78 };
    79 
    80 IMPORT_C clock_t	clock		(void);
    81 IMPORT_C double		difftime	(time_t _time2, time_t _time1) __SOFTFP;
    82 IMPORT_C time_t		mktime		(struct tm *_timeptr);
    83 IMPORT_C time_t		time		(time_t *_timer);
    84 IMPORT_C size_t		strftime	(char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t);
    85 #ifndef _REENT_ONLY
    86 IMPORT_C char*		asctime		(const struct tm *_tblock);
    87 IMPORT_C char*		ctime		(const time_t *_time);
    88 IMPORT_C struct tm*	gmtime		(const time_t *_timer);
    89 IMPORT_C struct tm*	localtime	(const time_t *_timer);
    90 #endif
    91 
    92 /**
    93 Re-entrant versions of the functions that return pointers to
    94 a statically allocated buffer. These are internal to the STDLIB
    95 implementation and not standard ANSI functions
    96 */
    97 IMPORT_C char*		asctime_r	(const struct tm *, char *);
    98 IMPORT_C char*		ctime_r		(const time_t *, char *);
    99 IMPORT_C struct tm*	gmtime_r	(const time_t *, struct tm *);
   100 IMPORT_C struct tm*	localtime_r	(const time_t *, struct tm *);
   101 
   102 #ifdef __cplusplus
   103 }
   104 #endif
   105 #endif /* _TIME_H_ */