home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / xpaint-247 / unix_time.h < prev    next >
C/C++ Source or Header  |  1996-07-24  |  2KB  |  84 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. #ifndef __SOCKET_LOADED
  18. /*
  19.  * Structure returned by gettimeofday(2) system call,
  20.  * and used in other calls.
  21.  */
  22. #if __DECC_VER < 50200000
  23. struct timeval
  24. {
  25.     long    tv_sec;        /* seconds */
  26.     long    tv_usec;    /* and microseconds */
  27. };
  28. #endif
  29. #endif
  30.  
  31. struct timezone
  32. {
  33.     int    tz_minuteswest;    /* minutes west of Greenwich */
  34.     int    tz_dsttime;    /* type of dst correction */
  35. };
  36.  
  37. #define    DST_NONE    0    /* not on dst */
  38. #define    DST_USA        1    /* USA style dst */
  39. #define    DST_AUST    2    /* Australian style dst */
  40. #define    DST_WET        3    /* Western European dst */
  41. #define    DST_MET        4    /* Middle European dst */
  42. #define    DST_EET        5    /* Eastern European dst */
  43. #define    DST_CAN        6    /* Canada */
  44. #define    DST_GB        7    /* Great Britain and Eire */
  45. #define    DST_RUM        8    /* Rumania */
  46. #define    DST_TUR        9    /* Turkey */
  47. #define    DST_AUSTALT    10    /* Australian style with shift in 1986 */
  48.  
  49. /*
  50.  * Operations on timevals.
  51.  *
  52.  * NB: timercmp does not work for >= or <=.
  53.  */
  54. #define    timerisset(tvp)        ((tvp)->tv_sec || (tvp)->tv_usec)
  55. #define    timercmp(tvp, uvp, cmp)    \
  56.     ((tvp)->tv_sec cmp (uvp)->tv_sec || \
  57.      (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
  58. #define    timerclear(tvp)        (tvp)->tv_sec = (tvp)->tv_usec = 0
  59.  
  60. /*
  61.  * Names of the interval timers, and structure
  62.  * defining a timer setting.
  63.  */
  64. #define    ITIMER_REAL    0
  65. #define    ITIMER_VIRTUAL    1
  66. #define    ITIMER_PROF    2
  67.  
  68. #if __DECC_VER < 50200000
  69. struct    itimerval
  70. {
  71.     struct    timeval it_interval;    /* timer interval */
  72.     struct    timeval it_value;    /* current value */
  73. };
  74. #endif
  75.  
  76. #ifndef KERNEL
  77. #include <time.h>
  78. #endif
  79.  
  80. int gettimeofday(struct timeval *tv, struct timezone *tz);
  81.  
  82. #endif /*!_UNIX_TIME_ */
  83.  
  84.