home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / xjig / vms_unix_time.h < prev    next >
C/C++ Source or Header  |  1997-05-26  |  2KB  |  103 lines

  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 _UNIX_TIME_
  15. #define _UNIX_TIME_
  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. struct timezone
  41. {
  42.     int    tz_minuteswest;    /* minutes west of Greenwich */
  43.     int    tz_dsttime;    /* type of dst correction */
  44. };
  45.  
  46. #define    DST_NONE    0    /* not on dst */
  47. #define    DST_USA        1    /* USA style dst */
  48. #define    DST_AUST    2    /* Australian style dst */
  49. #define    DST_WET        3    /* Western European dst */
  50. #define    DST_MET        4    /* Middle European dst */
  51. #define    DST_EET        5    /* Eastern European dst */
  52. #define    DST_CAN        6    /* Canada */
  53. #define    DST_GB        7    /* Great Britain and Eire */
  54. #define    DST_RUM        8    /* Rumania */
  55. #define    DST_TUR        9    /* Turkey */
  56. #define    DST_AUSTALT    10    /* Australian style with shift in 1986 */
  57.  
  58. /*
  59.  * Operations on timevals.
  60.  *
  61.  * NB: timercmp does not work for >= or <=.
  62.  */
  63. #define    timerisset(tvp)        ((tvp)->tv_sec || (tvp)->tv_usec)
  64. #define    timercmp(tvp, uvp, cmp)    \
  65.     ((tvp)->tv_sec cmp (uvp)->tv_sec || \
  66.      (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
  67. #define    timerclear(tvp)        (tvp)->tv_sec = (tvp)->tv_usec = 0
  68.  
  69. /*
  70.  * Names of the interval timers, and structure
  71.  * defining a timer setting.
  72.  */
  73. #define    ITIMER_REAL    0
  74. #define    ITIMER_VIRTUAL    1
  75. #define    ITIMER_PROF    2
  76.  
  77. #ifndef __DECC
  78. struct    itimerval
  79. {
  80.     struct    timeval it_interval;    /* timer interval */
  81.     struct    timeval it_value;    /* current value */
  82. };
  83. #else
  84. #if __DECC_VER < 50200000
  85. struct    itimerval
  86. {
  87.     struct    timeval it_interval;    /* timer interval */
  88.     struct    timeval it_value;    /* current value */
  89. };
  90. #endif /* __DECC_VER */
  91. #endif /* __DECC */
  92.  
  93. #ifndef KERNEL
  94. #include <time.h>
  95. #endif
  96.  
  97. #ifdef __cplusplus
  98. }
  99. #endif
  100.  
  101. #endif /*!_UNIX_TIME_*/
  102.  
  103.