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