Search
lxdream.org :: lxdream/test/include/time.h
lxdream 0.9.1
released Jun 29
Download Now
filename test/include/time.h
changeset 185:6755a04c447f
author nkeynes
date Tue Jul 11 01:35:27 2006 +0000 (16 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
file annotate diff log raw
nkeynes@185
     1
/*
nkeynes@185
     2
 * time.h
nkeynes@185
     3
 * 
nkeynes@185
     4
 * Struct and function declarations for dealing with time.
nkeynes@185
     5
 */
nkeynes@185
     6
nkeynes@185
     7
#ifndef _TIME_H_
nkeynes@185
     8
#define _TIME_H_
nkeynes@185
     9
nkeynes@185
    10
#include "_ansi.h"
nkeynes@185
    11
nkeynes@185
    12
#ifdef __cplusplus
nkeynes@185
    13
extern "C" {
nkeynes@185
    14
#endif
nkeynes@185
    15
nkeynes@185
    16
#ifndef NULL
nkeynes@185
    17
#define	NULL	0
nkeynes@185
    18
#endif
nkeynes@185
    19
nkeynes@185
    20
/* Get _CLOCKS_PER_SEC_ */
nkeynes@185
    21
#include <machine/time.h>
nkeynes@185
    22
nkeynes@185
    23
#ifndef _CLOCKS_PER_SEC_
nkeynes@185
    24
#define _CLOCKS_PER_SEC_ 1000
nkeynes@185
    25
#endif
nkeynes@185
    26
nkeynes@185
    27
#define CLOCKS_PER_SEC _CLOCKS_PER_SEC_
nkeynes@185
    28
#define CLK_TCK CLOCKS_PER_SEC
nkeynes@185
    29
#define __need_size_t
nkeynes@185
    30
#include <stddef.h>
nkeynes@185
    31
nkeynes@185
    32
/* Get _CLOCK_T_ and _TIME_T_.  */
nkeynes@185
    33
#include <machine/types.h>
nkeynes@185
    34
nkeynes@185
    35
#ifndef __clock_t_defined
nkeynes@185
    36
typedef _CLOCK_T_ clock_t;
nkeynes@185
    37
#define __clock_t_defined
nkeynes@185
    38
#endif
nkeynes@185
    39
nkeynes@185
    40
#ifndef __time_t_defined
nkeynes@185
    41
typedef _TIME_T_ time_t;
nkeynes@185
    42
#define __time_t_defined
nkeynes@185
    43
#endif
nkeynes@185
    44
nkeynes@185
    45
struct tm
nkeynes@185
    46
{
nkeynes@185
    47
  int	tm_sec;
nkeynes@185
    48
  int	tm_min;
nkeynes@185
    49
  int	tm_hour;
nkeynes@185
    50
  int	tm_mday;
nkeynes@185
    51
  int	tm_mon;
nkeynes@185
    52
  int	tm_year;
nkeynes@185
    53
  int	tm_wday;
nkeynes@185
    54
  int	tm_yday;
nkeynes@185
    55
  int	tm_isdst;
nkeynes@185
    56
};
nkeynes@185
    57
nkeynes@185
    58
clock_t	   _EXFUN(clock,    (void));
nkeynes@185
    59
double	   _EXFUN(difftime, (time_t _time2, time_t _time1));
nkeynes@185
    60
time_t	   _EXFUN(mktime,   (struct tm *_timeptr));
nkeynes@185
    61
time_t	   _EXFUN(time,     (time_t *_timer));
nkeynes@185
    62
#ifndef _REENT_ONLY
nkeynes@185
    63
char	  *_EXFUN(asctime,  (const struct tm *_tblock));
nkeynes@185
    64
char	  *_EXFUN(ctime,    (const time_t *_time));
nkeynes@185
    65
struct tm *_EXFUN(gmtime,   (const time_t *_timer));
nkeynes@185
    66
struct tm *_EXFUN(localtime,(const time_t *_timer));
nkeynes@185
    67
#endif
nkeynes@185
    68
size_t	   _EXFUN(strftime, (char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t));
nkeynes@185
    69
nkeynes@185
    70
char	  *_EXFUN(asctime_r,	(const struct tm *, char *));
nkeynes@185
    71
char	  *_EXFUN(ctime_r,	(const time_t *, char *));
nkeynes@185
    72
struct tm *_EXFUN(gmtime_r,	(const time_t *, struct tm *));
nkeynes@185
    73
struct tm *_EXFUN(localtime_r,	(const time_t *, struct tm *));
nkeynes@185
    74
nkeynes@185
    75
#ifdef __CYGWIN32__
nkeynes@185
    76
#ifndef __STRICT_ANSI__
nkeynes@185
    77
extern time_t _timezone __declspec(dllimport);
nkeynes@185
    78
extern int _daylight __declspec(dllimport);
nkeynes@185
    79
extern char *_tzname[2] __declspec(dllimport);
nkeynes@185
    80
nkeynes@185
    81
char *_EXFUN(timezone, (void));
nkeynes@185
    82
void _EXFUN(tzset, (void));
nkeynes@185
    83
#endif
nkeynes@185
    84
#endif /* __CYGWIN32__ */
nkeynes@185
    85
nkeynes@185
    86
#ifdef __cplusplus
nkeynes@185
    87
}
nkeynes@185
    88
#endif
nkeynes@185
    89
#endif /* _TIME_H_ */
nkeynes@185
    90
.