home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / xgopher.1.3 / osdep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-21  |  4.4 KB  |  120 lines

  1. /* osdep.h
  2.    try to isolate operating system and environment dependencies. */
  3.  
  4.      /*---------------------------------------------------------------*/
  5.      /* Xgopher        version 1.3     08 April 1993                  */
  6.      /*                version 1.2     20 November 1992               */
  7.      /*                version 1.1     20 April 1992                  */
  8.      /*                version 1.0     04 March 1992                  */
  9.      /* X window system client for the University of Minnesota        */
  10.      /*                                Internet Gopher System.        */
  11.      /* Allan Tuchman, University of Illinois at Urbana-Champaign     */
  12.      /*                Computing and Communications Services Office   */
  13.      /* Copyright 1992, 1993 by                                       */
  14.      /*           the Board of Trustees of the University of Illinois */
  15.      /* Permission is granted to freely copy and redistribute this    */
  16.      /* software with the copyright notice intact.                    */
  17.      /*---------------------------------------------------------------*/
  18.  
  19.  
  20. /* This file would be mostly unnecessary if everyone was running X11R5,
  21.    where the file <Xos.h> is pretty decent.  But, X11R4's <Xos.h> is
  22.    not sufficient to solve the OS dependencies.
  23. */
  24.  
  25. #ifndef OSDEP_H
  26. #define OSDEP_H
  27.  
  28. /*======================================================================*/
  29. /* getenv() is in stdlib.h =============================================*/
  30. /*======================================================================*/
  31.  
  32. #if defined(SYSV) || defined(SVR4)
  33. #include <stdlib.h>
  34. #else
  35. char    *getenv();
  36. #endif
  37.  
  38. /*======================================================================*/
  39. /* get string/strings and open(2) values ===============================*/
  40. /* by using MIT's logic from the R5 distribution of X11 ================*/
  41. /* R4 is pretty broken, so I can't use that one ========================*/
  42. /*======================================================================*/
  43. #include "MIT-Xos.h"
  44.  
  45. /*======================================================================*/
  46. /* binary copy header files ============================================*/
  47. /*======================================================================*/
  48.  
  49. #if defined(SYSV) || defined(SVR4)
  50. #ifndef bcopy
  51. #define bcopy(s,d,n)    memcpy((d),(s),(n))
  52. #endif
  53. #ifndef bzero
  54. #define bzero(s,n)    memset((s), 0, (n))
  55. #endif
  56. #endif
  57.  
  58. /*======================================================================*/
  59. /* get working directory path name =====================================*/
  60. /*======================================================================*/
  61.  
  62. #if defined(SYSV) || defined(SVR4)
  63. #include "conf.h"    /* for PATH_NAME_LEN */
  64. #include <unistd.h>    /* declaration of getcwd */
  65. #define getwd(d)    getcwd((d), PATH_NAME_LEN)
  66. #else
  67.     char    *getwd();
  68. #endif
  69.  
  70.  
  71. /*======================================================================*/
  72. /* try to find malloc's declaration ====================================*/
  73. /*======================================================================*/
  74.  
  75. #if defined(_POSIX_SOURCE) || !defined(NOSTDHDRS)
  76. #  if !defined(sequent)
  77. #include <stdlib.h>
  78. #  else /* sequent */
  79. char    *malloc();
  80. char    *realloc();
  81. #  endif
  82. #else
  83. #  if !defined(NeXt) && !defined(sequent) && !defined(__bsdi__) && !defined(unix)
  84. #include <malloc.h>
  85. #  else 
  86. char    *malloc();
  87. char    *realloc();
  88. #  endif
  89. #endif
  90.  
  91. /*======================================================================*/
  92. /* pid type ============================================================*/
  93. /*======================================================================*/
  94.  
  95. #if     !defined(SYSV) && !defined(__convex__) && !defined(__bsdi__) && !defined(linux)
  96. #define        PID_TYPE    int
  97. #ifdef ISCX    /** for ISC 3.0 + ISC's X11R4 package */
  98. #define        WNOHANG        1
  99. #endif
  100. #else
  101.     /* <sys/file.h> was included by the earlier section for open(2)
  102.        constants, but would otherwise need to be included here. */
  103. #define        PID_TYPE    pid_t
  104. #endif                          /* !defined(SYSV) */
  105.  
  106. /*======================================================================*/
  107. /* popon declaration ===================================================*/
  108. /*======================================================================*/
  109.  
  110. #if      defined(sequent)
  111.  
  112.     /* this is supposed to be defined in <stdio.h>, but
  113.        it turns up missing on some machines - like the sequent */
  114. #include <stdio.h>
  115.     FILE        *popen();
  116. #endif
  117.  
  118.  
  119. #endif /* OSDEP_H */
  120.