source: trunk/src/emx/include/time.h@ 123

Last change on this file since 123 was 123, checked in by zap, 22 years ago

Started the work for re-designing the EMX C runtime library to not require
EMX.DLL. The new design is projected to be as follows:

  • all emx syscalls are replaced with the routines from the old sys.lib library which is now compilable in both a.out and OMF formats.
  • the sys.a library should be made replaceable and selectable by some gcc switch (e.g. -msyslib=emx would link with emx.a instead of sys.a which would give almost full backward compatibility with emx).
  • All C functions names were renamed to not contain the starting underscore (e.g. fopen and not _fopen). The underscored aliases will be added later with the c_alias library (which will be generated automatically from all public symbols of libc; any exported symbol that do not start with an underscore will be given an underscored alias unless such a symbol is already defined).

Also a lot of updates to the building system. It is now much faster (thanks
to Knut's suggestion of using ash's builtin echo).
Also re-wrote thunk1.asm and thunk2.asm to GAS format; this removes the need
for MASM and makes it possible to use 16-bit functions in a.out programs
without the need for EMX.DLL.
Also made a lot of small changes I don't remember now.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.8 KB
Line 
1/* time.h (emx+gcc) */
2
3#ifndef _TIME_H
4#define _TIME_H
5
6#if defined (__cplusplus)
7extern "C" {
8#endif
9
10#if !defined (_SIZE_T)
11#define _SIZE_T
12typedef unsigned long size_t;
13#endif
14
15#if !defined (NULL)
16#if defined (__cplusplus)
17#define NULL 0
18#else
19#define NULL ((void *)0)
20#endif
21#endif
22
23#if !defined (_TIME_T)
24#define _TIME_T
25typedef unsigned long time_t;
26#endif
27
28#if !defined (_CLOCK_T)
29#define _CLOCK_T
30typedef long clock_t;
31#endif
32
33#if !defined (_TM)
34#define _TM
35struct tm /* cf. <emx/thread.h> */
36{
37 int tm_sec; /* 0..59 */
38 int tm_min; /* 0..59 */
39 int tm_hour; /* 0..23 */
40 int tm_mday; /* 1..31 */
41 int tm_mon; /* 0..11 */
42 int tm_year; /* 0(:=1900).. */
43 int tm_wday; /* 0..6 */
44 int tm_yday; /* 0..365 */
45 int tm_isdst; /* 0 */
46};
47#endif
48
49#if !defined (CLOCKS_PER_SEC)
50#define CLOCKS_PER_SEC 100
51#endif
52
53char *asctime (__const__ struct tm *);
54char *ctime (__const__ time_t *);
55clock_t clock (void);
56double difftime (time_t, time_t);
57struct tm *gmtime (__const__ time_t *);
58struct tm *localtime (__const__ time_t *);
59time_t mktime (struct tm *);
60size_t strftime (char *, size_t, __const__ char *, __const__ struct tm *);
61time_t time (time_t *);
62
63
64#if !defined (__STRICT_ANSI__)
65
66/* POSIX.1 */
67
68void tzset (void);
69
70#endif
71
72
73#if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)
74
75#if !defined (CLK_TCK)
76#define CLK_TCK 100
77#endif
78
79extern int daylight;
80extern long timezone;
81extern char *tzname[2];
82
83char *strptime (__const__ char *, __const__ char *, struct tm *);
84
85#endif
86
87
88#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)) \
89 || defined (_WITH_UNDERSCORE)
90
91extern int _daylight;
92extern long _timezone;
93extern char *_tzname[2];
94
95char *_strptime (__const__ char *, __const__ char *, struct tm *);
96void _tzset (void);
97
98#endif
99
100
101#if defined (__cplusplus)
102}
103#endif
104
105#endif /* not _TIME_H */
Note: See TracBrowser for help on using the repository browser.