home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1705 / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  6.0 KB  |  251 lines

  1. /*
  2.  * vi configuration file
  3.  * We try to automatically configure to various compilers and operating
  4.  * systems. Extend the autoconf section as needed.
  5.  */
  6.  
  7. /*************************** autoconf section ************************/
  8.  
  9. /* standard unix V (?) */
  10. #ifdef    M_SYSV
  11. # define UNIXV        1
  12. #endif
  13.  
  14. /* xelos system, University of Ulm */
  15. #ifdef    xelos
  16. # define UNIXV        1
  17. #endif
  18.  
  19. /* Microsoft C: sorry, Watcom does the same thing */
  20. #ifdef    M_I86
  21. # ifndef M_SYSV
  22. #  define MSDOS        1
  23. #  define MICROSOFT    1
  24. #  define COMPILED_BY    "Microsoft C 5.10"
  25. # endif
  26. #endif
  27.  
  28. /* Borlands Turbo C */
  29. #ifdef    __TURBOC__
  30. # define MSDOS        1
  31. # define TURBOC        1
  32. # define COMPILED_BY    "Turbo C 2.00"
  33. #endif
  34.  
  35. /* Tos Mark-Williams */
  36. #ifdef    M68000
  37. # define TOS 1
  38. # define COMPILED_BY    "Mark Williams C"
  39. #endif
  40.  
  41. /* OS-9 requires an explicit "-DOS9" in CFLAGS */
  42.  
  43. /* TOS requires an explicit "-DTOS" in CFLAGS */
  44.  
  45. /*************************** end of autoconf section ************************/
  46.  
  47. /* All undefined symbols are defined to zero here, to allow for older    */
  48. /* compilers which dont understand #if defined() or #if UNDEFINED_SYMBOL */
  49.  
  50. /*************************** operating systems *****************************/
  51.  
  52. #ifndef    BSD
  53. # define BSD    0        /* UNIX - Berkeley 4.x */
  54. #endif
  55.  
  56. #ifndef    UNIXV
  57. # define UNIXV    0        /* UNIX - AT&T SYSV */
  58. #endif
  59.  
  60. #ifndef    UNIX7
  61. # define UNIX7    0        /* UNIX - version 7 */
  62. #endif
  63.  
  64. #ifndef    MSDOS
  65. # define MSDOS    0        /* PC        */
  66. #endif
  67.  
  68. #ifndef    TOS
  69. # define TOS    0        /* Atari ST    */
  70. #endif
  71.  
  72. #ifndef    AMIGA
  73. # define AMIGA    0        /* Commodore Amiga */
  74. #endif
  75.  
  76. #ifndef OS9
  77. # define OS9    0        /* OS-9 / 68k */
  78. #endif
  79.  
  80.                 /* Minix has no predefines */
  81. #if !BSD && !UNIXV && !UNIX7 && !MSDOS && !TOS && !AMIGA && !OS9
  82. # define MINIX    1
  83. #else
  84. # define MINIX    0
  85. #endif
  86.  
  87.                 /* generic combination of Unices */
  88. #if UNIXV || UNIX7 || BSD || MINIX
  89. # define ANY_UNIX 1
  90. #else
  91. # define ANY_UNIX 0
  92. #endif
  93.  
  94. /*************************** compilers **************************************/
  95.  
  96. #ifndef    MICROSOFT
  97. # define MICROSOFT    0
  98. #endif
  99.  
  100. #ifndef    TURBOC
  101. # define TURBOC        0
  102. #endif
  103.  
  104. /******************************* Credit ************************************/
  105.  
  106. #if MSDOS
  107. # define CREDIT "Ported to MS-DOS by Guntram Blohm & Martin Patzel"
  108. #endif
  109.  
  110. #if TOS
  111. # define CREDIT "Ported to Atari/TOS by Guntram Blohm & Martin Patzel"
  112. #endif
  113.  
  114. /*************************** functions depending on OS *********************/
  115.  
  116. /* Only MSDOS and TOS need a special function for reading from the keyboard.
  117.  * All others just read from file descriptor 0.
  118.  */
  119. #if !MSDOS && !TOS
  120. # define ttyread(buf, len)    read(0, buf, len)    /* raw read */
  121. #endif
  122. #if !TOS
  123. # define ttywrite(buf, len)    write(1, buf, len)    /* raw write */
  124. #endif
  125.  
  126. /* The strchr() function is an official standard now, so everybody has it
  127.  * except Unix version 7 (which is old) and BSD Unix (which is academic).
  128.  * Those guys use something called index() to do the same thing.
  129.  */
  130. #if BSD || UNIX7 || MINIX
  131. # define strchr    index
  132. #endif
  133.  
  134. /* BSD uses bcopy() instead of memcpy() */
  135. #if BSD
  136. #define memcpy(dest, src, siz)    bcopy(src, dest, siz)
  137. #endif
  138.  
  139. /* text versa binary mode for read/write */
  140. #if !TOS
  141. #define    tread    read
  142. #define twrite  write
  143. #endif
  144.  
  145. /**************************** Compiler quirks *********************************/
  146.  
  147. /* The Microsoft Xenix cross compiler for DOS doesn't support "volatile" */
  148. #if MICROSOFT
  149. # define volatile
  150. #endif
  151.  
  152. /* the UNIX version 7, OS-9, and (some) TOS compilers, don't allow "void" */
  153. #if UNIX7 || TOS || OS9
  154. # define void int
  155. #endif
  156.  
  157. /* In OS9, argv[0] never changes */
  158. #if OS9
  159. # define NO_ARGV0
  160. #endif
  161.  
  162. /* as far as I know, all compilers except version 7 support unsigned char */
  163. /* NEWFLASH: the Minix-ST compiler has subtle problems with unsigned char */
  164. #if UNIX7 || MINIX
  165. # define UCHAR(c)    ((c) & 0xff)
  166. #else
  167. # define UCHAR(c)    ((unsigned char)(c))
  168. #endif
  169.  
  170. /* Some compilers prefer to have malloc declared as returning a (void *) */
  171. #if BSD
  172. extern void *malloc();
  173. #else
  174. extern char *malloc();
  175. #endif
  176.  
  177. /******************* Names of files and environment vars **********************/
  178.  
  179. #if ANY_UNIX
  180. # define TMPDIR        "/usr/tmp"    /* directory where temp files live */
  181. # define TMPNAME    "%s/elvt%04x%03x" /* temp file */
  182. # define CUTNAME    "%s/elvc%04x%03x" /* cut buffer's temp file */
  183. # define EXRC        ".exrc"        /* init file in current directory */
  184. # define KEYWORDPRG    "/usr/bin/ref"    /* keyword "help" program */
  185. # define SCRATCHOUT    "%s/soXXXXXX"    /* temp file used as input to filter */
  186. # define SLASH        '/'
  187. # define EXINIT        "EXINIT"
  188. #endif
  189.  
  190. #if MSDOS || TOS
  191. /* do not change TMPNAME, CUTNAME and SCRATCH*: they MUST begin with '%s\\'! */
  192. # define TMPDIR        "C:\\tmp"    /* directory where temp files live */
  193. # define TMPNAME    "%s\\elvt%04x.%03x" /* temp file */
  194. # define CUTNAME    "%s\\elvc%04x.%03x" /* cut buffer's temp file */
  195. # define EXRC        "elvis.rc"    /* init file in current directory */
  196. # if TOS
  197. # define KEYWORDPRG    "ref.ttp"    /* keyword "help" program */
  198. # else
  199. # define KEYWORDPRG    "ref.exe"    /* keyword "help" program */
  200. # endif
  201. # define SCRATCHIN    "%s\\siXXXXXX"    /* DOS ONLY - output of filter program */
  202. # define SCRATCHOUT    "%s\\soXXXXXX"    /* temp file used as input to filter */
  203. # define SLASH        '\\'
  204. #endif
  205.  
  206. #if OS9
  207. # define TMPDIR        "/dd/tmp"    /* directory where temp files live */
  208. # define TMPNAME    "%s/elvt%04x%03x" /* temp file */
  209. # define CUTNAME    "%s/elvc%04x%03x" /* cut buffer's temp file */
  210. # define EXRC        ".exrc"        /* init file in current directory */
  211. # define KEYWORDPRG    "/dd/cmds/ref"    /* keyword "help" program */
  212. # define SCRATCHOUT    "%s/soXXXXXX"    /* temp file used as input to filter */
  213. # define SLASH        '/'
  214. # define EXINIT        "EXINIT"
  215. #endif
  216.  
  217. #ifndef    TAGS
  218. # define TAGS        "tags"        /* tags file */
  219. #endif
  220.  
  221. #ifndef TMPNAME
  222. # define TMPNAME    "%s/elvt%04x.%03x"    /* temp file */
  223. #endif
  224.  
  225. #ifndef CUTNAME
  226. # define CUTNAME    "%s/elvc%04x.%03x"    /* cut buffer's temp file */
  227. #endif
  228.  
  229. #ifndef    EXRC
  230. # define EXRC        "elvis.rc"
  231. #endif
  232.  
  233. #ifndef HMEXRC
  234. # if !MSDOS && !TOS
  235. #  define HMEXRC    EXRC
  236. # endif
  237. #endif
  238.  
  239. #ifndef    KEYWORDPRG
  240. # define KEYWORDPRG    "ref"
  241. #endif
  242.  
  243. #ifndef    SCRATCHOUT
  244. # define SCRATCHIN    "%s/SIXXXXXX"
  245. # define SCRATCHOUT    "%s/SOXXXXXX"
  246. #endif
  247.  
  248. #ifndef    SLASH
  249. # define SLASH        '/'
  250. #endif
  251.