diff -urpN btxe.orig/include/async.h btxe/include/async.h
--- btxe.orig/include/async.h	1999-02-27 02:15:00.000000000 +0100
+++ btxe/include/async.h	2013-03-24 19:56:24.844226663 +0100
@@ -37,8 +37,8 @@
 #define IOCTL_DISK                  0x0008
 #define IOCTL_PHYSICALDISK          0x0009
 #ifndef __EMX__
-#define IOCTL_MONITOR               0x000A
-#define IOCTL_GENERAL               0x000B
+#define BT_IOCTL_MONITOR               0x000A
+#define BT_IOCTL_GENERAL               0x000B
 #endif
 
 /* General Device Control */
diff -urpN btxe.orig/include/externs.h btxe/include/externs.h
--- btxe.orig/include/externs.h	2000-08-09 10:52:26.000000000 +0200
+++ btxe/include/externs.h	2013-03-30 13:58:13.193908710 +0100
@@ -457,7 +457,7 @@ extern char *cleanup;
 extern char *answerback;
 extern char *CIDline;
 
-#ifdef OS_2
+#if defined(OS_2) && CAPI > 0
 
 extern byte UseCAPICID;
 extern char **AddCIDTo;
diff -urpN btxe.orig/include/includes.h btxe/include/includes.h
--- btxe.orig/include/includes.h	2000-08-09 10:52:26.000000000 +0200
+++ btxe/include/includes.h	2013-03-24 19:40:42.324219039 +0100
@@ -143,8 +143,8 @@ typedef struct utimbuf UTIMBUF;
 #   define UT_ACTIME actime
 typedef long off_t;
 
-#   include <sys\types.h>
-#   include <sys\stat.h>
+#   include <sys/types.h>
+#   include <sys/stat.h>
 #   include <mem.h>
 #   include <dir.h>
 #   include <alloc.h>
@@ -191,8 +191,8 @@ typedef long off_t;
 
 /* #if __BORLANDC__ >= 0x410 */
 #   ifdef __BORLANDC__
-#     include <sys\types.h>
-#     include <sys\stat.h>
+#     include <sys/types.h>
+#     include <sys/stat.h>
 #   else
 #     include <types.h>
 #     include <stat.h>
@@ -266,9 +266,9 @@ typedef void _cdecl MAINTYPE;
 # define _ffree(p)   free(p)
 # endif                         // defined _WIN32
 
-#include <sys\types.h>
-#include <sys\stat.h>
-#include <sys\utime.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/utime.h>
 typedef struct utimbuf UTIMBUF;
 
 #define UT_ACTIME actime
@@ -307,9 +307,9 @@ typedef void MAINTYPE;
 # else
 #   define COMPILER_NAME   "VAC++"
 # endif
-# include <sys\types.h>
-# include <sys\stat.h>
-# include <sys\utime.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <sys/utime.h>
 typedef struct utimbuf UTIMBUF;
 
 # define UT_ACTIME actime
@@ -355,9 +355,9 @@ typedef int MAINTYPE;
 # define SHARE_SOPEN            /* Share streams: sopen, not open */
 # define NEED_MKTEMP            /* Need our own mktemp            */
 # define FLUSHSTDOUT            /* MMP 960419 Need to flush standard output? */
-# include <sys\types.h>
-# include <sys\stat.h>
-# include <sys\utime.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <sys/utime.h>
 typedef struct utimbuf UTIMBUF;
 
 # define UT_ACTIME actime
@@ -389,9 +389,9 @@ typedef int MAINTYPE;           /* MR 96
 
 #ifdef __EMX__                  /* EMX 0.9c */
 # define COMPILER_NAME   "EMX"
-# include <sys\types.h>
-# include <sys\stat.h>
-# include <sys\utime.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <sys/utime.h>
 typedef unsigned short APIRET16; /*  TS 970126 */
 
 # define APIENTRY16 _Far16 _Pascal
@@ -452,8 +452,8 @@ typedef struct utimbuf UTIMBUF;
 # define NEED_CPUTS             /* Need our own cputs             */
 # define NEED_PUTCH             /* Need our own putch             */
 # define NEED_MKTEMP            /* Need our own mktemp            */
-# include <sys\types.h>
-# include <sys\stat.h>
+# include <sys/types.h>
+# include <sys/stat.h>
 struct utimbuf
 {
   time_t actime;                /* access time */
diff -urpN btxe.orig/include/prototyp.h btxe/include/prototyp.h
--- btxe.orig/include/prototyp.h	2000-05-14 19:50:08.000000000 +0200
+++ btxe/include/prototyp.h	2013-03-30 14:03:57.417967401 +0100
@@ -657,10 +657,12 @@ void copy_address (ADDRP, ADDRP); /* r.
 /* --------------------------------------------------------------------- */
 
 #ifdef OS_2
-
+#  if CAPI > 0 
 int CAPIInit (char *, char *);
 void CAPIStop (void);
+#  endif
 int CFOSMonitorStart (void);
+
 int CFOSResetHardware (void);
 word CFOSAddOrRemoveChannel (int what);
 
diff -urpN btxe.orig/linux/Makefile btxe/linux/Makefile
--- btxe.orig/linux/Makefile	2000-06-02 17:10:04.000000000 +0200
+++ btxe/linux/Makefile	2013-03-24 20:05:54.980251819 +0100
@@ -9,7 +9,7 @@
 # use fidoconfig (husky, see http://husky.physcip.uni-stuttgart.de/)
 # standard PATH_FIDOCONFIG should be ok with recent versions of fidoconfig
 
-USE_FIDOCONFIG = yes
+USE_FIDOCONFIG = no
 PATH_FIDOCONFIG = -I/usr/local/include
 
 # adjust these if neccessary
Binary files btxe.orig/linux/aglcrc.o and btxe/linux/aglcrc.o differ
Binary files btxe.orig/linux/asyn_lnx.o and btxe/linux/asyn_lnx.o differ
Binary files btxe.orig/linux/b_banner.o and btxe/linux/b_banner.o differ
Binary files btxe.orig/linux/b_bbs.o and btxe/linux/b_bbs.o differ
Binary files btxe.orig/linux/b_faxrcv.o and btxe/linux/b_faxrcv.o differ
Binary files btxe.orig/linux/b_flofil.o and btxe/linux/b_flofil.o differ
Binary files btxe.orig/linux/b_frproc.o and btxe/linux/b_frproc.o differ
Binary files btxe.orig/linux/b_help.o and btxe/linux/b_help.o differ
Binary files btxe.orig/linux/b_initva.o and btxe/linux/b_initva.o differ
Binary files btxe.orig/linux/b_logs.o and btxe/linux/b_logs.o differ
Binary files btxe.orig/linux/b_passwo.o and btxe/linux/b_passwo.o differ
Binary files btxe.orig/linux/b_proto.o and btxe/linux/b_proto.o differ
Binary files btxe.orig/linux/b_rspfil.o and btxe/linux/b_rspfil.o differ
Binary files btxe.orig/linux/b_sbinit.o and btxe/linux/b_sbinit.o differ
Binary files btxe.orig/linux/b_script.o and btxe/linux/b_script.o differ
Binary files btxe.orig/linux/b_search.o and btxe/linux/b_search.o differ
Binary files btxe.orig/linux/b_sessio.o and btxe/linux/b_sessio.o differ
Binary files btxe.orig/linux/b_spawn.o and btxe/linux/b_spawn.o differ
Binary files btxe.orig/linux/b_term.o and btxe/linux/b_term.o differ
Binary files btxe.orig/linux/b_termov.o and btxe/linux/b_termov.o differ
Binary files btxe.orig/linux/b_today.o and btxe/linux/b_today.o differ
Binary files btxe.orig/linux/b_wazoo.o and btxe/linux/b_wazoo.o differ
Binary files btxe.orig/linux/b_whack.o and btxe/linux/b_whack.o differ
Binary files btxe.orig/linux/b_wzsend.o and btxe/linux/b_wzsend.o differ
Binary files btxe.orig/linux/banner.o and btxe/linux/banner.o differ
Binary files btxe.orig/linux/bbs_ctra.o and btxe/linux/bbs_ctra.o differ
Binary files btxe.orig/linux/bbs_data.o and btxe/linux/bbs_data.o differ
Binary files btxe.orig/linux/bbs_io.o and btxe/linux/bbs_io.o differ
Binary files btxe.orig/linux/binkdlg.o and btxe/linux/binkdlg.o differ
Binary files btxe.orig/linux/binkley.lng and btxe/linux/binkley.lng differ
Binary files btxe.orig/linux/brec.o and btxe/linux/brec.o differ
Binary files btxe.orig/linux/bsend.o and btxe/linux/bsend.o differ
Binary files btxe.orig/linux/bt.o and btxe/linux/bt.o differ
Binary files btxe.orig/linux/btconfig.o and btxe/linux/btconfig.o differ
Binary files btxe.orig/linux/btutil and btxe/linux/btutil differ
Binary files btxe.orig/linux/btutil.o and btxe/linux/btutil.o differ
Binary files btxe.orig/linux/btxe and btxe/linux/btxe differ
Binary files btxe.orig/linux/cache.o and btxe/linux/cache.o differ
Binary files btxe.orig/linux/callback.o and btxe/linux/callback.o differ
Binary files btxe.orig/linux/callerid.o and btxe/linux/callerid.o differ
Binary files btxe.orig/linux/callwin.o and btxe/linux/callwin.o differ
Binary files btxe.orig/linux/chat.o and btxe/linux/chat.o differ
Binary files btxe.orig/linux/common.o and btxe/linux/common.o differ
Binary files btxe.orig/linux/css.o and btxe/linux/css.o differ
Binary files btxe.orig/linux/data.o and btxe/linux/data.o differ
Binary files btxe.orig/linux/dosfuncs.o and btxe/linux/dosfuncs.o differ
Binary files btxe.orig/linux/emsi.o and btxe/linux/emsi.o differ
Binary files btxe.orig/linux/evtparse.o and btxe/linux/evtparse.o differ
Binary files btxe.orig/linux/evtsetup.o and btxe/linux/evtsetup.o differ
Binary files btxe.orig/linux/file_all.o and btxe/linux/file_all.o differ
Binary files btxe.orig/linux/file_lnx.o and btxe/linux/file_lnx.o differ
Binary files btxe.orig/linux/fossil.o and btxe/linux/fossil.o differ
Binary files btxe.orig/linux/freepoll.o and btxe/linux/freepoll.o differ
Binary files btxe.orig/linux/ftsc.o and btxe/linux/ftsc.o differ
Binary files btxe.orig/linux/getbgfax.o and btxe/linux/getbgfax.o differ
Binary files btxe.orig/linux/gethcomm.o and btxe/linux/gethcomm.o differ
Binary files btxe.orig/linux/getra.o and btxe/linux/getra.o differ
Binary files btxe.orig/linux/gettg.o and btxe/linux/gettg.o differ
Binary files btxe.orig/linux/history.o and btxe/linux/history.o differ
Binary files btxe.orig/linux/hydra.o and btxe/linux/hydra.o differ
Binary files btxe.orig/linux/janus.o and btxe/linux/janus.o differ
Binary files btxe.orig/linux/keymap.o and btxe/linux/keymap.o differ
Binary files btxe.orig/linux/langload.o and btxe/linux/langload.o differ
Binary files btxe.orig/linux/m7rec.o and btxe/linux/m7rec.o differ
Binary files btxe.orig/linux/m7send.o and btxe/linux/m7send.o differ
Binary files btxe.orig/linux/mailer.o and btxe/linux/mailer.o differ
Binary files btxe.orig/linux/mailovly.o and btxe/linux/mailovly.o differ
Binary files btxe.orig/linux/mailroot.o and btxe/linux/mailroot.o differ
Binary files btxe.orig/linux/maxmcp.o and btxe/linux/maxmcp.o differ
Binary files btxe.orig/linux/maxprm.o and btxe/linux/maxprm.o differ
Binary files btxe.orig/linux/mdm_proc.o and btxe/linux/mdm_proc.o differ
Binary files btxe.orig/linux/misc.o and btxe/linux/misc.o differ
Binary files btxe.orig/linux/nodeproc.o and btxe/linux/nodeproc.o differ
Binary files btxe.orig/linux/outbound.o and btxe/linux/outbound.o differ
Binary files btxe.orig/linux/pktmsgs.o and btxe/linux/pktmsgs.o differ
Binary files btxe.orig/linux/protcomm.o and btxe/linux/protcomm.o differ
Binary files btxe.orig/linux/recvbark.o and btxe/linux/recvbark.o differ
Binary files btxe.orig/linux/recvsync.o and btxe/linux/recvsync.o differ
Binary files btxe.orig/linux/sbuf.o and btxe/linux/sbuf.o differ
Binary files btxe.orig/linux/sched.o and btxe/linux/sched.o differ
Binary files btxe.orig/linux/script2.o and btxe/linux/script2.o differ
Binary files btxe.orig/linux/sendbark.o and btxe/linux/sendbark.o differ
Binary files btxe.orig/linux/sendsync.o and btxe/linux/sendsync.o differ
Binary files btxe.orig/linux/squish.o and btxe/linux/squish.o differ
Binary files btxe.orig/linux/srif.o and btxe/linux/srif.o differ
Binary files btxe.orig/linux/statetbl.o and btxe/linux/statetbl.o differ
Binary files btxe.orig/linux/stats.o and btxe/linux/stats.o differ
Binary files btxe.orig/linux/timer.o and btxe/linux/timer.o differ
Binary files btxe.orig/linux/times.o and btxe/linux/times.o differ
Binary files btxe.orig/linux/version.o and btxe/linux/version.o differ
Binary files btxe.orig/linux/version7.o and btxe/linux/version7.o differ
Binary files btxe.orig/linux/vfos_lnx.o and btxe/linux/vfos_lnx.o differ
Binary files btxe.orig/linux/vt100.o and btxe/linux/vt100.o differ
Binary files btxe.orig/linux/xmrec.o and btxe/linux/xmrec.o differ
Binary files btxe.orig/linux/xmsend.o and btxe/linux/xmsend.o differ
Binary files btxe.orig/linux/yoohoo.o and btxe/linux/yoohoo.o differ
Binary files btxe.orig/linux/zmodem.o and btxe/linux/zmodem.o differ
Binary files btxe.orig/os2/.owc_cc.mak.swp and btxe/os2/.owc_cc.mak.swp differ
Binary files btxe.orig/os2/o_32_386/bink_pm.o and btxe/os2/o_32_386/bink_pm.o differ
Binary files btxe.orig/os2/o_32_386/binkdlg.o and btxe/os2/o_32_386/binkdlg.o differ
diff -urpN btxe.orig/os2/owc_cc.mak btxe/os2/owc_cc.mak
--- btxe.orig/os2/owc_cc.mak	1970-01-01 01:00:00.000000000 +0100
+++ btxe/os2/owc_cc.mak	2013-03-30 14:37:01.054218441 +0100
@@ -0,0 +1,676 @@
+#####################################################################
+#                                                                   #
+# makefile for compiling Binkley XE for OS/2 with Watcom C/C++ 10.x #
+#                                                                   #
+#####################################################################
+
+# compile for which OS (os2 or dos) (see ../dos/watcom.mak for DOS version!)
+OS       = os2
+
+# compile debug version (yes), non-debug version (no) or optimized version (opt)
+DEB      = opt
+
+# language (english, startrek, deutsch)
+LANGUAGE = english
+
+
+########################################################################
+#                                                                      #
+# make include file for BinkleyTerm Version 2.60 XE                    #
+#                                                                      #
+# Compiler: Watcom v10.x                                               #
+#                                                                      #
+########################################################################
+#                                                                      #
+# If you're using Watcom C v10.6 set environment variable WCCVER to    #
+# 106 (without a dot) to use the new features of v10.6.                #
+# Sorry, this is the only way I found to select between the different  #
+# versions of Watcom C.                                                #
+#                                                                      #
+########################################################################
+#                                                                      #
+# Set the environment variable WCCLOAD to the number of minutes you    #
+# want to keep wcc(386) in memory for faster compiling. Please note    #
+# that emxload is required to use this feature. If this variable is    #
+# not set, this feature is not used. Try "set WCCLOAD=5".              #
+#                                                                      #
+########################################################################
+#                                                                      #
+# The following macros can also be set in the command line or          #
+# in another makefile.                                                 #
+#                                                                      #
+# macro  description            default   possible values              #
+#                                                                      #
+# OS     Operating System       os2       dos, os2                     #
+# CPU    CPU                    386        86, 186, 286, 386, 486, 586 #
+# OVL    overlayed exe (DOS)    no        yes,  no                     #
+# DEB    debugging information  opt       yes,  no, code, opt          #
+# MCD    use maxcomm.dll        no        yes,  no                     #
+# CCH    outbound caching code  yes(OS2)  yes,  no                     #
+# IBS    internal BBS           no        yes,  no                     #
+# LNG    language               english   english, deutsch, startrek,  #
+#                                         swedish                      #
+#                                                                      #
+########################################################################
+
+.ERASE
+.OPTIMIZE
+.SILENT
+
+SRC_DIR    = ../src
+INC_DIR    = ../include
+LIB_DIR    = ../lib
+DOC_DIR    = ../doc
+
+ERRFOPT    = -fr=$(OBJ_DIR)/$^&.err
+
+# check...
+
+!ifndef OS
+OS         = os2
+!endif
+
+!ifndef CPU
+CPU        = 386
+!endif
+
+!ifndef OVL
+OVL        = no
+!endif
+
+!ifndef DEB
+DEB        = opt
+!endif
+
+!ifndef MCD
+MCD        = no
+!endif
+
+!ifndef CCH
+! ifeq OS os2
+CCH        = yes
+! else
+CCH        = no
+! endif
+!endif
+
+!ifndef IBS
+IBS        = no
+!endif
+
+!ifndef ELN
+ELN        = no
+!endif
+
+!ifndef LNG
+LNG        = english
+!endif
+
+!ifneq CPU 86
+! ifneq CPU 186
+!  ifneq CPU 286
+!   ifneq CPU 386
+!    ifneq CPU 486
+!     ifneq CPU 586
+!      error unsupported cpu $(CPU)...
+!     endif
+!    endif
+!   endif
+!  endif
+! endif
+!endif
+
+!ifneq OS dos
+! ifneq OS os2
+!  error unsupported Operating System $(OS)...
+! endif
+!endif
+
+!ifneq DEB yes
+! ifneq DEB code
+!  ifneq DEB no
+!   ifneq DEB opt
+!    error unsupported debug option
+!   endif
+!  endif
+! endif
+!endif
+
+!ifeq OS os2
+BIT        = 32
+!else ifeq OS dos
+BIT        = 16
+!endif
+
+BU_OS_EXE  = $(BU_EXE)
+
+!ifdef __OS2__
+NULDEV     = 1>nul 2>nul
+! ifeq OS dos
+BU_OS_EXE  = ../os2/e_32_386/btutil32.exe
+! endif
+!else ifdef __MSDOS__
+NULDEV     = >nul
+!endif
+!ifdef __LINUX__
+NULDEV     = >/dev/null 2>&1
+BU_OS_EXE  = ../linux/btutil
+!endif
+
+
+# settings...
+
+EXE_DIR    = ../$(OS)/e_$(BIT)_$(CPU)
+OBJ_DIR    = ../$(OS)/o_$(BIT)_$(CPU)
+
+!ifeq BIT 32
+#CC        = wpp386
+CC         = wcc386
+!else ifeq BIT 16
+#CC        = wpp
+CC         = wcc
+!endif
+
+AC         = wasm
+LNK        = wlink
+RC         = rc
+
+# files for binkley
+BT_OBJ_O   = aglcrc.obj
+BT_OBJ_O  += b_banner.obj
+BT_OBJ_O  += b_bbs.obj
+BT_OBJ_O  += b_faxrcv.obj
+BT_OBJ_O  += b_flofil.obj
+BT_OBJ_O  += b_frproc.obj
+BT_OBJ_O  += b_help.obj
+BT_OBJ_O  += b_initva.obj
+BT_OBJ_O  += b_logs.obj
+BT_OBJ_O  += b_passwo.obj
+BT_OBJ_O  += b_proto.obj
+BT_OBJ_O  += b_rspfil.obj
+BT_OBJ_O  += b_sbinit.obj
+BT_OBJ_O  += b_script.obj
+BT_OBJ_O  += b_search.obj
+BT_OBJ_O  += b_sessio.obj
+BT_OBJ_O  += b_spawn.obj
+BT_OBJ_O  += b_term.obj
+BT_OBJ_O  += b_termov.obj
+BT_OBJ_O  += b_today.obj
+BT_OBJ_O  += b_wazoo.obj
+BT_OBJ_O  += b_whack.obj
+BT_OBJ_O  += b_wzsend.obj
+BT_OBJ_O  += banner.obj
+BT_OBJ_R  += binkdlg.obj
+BT_OBJ_O  += brec.obj
+BT_OBJ_O  += bsend.obj
+BT_OBJ_O  += bt.obj
+BT_OBJ_O  += btconfig.obj
+BT_OBJ_O  += cache.obj
+BT_OBJ_O  += callback.obj
+BT_OBJ_O  += callerid.obj
+BT_OBJ_O  += callwin.obj
+#BT_OBJ_O  += capi.obj
+BT_OBJ_O  += cfosline.obj
+BT_OBJ_O  += chat.obj
+BT_OBJ_R  += common.obj
+BT_OBJ_O  += css.obj
+BT_OBJ_R  += data.obj
+BT_OBJ_O  += debug.obj
+BT_OBJ_R  += dosfuncs.obj
+BT_OBJ_O  += emsi.obj
+BT_OBJ_O  += evtparse.obj
+BT_OBJ_O  += evtsetup.obj
+BT_OBJ_R  += file_all.obj
+BT_OBJ_R  += fossil.obj
+BT_OBJ_O  += freepoll.obj
+BT_OBJ_O  += ftsc.obj
+BT_OBJ_O  += heap.obj
+BT_OBJ_O  += history.obj
+BT_OBJ_R  += hydra.obj
+BT_OBJ_R  += janus.obj
+BT_OBJ_R  += keymap.obj
+BT_OBJ_O  += langload.obj
+BT_OBJ_O  += m7rec.obj
+BT_OBJ_O  += m7send.obj
+BT_OBJ_R  += mailer.obj
+BT_OBJ_R  += mailovly.obj
+BT_OBJ_R  += mailroot.obj
+BT_OBJ_O  += maxmcp.obj
+BT_OBJ_O  += maxprm.obj
+BT_OBJ_O  += mdm_proc.obj
+BT_OBJ_R  += misc.obj
+BT_OBJ_O  += nodeproc.obj
+BT_OBJ_O  += outbound.obj
+BT_OBJ_O  += pktmsgs.obj
+BT_OBJ_O  += protcomm.obj
+BT_OBJ_O  += recvbark.obj
+BT_OBJ_O  += recvsync.obj
+BT_OBJ_R  += sbuf.obj
+BT_OBJ_O  += sched.obj
+BT_OBJ_O  += sendbark.obj
+BT_OBJ_O  += sendsync.obj
+BT_OBJ_O  += squish.obj
+BT_OBJ_O  += srif.obj
+BT_OBJ_O  += statetbl.obj
+BT_OBJ_O  += stats.obj
+BT_OBJ_R  += timer.obj
+BT_OBJ_O  += times.obj
+BT_OBJ_O  += version.obj
+BT_OBJ_R  += version7.obj
+BT_OBJ_O  += vt100.obj
+BT_OBJ_O  += xmrec.obj
+BT_OBJ_O  += xmsend.obj
+BT_OBJ_O  += yoohoo.obj
+BT_OBJ_R  += zmodem.obj
+
+!ifeq OS os2
+BT_OBJ_O  += asyn_os2.obj
+BT_OBJ_O  += exceptio.obj
+BT_OBJ_R  += file_os2.obj
+BT_OBJ_O  += os2_pm.obj
+BT_OBJ_O  += pipe.obj
+BT_OBJ_O  += vfos_os2.obj
+!else ifeq OS dos
+BT_OBJ_R  += bink_asm.obj
+BT_OBJ_R  += file_dos.obj
+BT_OBJ_R  += spawn.obj
+BT_OBJ_R  += vfos_dos.obj
+!endif
+
+!ifeq IBS yes
+BT_OBJ_O  += script2.obj
+BT_OBJ_O  += bbs_ctra.obj
+BT_OBJ_O  += bbs_data.obj
+BT_OBJ_O  += bbs_io.obj
+!endif
+
+!ifeq OS os2
+BT_LNK_OBJ  = file {$(BT_OBJ_R) $(BT_OBJ_O)}
+BT_LNK_OPT  = option modname=BT-XE option description 'BinkleyTerm' option version=2.60
+BU_LNK_OPT  = option modname=BTUtil option description 'BinkleyTerm' option version=2.60
+!else ifeq OS dos
+! ifeq OVL yes
+BT_LNK_OBJ  = option dynamic file {$(BT_OBJ_R)}
+BT_LNK_OBJ += begin autosection file {$(BT_OBJ_O)} end
+! else
+BT_LNK_OBJ  = file {$(BT_OBJ_R) $(BT_OBJ_O)}
+! endif
+!endif
+
+# files for btutil
+BU_OBJ     = btutil.obj
+BU_OBJ    += common.obj
+BU_OBJ    += gethcomm.obj
+BU_OBJ    += getra.obj
+BU_OBJ    += getbgfax.obj
+BU_OBJ    += getmax3.obj
+BU_OBJ    += gettg.obj
+
+# files for bink_pm.dll
+BD_OBJ     = bink_pm.obj
+
+# files for binkpipe.dll
+BP_OBJ     = binkpipe.obj
+
+# files for toss.exe (OS/2)
+TOS_OBJ    = toss.obj
+
+# files for xr5toxr6.exe (DOS)
+X56_OBJ    = xr5toxr6.obj
+
+# enable heap checking
+#OPTFLAGS += -dHEAPCHECK
+
+# hydra device
+OPTFLAGS  += -dHYDRADEV
+
+# OS/2 32bit, use internal async routines
+!ifeq OS os2
+! ifneq MCD yes
+OPTFLAGS   += -dNEED_OS2COMMS
+MCD_STR     = enabled
+! else
+MCD_STR     = disabled, using maxcomm.dll
+BT_LNK_OBJ += libfile maxcomm.lib
+! endif
+!endif
+
+# OS/2, enable priorities
+!ifeq OS os2
+OPTFLAGS  += -dNEED_SET_PRIOR
+!endif
+
+OPTFLAGS  += -dCAPI=0
+
+# bugfix for Spirit II modems
+#OPTFLAGS += -dSPIRIT_FIX
+
+# install internal cache module
+!ifeq CCH yes
+OPTFLAGS  += -dCACHE
+CCH_STR    = enabled
+!else
+CCH_STR    = disabled
+!endif
+
+# install except. handler (doesn't work; watcom's not able to produce valid codeview sym files)
+#OPTFLAGS += -dEXCEPTIONS
+
+# compile with internal BBS
+!ifeq IBS yes
+OPTFLAGS  += -dBBS_INTERNAL
+IBS_STR    = enabled
+!else
+IBS_STR    = disabled
+!endif
+
+# enable load of external BINKLEY.LNG (use only for debug proposes!)
+!ifeq ELN yes
+OPTFLAGS  += -dUSELNGFILE
+!endif
+
+# LNKOPTS   - general linker options
+# T_LNKOPTS - linker options to build textmode EXEs
+# P_LNKOPTS - linker options to build PM EXEs
+# D_LNKOPTS - linker options to build DLLs
+
+# CCOPTS    - general compiler options
+# D_CCOPTS  - compiler options to build DLLs
+# E_CCOPTS  - compiler options to build EXEs
+
+CCOPTS     = -i=$(INC_DIR) -wx -zq -zp1
+LNKOPTS    = option stack=32768 option cache option quiet
+LNKOPTS   += path $(OBJ_DIR) libpath $(LIB_DIR)
+
+!ifeq OS os2
+CCOPTS    += -bt=OS2V2 -dOS_2 -mf
+E_CCOPTS   = -bm
+D_CCOPTS   = -bd
+T_LNKOPTS  = system os2v2 pmcompatible
+D_LNKOPTS  = system os2v2 dll initinstance
+P_LNKOPTS  = system os2v2_pm
+GNAT       = 32
+!else ifeq OS dos
+CCOPTS    += -bt=DOS -dMSDOS -ml -zt48
+ACOPTS     = -bt=MSDOS -w9 -q $(ACOPTS_CPU) -dWATCOM
+LNKOPTS   += system dos
+GNAT       =
+! ifeq OVL yes
+CCOPTS    += -dOVERLAYS -wo -of
+OVL_STR    = enabled (dynamic overlay manager)
+! else
+OVL_STR    = disabled
+! endif
+!endif
+
+!ifeq DEB yes
+CCOPTS    += -d2 -od -hw -dCO_NOPT
+LNKOPTS   += debug all option symfile
+OPT_STR    = disabled
+DEB_STR    = enabled (watcom, symfile)
+!else ifeq DEB code
+CCOPTS    += -d2 -od -hw -dDEBUG -dCO_NOPT
+LNKOPTS   += debug all option symfile
+OPT_STR    = disabled
+DEB_STR    = enabled (watcom, symfile) + debug code
+!else ifeq DEB no
+CCOPTS    += -od -dCO_NOPT
+OPT_STR    = disabled
+DEB_STR    = disabled
+!else ifeq DEB opt
+! ifeq OS os2
+CCOPTS    += -omilre
+! else ifeq OS dos
+CCOPTS    += -osmlre
+#CCOPTS   += -oneatx
+! endif
+CCOPTS    += -s -dCO_OPT
+OPT_STR    = enabled
+DEB_STR    = disabled
+!endif
+
+!ifeq BIT 32
+! ifeq CPU 386
+CCOPTS    += -3r
+! else ifeq CPU 486
+CCOPTS    += -4r
+! else ifeq CPU 586
+CCOPTS    += -5r
+! endif
+!else ifeq BIT 16
+! ifeq CPU 86
+CCOPTS    += -0
+ACOPTS    += -0
+! else ifeq CPU 186
+CCOPTS    += -1
+ACOPTS    += -1
+! else ifeq CPU 286
+CCOPTS    += -2
+ACOPTS    += -2
+! else ifeq CPU 386
+CCOPTS    += -3
+ACOPTS    += -2
+! else ifeq CPU 486
+CCOPTS    += -4
+ACOPTS    += -2
+! else ifeq CPU 586
+CCOPTS    += -5
+ACOPTS    += -2
+! endif
+!endif
+CCOPTS    += -d_CPU=$(CPU)
+
+!ifeq OVL yes
+BT_EXE     = $(EXE_DIR)/bt_o_$(CPU).exe
+BT_MAP     = $(EXE_DIR)/bt_o_$(CPU).map
+!else
+BT_EXE     = $(EXE_DIR)/bt$(GNAT)_$(CPU).exe
+BT_MAP     = $(EXE_DIR)/bt$(GNAT)_$(CPU).map
+!endif
+
+BU_EXE     = $(EXE_DIR)/btutil$(GNAT).exe
+BU_MAP     = $(EXE_DIR)/btutil$(GNAT).map
+
+!ifeq OS os2
+BD_DLL     = $(EXE_DIR)/bink_pm.dll
+BD_MAP     = $(EXE_DIR)/bink_pm.map
+BP_EXE     = $(EXE_DIR)/binkpipe.exe
+BP_MAP     = $(EXE_DIR)/binkpipe.map
+TOS_EXE    = $(EXE_DIR)/toss.exe
+TOS_MAP    = $(EXE_DIR)/toss.map
+!endif
+
+!ifeq OS dos
+X56_EXE    = $(EXE_DIR)/xr5toxr6.exe
+X56_MAP    = $(EXE_DIR)/xr5toxr6.map
+!endif
+
+
+.EXTENSIONS  :
+.EXTENSIONS  : .exe .dll .obj .res .lib .c .asm .rc .lng
+
+.c   : $(SRC_DIR)
+.rc  : ../os2_pm
+.asm : $(SRC_DIR)
+.exe : $(EXE_DIR)
+.dll : $(EXE_DIR)
+.obj : $(OBJ_DIR)
+.res : $(OBJ_DIR)
+.lng : $(OBJ_DIR)
+.lib : $(OBJ_DIR)
+
+
+# dependencies
+
+all           : .SYMBOLIC tell dirs preload $(BT_EXE) $(BD_DLL) $(BP_EXE) $(X56_EXE) $(TOS_EXE)
+
+bt            : .SYMBOLIC tell dirs preload $(BT_EXE)
+
+btutil        : .SYMBOLIC dirs $(BU_EXE) 
+
+clean         : .SYMBOLIC clean_o clean_e clean_d
+
+
+tell          : .SYMBOLIC
+        echo .
+        echo compiling BT-XE for $(OS) $(BIT)bit i$(CPU)
+        echo optimzations  : $(OPT_STR)
+        echo debugging inf.: $(DEB_STR)
+!ifeq OS dos
+        echo overlays      : $(OVL_STR)
+!endif
+        echo .
+        echo optional modules
+        echo - outbnd cache: $(CCH_STR)
+!ifeq OS os2
+        echo - int. async  : $(MCD_STR)
+!endif
+        echo - int. BBS    : $(IBS_STR)
+!ifeq ELN yes
+        echo - ext.LNG sup.: enabled (use only for debuging)
+!endif
+        echo .
+
+dirs          : .SYMBOLIC
+        echo creating directories
+        -mkdir $(EXE_DIR) $(NULDEV)
+        -mkdir $(OBJ_DIR) $(NULDEV)
+
+preload       : .SYMBOLIC
+!ifdef %WCCLOAD
+        echo preloading $(CC)
+        emxload -m $(%WCCLOAD) $(CC)
+!endif
+
+clean_o       : .SYMBOLIC
+        echo removing object files
+        -rm -f $(OBJ_DIR)/*.obj $(OBJ_DIR)/*.res $(OBJ_DIR)/*.lng $(OBJ_DIR)/*.pch $(OBJ_DIR)/*.bak $(OBJ_DIR)/*.err $(OBJ_DIR)/*.mbr $(NULDEV)
+
+clean_e       : .SYMBOLIC
+        echo removing exe files
+        -rm -f $(EXE_DIR)/*.exe $(EXE_DIR)/*.dll $(EXE_DIR)/*.map $(EXE_DIR)/*.sym $(EXE_DIR)/*.ovl $(NULDEV)
+
+clean_d       : .SYMBOLIC
+        echo removing directories
+        -rmdir $(EXE_DIR) $(NULDEV)
+        -rmdir $(OBJ_DIR) $(NULDEV)
+
+
+$(BT_EXE)    : $(BT_OBJ_R) $(BT_OBJ_O) $(BU_EXE) $(BU_OS_EXE) $(LNG).lng
+        echo linking $(BT_EXE)
+        *$(LNK) $(LNKOPTS) $(T_LNKOPTS) option map=$(BT_MAP) name $(BT_EXE) $(BT_LNK_OBJ) $(BT_LNK_OPT)
+#!ifneq ELN yes
+#        echo patching language ($(LNG)) to $(BT_EXE)
+#        $(BU_OS_EXE) lng patch $(BT_EXE) $(OBJ_DIR)/$(LNG).lng $(NULDEV)
+#!endif
+
+!ifneq BU_OS_EXE $(BU_EXE)
+$(BU_OS_EXE)  : $(BU_OBJ)
+        echo you need $(BU_OS_EXE), please compile for your native OS first.
+!endif
+
+$(BU_EXE)     : $(BU_OBJ)
+!ifeq DEB code
+        echo debug code enabled, can't link $(BU_EXE).
+!else
+        echo linking $(BU_EXE)
+        *$(LNK) $(LNKOPTS) $(T_LNKOPTS) option map=$(BU_MAP) name $(BU_EXE) file {$(BU_OBJ)} $(BU_LNK_OPT)
+!endif
+
+gethcomm.obj  : .AUTODEPEND
+        echo compiling $(SRC_DIR)/gethist/$^&.c
+        *$(CC) $(SRC_DIR)/gethist/$^&.c -fo=$(OBJ_DIR)/$@ $(ERRFOPT) $(CCOPTS) $(E_CCOPTS)
+
+getra.obj     : .AUTODEPEND
+        echo compiling $(SRC_DIR)/gethist/$^&.c
+        *$(CC) $(SRC_DIR)/gethist/$^&.c -fo=$(OBJ_DIR)/$@ $(ERRFOPT) $(CCOPTS) $(E_CCOPTS)
+
+getbgfax.obj  : .AUTODEPEND
+        echo compiling $(SRC_DIR)/gethist/$^&.c
+        *$(CC) $(SRC_DIR)/gethist/$^&.c -fo=$(OBJ_DIR)/$@ $(ERRFOPT) $(CCOPTS) $(E_CCOPTS)
+
+getmax3.obj   : .AUTODEPEND
+        echo compiling $(SRC_DIR)/gethist/$^&.c
+        *$(CC) $(SRC_DIR)/gethist/$^&.c -fo=$(OBJ_DIR)/$@ $(ERRFOPT) $(CCOPTS) $(E_CCOPTS)
+
+gettg.obj     : .AUTODEPEND
+        echo compiling $(SRC_DIR)/gethist/telegard/$^&.c
+        *$(CC) $(SRC_DIR)/gethist/$^&.c -fo=$(OBJ_DIR)/$@ $(ERRFOPT) $(CCOPTS) $(E_CCOPTS)
+
+
+english.lng   : $(BU_OS_EXE) $(SRC_DIR)/language.txt
+        echo creating $(EXE_DIR)/english.lng
+        $(BU_OS_EXE) lng key E $(SRC_DIR)/language.txt $(OBJ_DIR)/english.lng $(NULDEV)
+
+startrek.lng  : $(BU_OS_EXE) $(SRC_DIR)/language.txt
+        echo creating $(EXE_DIR)/startrek.lng
+        $(BU_OS_EXE) lng key S $(SRC_DIR)/language.txt $(OBJ_DIR)/startrek.lng $(NULDEV)
+
+deutsch.lng   : $(BU_OS_EXE) $(SRC_DIR)/language.txt
+        echo creating $(EXE_DIR)/deutsch.lng
+        $(BU_OS_EXE) lng key G $(SRC_DIR)/language.txt $(OBJ_DIR)/deutsch.lng $(NULDEV)
+
+swedish.lng   : $(BU_OS_EXE) $(SRC_DIR)/language.txt
+        echo creating $(EXE_DIR)/swedish.lng
+        $(BU_OS_EXE) lng key V $(SRC_DIR)/language.txt $(OBJ_DIR)/swedish.lng $(NULDEV)
+
+!ifeq OS os2
+$(BD_DLL)     : $(BD_OBJ)
+        echo linking $(BD_DLL)
+        $(LNK) $(LNKOPTS) $(D_LNKOPTS) option map=$(BD_MAP) name $(BD_DLL) file {$(BD_OBJ)} option modname=Bink_PM option description 'BinkleyTerm' option caseexact segment class 'code' loadoncall export {IsPipeRunning SetWindowTitle GetVersion}
+
+$(BP_EXE)     : $(BP_OBJ) binkpipe.res
+        echo linking $(BP_EXE)
+        *$(LNK) $(LNKOPTS) $(P_LNKOPTS) option map=$(BP_MAP) name $(BP_EXE) file {$(BP_OBJ)} option modname=BinkPipe option description 'BinkleyTerm' option manyautodata option heapsize=8192
+        echo adding resources to $(BP_EXE)
+        *$(RC) -p -x $(OBJ_DIR)/binkpipe.res $(BP_EXE) >nul
+
+$(BD_OBJ)     : .AUTODEPEND
+        echo compiling $(SRC_DIR)/os2/bink_pm/$^&.c
+        *$(CC) $(SRC_DIR)/os2/bink_pm/$^&.c -fo=$(OBJ_DIR)/$@ $(ERRFOPT) $(CCOPTS) $(D_CCOPTS) -D__MIG_LIB__
+
+$(BP_OBJ)     : .AUTODEPEND
+        echo compiling $(SRC_DIR)/os2/binkpipe/$^&.c
+        *$(CC) $(SRC_DIR)/os2/binkpipe/$^&.c -fo=$(OBJ_DIR)/$@ $(ERRFOPT) $(CCOPTS) $(E_CCOPTS) -D_Optlink=
+
+binkpipe.res  : $(SRC_DIR)/os2/binkpipe/binkpipe.rc
+        echo copying ../os2/bt32.ico to $(SRC_DIR)/os2/binkpipe
+        cp ../os2/bt32.ico $(SRC_DIR)/os2/binkpipe >nul
+        echo compiling $(SRC_DIR)/os2/binkpipe/$^&.rc
+        -cd $(SRC_DIR)/os2/binkpipe
+        *$(RC) -i ../../$(INC_DIR) -r $^&.rc ../../$(OBJ_DIR)/$^&.res >nul
+        -cd ../../../os2
+
+$(TOS_EXE)    : $(TOS_OBJ)
+        echo linking $(TOS_EXE)
+        *$(LNK) $(LNKOPTS) $(T_LNKOPTS) option map=$(TOS_MAP) name $(TOS_EXE) file {$(TOS_OBJ)} option modname=TOSS option description 'TOSS - server/client for BinkleyTerm 2.60 eXtended Edition'
+
+toss.obj      : .AUTODEPEND
+        echo compiling $(SRC_DIR)/os2/toss/$^&.c
+        *$(CC) $(SRC_DIR)/os2/toss/$^&.c /fo=$(OBJ_DIR)/$^& $(ERRFOPT) $(CCOPTS) $(E_CCOPTS)
+
+!endif
+
+!ifeq OS dos
+$(X56_EXE)    : $(X56_OBJ)
+! ifeq DEB code
+        echo debug code enabled, can't link $(X56_EXE).
+! else
+        echo linking $(X56_EXE)
+        *$(LNK) $(LNKOPTS) $(T_LNKOPTS) option map=$(X56_MAP) name $(X56_EXE) file {$(X56_OBJ)}
+! endif
+
+xr5toxr6.obj  : .AUTODEPEND
+        echo compiling $(SRC_DIR)/dos/$^&.c
+        *$(CC) $(SRC_DIR)/dos/$^&.c /fo=$(OBJ_DIR)/$^& $(ERRFOPT) -i=$(SRC_DIR)/dos $(CCOPTS) $(E_CCOPTS)
+!endif
+
+.c.obj        : .AUTODEPEND
+        echo compiling $[*.c
+#        *$(CC) $[*.c -fo=$(OBJ_DIR)/$^& $(ERRFOPT) $(CCOPTS) $(E_CCOPTS) -fh=$(OBJ_DIR)/btincs.pch $(OPTFLAGS)
+        *$(CC) $[*.c -fo=$(OBJ_DIR)/$@ $(ERRFOPT) $(CCOPTS) $(E_CCOPTS) -fh=$(OBJ_DIR)/btincs.pch $(OPTFLAGS)
+
+.asm.obj      : .AUTODEPEND
+        echo compiling $[*.asm
+        *$(AC) $[*.asm -fo=$(OBJ_DIR)/$^& $(ERRFOPT) $(ACOPTS)
+
diff -urpN btxe.orig/os2/owc_cc.sh btxe/os2/owc_cc.sh
--- btxe.orig/os2/owc_cc.sh	1970-01-01 01:00:00.000000000 +0100
+++ btxe/os2/owc_cc.sh	2013-03-30 13:52:23.069851630 +0100
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+export WATCOM=/opt/watcom
+. $WATCOM/owsetenv.sh
+export INCLUDE=$WATCOM/h:$WATCOM/h/os2:$WATCOM/toolkit/h
+
+wmake -h -f owc_cc.mak "$@"
diff -urpN btxe.orig/src/b_sessio.c btxe/src/b_sessio.c
--- btxe.orig/src/b_sessio.c	2000-05-14 19:50:08.000000000 +0200
+++ btxe/src/b_sessio.c	2013-03-30 14:01:58.489947782 +0100
@@ -509,7 +509,7 @@ b_session_cleanup (int sess_result) /* V
   next_rescan = 0L;
   next_time = 0L;
 
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
   CIDFromCAPI[0] = 0;           /* Remove caller-id so it isn't used for next call... */
   UpdateCID = 1;                /* ...And allow CAPI thread to update it */
 #endif
diff -urpN btxe.orig/src/bt.c btxe/src/bt.c
--- btxe.orig/src/bt.c	2000-10-06 21:53:02.000000000 +0200
+++ btxe/src/bt.c	2013-03-30 13:58:57.341916657 +0100
@@ -372,7 +372,7 @@ binkmain (int argc, char *argv[])
   b_sbexit ();
   b_exitproc ();
 
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
   if (UseCAPICID)               /* CFS 970310 - Unlink from CAPI on exit */
     CAPIStop ();
 #endif
diff -urpN btxe.orig/src/btconfig.c btxe/src/btconfig.c
--- btxe.orig/src/btconfig.c	2000-08-09 10:52:30.000000000 +0200
+++ btxe/src/btconfig.c	2013-03-30 14:02:59.009957155 +0100
@@ -2457,7 +2457,7 @@ parse_keyword (int keyword, char *c)
 
 
   case 268:                    /* CFS 970310 CAPICID       */
-#if !defined(OS_2) || defined(__EMX__)
+#if !defined(OS_2) || defined(__EMX__) || CAPI == 0
     error = kwd_unknown;
 #else
     p = skip_to_word (c);
diff -urpN btxe.orig/src/callback.c btxe/src/callback.c
--- btxe.orig/src/callback.c	1999-03-22 02:49:22.000000000 +0100
+++ btxe/src/callback.c	2013-03-30 14:04:38.549974252 +0100
@@ -108,7 +108,7 @@ callback (ADDRP CBAddress)
   chg_mail = cftemp;
   docrash (CBAddress);
   time_release ();
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
   UpdateCID = 1;
 #endif
 }
diff -urpN btxe.orig/src/callerid.c btxe/src/callerid.c
--- btxe.orig/src/callerid.c	1999-03-22 02:49:22.000000000 +0100
+++ btxe/src/callerid.c	2013-03-30 14:05:02.661978176 +0100
@@ -119,7 +119,7 @@ rejected_call (char *cid)
       modem_reject ();
       time_release ();
       global_rescan ();         /* bugfix for multiline CE 971020 */
-#if defined(OS_2) && !defined(__EMX__)  /*  TS 970403   */
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0 /*  TS 970403   */
       UpdateCID = 1;
 #endif
     }
diff -urpN btxe.orig/src/capi.c btxe/src/capi.c
--- btxe.orig/src/capi.c	1999-03-22 02:49:24.000000000 +0100
+++ btxe/src/capi.c	2013-03-30 13:55:34.877880458 +0100
@@ -20,7 +20,7 @@
  *
  *---------------------------------------------------------------------------*/
 
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
 #pragma stack16 (0)
 
 #include "includes.h"
diff -urpN btxe.orig/src/cfosline.c btxe/src/cfosline.c
--- btxe.orig/src/cfosline.c	1999-02-27 02:15:46.000000000 +0100
+++ btxe/src/cfosline.c	2013-03-30 14:08:45.402013583 +0100
@@ -134,7 +134,7 @@ CFOSResetHardware (void)
   ULONG LParam, LReturn;
 
   input.ax = 0x9001;
-  DosDevIOCtl2 (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
+  DosDevIOCtl (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
                 sizeof (input), &LParam, &output, sizeof (output), &LReturn);
   return output.ax;
 }
@@ -154,7 +154,7 @@ CFOSAddOrRemoveChannel (int what)
   else
     input.bx = 2;
 
-  DosDevIOCtl2 (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
+  DosDevIOCtl (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
                 sizeof (input), &LParam, &output, sizeof (output), &LReturn);
 
   return output.ax;
@@ -193,7 +193,7 @@ CFOSMonitorThread (PVOID x)
       {
         input.ax = 0x9000;
         output.ax = output.cx = output.dx = 0;
-        DosDevIOCtl2 (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
+        DosDevIOCtl (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
                sizeof (input), &LParam, &output, sizeof (output), &LReturn);
         if (output.ax != 0x1969 || output.cx != 0x6346 || output.dx != 0x6f73)
         {
@@ -230,7 +230,7 @@ CFOSMonitorThread (PVOID x)
         /* Get ISDN time */
         input.ax = 0x9005;
         input.bx = 1;           /* Don't reset CFOS timediff */
-        DosDevIOCtl2 (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
+        DosDevIOCtl (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
                sizeof (input), &LParam, &output, sizeof (output), &LReturn);
         time (&it);
         if (output.cx != 0x7fff || output.bx != 0xffff)
@@ -312,7 +312,7 @@ CFOSMonitorThread (PVOID x)
           input.ax = 0x9002;
           input.cx = sizeof (output.buffer);
           input.buflen = sizeof (output.buffer);
-          DosDevIOCtl2 (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
+          DosDevIOCtl (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
                sizeof (input), &LParam, &output, sizeof (output), &LReturn);
           if (output.ax)        /* Function failed */
           {
@@ -346,7 +346,7 @@ CFOSMonitorThread (PVOID x)
               input.ax = 0x9003;
               input.bx = 0xffff;
               input.buflen = sizeof (output.buffer);
-              DosDevIOCtl2 (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
+              DosDevIOCtl (PortHandle, CFOSCATEGORY, CFOSFUNCTION, &input,
                sizeof (input), &LParam, &output, sizeof (output), &LReturn);
               if (output.ax)
               {
diff -urpN btxe.orig/src/mailroot.c btxe/src/mailroot.c
--- btxe.orig/src/mailroot.c	2000-05-17 17:37:44.000000000 +0200
+++ btxe/src/mailroot.c	2013-03-30 14:01:23.621941790 +0100
@@ -382,7 +382,7 @@ process_the_damned_mail:
     }
     else
       callstart = cfscallstart;
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
     UpdateCID = 0;
 #endif
     sess_result = b_session (1, &CallInfo);  /* do a mail session  *//* VRP 990826 */
@@ -457,7 +457,7 @@ dial_aborted:
 
 end_movelogs:
 
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
   UpdateCID = 1;
 #endif
   movelogs ();
@@ -501,7 +501,7 @@ handle_inbound_mail (int answer_now)
                               !(server_mode && CARRIER) && !CHAR_AVAIL ()))
     {
       time_release ();
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
       UpdateCID = 1;
 #endif
       return (0);               /* No, nothing to do                */
@@ -539,7 +539,7 @@ handle_inbound_mail (int answer_now)
     if (server_mode && CARRIER)
     {
       mr = CONNECTED;
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
       UpdateCID = 0;
 #endif
     }
@@ -558,7 +558,7 @@ handle_inbound_mail (int answer_now)
       {
         ++iRingCount;           /* no need to check an timer, we've only got 10secs */
 
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
         UpdateCID = 0;
 #endif
         /* Unblank on the first ring */
@@ -647,7 +647,7 @@ handle_inbound_mail (int answer_now)
         modem_hangup ();        /* MR 970523 hangup                 */
         modem_init ();          /*           and reinit modem       */
         time_release ();
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
         UpdateCID = 1;
 #endif
         return (0);             /* Nothing happened...              */
diff -urpN btxe.orig/src/mdm_proc.c btxe/src/mdm_proc.c
--- btxe.orig/src/mdm_proc.c	2000-08-09 10:52:34.000000000 +0200
+++ btxe/src/mdm_proc.c	2013-03-30 14:05:37.381983788 +0100
@@ -307,7 +307,7 @@ dial_modem (char *numbertocall, ADDRP ad
     sprintf (modemstr, "%s%s%s", modem.predial == NULL ? "" : modem.predial,
              translated == NULL ? "" : translated,
              modem.postdial == NULL ? "" : modem.postdial);
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
     UpdateCID = 0;
     strcpy (CIDFromCAPI, translated);  /* So it can be added to CONNECT */
 #endif
@@ -526,7 +526,7 @@ get_response (long end_time, int show, i
   *user = userbreak;
   *p = '\0';                    /* terminate the new string  */
 
-#if defined(OS_2) && !defined(__EMX__)
+#if defined(OS_2) && !defined(__EMX__) && CAPI > 0
   for (x = 0; x < AddCIDToNumber; x++)
   {
     if (strstr (response_string, AddCIDTo[x]) == response_string)
