Skip to content
Snippets Groups Projects
Commit 1b393810 authored by rswindell's avatar rswindell
Browse files

OpenDoors C++ DoorKit (v6.21)

parent a8b56c32
No related branches found
No related tags found
No related merge requests found
Showing
with 16945 additions and 0 deletions
; DOOR.CFG - Sample OpenDoors door configuration file
;
; This configuration file can be used by the sysop to customize an OpenDoors
; door for use on their own system. The information in this file is NOT usually
; needed, and the file can be left as is, or even erased, without effecting the
; door's performance. OpenDoors is designed to run on almost any BBS system
; automatically, without requiring anything but to the door's .EXE file.
; However, there are many cases where the sysop may wish to customize a door's
; operation using this configuration file. The configuration file system is
; provided to allow the customization of options such as paging hours, maximum
; time permitted within the door, etc., and to allow OpenDoors doors to be run
; under even the most non-typical BBS setups.
;
; Any text following a semi-colon (;), and blank lines, are ignored.
;
;------------------------------------------------------------------------------
;
; BBS system directory. Indicates where the door information file (drop file)
; can be found. Remove the semi-colon (;) to activate this option.
;
;BBSDir C:\BBS
;
;------------------------------------------------------------------------------
;
; The door's working directory. This is where the door's system files are
; located. Remove the semi-colon (;) to activate this option.
;
;DoorDir C:\BBS\MYDOOR
;
;------------------------------------------------------------------------------
;
; Local mode override. Forces door to always operate in local test mode.
; Remove the semi-colon (;) to activate this option. When this mode is
; activated, no door information file is required and default settings are
; used for the user's name, location, etc.
;
;LocalMode
;
;------------------------------------------------------------------------------
;
; Door personality setting. This setting selects one of a number of sysop
; interface personalities. Each personality setting emulates the status line
; format and sysop function keys of a particular BBS package. Valid
; personality settings are:
;
; Standard (OpenDoors style, simplified from RA)
; PCBoard
; RemoteAccess
; Wildcat
;
Personality Standard
;
;------------------------------------------------------------------------------
;
; Log File options. "LogFileName" specifies filename (path optional) where the
; door should record log information. To disable the log file altogether,
; remove the semi-colon (;) from the "DisableLogging" line.
;
;LogFileName DOOR.LOG
;DisableLogging
;
;------------------------------------------------------------------------------
;
; BBS node number that door is running on. Only used if OpenDoors is unable
; to determine the node number by some other means.
;
Node 1
;
;------------------------------------------------------------------------------
;
; Sysop paging hours. Sysop paging will be permitted beginning at the start
; time, up until, but not including, the end time. Times should be in 24-hour
; format. To disable paging on a particular day, set the paging start and end
; times to the same time. To make paging always available, set the start time
; to 0:00 and the end time to 23:59.
;
; Start Time End Time
SundayPagingHours 9:00 22:00
MondayPagingHours 8:30 22:00
TuesdayPagingHours 8:30 22:00
WednesdayPagingHours 8:30 22:00
ThursdayPagingHours 8:30 22:00
FridayPagingHours 8:30 22:00
SaturdayPagingHours 9:00 22:00
;
;------------------------------------------------------------------------------
;
; Duration of sysop page. Value indicates the number of beeps that compose the
; sysop page alarm, with one beep sounded per second.
;
PageDuration 10
;
;------------------------------------------------------------------------------
;
; Maximum length of time a user is permitted to access the door. If the user's
; total remaining time on the BBS is less than this value, the user will only
; be permitted to access the door for this shorter length of time. This option
; may be disabled by placing a semi-colon (;) at the beginning of the line.
; When this option is disabled, the user will be permitted to use the full
; of their remaining time on the BBS within the door.
;
;MaximumDoorTime 15
;
;------------------------------------------------------------------------------
;
; Inactivity timeout. Specifies the maximum number of seconds that may elapse
; without the user pressing any key, before the user will be automatically
; disconnected. A value of 0 disables inactivity timeouts.
;
InactivityTimeout 200
;
;------------------------------------------------------------------------------
;
; Name of the sysop. OpenDoors can usually determine the sysop's name from the
; information passed to the door by the BBS. However, some BBS software does
; not supply this information to doors. In such cases, if the sysop's name is
; required by the door, it may be supplied here. Remove the semi-colon (;) to
; activate this option.
;
;SysopName The Sysop
;
;------------------------------------------------------------------------------
;
; Name of the BBS. OpenDoors can usually determine the name of the BBS from
; the information passed to the door by the BBS. However, some BBS software
; does not supply this information to door programs. In such cases, if the
; name of the BBS is needed by the door, it may be supplied here. Remove the
; semi-colon (;) to activate this option.
;
;SystemName Unnamed BBS
;
;------------------------------------------------------------------------------
;
; Door colour options. These options specify the various text colours that
; will be used by the door if ANSI or AVATAR graphics modes are available.
; Colours are specified in the format:
;
; {Bright} {Flashing} [Foreground Colour] on [Background Colour]
;
; Where foreground and background colours are one of:
;
; Black
; Blue
; Green
; Cyan
; Red
; Magenta
; Yellow / Brown
; White / Grey
;
; Note that some of these options (such as those that pertain to files
; listings) are not used for all doors.
;
ChatUserColour Bright white on black
ChatSysopColour Bright red on black
FileListTitleColour Bright yellow on black
FileListNameColour Bright yellow on black
FileListSizeColour Bright magenta on black
FileListDescriptionColour Cyan on black
FileListOfflineColour Bright red on black
PagePromptColour Bright white on black
PopupMenuTitleColour Bright white on grey
PopupMenuBorderColour Black on grey
PopupMenuTextColour Black on grey
PopupMenuKeyColour Red on grey
PopupMenuHighlightColour Grey on black
PopupMenuHighKeyColour Red on black
;
;------------------------------------------------------------------------------
;
; Memory swapping options. These options are generally not needed, but can be
; used to customize OpenDoor's swapping behaviour. "SwappingDir" can be used
; to specify which directory or directories should be used for swapping.
; Multiple directory paths can be seperated using a semi-colon.
; "SwappingNoEMS" can be used to prevent any swapping from being done to EMS
; memory, and "SwappingDisable" can be used to disable memory swapping
; altogether. Remove the semi-colon (;) to activate any of these options.
;
;SwappingDir C:\
;SwappingNoEMS
;SwappingDisable
;
;------------------------------------------------------------------------------
;
; Serial port options. These options are generally not needed, as these
; settings can usually be determined from the BBS door information file.
; "LockedBPS" specifies the the BPS rate at which the door should communicate
; with the modem. "SerialPort" specifies the port port number that the modem
; is connected to. Unless you have reassigned the port numbers through your
; FOSSIL drive, port 0 corresponds to COM1, port 1 corresponds to COM2, and
; so on. Remove the semi-colon (;) to activate either of these options.
;
;LockedBPS 38400
;SerialPort 0
;
;
; Under DOS, a FOSSIL driver is normally used for serial I/O if one is
; available. If a FOSSIL driver has not been loaded, the door communicates
; directly with the modem. Removing the semi-colon (;) from the "NoFossil"
; option causes the door to always communicate directly with the modem,
; bypassing any FOSSIL driver.
;
;NoFossil
;
;------------------------------------------------------------------------------
;
; The following options only apply for the MS-DOS version of this program,
; and only if a FOSSIL driver is NOT being used for serial communications.
; If a FOSSIL driver IS being used, these options are normally set on the
; FOSSIL driver command line. Under Windows, these options are set in the
; control panel.
;
; Hexidecimal address of the serial port. This address can usually be
; determined automatically for ports COM1, COM2, COM3, and COM4, and is
; normally only required for ports COM5 and higher. Remove the semi-colon
; (;) to activate this option.
;
;PortAddress 2F8
;
;
; Interrupt request line that the serial port is using. May be any IRQ line
; from 1 to 15. By default, IRQ line 4 is used for ports COM1: and COM3:,
; while IRQ line 3 is used for all other ports. Remove the semi-colon (;)
; to activate this option.
;
;PortIRQ 4
;
;
; Serial I/O buffer sizes. "ReceiveBuffer" specifies the number of bytes in
; the serial I/O receive buffer. You may want to increase this buffer size
; if you find that characters being sent from the user's modem are being lost.
; "TransmitBuffer" specifies the number of bytes in the serial I/O transmit
; buffer. You may want to increase this buffer size for improved performance
; in some multitasking environments. A transmit buffer size smaller than 3072
; bytes is not recommended.
;
ReceiveBuffer 256
TransmitBuffer 3072
;
;
; UART FIFO buffers. Normally, OpenDoors will use 16550A UART FIFO buffers
; if they are available. You can prevent OpenDoors from using the FIFO
; buffers, even if they are available, by removing the semi-colon before
; the "NoFIFO" keyword. The "FIFOTriggerSize" specifies how many characters
; may be placed in the FIFO buffers before an serial I/O interrupt is
; envoked. Valid values are 1, 4, 8 and 14 bytes. The default value is 4
; bytes.
;
;NoFIFO
FIFOTriggerSize 4
;
;------------------------------------------------------------------------------
;
; The following options control if and how the Windows version of this program
; disables DTR response by the modem prior to exiting. Normally, the sequence
; of modem commands specified by DisableDTR is sent before exiting, to prevent
; the modem from hanging up. To disable this feature, remove the semi-colon
; (;) at the beginning of the NoDTRDisable line.
;
; DisableDTR specifies a series of commands to be sent to the modem, and
; responses to be received by the modem. Each command and response is
; separated by a space. A tilde (~) character denotes a one second pause, and
; a pipe (|) denotes a CR.
;
;NoDTRDisable
DisableDTR ~+++ OK AT&D0| OK ATO|
;
;------------------------------------------------------------------------------
;
; Custom door information file support. OpenDoors automatically recognizes
; most door information file (drop file) formats, including DORINFO?.DEF,
; EXITINFO.BBS, DOOR.SYS, SFDOORS.DAT, CALLINFO.BBS and CHAIN.TXT. However,
; to permit OpenDoors doors to operate on BBS systems that produce a different
; format file, you may define a custom door information file format. A custom
; door information file format is defined using the "CustomFileName" command,
; followed by one or more lines beginning with the "CustomFileLine" command.
;
; The "CustomFileName" option specifies the filename used to distinguish this
; file format from other file formats. This filename should not include a
; path. To specify the path where the door information file is located, use
; the BBSDir setting, near the beginning of this file. If the filename of the
; custom format is the same as that of one of the built-in formats, the custom
; format will override the built-in format.
;
; The actual format of the custom file is specified using a number of lines
; that begin with the keyword "CustomFileLine". Each of these lines will
; correspond to a single line in the door information file, with the option
; following the "CustomFileLine" keyword specifying the information that can
; be found on that line. This can be one of the following keywords:
;
; Ignore - Causes the next line in the door information
; file to be ignored. Use on lines for which none
; of the options below apply.
; ComPort - COM? port the modem is connected to
; (0 indicates local mode)
; FossilPort - Fossil port number the modem is connected to
; ModemBPS - BPS rate at which to communicate with modem
; (0 or non-numerical value indicates local mode)
; LocalMode - 1, T or Y if door is operating in local mode
; UserName - Full name of the user
; UserFirstName - First name(s) of the user
; UserLastName - Last name of the user
; Alias - The user's psuedonym / handle
; HoursLeft - Hours user has left online
; MinutesLeft - Minutes user has left online, or time left online
; in format hh:mm
; SecondsLeft - Seconds user has left online, or time left online
; in format hh:mm:ss or format mm:ss
; (If more than one of the above time options are
; used, the user time left is taken to be the total
; of all of these values.)
; ANSI - 1, T, Y or G for ANSI graphics mode
; AVATAR - 1, T or Y for AVATAR graphics mode
; RIP - 1, T or Y for RIP graphics mode
; PagePausing - 1, T or Y if user wishes a pause at end of screen
; ScreenLength - Number of lines on user's screen
; ScreenClearing - 1, T or Y if screen clearing mode is on
; Security - The user's security level / access level
; City - City the user is calling from
; Node - Node number user is connected to
; SysopName - Full name of the sysop
; SysopFirstName - The sysop's first name(s)
; SysopLastName - The sysop's last name
; SystemName - Name of the BBS
;
;
CustomFileName EXAMPLE.DEF ; Same format as DORINFO?.DEF
CustomFileLine SystemName
CustomFileLine SysopFirstName
CustomFileLine SysopLastName
CustomFileLine ComPort
CustomFileLine ModemBPS
CustomFileLine Ignore
CustomFileLine UserFirstName
CustomFileLine UserLastName
CustomFileLine City
CustomFileLine ANSI
CustomFileLine Security
CustomFileLine MinutesLeft
;
;------------------------------------------------------------------------------
TEST BBS
THE
SYSOP
COM0
0 BAUD,N,8,1
0
TEST
USER
UNKNOWN LOCATION
1
10
60
# OpenDoors 6.10
# (C) Copyright 1991 - 1997 by Brian Pirie. All Rights Reserved.
#
#
# File: DOS.mak
#
# Description: Makefile used to build the MS-DOS OpenDoors libraries from
# the sources. Usage is described below.
#
# Revisions: Date Ver Who Change
# ---------------------------------------------------------------
# Oct 13, 1994 6.00 BP New file header format.
# Oct 13, 1994 6.00 BP Made directories configurable.
# Oct 13, 1994 6.00 BP Erase tlib-created backup file.
# Oct 14, 1994 6.00 BP Added ODGen.h dependencies.
# Oct 14, 1994 6.00 BP Added ODPlat.c module.
# Oct 31, 1994 6.00 BP Added headers dependency constant.
# Nov 01, 1994 6.00 BP Added ODUtil.c module.
# Dec 31, 1994 6.00 BP Added -B option for Borland Cs.
# Jan 01, 1995 6.00 BP Added ODKrnl.c, ODKrnl.h.
# Jan 29, 1995 6.00 BP Added ODCmdLn.c.
# Nov 16, 1995 6.00 BP Added ODInQue.c, and new headers.
# Nov 21, 1995 6.00 BP Created ODInit1.c, ODInit2.c.
# Dec 02, 1995 6.00 BP Added ODRes.h
# Dec 02, 1995 6.00 BP Added ODFrame.c, ODFrame.h.
# Dec 02, 1995 6.00 BP Added ODStat.h, ODSwap.h.
# Dec 04, 1995 6.00 BP Changes for building Win32 version.
# Dec 05, 1995 6.00 BP Split into makefiles for each platform
# Dec 07, 1995 6.00 BP Added ODEdit.c.
# Jan 04, 1996 6.00 BP Added ODGetIn.c.
# Feb 09, 1996 6.00 BP Renamed ODInit?.* to ODInEx?.*
# Feb 19, 1996 6.00 BP Changed version number to 6.00.
# Mar 03, 1996 6.10 BP Begin version 6.10.
#
###############################################################################
#
# USAGE INFORMATION
#
###############################################################################
#
# Command Line: make -fDOS.mak -DTARGET=?
# or
# nmake -fDOS.mak "TARGET=?"
#
# Where: "TARGET=?" - Specifies which version of the library should be
# built. TARGET can be set to:
#
# t - MS-DOS version, tiny memory model
# s - MS-DOS version, small memory model
# c - MS-DOS version, compact memory model
# m - MS-DOS version, medium memory model
# l - MS-DOS version, large memory model
# h - MS-DOS version, huge memory model
#
# Setting must be in lower case for Borland compilers,
# uppercase for Microsoft compilers.
#
###############################################################################
#
# CONFIGURATION
#
# Customize this section of the makefile to provide the relevant information
# for your compiler, assembler (if any) and build environment.
#
###############################################################################
# Compiler executable file name. Use:
#
# tcc - For Borland Turbo C and Turbo C++
# bcc - For Borland C++
# cl - For Microsoft compilers
#
CC=tcc
#
#------------------------------------------------------------------------------
#
# Assembler executable file name. Use:
#
# tasm - For Turbo Assembler
# masm - For Microsoft Macro Assembler
#
AS=tasm
#
#------------------------------------------------------------------------------
#
# Library managment utility. Use:
#
# tlib - For Borland compilers
# lib - For Microsoft compilers
#
LIB=tlib
#
#------------------------------------------------------------------------------
#
# MS-DOS compiler command-line flags. Use:
#
# -m$(TARGET) -c -O -G -Z -d -B - For Borland compilers including Turbo C
# /a$(TARGET) /c /nologo - For Microsoft compilers
#
CFLAGS=-m$(TARGET) -c -O -G -Z -d -Ic:\progra~1\tc\include
#
#------------------------------------------------------------------------------
#
# Assembler command-line flags.
#
AFLAGS=/mx
ADEFLCODE=/dLCODE
ADEFLDATA=/dLDATA
#
#------------------------------------------------------------------------------
#
# Output directories. customize for your own preferences. Note that trailing
# backslash (\) characters are required.
#
SOURCEDIR=.\ # Comments required
ODHEADERDIR=.\ # in order to
OBJDIR=..\obj\ # avoid line
LIBDIR=..\lib\ # concatentation
#
###############################################################################
#
# DEPENDENCIES
#
# You won't normally have to change anything after this point in this makefile.
#
###############################################################################
#
# Define primary target.
#
all: $(LIBDIR)ODoor$(TARGET).lib
#
#------------------------------------------------------------------------------
#
# Name of all headers.
#
HEADERS= $(HEADERDIR)ODCom.h\
$(HEADERDIR)ODCore.h\
$(HEADERDIR)ODFrame.h\
$(HEADERDIR)ODGen.h\
$(HEADERDIR)ODInEx.h\
$(HEADERDIR)ODInQue.h\
$(HEADERDIR)ODKrnl.h\
$(HEADERDIR)ODPlat.h\
$(HEADERDIR)ODRes.h\
$(HEADERDIR)ODScrn.h\
$(HEADERDIR)ODStat.h\
$(HEADERDIR)ODSwap.h\
$(HEADERDIR)ODTypes.h\
$(HEADERDIR)ODUtil.h\
$(HEADERDIR)OpenDoor.h
#
#------------------------------------------------------------------------------
#
# Build from C sources.
#
$(OBJDIR)odauto$(TARGET).obj : $(SOURCEDIR)odauto.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odauto.c
command /c erase $(OBJDIR)odauto$(TARGET).obj
move odauto.obj $(OBJDIR)odauto$(TARGET).obj
$(OBJDIR)odblock$(TARGET).obj : $(SOURCEDIR)odblock.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odblock.c
command /c erase $(OBJDIR)odblock$(TARGET).obj
move odblock.obj $(OBJDIR)odblock$(TARGET).obj
$(OBJDIR)odcfile$(TARGET).obj : $(SOURCEDIR)odcfile.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odcfile.c
command /c erase $(OBJDIR)odcfile$(TARGET).obj
move odcfile.obj $(OBJDIR)odcfile$(TARGET).obj
$(OBJDIR)odcmdln$(TARGET).obj : $(SOURCEDIR)odcmdln.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odcmdln.c
command /c erase $(OBJDIR)odcmdln$(TARGET).obj
move odcmdln.obj $(OBJDIR)odcmdln$(TARGET).obj
$(OBJDIR)odcom$(TARGET).obj : $(SOURCEDIR)odcom.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odcom.c
command /c erase $(OBJDIR)odcom$(TARGET).obj
move odcom.obj $(OBJDIR)odcom$(TARGET).obj
$(OBJDIR)odcore$(TARGET).obj : $(SOURCEDIR)odcore.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odcore.c
command /c erase $(OBJDIR)odcore$(TARGET).obj
move odcore.obj $(OBJDIR)odcore$(TARGET).obj
$(OBJDIR)oddrbox$(TARGET).obj : $(SOURCEDIR)oddrbox.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)oddrbox.c
command /c erase $(OBJDIR)oddrbox$(TARGET).obj
move oddrbox.obj $(OBJDIR)oddrbox$(TARGET).obj
$(OBJDIR)odedit$(TARGET).obj : $(SOURCEDIR)odedit.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odedit.c
command /c erase $(OBJDIR)odedit$(TARGET).obj
move odedit.obj $(OBJDIR)odedit$(TARGET).obj
$(OBJDIR)odedstr$(TARGET).obj : $(SOURCEDIR)odedstr.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odedstr.c
command /c erase $(OBJDIR)odedstr$(TARGET).obj
move odedstr.obj $(OBJDIR)odedstr$(TARGET).obj
$(OBJDIR)odemu$(TARGET).obj : $(SOURCEDIR)odemu.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odemu.c
command /c erase $(OBJDIR)odemu$(TARGET).obj
move odemu.obj $(OBJDIR)odemu$(TARGET).obj
$(OBJDIR)odgetin$(TARGET).obj : $(SOURCEDIR)odgetin.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odgetin.c
command /c erase $(OBJDIR)odgetin$(TARGET).obj
move odgetin.obj $(OBJDIR)odgetin$(TARGET).obj
$(OBJDIR)odgraph$(TARGET).obj : $(SOURCEDIR)odgraph.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odgraph.c
command /c erase $(OBJDIR)odgraph$(TARGET).obj
move odgraph.obj $(OBJDIR)odgraph$(TARGET).obj
$(OBJDIR)odinex1$(TARGET).obj : $(SOURCEDIR)odinex1.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odinex1.c
command /c erase $(OBJDIR)odinex1$(TARGET).obj
move odinex1.obj $(OBJDIR)odinex1$(TARGET).obj
$(OBJDIR)odinex2$(TARGET).obj : $(SOURCEDIR)odinex2.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odinex2.c
command /c erase $(OBJDIR)odinex2$(TARGET).obj
move odinex2.obj $(OBJDIR)odinex2$(TARGET).obj
$(OBJDIR)odinque$(TARGET).obj : $(SOURCEDIR)odinque.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odinque.c
command /c erase $(OBJDIR)odinque$(TARGET).obj
move odinque.obj $(OBJDIR)odinque$(TARGET).obj
$(OBJDIR)odkrnl$(TARGET).obj : $(SOURCEDIR)odkrnl.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odkrnl.c
command /c erase $(OBJDIR)odkrnl$(TARGET).obj
move odkrnl.obj $(OBJDIR)odkrnl$(TARGET).obj
$(OBJDIR)odlist$(TARGET).obj : $(SOURCEDIR)odlist.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odlist.c
command /c erase $(OBJDIR)odlist$(TARGET).obj
move odlist.obj $(OBJDIR)odlist$(TARGET).obj
$(OBJDIR)odlog$(TARGET).obj : $(SOURCEDIR)odlog.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odlog.c
command /c erase $(OBJDIR)odlog$(TARGET).obj
move odlog.obj $(OBJDIR)odlog$(TARGET).obj
$(OBJDIR)odmulti$(TARGET).obj : $(SOURCEDIR)odmulti.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odmulti.c
command /c erase $(OBJDIR)odmulti$(TARGET).obj
move odmulti.obj $(OBJDIR)odmulti$(TARGET).obj
$(OBJDIR)odplat$(TARGET).obj : $(SOURCEDIR)odplat.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odplat.c
command /c erase $(OBJDIR)odplat$(TARGET).obj
move odplat.obj $(OBJDIR)odplat$(TARGET).obj
$(OBJDIR)odpcb$(TARGET).obj : $(SOURCEDIR)odpcb.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odpcb.c
command /c erase $(OBJDIR)odpcb$(TARGET).obj
move odpcb.obj $(OBJDIR)odpcb$(TARGET).obj
$(OBJDIR)odpopup$(TARGET).obj : $(SOURCEDIR)odpopup.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odpopup.c
command /c erase $(OBJDIR)odpopup$(TARGET).obj
move odpopup.obj $(OBJDIR)odpopup$(TARGET).obj
$(OBJDIR)odprntf$(TARGET).obj : $(SOURCEDIR)odprntf.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odprntf.c
command /c erase $(OBJDIR)odprntf$(TARGET).obj
move odprntf.obj $(OBJDIR)odprntf$(TARGET).obj
$(OBJDIR)odra$(TARGET).obj : $(SOURCEDIR)odra.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odra.c
command /c erase $(OBJDIR)odra$(TARGET).obj
move odra.obj $(OBJDIR)odra$(TARGET).obj
$(OBJDIR)odscrn$(TARGET).obj : $(SOURCEDIR)odscrn.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odscrn.c
command /c erase $(OBJDIR)odscrn$(TARGET).obj
move odscrn.obj $(OBJDIR)odscrn$(TARGET).obj
$(OBJDIR)odspawn$(TARGET).obj : $(SOURCEDIR)odspawn.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odspawn.c
command /c erase $(OBJDIR)odspawn$(TARGET).obj
move odspawn.obj $(OBJDIR)odspawn$(TARGET).obj
$(OBJDIR)odstand$(TARGET).obj : $(SOURCEDIR)odstand.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odstand.c
command /c erase $(OBJDIR)odstand$(TARGET).obj
move odstand.obj $(OBJDIR)odstand$(TARGET).obj
$(OBJDIR)odstat$(TARGET).obj : $(SOURCEDIR)odstat.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odstat.c
command /c erase $(OBJDIR)odstat$(TARGET).obj
move odstat.obj $(OBJDIR)odstat$(TARGET).obj
$(OBJDIR)odsys$(TARGET).obj : $(SOURCEDIR)odsys.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odsys.c
command /c erase $(OBJDIR)odsys$(TARGET).obj
move odsys.obj $(OBJDIR)odsys$(TARGET).obj
$(OBJDIR)odutil$(TARGET).obj : $(SOURCEDIR)odutil.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odutil.c
command /c erase $(OBJDIR)odutil$(TARGET).obj
move odutil.obj $(OBJDIR)odutil$(TARGET).obj
$(OBJDIR)odwcat$(TARGET).obj : $(SOURCEDIR)odwcat.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odwcat.c
command /c erase $(OBJDIR)odwcat$(TARGET).obj
move odwcat.obj $(OBJDIR)odwcat$(TARGET).obj
$(OBJDIR)odwin$(TARGET).obj : $(SOURCEDIR)odwin.c $(HEADERS)
$(CC) $(CFLAGS) $(SOURCEDIR)odwin.c
command /c erase $(OBJDIR)odwin$(TARGET).obj
move odwin.obj $(OBJDIR)odwin$(TARGET).obj
#
#------------------------------------------------------------------------------
#
# Build from assembly sources.
#
$(OBJDIR)odswapt.obj : $(SOURCEDIR)odswap.asm
$(AS) $(AFLAGS) $(SOURCEDIR)odswap.asm
command /c erase $(OBJDIR)odswapt.obj
move odswap.obj $(OBJDIR)odswapt.obj
$(OBJDIR)odswaps.obj : $(SOURCEDIR)odswap.asm
$(AS) $(AFLAGS) $(SOURCEDIR)odswap.asm
command /c erase $(OBJDIR)odswaps.obj
move odswap.obj $(OBJDIR)odswaps.obj
$(OBJDIR)odswapc.obj : $(SOURCEDIR)odswap.asm
$(AS) $(AFLAGS) $(ADEFLDATA) $(SOURCEDIR)odswap.asm
command /c erase $(OBJDIR)odswapc.obj
move odswap.obj $(OBJDIR)odswapc.obj
$(OBJDIR)odswapm.obj : $(SOURCEDIR)odswap.asm
$(AS) $(AFLAGS) $(ADEFLCODE) $(SOURCEDIR)odswap.asm
command /c erase $(OBJDIR)odswapm.obj
move odswap.obj $(OBJDIR)odswapm.obj
$(OBJDIR)odswapl.obj : $(SOURCEDIR)odswap.asm
$(AS) $(AFLAGS) $(ADEFLDATA) $(ADEFLCODE) $(SOURCEDIR)odswap.asm
command /c erase $(OBJDIR)odswapl.obj
move odswap.obj $(OBJDIR)odswapl.obj
$(OBJDIR)odswaph.obj : $(SOURCEDIR)odswap.asm
$(AS) $(AFLAGS) $(ADEFLDATA) $(ADEFLCODE) $(SOURCEDIR)odswap.asm
command /c erase $(OBJDIR)odswaph.obj
move odswap.obj $(OBJDIR)odswaph.obj
#
#------------------------------------------------------------------------------
#
# Build library from objects.
#
OBJECTS= $(OBJDIR)odauto$(TARGET).obj\
$(OBJDIR)odblock$(TARGET).obj\
$(OBJDIR)odcfile$(TARGET).obj\
$(OBJDIR)odcmdln$(TARGET).obj\
$(OBJDIR)odcom$(TARGET).obj\
$(OBJDIR)odcore$(TARGET).obj\
$(OBJDIR)oddrbox$(TARGET).obj\
$(OBJDIR)odedit$(TARGET).obj\
$(OBJDIR)odedstr$(TARGET).obj\
$(OBJDIR)odemu$(TARGET).obj\
$(OBJDIR)odgetin$(TARGET).obj\
$(OBJDIR)odgraph$(TARGET).obj\
$(OBJDIR)odinex1$(TARGET).obj\
$(OBJDIR)odinex2$(TARGET).obj\
$(OBJDIR)odinque$(TARGET).obj\
$(OBJDIR)odkrnl$(TARGET).obj\
$(OBJDIR)odlist$(TARGET).obj\
$(OBJDIR)odlog$(TARGET).obj\
$(OBJDIR)odmulti$(TARGET).obj\
$(OBJDIR)odplat$(TARGET).obj\
$(OBJDIR)odpcb$(TARGET).obj\
$(OBJDIR)odpopup$(TARGET).obj\
$(OBJDIR)odprntf$(TARGET).obj\
$(OBJDIR)odra$(TARGET).obj\
$(OBJDIR)odscrn$(TARGET).obj\
$(OBJDIR)odspawn$(TARGET).obj\
$(OBJDIR)odstand$(TARGET).obj\
$(OBJDIR)odstat$(TARGET).obj\
$(OBJDIR)odswap$(TARGET).obj\
$(OBJDIR)odsys$(TARGET).obj\
$(OBJDIR)odutil$(TARGET).obj\
$(OBJDIR)odwcat$(TARGET).obj\
$(OBJDIR)odwin$(TARGET).obj
$(LIBDIR)odoor$(TARGET).lib : $(OBJECTS)
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odauto$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odblock$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odcfile$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odcmdln$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odcom$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odcore$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)oddrbox$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odedit$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odedstr$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odemu$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odgetin$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odgraph$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odinex1$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odinex2$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odinque$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odkrnl$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odlist$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odlog$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odmulti$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odplat$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odpcb$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odpopup$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odprntf$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odra$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odscrn$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odspawn$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odstand$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odstat$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odswap$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odsys$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odutil$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odwcat$(TARGET).obj
$(LIB) $(LIBDIR)odoor$(TARGET).lib -+$(OBJDIR)odwin$(TARGET).obj
erase $(LIBDIR)odoor$(TARGET).bak
#
#------------------------------------------------------------------------------
OpenDoors 6.21 C/C++ door programming toolkit
OpenDoors is an advanced, easy to use library
for writing online software such as BBS doors
Includes full source code and DLL for the
native-Win32 version. v6.2x modifications by
Rob Swindell (www.synchro.net) add support for
TCP socket (Telnet) connections and Door32.sys!
OpenDoors transparently interfaces with most
BBS systems, automatically displays output on
both local and remote screens, creates ANSI/
AVATAR/RIP control sequences, and provides a
sysop interface with commands for chat, time
adjustment, disconnecting, etc.
http://www.attcanada.net/~pirie/opendoors.html
(C) 1991-2001 Brian Pirie
src/odoors/ODApp.ico

1.05 KiB

/* OpenDoors Online Software Programming Toolkit
* (C) Copyright 1991 - 1999 by Brian Pirie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* File: ODAuto.c
*
* Description: Implements od_autodetect() for automatic detection of
* terminal emulation supported by remote system.
*
* Revisions: Date Ver Who Change
* ---------------------------------------------------------------
* Oct 13, 1994 6.00 BP New file header format.
* Oct 14, 1994 6.00 BP Standardized coding style.
* Dec 31, 1994 6.00 BP Use new millisecond timer functions.
* Nov 12, 1995 6.00 BP 32-bit portability.
* Nov 13, 1995 6.00 BP Fixed non-functioning RIP autodetect.
* Nov 16, 1995 6.00 BP Removed oddoor.h, added odcore.h.
* Dec 12, 1995 6.00 BP Added entry, exit and kernel macros.
* Dec 30, 1995 6.00 BP Added ODCALL for calling convention.
* Feb 19, 1996 6.00 BP Changed version number to 6.00.
* Mar 03, 1996 6.10 BP Begin version 6.10.
*/
#define BUILDING_OPENDOORS
#include <string.h>
#include <ctype.h>
#include "OpenDoor.h"
#include "ODTypes.h"
#include "ODGen.h"
#include "ODPlat.h"
#include "ODCore.h"
#include "ODKrnl.h"
/* Private function prototypes. */
static char ODWaitNoCase(char *pszWaitFor, tODMilliSec WaitTime);
/* Number of attempts and timeout values for testing each terminal emulation */
/* protocol. */
#define ANSI_TRIES 1
#define ANSI_WAIT 660 /* Time in milliseconds. */
#define RIP_TRIES 1
#define RIP_WAIT 660 /* Time in milliseconds. */
/* Strings to use for autodetection. */
#define ANSI_QUERY "\x1b[6n\r \r"
#define ANSI_RESPONSE "\x1b["
#define RIP_QUERY "\r\x1b[!\r \r"
#define RIP_RESPONSE "RIP"
/* Maximum number of characters to match with _waitnocase(). */
#define MATCH_LEN 3
/* ----------------------------------------------------------------------------
* od_autodetect()
*
* Determines the terminal emulation capabilities of the remote communications
* software, when possible. Turns on ANSI and/or RIP modes if they are
* supported by the remote system.
*
* Parameters: nFlags - Currently unused.
*
* Return: void
*/
ODAPIDEF void ODCALL od_autodetect(INT nFlags)
{
INT nCount;
/* Log function entry if running in trace mode. */
TRACE(TRACE_API, "od_autodetect()");
/* Initialize OpenDoors if it hasn't aready been done. */
if(!bODInitialized) od_init();
OD_API_ENTRY();
/* Temporary code that will be optimized out, which prevents a compiler */
/* warning from being generated for the currently unused flags parameter. */
(void)nFlags;
/* If operating in local mode, turn on ANSI mode, but not RIP. */
if(od_control.baud == 0)
{
od_control.user_ansi = TRUE;
OD_API_EXIT();
return;
}
/* If user_ansi is not set, attempt to determine ANSI capabilities. */
if(!od_control.user_ansi)
{
/* Clear inbound keyboard buffer. */
od_clear_keybuffer();
/* Try twice to test ANSI capabilities. */
for(nCount = 0; nCount < ANSI_TRIES; ++nCount)
{
/* Send a string that an ANSI capable terminal will usually */
/* respond to. */
od_disp(ANSI_QUERY, strlen(ANSI_QUERY), FALSE);
/* Wait for response expected from an ANSI terminal, for up to */
/* 12/18.2 second. */
if(ODWaitNoCase(ANSI_RESPONSE, ANSI_WAIT))
{
/* If expected sequence was received, turn on ANSI mode and */
/* exit the loop. */
od_control.user_ansi = TRUE;
break;
}
}
od_clear_keybuffer();
}
/* If user_rip is not set, attempt to determine RIP capabilities. */
if(!od_control.user_rip)
{
/* Clear inbound keyboard buffer. */
od_clear_keybuffer();
/* Try twice to test RIP capabilities. */
for(nCount = 0; nCount < RIP_TRIES; ++nCount)
{
/* Send a string that a RIP capable terminal will usually */
/* respond to. */
od_disp(RIP_QUERY, strlen(RIP_QUERY), FALSE);
/* Wait for response expected from a RIP terminal. */
if(ODWaitNoCase(RIP_RESPONSE, RIP_WAIT))
{
/* If expected sequence was received, turn on RIP mode and */
/* exit the loop. */
od_control.user_rip = TRUE;
break;
}
}
od_clear_keybuffer();
}
OD_API_EXIT();
}
/* ----------------------------------------------------------------------------
* ODWaitNoCase() *** PRIVATE FUNCTION ***
*
* Waits up to the specified maximum time for a specified string to be sent
* from the remote system. String matching is not case sensitive.
*
* Parameters: pszWaitFor - String to wait for.
*
* WaitTime - Maximum time, in milliseconds, to wait.
*
* Return: TRUE on success, FALSE on failure.
*/
static char ODWaitNoCase(char *pszWaitFor, tODMilliSec WaitTime)
{
tODTimer Timer;
char szReceived[MATCH_LEN + 1];
int nCount;
char chReceived;
int nMatchChars = MIN(MATCH_LEN, strlen(pszWaitFor));
ASSERT(pszWaitFor != NULL);
ASSERT(strlen(pszWaitFor) != 0);
ASSERT(WaitTime >= 0);
ODTimerStart(&Timer, WaitTime);
for(nCount = 0; nCount <= MATCH_LEN; ++nCount)
{
szReceived[nCount] = '\0';
}
do
{
if((chReceived = od_get_key(FALSE)) != 0)
{
for(nCount = 0; nCount < MATCH_LEN - 1; ++ nCount)
{
szReceived[nCount] = szReceived[nCount + 1];
}
szReceived[MATCH_LEN - 1] = chReceived;
if(strnicmp(szReceived + (MATCH_LEN - nMatchChars), pszWaitFor,
nMatchChars) == 0)
{
return(TRUE);
}
}
} while(!ODTimerElapsed(&Timer));
return(FALSE);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* OpenDoors Online Software Programming Toolkit
* (C) Copyright 1991 - 1999 by Brian Pirie.
*
* Oct-2001 door32.sys/socket modifications by Rob Swindell (www.synchro.net)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* File: ODCom.h
*
* Description: Public definitions for serial communications module, which
* is implemented in odcom.c
*
* Revisions: Date Ver Who Change
* ---------------------------------------------------------------
* Oct 21, 1994 6.00 BP Created.
* Jan 01, 1995 6.00 BP Added ODComWaitEvent().
* Dec 21, 1995 6.00 BP Add ability to use already open port.
* Jan 09, 1996 6.00 BP Supply actual in/out buffer size used.
* Feb 19, 1996 6.00 BP Changed version number to 6.00.
* Mar 03, 1996 6.10 BP Begin version 6.10.
* Mar 06, 1996 6.10 BP Initial support for Door32 interface.
* Oct 19, 2001 6.20 RS Added TCP/IP socket (telnet) support.
*/
#ifndef _INC_ODCOM
#define _INC_ODCOM
/* odtypes.h is needed for definitions of tODHandle, and BOOL. */
#include "ODTypes.h"
/* Serial I/O handle. */
typedef tODHandle tPortHandle;
/* Flow Control setting manifest constants. */
#define FLOW_NONE 0x00
#define FLOW_RTSCTS 0x02
#define FLOW_DEFAULT 0x80
/* Parity bit setting manifest constants. */
#define ODPARITY_NONE 0x00
#define ODPARITY_ODD 0x08
#define ODPARITY_EVEN 0x18
#define ODPARITY_MASK 0x18
/* Stop bit setting manifest constants. */
#define STOP_ONE 0x00
#define STOP_ONE_POINT_FIVE 0x04 /* Only with DATABITS_FIVE. */
#define STOP_TWO 0x04 /* Only if not using DATABITS_FIVE. */
#define STOP_MASK 0x04
/* Character length manifest constants. */
#define DATABITS_FIVE 0x00
#define DATABITS_SIX 0x01
#define DATABITS_SEVEN 0x02
#define DATABITS_EIGHT 0x03
#define DATABITS_MASK 0x03
/* FIFO setting constants. */
#define FIFO_DISABLE 0x00
#define FIFO_ENABLE 0x01
#define FIFO_TRIGGER_1 0x00
#define FIFO_TRIGGER_4 0x40
#define FIFO_TRIGGER_8 0x80
#define FIFO_TRIGGER_14 0xc0
/* Misc. manifest constants. */
#define SPEED_UNSPECIFIED 0
#define SIZE_NON_ZERO -1
/* Serial I/O method settings. */
typedef enum
{
kComMethodUnspecified,
kComMethodFOSSIL,
kComMethodUART,
kComMethodWin32,
kComMethodDoor32,
kComMethodSocket,
} tComMethod;
/* Serial I/O event types. */
typedef enum
{
kNoCarrier
} tComEvent;
/* Serial I/O function prototypes. */
tODResult ODComAlloc(tPortHandle *phPort);
tODResult ODComFree(tPortHandle hPort);
tODResult ODComSetIdleFunction(tPortHandle hPort,
void (*pfCallback)(void));
tODResult ODComSetFlowControl(tPortHandle hPort, BYTE btFlowControlSetting);
tODResult ODComSetSpeed(tPortHandle hPort, long lSpeed);
tODResult ODComSetPort(tPortHandle hPort, BYTE btPort);
tODResult ODComSetIRQ(tPortHandle hPort, BYTE btIRQLevel);
tODResult ODComSetPortAddress(tPortHandle hPort, int nPortAddress);
tODResult ODComSetWordFormat(tPortHandle hPort, BYTE btWordFormat);
tODResult ODComSetRXBuf(tPortHandle hPort, int nReceiveBufferSize);
tODResult ODComSetTXBuf(tPortHandle hPort, int nTransmitBufferSize);
tODResult ODComSetFIFO(tPortHandle hPort, BYTE btFIFOSetting);
tODResult ODComSetPreferredMethod(tPortHandle hPort, tComMethod Method);
tODResult ODComGetMethod(tPortHandle hPort, tComMethod *pMethod);
tODResult ODComOpen(tPortHandle hPort);
tODResult ODComOpenFromExistingHandle(tPortHandle hPort,
DWORD dwExistingHandle);
tODResult ODComClose(tPortHandle hPort);
tODResult ODComClearInbound(tPortHandle hPort);
tODResult ODComClearOutbound(tPortHandle hPort);
tODResult ODComInbound(tPortHandle hPort, int *pnInboundWaiting);
tODResult ODComOutbound(tPortHandle hPort, int *pnOutboundWaiting);
tODResult ODComCarrier(tPortHandle hPort, BOOL *pbIsCarrier);
tODResult ODComSetDTR(tPortHandle hPort, BOOL bHigh);
tODResult ODComSendByte(tPortHandle hPort, BYTE btToSend);
tODResult ODComGetByte(tPortHandle hPort, char *pbtNext, BOOL bWait);
tODResult ODComSendBuffer(tPortHandle hPort, BYTE *pbtBuffer, int nSize);
tODResult ODComGetBuffer(tPortHandle hPort, BYTE *pbtBuffer, int nSize,
int *pnBytesRead);
tODResult ODComWaitEvent(tPortHandle hPort, tComEvent Event);
#endif /* !_INC_ODCOM */
This diff is collapsed.
/* OpenDoors Online Software Programming Toolkit
* (C) Copyright 1991 - 1999 by Brian Pirie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* File: ODCore.h
*
* Description: Global functions and variables provide by the odcore.c
* module. These core facilities are used throughout OpenDoors,
* and are required regardless of what OpenDoors features that
* a given program uses.
*
* Revisions: Date Ver Who Change
* ---------------------------------------------------------------
* Nov 16, 1995 6.00 BP Created.
* Nov 17, 1995 6.00 BP Use new input queue mechanism.
* Dec 24, 1995 6.00 BP Added abtGreyBlock.
* Dec 30, 1995 6.00 BP Added ODCALL for calling convention.
* Jan 01, 1996 6.00 BP Changed TEXT_SIZE to 49.
* Feb 19, 1996 6.00 BP Changed version number to 6.00.
* Mar 03, 1996 6.10 BP Begin version 6.10.
* Sep 01, 1996 6.10 BP Update output area on od_set_per...().
*/
#ifndef _INC_ODCORE
#define _INC_ODCORE
/* Include other header files that have definitions neede by this one. */
#include "ODInQue.h"
#include "ODCom.h"
#include "ODPlat.h"
#include "ODScrn.h"
/* OpenDoors global initialized flag. */
extern BOOL bODInitialized;
/* Global serial port object handle. */
extern tPortHandle hSerialPort;
/* Global input queue object handle. */
extern tODInQueueHandle hODInputQueue;
/* Reentrancy control. */
extern BOOL bIsCallbackActive;
extern BOOL bShellChatActive;
/* Global working space. */
#define OD_GLOBAL_WORK_STRING_SIZE 257
extern char szODWorkString[OD_GLOBAL_WORK_STRING_SIZE];
/* Global instance of the text information structure for general use. */
extern tODScrnTextInfo ODTextInfo;
/* Logfile function hooks. */
extern BOOL (*pfLogWrite)(INT);
extern void (*pfLogClose)(INT);
/* od_colour_config() support for od_printf(). */
extern char chColorCheck;
extern char *pchColorEndPos;
/* Status line information. */
extern BYTE btCurrentStatusLine;
extern OD_PERSONALITY_CALLBACK *pfCurrentPersonality;
extern char szDesiredPersonality[33];
typedef BOOL ODCALL SET_PERSONALITY_FUNC(char *pszName);
extern SET_PERSONALITY_FUNC *pfSetPersonality;
/* Commonly used character sequences. */
extern char abtBlackBlock[2];
extern char abtGreyBlock[2];
extern char szBackspaceWithDelete[4];
/* Current output area on screen. */
extern BYTE btOutputTop;
extern BYTE btOutputBottom;
/* Core functions used throughout OpenDoors. */
void ODWaitDrain(tODMilliSec MaxWait);
void ODStoreTextInfo(void);
void ODRestoreTextInfo(void);
void ODStringToName(char *pszToConvert);
BOOL ODPagePrompt(BOOL *pbPausing);
/* Number of built-in configuration file options. */
#define TEXT_SIZE 49
/* Number of user-defined info file options. */
#define LINES_SIZE 25
#endif /* _INC_ODCORE */
/* OpenDoors Online Software Programming Toolkit
* (C) Copyright 1991 - 1999 by Brian Pirie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* File: ODDrBox.c
*
* Description: Implements the od_draw_box() function.
*
* Revisions: Date Ver Who Change
* ---------------------------------------------------------------
* Oct 13, 1994 6.00 BP New file header format.
* Dec 09, 1994 6.00 BP Standardized coding style.
* Aug 19, 1995 6.00 BP 32-bit portability.
* Nov 16, 1995 6.00 BP Removed oddoor.h, added odcore.h.
* Dec 12, 1995 6.00 BP Added entry, exit and kernel macros.
* Dec 30, 1995 6.00 BP Added ODCALL for calling convention.
* Feb 19, 1996 6.00 BP Changed version number to 6.00.
* Mar 03, 1996 6.10 BP Begin version 6.10.
*/
#define BUILDING_OPENDOORS
#include "OpenDoor.h"
#include "ODCore.h"
#include "ODGen.h"
#include "ODKrnl.h"
/* ----------------------------------------------------------------------------
* od_draw_box()
*
* Draws a box on the local and remote screens, using the box characters
* specified in od_control.od_box_chars. Unlike the window functions, this
* function does not store the original contents of the screen where the box
* is drawn.
*
* Parameters: btLeft - Column number of the left side of the box.
*
* btTop - Row number of the top side of the box.
*
* btRight - Column number of hte right side of the box.
*
* btBottom - Row number of the bottom side of the box.
*
* Return: TRUE on success, or FALSE on failure.
*/
ODAPIDEF BOOL ODCALL od_draw_box(BYTE btLeft, BYTE btTop, BYTE btRight,
BYTE btBottom)
{
/* Number of current line being drawn. */
BYTE btLine;
/* X size of window. */
BYTE btBetweenSize = (btRight - btLeft) - 1;
/* Log function entry if running in trace mode */
TRACE(TRACE_API, "od_draw_box()");
/* Ensure that OpenDoors has been initialized */
if(!bODInitialized) od_init();
OD_API_ENTRY();
/* Setup od_box_chars appropriately */
if(od_control.od_box_chars[BOX_BOTTOM] == 0)
{
od_control.od_box_chars[BOX_BOTTOM] = od_control.od_box_chars[BOX_TOP];
}
if(od_control.od_box_chars[BOX_RIGHT] == 0)
{
od_control.od_box_chars[BOX_RIGHT] = od_control.od_box_chars[BOX_LEFT];
}
/* Check that required display capabilities are supported. */
if(!(od_control.user_ansi || od_control.user_avatar))
{
od_control.od_error = ERR_NOGRAPHICS;
OD_API_EXIT();
return(FALSE);
}
/* Check that parameters are within valid range. */
if(btLeft<1 || btTop<1 || btRight>80 || btBottom>25)
{
od_control.od_error = ERR_PARAMETER;
OD_API_EXIT();
return(FALSE);
}
/* Move to top corner, if needed. */
od_set_cursor(btTop, btLeft);
/* Display left corner character. */
od_putch(od_control.od_box_chars[BOX_UPPERLEFT]);
/* Display top line. */
od_repeat(od_control.od_box_chars[BOX_TOP], btBetweenSize);
/* Display right corner character. */
od_putch(od_control.od_box_chars[BOX_UPPERRIGHT]);
/* If AVATAR display mode is available. */
if(od_control.user_avatar)
{
/* Display first left vertical line. */
od_set_cursor(btTop + 1, btLeft);
od_putch(od_control.od_box_chars[BOX_LEFT]);
/* Fill in the center of the window. */
od_emulate(22);
od_emulate(12);
od_emulate((BYTE)od_control.od_cur_attrib);
od_emulate((BYTE)((btBottom - btTop) - 1));
od_emulate(btBetweenSize);
/* Display first right vertical line. */
od_set_cursor(btTop + 1, btRight);
od_putch(od_control.od_box_chars[BOX_RIGHT]);
/* Display remaining vertical lines. */
for(btLine = btTop + 2; btLine < btBottom; ++btLine)
{
/* Move to the start of the line. */
od_set_cursor(btLine, btLeft);
/* Display left line character. */
od_putch(od_control.od_box_chars[BOX_LEFT]);
/* Move to line start. */
od_set_cursor(btLine, btRight);
/* Display right line character. */
od_putch(od_control.od_box_chars[BOX_RIGHT]);
}
}
/* If AVATAR mode is not available. */
else
{
/* Loop through middle lines of window. */
for(btLine = btTop + 1; btLine < btBottom; ++btLine)
{
/* Move to the start of the line. */
od_set_cursor(btLine,btLeft);
/* Display left line character. */
od_putch(od_control.od_box_chars[BOX_LEFT]);
/* Display the blank area. */
od_repeat(' ', btBetweenSize);
/* Display the right line character. */
od_putch(od_control.od_box_chars[BOX_RIGHT]);
}
}
/* Move to bottom corner. */
od_set_cursor(btBottom, btLeft);
/* Display left corner character. */
od_putch(od_control.od_box_chars[BOX_LOWERLEFT]);
/* Display bottom line. */
od_repeat(od_control.od_box_chars[BOX_BOTTOM], btBetweenSize);
/* Display right corner character. */
od_putch(od_control.od_box_chars[BOX_LOWERRIGHT]);
/* Return with success. */
OD_API_EXIT();
return(TRUE);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* OpenDoors Online Software Programming Toolkit
* (C) Copyright 1991 - 1999 by Brian Pirie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* File: ODFrame.h
*
* Description: Defines the public interface to the OpenDoors frame window.
* This file is only applicable when building the Win32 version
* of OpenDoors.
*
* Revisions: Date Ver Who Change
* ---------------------------------------------------------------
* Aug 20, 1995 6.00 BP Created.
* Jan 20, 1996 6.00 BP Made ODFrameCenter...() shared.
* Feb 17, 1996 6.00 BP Add ...Accelerator() return value.
* Feb 19, 1996 6.00 BP Changed version number to 6.00.
* Mar 03, 1996 6.10 BP Begin version 6.10.
*/
#ifndef _INC_ODFRAME
#define _INC_ODFRAME
#include "ODPlat.h"
#include "ODGen.h"
#ifdef ODPLAT_WIN32
/* Public frame window functions. */
tODResult ODFrameStart(HANDLE hInstance, tODThreadHandle *phFrameThread);
INT ODFrameGetUsedClientAtTop(HWND hwndFrame);
INT ODFrameGetUsedClientAtBottom(HWND hwndFrame);
BOOL ODFrameTranslateAccelerator(HWND hwndFrame, LPMSG pMsg);
void ODFrameUpdateCmdUI(void);
void ODFrameUpdateTimeDisplay(void);
void ODFrameUpdateWantChat(void);
void ODFrameCenterWindowInParent(HWND hwndChild);
/* User defined messages that are handled by the frame window. */
#define WM_SHOW_MESSAGE (WM_USER + 1)
#define WM_REMOVE_MESSAGE (WM_USER + 2)
#endif /* ODPLAT_WIN32 */
#endif /* _INC_ODFRAME */
/* OpenDoors Online Software Programming Toolkit
* (C) Copyright 1991 - 1999 by Brian Pirie.
*
* Oct-2001 door32.sys/socket modifications by Rob Swindell (www.synchro.net)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* File: ODGen.h
*
* Description: Contains general definitions used throughout OpenDoors,
* including: - version information manifest constants
* - debugging macros
* - compiler-dependent definitions
* - internally used macros
*
* Revisions: Date Ver Who Change
* ---------------------------------------------------------------
* Oct 13, 1994 6.00 BP Created.
* Oct 20, 1994 6.00 BP Added DIM macro.
* Dec 31, 1994 6.00 BP Remove USEINLINE option.
* Dec 12, 1995 6.00 BP Moved ODPLAT_??? to OpenDoor.h.
* Dec 19, 1995 6.00 BP Implement ASSERT() for Win32.
* Jan 23, 1996 6.00 BP Added OD_TEXTMODE.
* Feb 19, 1996 6.00 BP Changed version number to 6.00.
* Feb 24, 1996 6.00 BP Turn off OD_DIAGNOSTICS.
* Mar 03, 1996 6.10 BP Begin version 6.10.
* Mar 03, 1996 6.10 BP Moved ODFAR to OpenDoor.h.
* Oct 19, 2001 6.20 RS Incremented version for socket support.
*/
#ifndef _INC_ODGEN
#define _INC_ODGEN
/* PLATFORM-SPECIFIC DEFINITIONS. */
/* DLL specific defintions. */
#ifdef OD_DLL
#ifdef ODPLAT_WIN32
#define OD_DLL_NAME "ODOORS62"
#endif /* ODPLAT_WIN32 */
#endif /* OD_DLL */
/* Mutlithreading specific definitions. */
#ifdef ODPLAT_WIN32
#define OD_MULTITHREADED
#endif /* ODPLAT_WIN32 */
/* Text mode specific definitions. */
#ifdef ODPLAT_DOS
#define OD_TEXTMODE
#endif /* ODPLAT_DOS */
/* DOS specific definitions. */
#ifdef ODPLAT_DOS
/* Keyword to flag ISR functions. */
#define INTERRUPT interrupt
/* Inline assembly keyword varies from compiler to compiler. */
#ifdef _MSC_VER
#define ASM __asm
#else
#define ASM asm
#endif
/* Memory model information. */
#ifdef __TINY__
#define SMALLDATA
#define SMALLCODE
#endif
#ifdef __SMALL__
#define SMALLDATA
#define SMALLCODE
#endif
#ifdef __COMPACT__
#define LARGEDATA
#define SMALLCODE
#endif
#ifdef __MEDIUM__
#define SMALLDATA
#define LARGECODE
#endif
#ifdef __LARGE__
#define LARGEDATA
#define LARGECODE
#endif
#ifdef __HUGE__
#define LARGEDATA
#define LARGECODE
#endif
#endif /* ODPLAT_DOS */
/* VERSION INFORMATION CONSTANTS. */
#define OD_VER_SHORTNAME "OpenDoors"
#define OD_VER_STATUSLINE " OpenDoors 6.20 - (C) Copyright 1991-2001" \
" by Brian Pirie "
#define OD_VER_UNREG_STAT " OpenDoors 6.20 *WARNING* Unregistered Version" \
" - Limit 1 month trial period! "
#ifdef ODPLAT_DOS
#define OD_VER_SIGNON "[OpenDoors 6.20/DOS - " \
"(C) Copyright 1991-2001 by Brian Pirie]\n\r"
#define OD_VER_FULLNAME "OpenDoors 6.20/DOS"
#endif /* ODPLAT_DOS */
#ifdef ODPLAT_WIN32
#define OD_VER_SIGNON "[OpenDoors 6.20/Win32 - " \
"(C) Copyright 1991-2001 by Brian Pirie]\n\r"
#define OD_VER_FULLNAME "OpenDoors 6.20/Win32"
#endif /* ODPLAT_WIN32 */
/* COMPILER DEPENDENT DEFINITIONS. */
/* Some compilers don't like const keyword on parameters. */
#define CONST const
/* DEBUG MACROS. */
/* OD_DEBUG is defined for debug version of the library. */
/* #define OD_DEBUG */
/* OD_DIAGNOSTICS is defined to enable od_internal_debug. */
/* #define OD_DIAGNOSTICS */
/* ASSERTion macro - terminates if test condition fails. */
#ifdef OD_DEBUG
#define __STR(x) __VAL(x)
#define __VAL(x) #x
#ifdef ODPLAT_WIN32
#define ASSERT(x) if(!(x)) { MessageBox(NULL, __FILE__ ":" \
__STR(__LINE__) "\n" #x, OD_VER_FULLNAME " - Test condition failed", \
MB_ICONSTOP | MB_OK); exit(1); }
#else /* !ODPLAT_WIN32 */
#define ASSERT(x) if(!(x)) { puts(OD_VER_FULLNAME \
" - Test condition failed:\n" __FILE__ ":" __STR(__LINE__) "\n" #x); \
exit(1); }
#endif /* !ODPLAT_WIN32 */
#else /* !OD_DEBUG */
#define ASSERT(x)
#endif /* !OD_DEBUG */
/* TRACE() macro - used to generate debug output. */
#ifdef OD_TRACE
#include <stdio.h>
#define TRACE_API 1
#define TRACE(x, y) printf("[%s]", y);
#else
#define TRACE(x, y)
#endif
/* SCREEN SIZE. */
#define OD_SCREEN_WIDTH 80
#define OD_SCREEN_HEIGHT 25
/* INTERNALLY USED MACROS. */
/* MIN() and MAX() macros. Note that expressions passed to macros may be */
/* evaluated more than once. For this reason, it is best to only pass */
/* constants or variables to these macros. */
#ifndef MIN
#define MIN(x, y) ((x) > (y)) ? (y) : (x)
#endif /* !MIN */
#ifndef MAX
#define MAX(x, y) ((x) > (y)) ? (x) : (y)
#endif /* !MAX */
/* DIM() macro. Returns the number of elements in an array. */
#ifndef DIM
#define DIM(x) (sizeof(x) / sizeof(*x))
#endif /* !DIM */
/* UNUSED() macro. Used to flag that a function parameter is intentionally */
/* not used, thus preventing a compile-time warning. */
#define UNUSED(x) ((void)(x))
#endif /* !_INC_ODGEN */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment