ftp://ftp.smr.ru/pub/0/FreeBSD/releases/distfiles/xscreensaver-3.16.tar.gz
[xscreensaver] / utils / vms-gtod.h
1 /*      @(#)time.h 2.9 87/01/17 SMI; from UCB 7.1 6/4/86        */
2
3 /*
4         Definitions of various structures used on UNIX for
5         time-related syscalls.
6 */
7
8 /*
9  * Copyright (c) 1982, 1986 Regents of the University of California.
10  * All rights reserved.  The Berkeley software License Agreement
11  * specifies the terms and conditions for redistribution.
12  */
13
14 #ifndef _VMS_GTOD_
15 #define _VMS_GTOD_
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 /*
22  * Structure returned by gettimeofday(2) system call,
23  * and used in other calls.
24  */
25 #ifndef __DECC
26 struct timeval
27 {
28         long    tv_sec;         /* seconds */
29         long    tv_usec;        /* and microseconds */
30 };
31 #else
32 #if __DECC_VER < 50200000
33 struct timeval
34 {
35         long    tv_sec;         /* seconds */
36         long    tv_usec;        /* and microseconds */
37 };
38 #endif /* __DECC_VER */
39 #endif /* __DECC */
40
41 /*
42  * Operations on timevals.
43  *
44  * NB: timercmp does not work for >= or <=.
45  */
46 #define timerisset(tvp)         ((tvp)->tv_sec || (tvp)->tv_usec)
47 #define timercmp(tvp, uvp, cmp) \
48         ((tvp)->tv_sec cmp (uvp)->tv_sec || \
49          (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
50 #define timerclear(tvp)         (tvp)->tv_sec = (tvp)->tv_usec = 0
51
52 /*
53  * Names of the interval timers, and structure
54  * defining a timer setting.
55  */
56 #define ITIMER_REAL     0
57 #define ITIMER_VIRTUAL  1
58 #define ITIMER_PROF     2
59
60 #ifndef __DECC
61 struct  itimerval
62 {
63         struct  timeval it_interval;    /* timer interval */
64         struct  timeval it_value;       /* current value */
65 };
66 #else
67 #if __DECC_VER < 50200000
68 struct  itimerval
69 {
70         struct  timeval it_interval;    /* timer interval */
71         struct  timeval it_value;       /* current value */
72 };
73 #endif /* __DECC_VER */
74 #endif /* __DECC */
75
76 #ifndef KERNEL
77 #include <time.h>
78 #endif
79
80 #ifdef __cplusplus
81 }
82 #endif
83
84 #endif /*!_VMS_GTOD_*/
85