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