home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mm / mm-0.90 / compat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-18  |  2.9 KB  |  128 lines

  1. /*
  2.  * Copyright (c) 1986, 1990 by The Trustees of Columbia University in
  3.  * the City of New York.  Permission is granted to any individual or
  4.  * institution to use, copy, or redistribute this software so long as it
  5.  * is not sold for profit, provided this copyright notice is retained.
  6.  */
  7.  
  8. #ifdef RCSID
  9. #ifndef lint
  10. static char *compat_rcsid = "$Header: /f/src2/encore.bin/cucca/mm/tarring-it-up/RCS/compat.h,v 2.2 90/10/04 18:23:48 melissa Exp $";
  11. #endif
  12. #endif /* RCSID */
  13.  
  14. /*
  15.  * This file contains definitions needed to resolve incompatibilities
  16.  * between various different C library implementations.  Conditional
  17.  * declarations here depend on macros defined in config.h, and perhaps
  18.  * <sys/param.h> (included by osfiles.h), so this file should be included
  19.  * after them, but before any other other header files or source code
  20.  * which may depend on these declarations.
  21.  */
  22.  
  23. /*
  24.  * map index & rindex to strchr and strrchr if we don't have them.
  25.  */
  26. #ifndef HAVE_INDEX
  27. #define index strchr
  28. #define rindex strrchr
  29. #endif
  30.  
  31. /*
  32.  * non-Berkeley C libaries generally don't have bzero and friends
  33.  */
  34. #ifndef HAVE_BSTRING
  35. #define bzero(a,b)    memset((a),0,b)
  36. #define bcopy(a,b,c)    memcpy((b),(a),c)
  37. #define bcmp(a,b,c)    memcmp((a),(b),c)
  38. #endif
  39.  
  40. /*
  41.  * Some systems don't have rename(2)
  42.  */
  43. #ifndef HAVE_RENAME
  44. #define rename bsdrename
  45. #endif
  46.  
  47. /*
  48.  * Some systems don't have have vfork(2)
  49.  */
  50. #ifndef HAVE_VFORK
  51. #define vfork fork
  52. #endif
  53.  
  54. /*
  55.  * Non-berkeley systems generally don't have getwd(2).
  56.  */
  57. #ifndef HAVE_GETWD
  58. #define getwd bsdgetwd
  59. #endif
  60.  
  61. /*
  62.  * In SVR3, signal(2) is declared void (*signal())() rather than
  63.  * int (*signal())().
  64.  */
  65. #ifdef HAVE_VOIDSIG
  66. #define signalhandler void
  67. #else
  68. #define signalhandler int
  69. #endif
  70.  
  71. /*
  72.  * Some older systems systems don't have unistd.h.
  73.  */
  74. #if defined(L_SET) && !defined(SEEK_SET)
  75. #define SEEK_SET    L_SET
  76. #define SEEK_CUR    L_INCR
  77. #define SEEK_END    L_XTND
  78. #endif
  79.  
  80. /*
  81.  * Make sure filename strings are long enough.
  82.  */
  83. #ifndef MAXPATHLEN
  84. #define MAXPATHLEN 1024
  85. #endif
  86.  
  87. /*
  88.  * Define a macro to give a process its own process group.
  89.  */
  90. #ifdef HAVE_BSD_SETPGRP
  91. # define new_process_group() setpgrp(0, getpid ())
  92. #else
  93. # define new_process_group() setpgrp()
  94. #endif
  95.  
  96.  
  97. /*
  98.  * Some systems define both, so the distinction isn't useful, and
  99.  * we'll use SIGCHLD internally.
  100.  */
  101. #if defined(SIGCLD) && !defined(SIGCHLD)
  102. #define SIGCHLD SIGCLD
  103. #endif
  104.  
  105. /*
  106.  * On systems without the Berkeley signal behavior, use special
  107.  * versions of read(2) and write(2)
  108.  */
  109. #ifndef HAVE_BSD_SIGNALS
  110. #define read sys_read
  111. #define write sys_write
  112. #endif
  113.  
  114. /*
  115.  * Finally, try to ensure that one of BSD or SYSV is #defined, for
  116.  * the benefit of code which assumes that one or the other is true.
  117.  */
  118.  
  119. #if !defined(BSD) && !defined(SYSV)
  120. #   if hpux || u3b || u3b2 || u3b5 || u3b15 || u3b20 || SVR2 || SVR3 || AIX
  121. #    define SYSV 1
  122. #   else
  123. #    if defined(TIOCNOTTY) || sun || ultrix || accel || pyr || bsd4_2
  124. #        define BSD 1
  125. #    endif
  126. #   endif /* !SYSV */
  127. #endif
  128.