Bring cvs-1.12.9 into the CVS repository
[dragonfly.git] / contrib / cvs-1.12.9 / lib / xtime.h
1 /* This program is free software; you can redistribute it and/or modify
2    it under the terms of the GNU General Public License as published by
3    the Free Software Foundation; either version 2, or (at your option)
4    any later version.
5
6    This program is distributed in the hope that it will be useful,
7    but WITHOUT ANY WARRANTY; without even the implied warranty of
8    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9    GNU General Public License for more details.  */
10
11 /* This file simply performs the include magic necessary for using time
12  * functions
13  */
14
15 #ifdef vms
16 # include <time.h>
17 #else /* vms */
18
19 # if TIME_WITH_SYS_TIME
20 #   include <sys/time.h>
21 #   include <time.h>
22 # else /* TIME_WITH_SYS_TIME */
23 #   if HAVE_SYS_TIME_H
24 #     include <sys/time.h>
25 #   else /* HAVE_SYS_TIME_H */
26 #     include <time.h>
27 #   endif /* !HAVE_SYS_TIME_H */
28 # endif /* !TIME_WITH_SYS_TIME */
29
30 # ifdef HAVE_SYS_TIMEB_H
31 #   include <sys/timeb.h>
32 # else /* HAVE_SYS_TIMEB_H */
33 /*
34  * We use the obsolete `struct timeb' as part of our interface!
35  * Since the system doesn't have it, we define it here;
36  * our callers must do likewise.
37  *
38  * At the least we were using this in lib/getdate.y, but lib/system.h used to
39  * define it too, so maybe CVS is using it elsewhere.
40  */
41 struct timeb {
42     time_t              time;           /* Seconds since the epoch      */
43     unsigned short      millitm;        /* Field not used               */
44     short               timezone;       /* Minutes west of GMT          */
45     short               dstflag;        /* Field not used               */
46 };
47 # endif /* !HAVE_SYS_TIMEB_H */
48
49 # ifdef timezone
50 #   undef timezone /* needed for sgi */
51 # endif /* timezone */
52
53 # if !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE)
54 extern long timezone;
55 # endif /* !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE) */
56
57 #endif /* !vms */