home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / apps / text_ed / elv16b2 / st / config.h < prev    next >
C/C++ Source or Header  |  1992-05-13  |  14KB  |  610 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. #ifndef _CONFIG_H
  8. # define _CONFIG_H
  9.  
  10. /*************************** autoconf section ************************/
  11.  
  12. /* Commodore-Amiga */
  13. #ifdef    amiga
  14. # define AMIGA        1
  15. # define COMPILED_BY    "Manx Aztec C 5.2b"
  16. # define TINYSTACK    1
  17. #endif
  18.  
  19. /* standard unix V (?) */
  20. #ifdef    M_SYSV
  21. # define UNIXV        1
  22. # ifdef M_XENIX
  23. #  ifndef M_I386
  24. #   define TINYSTACK    1
  25. #  endif
  26. # endif
  27. #endif
  28.  
  29. /* xelos system, University of Ulm */
  30. #ifdef    xelos
  31. # define UNIXV        1
  32. #endif
  33.  
  34. /* BSD UNIX? */
  35. #ifdef bsd
  36. # define BSD        1
  37. #else
  38. # ifdef sun
  39. #  define BSD        1
  40. # endif
  41. #endif
  42.  
  43. /* Microsoft C: sorry, Watcom does the same thing */
  44. #ifdef    M_I86
  45. # ifndef M_SYSV
  46. #  define MSDOS        1
  47. #  ifdef IBMC2
  48. #   define COMPILED_BY    "IBM C/2 1.00"
  49. #  else
  50. #   define MICROSOFT    1
  51. #   define COMPILED_BY    "Microsoft C 5.10"
  52. #  endif
  53. #  define TINYSTACK    1
  54. # endif
  55. #endif
  56.  
  57. /* Borland's Turbo C */
  58. #ifdef    __TURBOC__
  59. # define MSDOS        1
  60. # define TURBOC        1
  61. # ifdef __BORLANDC__
  62. # define COMPILED_BY    "Borland C 2.00"
  63. # else
  64. # define COMPILED_BY    (__TURBOC__ >= 661 ? "Turbo C++ 1.00" : "Turbo C 2.00")
  65. # endif
  66. # define TINYSTACK    1
  67. #endif
  68.  
  69. /* Tos Mark-Williams */
  70. #ifdef    M68000
  71. # define TOS 1
  72. # define COMPILED_BY    "Mark Williams C"
  73. # define TINYSTACK    1
  74. #endif
  75.  
  76. /* Tos GNU-C */
  77. #ifdef __atarist__
  78. # ifdef __gem__
  79. #  define TOS 1
  80. #  define COMPILED_BY    "GNU-C " __VERSION__
  81. #  define TINYSTACK    1
  82. # endif
  83. #endif
  84.  
  85. #if MINT
  86. # ifdef TOS
  87. #  undef TOS
  88. # endif
  89. #endif
  90.  
  91. /* OS9/68000 */
  92. #ifdef    OSK
  93. # define COMPILED_BY    "Microware C V2.3 Edition 40"
  94. # define TINYSTACK    1
  95. #endif
  96.  
  97. /* DEC Rainbow, running MS-DOS (handled by earlier MS-DOS tests) */
  98. /* (would need -DRAINBOW in CFLAGS to compile a Rainbow-compatible .EXE) */
  99.  
  100. #ifdef VMS
  101. # define COMPILED_BY    "VAX/VMS VAXC compiler"
  102. # undef VMS
  103. # define VMS 1
  104. #endif
  105.  
  106.  
  107. /*************************** end of autoconf section ************************/
  108.  
  109. /* All undefined symbols are defined to zero here, to allow for older    */
  110. /* compilers which dont understand #if defined() or #if UNDEFINED_SYMBOL */
  111.  
  112. /*************************** operating systems *****************************/
  113.  
  114. #ifndef    BSD
  115. # define BSD    0        /* UNIX - Berkeley 4.x */
  116. #endif
  117.  
  118. #ifndef    UNIXV
  119. # define UNIXV    0        /* UNIX - AT&T SYSV */
  120. #endif
  121.  
  122. #ifndef    UNIX7
  123. # define UNIX7    0        /* UNIX - version 7 */
  124. #endif
  125.  
  126. #ifndef    MSDOS
  127. # define MSDOS    0        /* PC        */
  128. #endif
  129.  
  130. #ifndef    TOS
  131. # define TOS    0        /* Atari ST    */
  132. #endif
  133.  
  134. #ifndef    MINT
  135. # define MINT    0        /* Atari ST, gcc, MiNT    */
  136. #endif
  137.  
  138. #ifndef    AMIGA
  139. # define AMIGA    0        /* Commodore Amiga */
  140. #endif
  141.  
  142. #ifndef OSK
  143. # define OSK    0        /* OS-9 / 68k */
  144. #endif
  145.  
  146. #ifndef COHERENT
  147. # define COHERENT 0        /* Coherent */
  148. #endif
  149.  
  150. #ifndef RAINBOW            /* DEC Rainbow support, under MS-DOS */
  151. # define RAINBOW 0
  152. #endif
  153.  
  154. #ifndef VMS
  155. # define VMS 0                  /* VAX/VMS */
  156. #endif
  157.  
  158.                 /* Minix has no predefines */
  159. #if !BSD && !UNIXV && !UNIX7 && !MSDOS && !TOS && !AMIGA && !OSK && !COHERENT && !VMS && !MINT
  160. # define MINIX    1
  161. #else
  162. # define MINIX    0
  163. #endif
  164.  
  165.                 /* generic combination of Unices */
  166. #if UNIXV || UNIX7 || BSD || MINIX || COHERENT
  167. # define ANY_UNIX 1
  168. #else
  169. # define ANY_UNIX 0
  170. #endif
  171.  
  172. #ifndef TINYSTACK
  173. # define TINYSTACK 0
  174. #endif
  175.  
  176. /*************************** compilers **************************************/
  177.  
  178. #ifndef    AZTEC_C
  179. # define AZTEC_C    0
  180. #endif
  181.  
  182. #ifndef    MICROSOFT
  183. # define MICROSOFT    0
  184. #endif
  185.  
  186. #ifndef    TURBOC
  187. # define TURBOC        0
  188. #endif
  189.  
  190. /* Should we use "new style" ANSI C prototypes? */
  191. #ifdef __STDC__
  192. # define NEWSTYLE 1
  193. #endif
  194. #ifdef __cplusplus
  195. # define NEWSTYLE 1
  196. #endif
  197. #ifndef NEWSTYLE
  198. # define NEWSTYLE 0
  199. #endif
  200.  
  201. #if NEWSTYLE
  202. # define P_(s) s
  203. #else
  204. # define P_(s) ()
  205. #endif
  206.  
  207. /******************************* Credit ************************************/
  208.  
  209. #if MSDOS
  210. # define CREDIT "Ported to MS-DOS by Guntram Blohm & Martin Patzel"
  211. # if RAINBOW
  212. #  define CREDIT2 "Rainbow support added by Willett Kempton"
  213. # endif
  214. #endif
  215.  
  216. #if AMIGA
  217. # define CREDIT "Ported to AmigaDOS 2.04 by Mike Rieser & Dale Rahn"
  218. #endif
  219.  
  220. #if TOS
  221. # define CREDIT "Ported to Atari/TOS by Guntram Blohm & Martin Patzel"
  222. #endif
  223.  
  224. #if OSK
  225. # define CREDIT    "Ported to Microware OS9/68k by Peter Reinig"
  226. #endif
  227.  
  228. #if COHERENT
  229. # define CREDIT    "Ported to Coherent by Esa Ahola"
  230. #endif
  231.  
  232. #if VMS
  233. # define CREDIT "Ported to VAX/VMS by John Campbell"
  234. #endif
  235. /*************************** functions depending on OS *********************/
  236.  
  237. /* There are two terminal-related functions that we need: ttyread() and
  238.  * ttywrite().  The ttyread() function implements read-with-timeout and is
  239.  * a true function on all systems.  The ttywrite() function is almost always
  240.  * just a macro...
  241.  */
  242. #if !TOS && !AMIGA && !MINT
  243. # define ttywrite(buf, len)    write(1, buf, (unsigned)(len))    /* raw write */
  244. #endif
  245.  
  246. /* The strchr() function is an official standard now, so everybody has it
  247.  * except Unix version 7 (which is old) and BSD Unix (which is academic).
  248.  * Those guys use something called index() to do the same thing.
  249.  */
  250. #if BSD || UNIX7 || OSK
  251. # define strchr    index
  252. #endif
  253. #if !NEWSTYLE
  254. extern char *strchr();
  255. #endif
  256.  
  257. /* BSD uses bcopy() instead of memcpy() */
  258. #if BSD
  259. # define memcpy(dest, src, siz)    bcopy(src, dest, siz)
  260. #endif
  261.  
  262. /* BSD uses getwd() instead of getcwd().  The arguments are a little different,
  263.  * but we'll ignore that and hope for the best; adding arguments to the macro
  264.  * would mess up an "extern" declaration of the function.
  265.  */
  266. #if BSD || COHERENT
  267. # define getcwd    getwd
  268. #endif
  269. extern char *getcwd();
  270.  
  271. /* text versa binary mode for read/write */
  272. #if !TOS && !MINT
  273. #define    tread(fd,buf,n)        read(fd,buf,(unsigned)(n))
  274. #define twrite(fd,buf,n)    write(fd,buf,(unsigned)(n))
  275. #endif
  276.  
  277. #if MINT
  278. extern int read();
  279. extern int tread();
  280. extern int write();
  281. extern int twrite();
  282. #endif
  283.  
  284. /**************************** Compiler quirks *********************************/
  285.  
  286. /* the UNIX version 7 and (some) TOS compilers, don't allow "void" */
  287. #if (UNIX7 || TOS) && !NEWSTYLE
  288. # define void int
  289. #endif
  290.  
  291. /* as far as I know, all compilers except version 7 support unsigned char */
  292. /* NEWFLASH: the Minix-ST compiler has subtle problems with unsigned char */
  293. #if UNIX7 || MINIX
  294. # define UCHAR(c)    ((c) & 0xff)
  295. # define uchar        char
  296. #else
  297. # define UCHAR(c)    ((unsigned char)(c))
  298. # define uchar        unsigned char
  299. #endif
  300.  
  301. /* Some compilers prefer to have malloc declared as returning a (void *) */
  302. /* ANSI, on the other hand, needs the arguments to free() to be cast */
  303. #ifndef    __STDC__
  304. # if BSD || AMIGA || MINIX
  305. extern void *malloc();
  306. #  define _free_(ptr)    free((void *)ptr)
  307. # else
  308. extern char *malloc();
  309. #  define _free_(ptr)    free((char *)ptr)
  310. # endif
  311. #else
  312. # define _free_(ptr)    free((void *)ptr)
  313. #endif    /* __STDC__ */
  314.  
  315. /* everybody but Amiga wants lseek declared here */
  316. #if !AMIGA
  317. extern long lseek();
  318. #endif
  319.  
  320. /******************* Names of files and environment vars **********************/
  321.  
  322. #if ANY_UNIX
  323. # ifndef TMPDIR
  324. #  if MINIX
  325. #   define TMPDIR    "/usr/tmp"    /* Keep elvis' temp files off RAM disk! */
  326. #  else
  327. #   define TMPDIR    "/tmp"        /* directory where temp files live */
  328. #  endif
  329. # endif
  330. # ifndef PRSVDIR
  331. #  define PRSVDIR    "/usr/preserve"    /* directory where preserved file live */
  332. # endif
  333. # ifndef PRSVINDEX
  334. #  define PRSVINDEX    "/usr/preserve/Index" /* index of files in PRSVDIR */
  335. # endif
  336. # ifndef EXRC
  337. #  define EXRC        ".exrc"        /* init file in current directory */
  338. # endif
  339. # define SCRATCHOUT    "%s/soXXXXXX"    /* temp file used as input to filter */
  340. # ifndef SHELL
  341. #  define SHELL        "/bin/sh"    /* default shell */
  342. # endif
  343. # if COHERENT
  344. #  ifndef REDIRECT
  345. #   define REDIRECT    ">"        /* Coherent CC writes errors to stdout */
  346. #  endif
  347. # endif
  348. #endif
  349.  
  350. #if AMIGA        /* Specify AMIGA environment */
  351. # ifndef CC_COMMAND
  352. #  define CC_COMMAND    "cc"        /* generic C compiler */
  353. # endif
  354. # ifndef COLON
  355. #  define COLON        ':'        /* Amiga files can also end in `:' */
  356. # endif
  357. # ifndef SYSEXRC
  358. #  define SYSEXRC    "S:" EXRC    /* name of ".exrc" file in system dir */
  359. # endif
  360. # ifndef MAXRCLEN
  361. #  define MAXRCLEN    2048        /* max size of a .exrc file */
  362. # endif
  363. # ifndef NBUFS
  364. #  define NBUFS        10        /* must be at least 3 -- more is better */
  365. # endif
  366. # ifndef NEEDSYNC
  367. #  define NEEDSYNC    TRUE        /* assume ":se sync" by default */
  368. # endif
  369. # ifndef PRSVDIR
  370. #  define PRSVDIR    "Elvis:"    /* directory where preserved file live */
  371. # endif
  372. # ifndef PRSVINDEX
  373. #  define PRSVINDEX    "Elvis:Index"    /* index of files in PRSVDIR */
  374. # endif
  375. # ifndef REDIRECT
  376. #  define REDIRECT    ">"        /* Amiga writes errors to stdout */
  377. # endif
  378. # ifndef SCRATCHIN
  379. #  define SCRATCHIN    "%sSIXXXXXX"
  380. # endif
  381. # ifndef SCRATCHOUT
  382. #  define SCRATCHOUT    "%sSOXXXXXX"
  383. # endif
  384. # ifndef SHELL
  385. #  define SHELL        "newshell"    /* default shell */
  386. # endif
  387. # ifndef TERMTYPE
  388. #  define TERMTYPE    "amiga"        /* default termtype */
  389. # endif
  390. # ifndef TMPDIR                /* for AMIGA should end in `:' or `/' */
  391. #  define TMPDIR    "T:"        /* directory where temp files live */
  392. # endif
  393. # ifndef TMPNAME
  394. #  define TMPNAME    "%selv_%x.%x"    /* format of names for temp files */
  395. # endif
  396. #endif
  397.  
  398. #if MSDOS || TOS || MINT
  399. /* do not change TMPNAME and SCRATCH*: they MUST begin with '%s\\'! */
  400. # if !MINT
  401. #  ifndef TMPDIR
  402. #   define TMPDIR    "C:\\tmp"    /* directory where temp files live */
  403. #  endif
  404. #  ifndef PRSVDIR
  405. #   define PRSVDIR    "C:\\preserve"    /* directory where preserved file live */
  406. #  endif
  407. #  ifndef PRSVINDEX
  408. #   define PRSVINDEX    "C:\\preserve\\Index" /* index of files in PRSVDIR */
  409. #  endif
  410. # else
  411. #  ifndef TMPDIR
  412. #   define TMPDIR    "/tmp"        /* directory where temp files live */
  413. #  endif
  414. #  ifndef PRSVDIR
  415. #   define PRSVDIR    "/usr/preserve"    /* directory where preserved file live */
  416. #  endif
  417. #  ifndef PRSVINDEX
  418. #   define PRSVINDEX    "/usr/preserve/Index" /* index of files in PRSVDIR */
  419. #  endif
  420. # endif
  421. # define TMPNAME    "%s\\elv_%x.%x" /* temp file */
  422. # if MSDOS
  423. #  if MICROSOFT
  424. #   define CC_COMMAND    "cl -c"        /* C compiler */
  425. #  else
  426. #   if __BORLANDC__  /* Borland C */
  427. #    define CC_COMMAND    "bcc"        /* C compiler */
  428. #   else
  429. #   if TURBOC        /* Turbo C */
  430. #    define CC_COMMAND    "tcc"        /* C compiler */
  431. #   endif    /* TURBOC */
  432. #   endif    /* BORLANDC */
  433. #  endif        /* MICROSOFT */
  434. # endif        /* MSDOS */
  435. # define SCRATCHIN    "%s\\siXXXXXX"    /* DOS ONLY - output of filter program */
  436. # define SCRATCHOUT    "%s\\soXXXXXX"    /* temp file used as input to filter */
  437. # if !MINT
  438. #  define SLASH        '\\'
  439. # else
  440. #  define SLASH        '/'
  441. # endif
  442. # ifndef SHELL
  443. #  if TOS || MINT
  444. #   define SHELL    "shell.ttp"    /* default shell */
  445. #  else
  446. #   define SHELL    "command.com"    /* default shell */
  447. #  endif
  448. # endif
  449. # define NEEDSYNC    TRUE        /* assume ":se sync" by default */
  450. # if (TOS || MINT) && __GNUC__        /* probably on other systems, too */
  451. #  define REDIRECT    "2>"        /* GNUC reports on 2, others on 1 */
  452. #  define CC_COMMAND    "gcc -c"
  453. # else
  454. #  define REDIRECT    ">"        /* shell's redirection of stderr */
  455. # endif
  456. #endif
  457.  
  458. #if VMS
  459. /* do not change TMPNAME, and SCRATCH*: they MUST begin with '%s\\'! */
  460. # ifndef TMPDIR
  461. #  define TMPDIR        "sys$scratch:"  /* directory where temp files live */
  462. # endif
  463. # define TMPNAME        "%selv_%x.%x;1" /* temp file */
  464. # define SCRATCHIN      "%ssiXXXXXX"    /* DOS ONLY - output of filter program */
  465. # define SCRATCHOUT     "%ssoXXXXXX"    /* temp file used as input to filter */
  466. # define SLASH          '\:'  /* Worry point... jdc */
  467. # ifndef SHELL
  468. #   define SHELL        ""      /* default shell */
  469. # endif
  470. # define REDIRECT       ">"             /* shell's redirection of stderr */
  471. # define tread(fd,buf,n)  vms_read(fd,buf,(unsigned)(n))
  472. # define close vms_close
  473. # define lseek vms_lseek
  474. # define unlink vms_delete
  475. # define delete __delete   /* local routine conflicts w/VMS rtl routine. */
  476. # define rpipe vms_rpipe
  477. # define rpclose vms_rpclose
  478. # define ttyread vms_ttyread
  479. /* There is no sync() on vms */
  480. # define sync()
  481. /* jdc -- seems VMS external symbols are case insensitive */
  482. # define m_fWord m_fw_ord
  483. # define m_bWord m_bw_ord
  484. # define m_eWord m_ew_ord
  485. # define m_Nsrch m_n_srch
  486. # define m_Fch   m_f_ch
  487. # define m_Tch   m_t_ch
  488. # define v_Xchar v_x_char
  489. /* jdc -- also, braindead vms curses always found by linker. */
  490. # define LINES elvis_LINES
  491. # define COLS  elvis_COLS
  492. # define curscr elvis_curscr
  493. # define stdscr elvis_stdscr
  494. # define initscr elvis_initscr
  495. # define endwin  elvis_endwin
  496. # define wrefresh elvis_wrefresh
  497. #endif
  498.  
  499. #if OSK
  500. # ifndef TMPDIR
  501. #  define TMPDIR    "/dd/tmp"       /* directory where temp files live */
  502. # endif
  503. # ifndef PRSVDIR
  504. #  define PRSVDIR    "/dd/usr/preserve" /* directory where preserved file live */
  505. # endif
  506. # ifndef PRSVINDEX
  507. #  define PRSVINDEX    "/dd/usr/preserve/Index" /* index of files in PRSVDIR */
  508. # endif
  509. # ifndef CC_COMMAND
  510. #  define CC_COMMAND    "cc -r"           /* name of the compiler */
  511. # endif
  512. # ifndef EXRC
  513. #  define EXRC        ".exrc"           /* init file in current directory */
  514. # endif
  515. # define SCRATCHOUT    "%s/soXXXXXX"       /* temp file used as input to filter */
  516. # ifndef SHELL
  517. #  define SHELL        "shell"           /* default shell */
  518. # endif
  519. # define FILEPERMS    (S_IREAD|S_IWRITE) /* file permissions used for creat() */
  520. # define REDIRECT    ">>-"           /* shell's redirection of stderr */
  521. # define sync()                   /* OS9 doesn't need a sync() */
  522. #endif
  523.  
  524. #ifndef    TAGS
  525. # define TAGS        "tags"        /* name of the tags file */
  526. #endif
  527.  
  528. #ifndef TMPNAME
  529. # define TMPNAME    "%s/elv_%x.%x"    /* format of names for temp files */
  530. #endif
  531.  
  532. #ifndef EXINIT
  533. # define EXINIT        "EXINIT"    /* name of EXINIT environment variable */
  534. #endif
  535.  
  536. #ifndef    EXRC
  537. # define EXRC        "elvis.rc"    /* name of ".exrc" file in current dir */
  538. #endif
  539.  
  540. #ifndef HMEXRC
  541. # define HMEXRC        EXRC        /* name of ".exrc" file in home dir */
  542. #endif
  543.  
  544. #ifndef    KEYWORDPRG
  545. # define KEYWORDPRG    "ref"
  546. #endif
  547.  
  548. #ifndef    SCRATCHOUT
  549. # define SCRATCHIN    "%s/SIXXXXXX"
  550. # define SCRATCHOUT    "%s/SOXXXXXX"
  551. #endif
  552.  
  553. #ifndef ERRLIST
  554. # define ERRLIST    "errlist"
  555. #endif
  556.  
  557. #ifndef    SLASH
  558. # define SLASH        '/'
  559. #endif
  560.  
  561. #ifndef SHELL
  562. # define SHELL        "shell"
  563. #endif
  564.  
  565. #ifndef REG
  566. # define REG        register
  567. #endif
  568.  
  569. #ifndef NEEDSYNC
  570. # define NEEDSYNC    FALSE
  571. #endif
  572.  
  573. #ifndef FILEPERMS
  574. # define FILEPERMS    0666
  575. #endif
  576.  
  577. #ifndef PRESERVE
  578. # define PRESERVE    "elvprsv"    /* name of the "preserve" program */
  579. #endif
  580.  
  581. #ifndef CC_COMMAND
  582. # define CC_COMMAND    "cc -c"
  583. #endif
  584.  
  585. #ifndef MAKE_COMMAND
  586. # define MAKE_COMMAND    "make"
  587. #endif
  588.  
  589. #ifndef REDIRECT
  590. # define REDIRECT    "2>"
  591. #endif
  592.  
  593. #ifndef BLKSIZE
  594. # ifdef CRUNCH
  595. #  define BLKSIZE    1024
  596. # else
  597. #  define BLKSIZE    2048
  598. # endif
  599. #endif
  600.  
  601. #ifndef KEYBUFSIZE
  602. # define KEYBUFSIZE    1000
  603. #endif
  604.  
  605. #ifndef MAILER
  606. # define MAILER        "mail"
  607. #endif
  608.  
  609. #endif  /* ndef _CONFIG_H */
  610.