home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / TIME_.H < prev    next >
C/C++ Source or Header  |  1994-07-27  |  2KB  |  63 lines

  1. /* Copyright (C) 1991, 1992 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* time_.h */
  20. /* Generic substitute for Unix sys/time.h */
  21.  
  22. /* We must include std.h before any file that includes sys/types.h. */
  23. #include "std.h"
  24.  
  25. /* The location (or existence) of certain system headers is */
  26. /* environment-dependent. We detect this in the makefile */
  27. /* and conditionally define switches in gconfig_.h. */
  28. #include "gconfig_.h"
  29.  
  30. /* Some System V environments don't include sys/time.h. */
  31. /* The SYSTIME_H switch in gconfig_.h reflects this. */
  32. #ifdef SYSTIME_H
  33. #  include <sys/time.h>
  34. #else
  35. struct timeval {
  36.     long tv_sec, tv_usec;
  37. };
  38. struct timezone {
  39.     int tz_minuteswest, tz_dsttime;
  40. };
  41. #endif
  42.  
  43. #if defined(AUX) || defined(_IBMR2) || defined(SYSV) || defined(SVR4)        /* A/UX, IBM RS/6000, AIX 3.n, System V.4 */
  44. #  include <time.h>
  45. #endif
  46.  
  47. #if defined(ultrix) && defined(mips)
  48. /* Apparently some versions of Ultrix for the DECstation include */
  49. /* time_t in sys/time.h, and some don't.  If you get errors */
  50. /* compiling gp_unix.c, uncomment the next line. */
  51. /*    typedef    int    time_t;    */
  52. #endif
  53.  
  54. /* In SVR4 (but not other System V implementations), */
  55. /* gettimeofday doesn't take a timezone argument. */
  56. /* Patch callers of gettimeofday so they call our own routine */
  57. /* (in gp_sysv.c). */
  58. #ifdef SVR4
  59. int gp_gettimeofday(P2(struct timeval *, struct timezone *));
  60. #  define gettimeofday(tvp, tzp) gp_gettimeofday(tvp, tzp)
  61. #  define use_gp_gettimeofday
  62. #endif
  63.