home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / BSRC_250.LZH / INCLUDES.H < prev    next >
C/C++ Source or Header  |  1991-09-15  |  10KB  |  300 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software, Co.                       */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          Freely Available<tm> Software.                 */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*                  Common Include Files for BinkleyTerm                    */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*    For complete  details  of the licensing restrictions, please refer    */
  17. /*    to the License  agreement,  which  is published in its entirety in    */
  18. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.250.    */
  19. /*                                                                          */
  20. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  21. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  22. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  23. /*    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    */
  24. /*    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    */
  25. /*    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    */
  26. /*    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    */
  27. /*    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      */
  28. /*                                                                          */
  29. /*                                                                          */
  30. /* You can contact Bit Bucket Software Co. at any one of the following      */
  31. /* addresses:                                                               */
  32. /*                                                                          */
  33. /* Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             */
  34. /* P.O. Box 460398                AlterNet 7:491/0                          */
  35. /* Aurora, CO 80046               BBS-Net  86:2030/1                        */
  36. /*                                Internet f491.n343.z1.fidonet.org         */
  37. /*                                                                          */
  38. /* Please feel free to contact us at any time to share your comments about  */
  39. /* our software and/or licensing policies.                                  */
  40. /*                                                                          */
  41. /*--------------------------------------------------------------------------*/
  42.  
  43.  
  44. /*
  45.  * This file drives all the defines and includes in BinkleyTerm. In
  46.  * here we handle cross-compiler portability issues. It was originally
  47.  * born to make compiled headers (a neat feature of Borland C) work,
  48.  * but the other role quickly caught on as well.
  49.  *
  50.  * Some of the portability stuff will no doubt wind up in other Bink
  51.  * include files -- but the system-level stuff such as utime, etc
  52.  * is all dealt with here.
  53.  *
  54.  * All main Bink modules should include this file before any specific
  55.  * local includes.
  56.  *
  57.  */
  58.  
  59.  
  60. /* System include files */
  61.  
  62. #include <stdio.h>
  63. #include <signal.h>
  64. #include <ctype.h>
  65.  
  66. #ifdef MEWEL
  67. #include <Window.H>
  68. #include <WinDecls.H>
  69. #include <GSDfn.H>     /* ?????? */
  70. #endif
  71.  
  72. #if ( !defined(MEWEL) & defined(MILQ) )
  73. #define MILQ
  74. #include <Windows.H>
  75. #include <GSDfn.H>     /* ?????? */
  76. #endif
  77.  
  78. #ifndef MILQ
  79. #include <conio.h>
  80. #endif
  81.  
  82. #include <string.h>
  83. #include <process.h>
  84. #include <stdlib.h>
  85. #include <stdarg.h>
  86. #include <io.h>
  87. #include <dos.h>
  88. #include <errno.h>
  89. #include <time.h>
  90. #include <sys\types.h>
  91. #include <sys\stat.h>
  92. #include <fcntl.h>
  93. #include <share.h>
  94.  
  95.  
  96. /*
  97.  * Compiler-specific stuff. The baseline in this sucker is
  98.  * Microsoft C 6.00a. Below what you see are the includes and
  99.  * macros we need to differentiate individual compilers from
  100.  * the baseline.
  101.  *
  102.  * The easiest way to add a new compiler is to replicate the
  103.  * _MSC_VER section using whatever manifest constant your
  104.  * compiler uses to identify itself, then do the fixups in
  105.  * that section.
  106.  *
  107.  * Be sure to put your section before that last define for
  108.  * COMPILER_NAME!
  109.  *
  110.  */
  111.  
  112.  
  113. #ifdef __TURBOC__       /* Borland C++ 2.0                */
  114. /*
  115.  * Borland.
  116.  *
  117.  * No sharing stream open. (s)open/fdopen works, though.
  118.  * Signal call is non-generic and incompatible
  119.  * Read/Write to far memory in near model not implemented
  120.  * Console output non-generic
  121.  * No utime call
  122.  *
  123.  */
  124.  
  125. #ifdef __BORLANDC__
  126. #define COMPILER_NAME   "-Borland"
  127. #else
  128. #define COMPILER_NAME   "-Turbo"
  129. #endif
  130. #define MUST_FDOPEN     /* Share streams: sopen+fdopen    */
  131. #define NO_SIGNALS      /* Don't install a signal handler */
  132. #define NEED_DOSREAD    /* Need our own _dos_(read/write) */
  133. #define NEED_CPUTS      /* Need our own cputs             */
  134. #define NEED_PUTCH      /* Need our own putch             */
  135. #define NEED_CPRINTF    /* Need our own cprintf           */
  136. struct utimbuf {
  137.     time_t actime;      /* access time */
  138.     time_t modtime;     /* modification time */
  139. };
  140. typedef struct utimbuf UTIMBUF;
  141. int cdecl utime(char *, struct utimbuf *);
  142. #define UT_ACTIME actime
  143. typedef long off_t;
  144. #include <mem.h>
  145. #include <dir.h>
  146. #include <alloc.h>
  147. #define _fmalloc(n) farmalloc (n)
  148. #define _ffree(n) farfree (n)
  149. #undef sopen /* we don't want to use all the args */
  150. #define sopen(a,b,c) open (a, b|c)
  151. #endif
  152.  
  153.  
  154. #ifdef _MSC_VER         /* Microsoft C 5.1 or 6.0a        */
  155. /*
  156.  * Microsoft.
  157.  *
  158.  * By and large, it's Microsoft compatible <grin>
  159.  *
  160.  * MSC 5.10 and below has no way to open a stream in
  161.  * sharing mode. sopen/fdopen doesn't work.
  162.  *
  163.  */
  164.  
  165. #if _MSC_VER == 510
  166. #define COMPILER_NAME   "-uSoft5.1"
  167. #endif
  168. #if _MSC_VER == 600
  169. #define COMPILER_NAME   "-uSoft6.0"
  170. #endif
  171. #if _MSC_VER < 600
  172. #define CANT_FSOPEN
  173. #endif
  174. #include <sys/utime.h>
  175. typedef struct utimbuf UTIMBUF;
  176. #define UT_ACTIME actime
  177. #include <memory.h>
  178. #include <direct.h>
  179. #include <malloc.h>
  180. #endif
  181.  
  182.  
  183. #ifdef __WATCOMC__      /* WATCOM C 8.0                   */
  184. /*
  185.  * WATCOM.
  186.  *
  187.  * No sharing stream open. sopen/fdopen doesn't work.
  188.  * No mktemp call
  189.  * utime structure member naming different
  190.  *
  191.  */
  192.  
  193. #define COMPILER_NAME   "-WATCOM"
  194. #define CANT_FSOPEN     /* No way to share streams        */
  195. #define NEED_MKTEMP     /* Need our own mktemp            */
  196. #include <sys/utime.h>
  197. typedef struct utimbuf UTIMBUF;
  198. #define UT_ACTIME acctime /* WCC acctime = actime         */
  199. #include <direct.h>
  200. #include <malloc.h>
  201. #endif
  202.  
  203.  
  204. #ifdef __ZTC__          /* Zortech C++ 3.0 */
  205. /*
  206.  * Zortech.
  207.  *
  208.  * No sharing stream open. sopen/fdopen doesn't work.
  209.  * Signal handler stuff incompatible
  210.  * Read/Write to far memory in near model not implemented
  211.  * No console I/O functions
  212.  * No mktemp call
  213.  * utime doesn't use a structure
  214.  * no ultoa, we use more limited ltoa
  215.  * tzset not there or needed
  216.  *
  217.  */
  218.  
  219. #define COMPILER_NAME   "-Zortech"
  220. #define CANT_FSOPEN     /* No way to share streams        */
  221. #define NO_SIGNALS      /* Don't install a signal handler */
  222. #define NEED_DOSREAD    /* Need our own _dos_(read/write) */
  223. #define NEED_CPUTS      /* Need our own cputs             */
  224. #define NEED_PUTCH      /* Need our own putch             */
  225. #define NEED_MKTEMP     /* Need our own mktemp            */
  226. struct utimbuf {
  227.     time_t actime;      /* access time */
  228.     time_t modtime;     /* modification time */
  229. };
  230. typedef time_t UTIMBUF; /* ZTC utime uses a time_t array  */
  231. #define UT_ACTIME actime
  232. #ifdef __VCM__
  233. #define __LARGE__       /* VCM model same as large, really*/
  234. #endif
  235. typedef long off_t;
  236. #include <direct.h>
  237. #define _fmalloc(n) farmalloc (n)
  238. #define _ffree(n) farfree (n)
  239. #define ultoa(x,y,z) ltoa((long)x,y,z)
  240. #define stricmp(x,y) strcmpl(x,y)
  241. #define _dos_setdrive(x,y) dos_setdrive(x,y)
  242. #define tzset()
  243. #endif
  244.  
  245.  
  246. /*
  247.  * Make sure there's at least a zero-length string for
  248.  * the compiler name.
  249.  *
  250.  * THIS LINE SHOULD ALWAYS BE LAST!
  251.  *
  252.  */
  253.  
  254. #ifndef COMPILER_NAME
  255. #define COMPILER_NAME   ""
  256. #endif
  257.  
  258. #ifndef OS_2
  259.  
  260. #ifndef MILQ
  261. typedef unsigned int USHORT;
  262. #endif
  263.  
  264. typedef int HFILE;
  265. typedef unsigned char far *PCH;
  266. typedef unsigned short HVIO;
  267. #define hfComHandle (port_ptr + 1)
  268. #define COMFILE_PREFIX ""
  269. #define COMFILE_SUFFIX ".BAT"
  270. #endif
  271.  
  272. /* Local include files */
  273.  
  274. #include "bink.h"
  275. #include "defines.h"
  276. #include "com.h"
  277. #include "xfer.h"
  278. #include "msgs.h"
  279. #include "zmodem.h"
  280. #include "keybd.h"
  281. #include "keyfncs.h"
  282. #include "sbuf.h"
  283. #include "sched.h"
  284. #include "timer.h"
  285. #include "vfossil.h"
  286. #include "externs.h"
  287. #include "prototyp.h"
  288.  
  289. #ifdef OS_2 /* This MUST follow our includes, I don't know why */
  290. #define INCL_DOSPROCESS
  291. #include <os2.h>
  292. #define _dos_read DosRead
  293. #define _dos_write DosWrite
  294. #define COMFILE_PREFIX ""
  295. #define COMFILE_SUFFIX ".CMD"
  296. #endif
  297.  
  298. #define isBITBRAIN 0x1b
  299.  
  300.