From 24b63b3b6a4091bb19947292b1ebfe61fbb3f5ba Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Tue, 5 Feb 2013 10:02:07 -0500 Subject: [PATCH 01/17] Reorganized and got BP compiling --- .gitattributes | 22 - .gitignore | 165 +--- BPC.CFG | 27 + BUILDBP.CMD | 63 ++ BUILDVP.CMD | 63 ++ COMPILE.TXT | 55 ++ COPYEXEBP.CMD | 10 + COPYEXEVP.CMD | 9 + README.md | 30 + ARCHIVE1.PAS => SOURCE/ARCHIVE1.PAS | 0 ARCHIVE2.PAS => SOURCE/ARCHIVE2.PAS | 0 ARCHIVE3.PAS => SOURCE/ARCHIVE3.PAS | 0 ARCVIEW.PAS => SOURCE/ARCVIEW.PAS | 0 AUTOMSG.PAS => SOURCE/AUTOMSG.PAS | 0 BBSLIST.PAS => SOURCE/BBSLIST.PAS | 0 BOOT.PAS => SOURCE/BOOT.PAS | 0 BULLETIN.PAS => SOURCE/BULLETIN.PAS | 0 COMMON.PAS => SOURCE/COMMON.PAS | 0 COMMON1.PAS => SOURCE/COMMON1.PAS | 0 COMMON2.PAS => SOURCE/COMMON2.PAS | 0 COMMON3.PAS => SOURCE/COMMON3.PAS | 0 COMMON4.PAS => SOURCE/COMMON4.PAS | 0 COMMON5.PAS => SOURCE/COMMON5.PAS | 0 CUSER.PAS => SOURCE/CUSER.PAS | 0 DOORS.PAS => SOURCE/DOORS.PAS | 0 SOURCE/ELECOM/BUFUNIT.PAS | 140 +++ SOURCE/ELECOM/COMBASE.PAS | 309 +++++++ SOURCE/ELECOM/ELECOM13.PAS | 350 +++++++ SOURCE/ELECOM/ELEDEF.PAS | 101 ++ SOURCE/ELECOM/ELENORM.PAS | 376 ++++++++ SOURCE/ELECOM/EXAM2.PAS | 150 +++ SOURCE/ELECOM/FOS_COM.PAS | 550 +++++++++++ SOURCE/ELECOM/HISTORY.102 | 19 + SOURCE/ELECOM/HISTORY.103 | 24 + SOURCE/ELECOM/IBMSO32.PAS | 113 +++ SOURCE/ELECOM/IBMTCP32.PAS | 53 ++ SOURCE/ELECOM/OS2COM.PAS | 786 ++++++++++++++++ SOURCE/ELECOM/PROCS.TXT | 109 +++ SOURCE/ELECOM/README.TXT | 17 + SOURCE/ELECOM/SOCKDEF.PAS | 606 ++++++++++++ SOURCE/ELECOM/SOCKFUNC.PAS | 831 +++++++++++++++++ SOURCE/ELECOM/SOCKFUNC.RC | 92 ++ SOURCE/ELECOM/SOCKFUNC.RES | Bin 0 -> 2392 bytes SOURCE/ELECOM/TELNET.PAS | 863 ++++++++++++++++++ SOURCE/ELECOM/THREADS.PAS | 421 +++++++++ SOURCE/ELECOM/W32SNGL.PAS | 824 +++++++++++++++++ SOURCE/ELECOM/W32SOCK.PAS | 205 +++++ SOURCE/ELECOM/WIN32COM.PAS | 790 ++++++++++++++++ SOURCE/ELECOM/WINDEF.FPC | 79 ++ SOURCE/ELECOM/dllexam.pas | 86 ++ SOURCE/ELECOM/example.pas | 181 ++++ EMAIL.PAS => SOURCE/EMAIL.PAS | 0 EVENTS.PAS => SOURCE/EVENTS.PAS | 0 EXECBAT.PAS => SOURCE/EXECBAT.PAS | 0 FILE0.PAS => SOURCE/FILE0.PAS | 0 FILE1.PAS => SOURCE/FILE1.PAS | 0 FILE10.PAS => SOURCE/FILE10.PAS | 0 FILE11.PAS => SOURCE/FILE11.PAS | 0 FILE12.PAS => SOURCE/FILE12.PAS | 0 FILE13.PAS => SOURCE/FILE13.PAS | 0 FILE14.PAS => SOURCE/FILE14.PAS | 0 FILE2.PAS => SOURCE/FILE2.PAS | 0 FILE3.PAS => SOURCE/FILE3.PAS | 0 FILE4.PAS => SOURCE/FILE4.PAS | 0 FILE5.PAS => SOURCE/FILE5.PAS | 0 FILE6.PAS => SOURCE/FILE6.PAS | 0 FILE7.PAS => SOURCE/FILE7.PAS | 0 FILE8.PAS => SOURCE/FILE8.PAS | 0 FILE9.PAS => SOURCE/FILE9.PAS | 0 LINECHAT.PAS => SOURCE/LINECHAT.PAS | 0 LOGON.PAS => SOURCE/LOGON.PAS | 0 MAIL0.PAS => SOURCE/MAIL0.PAS | 0 MAIL1.PAS => SOURCE/MAIL1.PAS | 0 MAIL2.PAS => SOURCE/MAIL2.PAS | 0 MAIL3.PAS => SOURCE/MAIL3.PAS | 0 MAIL4.PAS => SOURCE/MAIL4.PAS | 0 MAINT.PAS => SOURCE/MAINT.PAS | 0 MENUS.PAS => SOURCE/MENUS.PAS | 0 MENUS2.PAS => SOURCE/MENUS2.PAS | 0 MENUS3.PAS => SOURCE/MENUS3.PAS | 0 MISCUSER.PAS => SOURCE/MISCUSER.PAS | 0 MSGPACK.PAS => SOURCE/MSGPACK.PAS | 0 MULTNODE.PAS => SOURCE/MULTNODE.PAS | 0 MYIO.PAS => SOURCE/MYIO.PAS | 0 NEWUSERS.PAS => SOURCE/NEWUSERS.PAS | 0 NODELIST.PAS => SOURCE/NODELIST.PAS | 0 OFFLINE.PAS => SOURCE/OFFLINE.PAS | 0 RECORDS.PAS => SOURCE/RECORDS.PAS | 0 RENEGADE.PAS => SOURCE/RENEGADE.PAS | 0 RENEMAIL.PAS => SOURCE/RENEMAIL.PAS | 0 RGLNG.PAS => SOURCE/RGLNG.PAS | 0 RGMAIN.PAS => SOURCE/RGMAIN.PAS | 0 RGNOTE.PAS => SOURCE/RGNOTE.PAS | 0 RGQUOTE.PAS => SOURCE/RGQUOTE.PAS | 0 RGSCFG.PAS => SOURCE/RGSCFG.PAS | 0 SCRIPT.PAS => SOURCE/SCRIPT.PAS | 0 SHORTMSG.PAS => SOURCE/SHORTMSG.PAS | 0 SPAWNO.PAS => SOURCE/SPAWNO.PAS | 0 SPLITCHA.PAS => SOURCE/SPLITCHA.PAS | 0 STATS.PAS => SOURCE/STATS.PAS | 0 SYSOP1.PAS => SOURCE/SYSOP1.PAS | 0 SYSOP10.PAS => SOURCE/SYSOP10.PAS | 0 SYSOP11.PAS => SOURCE/SYSOP11.PAS | 0 SYSOP12.PAS => SOURCE/SYSOP12.PAS | 0 SYSOP2.PAS => SOURCE/SYSOP2.PAS | 0 SYSOP2A.PAS => SOURCE/SYSOP2A.PAS | 0 SYSOP2B.PAS => SOURCE/SYSOP2B.PAS | 0 SYSOP2C.PAS => SOURCE/SYSOP2C.PAS | 0 SYSOP2D.PAS => SOURCE/SYSOP2D.PAS | 0 SYSOP2E.PAS => SOURCE/SYSOP2E.PAS | 0 SYSOP2F.PAS => SOURCE/SYSOP2F.PAS | 0 SYSOP2G.PAS => SOURCE/SYSOP2G.PAS | 0 SYSOP2H.PAS => SOURCE/SYSOP2H.PAS | 0 SYSOP2I.PAS => SOURCE/SYSOP2I.PAS | 0 SYSOP2J.PAS => SOURCE/SYSOP2J.PAS | 0 SYSOP2K.PAS => SOURCE/SYSOP2K.PAS | 0 SYSOP2L.PAS => SOURCE/SYSOP2L.PAS | 0 SYSOP2M.PAS => SOURCE/SYSOP2M.PAS | 0 SYSOP2O.PAS => SOURCE/SYSOP2O.PAS | 0 SYSOP3.PAS => SOURCE/SYSOP3.PAS | 0 SYSOP4.PAS => SOURCE/SYSOP4.PAS | 0 SYSOP5.PAS => SOURCE/SYSOP5.PAS | 0 SYSOP6.PAS => SOURCE/SYSOP6.PAS | 0 SYSOP7.PAS => SOURCE/SYSOP7.PAS | 0 SYSOP7M.PAS => SOURCE/SYSOP7M.PAS | 0 SYSOP8.PAS => SOURCE/SYSOP8.PAS | 0 SYSOP9.PAS => SOURCE/SYSOP9.PAS | 0 TAGLINE.PAS => SOURCE/TAGLINE.PAS | 0 TIMEBANK.PAS => SOURCE/TIMEBANK.PAS | 0 TIMEFUNC.PAS => SOURCE/TIMEFUNC.PAS | 0 ACFLAGS.ASC => SOURCE/UNUSED/ACFLAGS.ASC | 0 ARCHIVE1.TPU => SOURCE/UNUSED/ARCHIVE1.TPU | Bin ARCHIVE2.TPU => SOURCE/UNUSED/ARCHIVE2.TPU | Bin ARCHIVE3.TPU => SOURCE/UNUSED/ARCHIVE3.TPU | Bin ARCVIEW.TPU => SOURCE/UNUSED/ARCVIEW.TPU | Bin AUTOMSG.TPU => SOURCE/UNUSED/AUTOMSG.TPU | Bin BATCH6.LST => SOURCE/UNUSED/BATCH6.LST | 0 BBSLIST.TPU => SOURCE/UNUSED/BBSLIST.TPU | Bin BOOT.TPU => SOURCE/UNUSED/BOOT.TPU | Bin BULLETIN.TPU => SOURCE/UNUSED/BULLETIN.TPU | Bin CHAIN.TXT => SOURCE/UNUSED/CHAIN.TXT | 0 CHAINT~1.TXT => SOURCE/UNUSED/CHAINT~1.TXT | 0 CHANGE.TXT => SOURCE/UNUSED/CHANGE.TXT | 0 CHANGE1.TXT => SOURCE/UNUSED/CHANGE1.TXT | 0 CHANGE10.TXT => SOURCE/UNUSED/CHANGE10.TXT | 0 CHANGE11.TXT => SOURCE/UNUSED/CHANGE11.TXT | 0 CHANGE12.TXT => SOURCE/UNUSED/CHANGE12.TXT | 0 CHANGE13.TXT => SOURCE/UNUSED/CHANGE13.TXT | 0 CHANGE14.TXT => SOURCE/UNUSED/CHANGE14.TXT | 0 CHANGE2.TXT => SOURCE/UNUSED/CHANGE2.TXT | 0 CHANGE3.TXT => SOURCE/UNUSED/CHANGE3.TXT | 0 CHANGE4.TXT => SOURCE/UNUSED/CHANGE4.TXT | 0 CHANGE5.TXT => SOURCE/UNUSED/CHANGE5.TXT | 0 CHANGE6.TXT => SOURCE/UNUSED/CHANGE6.TXT | 0 CHANGE7.TXT => SOURCE/UNUSED/CHANGE7.TXT | 0 CHANGE8.TXT => SOURCE/UNUSED/CHANGE8.TXT | 0 CHANGE9.TXT => SOURCE/UNUSED/CHANGE9.TXT | 0 CHANGES.TXT => SOURCE/UNUSED/CHANGES.TXT | 0 CHANGES1.TXT => SOURCE/UNUSED/CHANGES1.TXT | 0 CHANGES2.TXT => SOURCE/UNUSED/CHANGES2.TXT | 0 CHANGES3.TXT => SOURCE/UNUSED/CHANGES3.TXT | 0 CHANGES4.TXT => SOURCE/UNUSED/CHANGES4.TXT | 0 CHANGES7.TXT => SOURCE/UNUSED/CHANGES7.TXT | 0 CHANGES8.TXT => SOURCE/UNUSED/CHANGES8.TXT | 0 CHANGES9.TXT => SOURCE/UNUSED/CHANGES9.TXT | 0 CHNAGE2.TXT => SOURCE/UNUSED/CHNAGE2.TXT | 0 COMMON.TPU => SOURCE/UNUSED/COMMON.TPU | Bin COMMON1.TPU => SOURCE/UNUSED/COMMON1.TPU | Bin COMMON2.TPU => SOURCE/UNUSED/COMMON2.TPU | Bin COMMON3.TPU => SOURCE/UNUSED/COMMON3.TPU | Bin COMMON4.TPU => SOURCE/UNUSED/COMMON4.TPU | Bin COMMON5.TPU => SOURCE/UNUSED/COMMON5.TPU | Bin CRC32.ASM => SOURCE/UNUSED/CRC32.ASM | 0 CRC32A.PAS => SOURCE/UNUSED/CRC32A.PAS | 0 CUSER.TPU => SOURCE/UNUSED/CUSER.TPU | Bin DEZIP.PAS => SOURCE/UNUSED/DEZIP.PAS | 0 DOOR.SYS => SOURCE/UNUSED/DOOR.SYS | 0 DOOR32.SYS => SOURCE/UNUSED/DOOR32.SYS | 0 DOOR32~1.TXT => SOURCE/UNUSED/DOOR32~1.TXT | 0 DOORS.TPU => SOURCE/UNUSED/DOORS.TPU | Bin DOORSY~1.DOC => SOURCE/UNUSED/DOORSY~1.DOC | Bin DORINFO1.DEF => SOURCE/UNUSED/DORINFO1.DEF | 0 DORINF~1.TXT => SOURCE/UNUSED/DORINF~1.TXT | 0 DRAG_010.PAS => SOURCE/UNUSED/DRAG_010.PAS | 0 EC.PAS => SOURCE/UNUSED/EC.PAS | 0 EC.TXT => SOURCE/UNUSED/EC.TXT | 0 EMAIL.TPU => SOURCE/UNUSED/EMAIL.TPU | Bin ERROR.LOG => SOURCE/UNUSED/ERROR.LOG | 0 EVENT.PAS => SOURCE/UNUSED/EVENT.PAS | 0 EVENT.TPU => SOURCE/UNUSED/EVENT.TPU | Bin EVENTS.TPU => SOURCE/UNUSED/EVENTS.TPU | Bin EXECBAT.TPU => SOURCE/UNUSED/EXECBAT.TPU | Bin FAELNG.EXE => SOURCE/UNUSED/FAELNG.EXE | Bin FAELNG.PAS => SOURCE/UNUSED/FAELNG.PAS | 0 FAELNG.TXT => SOURCE/UNUSED/FAELNG.TXT | 0 FAEPR.DAT => SOURCE/UNUSED/FAEPR.DAT | Bin FAETX.DAT => SOURCE/UNUSED/FAETX.DAT | 0 FILE0.TPU => SOURCE/UNUSED/FILE0.TPU | Bin FILE1.TPU => SOURCE/UNUSED/FILE1.TPU | Bin FILE10.LEE => SOURCE/UNUSED/FILE10.LEE | 0 FILE10.TPU => SOURCE/UNUSED/FILE10.TPU | Bin FILE11.TPU => SOURCE/UNUSED/FILE11.TPU | Bin FILE12.TPU => SOURCE/UNUSED/FILE12.TPU | Bin FILE13.TPU => SOURCE/UNUSED/FILE13.TPU | Bin FILE14.TPU => SOURCE/UNUSED/FILE14.TPU | Bin FILE2.TPU => SOURCE/UNUSED/FILE2.TPU | Bin FILE3.TPU => SOURCE/UNUSED/FILE3.TPU | Bin FILE4.TPU => SOURCE/UNUSED/FILE4.TPU | Bin FILE5.TPU => SOURCE/UNUSED/FILE5.TPU | Bin FILE6.TPU => SOURCE/UNUSED/FILE6.TPU | Bin FILE7.TPU => SOURCE/UNUSED/FILE7.TPU | Bin FILE8.TPU => SOURCE/UNUSED/FILE8.TPU | Bin FILE9.TPU => SOURCE/UNUSED/FILE9.TPU | Bin FILES.BBS => SOURCE/UNUSED/FILES.BBS | 0 FSHELP.ASC => SOURCE/UNUSED/FSHELP.ASC | 0 FSTR.PAS => SOURCE/UNUSED/FSTR.PAS | 0 FTS-0001.016 => SOURCE/UNUSED/FTS-0001.016 | 0 GREP.COM => SOURCE/UNUSED/GREP.COM | Bin INSTALL.EXE => SOURCE/UNUSED/INSTALL.EXE | Bin INSTALL.PAS => SOURCE/UNUSED/INSTALL.PAS | 0 IS286.PAS => SOURCE/UNUSED/IS286.PAS | 0 LEE.EXE => SOURCE/UNUSED/LEE.EXE | Bin LEE.PAS => SOURCE/UNUSED/LEE.PAS | 0 LEE.TXT => SOURCE/UNUSED/LEE.TXT | 0 LGNQUOTE.DAT => SOURCE/UNUSED/LGNQUOTE.DAT | 0 LGNQUOTE.PTR => SOURCE/UNUSED/LGNQUOTE.PTR | Bin LGNQUOTE.TXT => SOURCE/UNUSED/LGNQUOTE.TXT | 0 LINECHAT.TPU => SOURCE/UNUSED/LINECHAT.TPU | Bin LOGON.BAT => SOURCE/UNUSED/LOGON.BAT | 0 LOGON.TPU => SOURCE/UNUSED/LOGON.TPU | Bin MAIL0.TPU => SOURCE/UNUSED/MAIL0.TPU | Bin MAIL1.LEE => SOURCE/UNUSED/MAIL1.LEE | 0 MAIL1.TPU => SOURCE/UNUSED/MAIL1.TPU | Bin MAIL2.TPU => SOURCE/UNUSED/MAIL2.TPU | Bin MAIL3.TPU => SOURCE/UNUSED/MAIL3.TPU | Bin MAIL4.TPU => SOURCE/UNUSED/MAIL4.TPU | Bin MAIL5.PAS => SOURCE/UNUSED/MAIL5.PAS | 0 MAIL5.TPU => SOURCE/UNUSED/MAIL5.TPU | Bin MAIL6.PAS => SOURCE/UNUSED/MAIL6.PAS | 0 MAIL6.TPU => SOURCE/UNUSED/MAIL6.TPU | Bin MAIL7.PAS => SOURCE/UNUSED/MAIL7.PAS | 0 MAIL7.TPU => SOURCE/UNUSED/MAIL7.TPU | Bin MAINT.TPU => SOURCE/UNUSED/MAINT.TPU | Bin MARRIAGE.DAT => SOURCE/UNUSED/MARRIAGE.DAT | Bin MARRIAGE.PTR => SOURCE/UNUSED/MARRIAGE.PTR | Bin MARRIAGE.TXT => SOURCE/UNUSED/MARRIAGE.TXT | 0 MENUS.TPU => SOURCE/UNUSED/MENUS.TPU | Bin MENUS2.TPU => SOURCE/UNUSED/MENUS2.TPU | Bin MENUS3.TPU => SOURCE/UNUSED/MENUS3.TPU | Bin MENUS4.PAS => SOURCE/UNUSED/MENUS4.PAS | 0 MENUS4.TPU => SOURCE/UNUSED/MENUS4.TPU | Bin MISCCHAT.PAS => SOURCE/UNUSED/MISCCHAT.PAS | 0 MISCUSER.TPU => SOURCE/UNUSED/MISCUSER.TPU | Bin MSGPACK.TPU => SOURCE/UNUSED/MSGPACK.TPU | Bin MSGQUOTE.DAT => SOURCE/UNUSED/MSGQUOTE.DAT | 0 MSGQUOTE.PTR => SOURCE/UNUSED/MSGQUOTE.PTR | Bin MSGQUOTE.TXT => SOURCE/UNUSED/MSGQUOTE.TXT | 0 MULT.PAS => SOURCE/UNUSED/MULT.PAS | 0 MULTNODE.TPU => SOURCE/UNUSED/MULTNODE.TPU | Bin MYIO.TPU => SOURCE/UNUSED/MYIO.TPU | Bin NEWMCI.TXT => SOURCE/UNUSED/NEWMCI.TXT | 0 NEWUSERS.TPU => SOURCE/UNUSED/NEWUSERS.TPU | Bin NODELIST.TPU => SOURCE/UNUSED/NODELIST.TPU | Bin NONAME00.EXE => SOURCE/UNUSED/NONAME00.EXE | Bin OFFLINE.TPU => SOURCE/UNUSED/OFFLINE.TPU | Bin OVRUMB.DOC => SOURCE/UNUSED/OVRUMB.DOC | 0 OVRUMB.PAS => SOURCE/UNUSED/OVRUMB.PAS | 0 OVRUMB.TPU => SOURCE/UNUSED/OVRUMB.TPU | Bin PCBOAR~1.TXT => SOURCE/UNUSED/PCBOAR~1.TXT | 0 PKUNZIP.EXE => SOURCE/UNUSED/PKUNZIP.EXE | Bin PKZIP.EXE => SOURCE/UNUSED/PKZIP.EXE | Bin PRHELP.ASC => SOURCE/UNUSED/PRHELP.ASC | 0 RENEGADE.DAT => SOURCE/UNUSED/RENEGADE.DAT | Bin RENEGADE.EXE => SOURCE/UNUSED/RENEGADE.EXE | Bin RENEGADE.LNG => SOURCE/UNUSED/RENEGADE.LNG | 0 RENEGADE.OVR => SOURCE/UNUSED/RENEGADE.OVR | Bin RENEGADE.PIF => SOURCE/UNUSED/RENEGADE.PIF | Bin RENEGADE.TPH => SOURCE/UNUSED/RENEGADE.TPH | Bin RENEMAIL.EXE => SOURCE/UNUSED/RENEMAIL.EXE | Bin RENEMAIL.TPH => SOURCE/UNUSED/RENEMAIL.TPH | Bin REUPDATE.PAS => SOURCE/UNUSED/REUPDATE.PAS | 0 RGAPI.PAS => SOURCE/UNUSED/RGAPI.PAS | 0 RGFLIST.PAS => SOURCE/UNUSED/RGFLIST.PAS | 0 RGINTRO.ANS => SOURCE/UNUSED/RGINTRO.ANS | 0 RGLNG.EXE => SOURCE/UNUSED/RGLNG.EXE | Bin RGLNG.TXT => SOURCE/UNUSED/RGLNG.TXT | 0 RGLNGNEW.TXT => SOURCE/UNUSED/RGLNGNEW.TXT | 0 RGLNGPR.DAT => SOURCE/UNUSED/RGLNGPR.DAT | Bin RGLNGTX.DAT => SOURCE/UNUSED/RGLNGTX.DAT | Bin RGMAIN.EXE => SOURCE/UNUSED/RGMAIN.EXE | Bin RGMAIN.TXT => SOURCE/UNUSED/RGMAIN.TXT | 0 RGMAINPR.DAT => SOURCE/UNUSED/RGMAINPR.DAT | Bin RGMAINT.EXE => SOURCE/UNUSED/RGMAINT.EXE | Bin RGMAINT.PAS => SOURCE/UNUSED/RGMAINT.PAS | 0 RGMAINT1.PAS => SOURCE/UNUSED/RGMAINT1.PAS | 0 RGMAINT2.PAS => SOURCE/UNUSED/RGMAINT2.PAS | 0 RGMAINTX.DAT => SOURCE/UNUSED/RGMAINTX.DAT | Bin RGNOTE.EXE => SOURCE/UNUSED/RGNOTE.EXE | Bin RGNOTE.TXT => SOURCE/UNUSED/RGNOTE.TXT | 0 RGNOTEPR.DAT => SOURCE/UNUSED/RGNOTEPR.DAT | Bin RGNOTETX.DAT => SOURCE/UNUSED/RGNOTETX.DAT | Bin RGQUOTE.EXE => SOURCE/UNUSED/RGQUOTE.EXE | Bin RGSCFG.EXE => SOURCE/UNUSED/RGSCFG.EXE | Bin RGSCFG.TXT => SOURCE/UNUSED/RGSCFG.TXT | 0 RGSCFGPR.DAT => SOURCE/UNUSED/RGSCFGPR.DAT | Bin RGSCFGTX.DAT => SOURCE/UNUSED/RGSCFGTX.DAT | Bin RGSTAT.PAS => SOURCE/UNUSED/RGSTAT.PAS | 0 RGUPDATE.EXE => SOURCE/UNUSED/RGUPDATE.EXE | Bin RGUPDATE.PAS => SOURCE/UNUSED/RGUPDATE.PAS | 0 RGUPDT1.EXE => SOURCE/UNUSED/RGUPDT1.EXE | Bin RGUPDT1.PAS => SOURCE/UNUSED/RGUPDT1.PAS | 0 RGUPDT2.EXE => SOURCE/UNUSED/RGUPDT2.EXE | Bin RGUPDT2.PAS => SOURCE/UNUSED/RGUPDT2.PAS | 0 RGUPDT3.EXE => SOURCE/UNUSED/RGUPDT3.EXE | Bin RGUPDT3.PAS => SOURCE/UNUSED/RGUPDT3.PAS | 0 RGUPDT4.PAS => SOURCE/UNUSED/RGUPDT4.PAS | 0 RGV118.EXE => SOURCE/UNUSED/RGV118.EXE | Bin RGV118.PAS => SOURCE/UNUSED/RGV118.PAS | 0 RGVER.EXE => SOURCE/UNUSED/RGVER.EXE | Bin RGVER.PAS => SOURCE/UNUSED/RGVER.PAS | 0 RGVERUDT.EXE => SOURCE/UNUSED/RGVERUDT.EXE | Bin RGVERUDT.PAS => SOURCE/UNUSED/RGVERUDT.PAS | 0 RMAILWKS.PAS => SOURCE/UNUSED/RMAILWKS.PAS | 0 RMCHANGE.DOC => SOURCE/UNUSED/RMCHANGE.DOC | 0 RMUPDATE.DOC => SOURCE/UNUSED/RMUPDATE.DOC | 0 SCRIPT.TPU => SOURCE/UNUSED/SCRIPT.TPU | Bin SHORTMSG.TPU => SOURCE/UNUSED/SHORTMSG.TPU | Bin SORTING.PAS => SOURCE/UNUSED/SORTING.PAS | 0 SPAWNO.TPU => SOURCE/UNUSED/SPAWNO.TPU | Bin SPLITCHA.TPU => SOURCE/UNUSED/SPLITCHA.TPU | Bin STATS.TPU => SOURCE/UNUSED/STATS.TPU | Bin SYSCHAT.PAS => SOURCE/UNUSED/SYSCHAT.PAS | 0 SYSCHAT.TPU => SOURCE/UNUSED/SYSCHAT.TPU | Bin SYSOP1.TPU => SOURCE/UNUSED/SYSOP1.TPU | Bin SYSOP10.TPU => SOURCE/UNUSED/SYSOP10.TPU | Bin SYSOP11.TPU => SOURCE/UNUSED/SYSOP11.TPU | Bin SYSOP12.TPU => SOURCE/UNUSED/SYSOP12.TPU | Bin SYSOP2.TPU => SOURCE/UNUSED/SYSOP2.TPU | Bin SYSOP2A.TPU => SOURCE/UNUSED/SYSOP2A.TPU | Bin SYSOP2B.TPU => SOURCE/UNUSED/SYSOP2B.TPU | Bin SYSOP2C.TPU => SOURCE/UNUSED/SYSOP2C.TPU | Bin SYSOP2D.TPU => SOURCE/UNUSED/SYSOP2D.TPU | Bin SYSOP2E.TPU => SOURCE/UNUSED/SYSOP2E.TPU | Bin SYSOP2F.TPU => SOURCE/UNUSED/SYSOP2F.TPU | Bin SYSOP2G.TPU => SOURCE/UNUSED/SYSOP2G.TPU | Bin SYSOP2H.TPU => SOURCE/UNUSED/SYSOP2H.TPU | Bin SYSOP2I.TPU => SOURCE/UNUSED/SYSOP2I.TPU | Bin SYSOP2J.TPU => SOURCE/UNUSED/SYSOP2J.TPU | Bin SYSOP2K.TPU => SOURCE/UNUSED/SYSOP2K.TPU | Bin SYSOP2L.TPU => SOURCE/UNUSED/SYSOP2L.TPU | Bin SYSOP2M.TPU => SOURCE/UNUSED/SYSOP2M.TPU | Bin SYSOP2O.TPU => SOURCE/UNUSED/SYSOP2O.TPU | Bin SYSOP3.TPU => SOURCE/UNUSED/SYSOP3.TPU | Bin SYSOP4.TPU => SOURCE/UNUSED/SYSOP4.TPU | Bin SYSOP5.TPU => SOURCE/UNUSED/SYSOP5.TPU | Bin SYSOP6.TPU => SOURCE/UNUSED/SYSOP6.TPU | Bin SYSOP6~1.PAS => SOURCE/UNUSED/SYSOP6~1.PAS | 0 SYSOP7.TPU => SOURCE/UNUSED/SYSOP7.TPU | Bin SYSOP7M.TPU => SOURCE/UNUSED/SYSOP7M.TPU | Bin SYSOP8.TPU => SOURCE/UNUSED/SYSOP8.TPU | Bin SYSOP9.TPU => SOURCE/UNUSED/SYSOP9.TPU | Bin TAGLINE.DAT => SOURCE/UNUSED/TAGLINE.DAT | 0 TAGLINE.EXE => SOURCE/UNUSED/TAGLINE.EXE | Bin TAGLINE.PTR => SOURCE/UNUSED/TAGLINE.PTR | Bin TAGLINE.TXT => SOURCE/UNUSED/TAGLINE.TXT | 0 TAGSTAT.PAS => SOURCE/UNUSED/TAGSTAT.PAS | 0 TEMP6.BAT => SOURCE/UNUSED/TEMP6.BAT | 0 TIMEBANK.TPU => SOURCE/UNUSED/TIMEBANK.TPU | Bin TIMEFUNC.TPU => SOURCE/UNUSED/TIMEFUNC.TPU | Bin TPX.DSK => SOURCE/UNUSED/TPX.DSK | Bin TPX.TP => SOURCE/UNUSED/TPX.TP | Bin TURBO.DSK => SOURCE/UNUSED/TURBO.DSK | Bin USER.PAS => SOURCE/UNUSED/USER.PAS | 0 VOTE.TPU => SOURCE/UNUSED/VOTE.TPU | Bin WD110107.TXT => SOURCE/UNUSED/WD110107.TXT | 0 WD110207.TXT => SOURCE/UNUSED/WD110207.TXT | 0 WD110307.TXT => SOURCE/UNUSED/WD110307.TXT | 0 WFCMENU.TPU => SOURCE/UNUSED/WFCMENU.TPU | Bin WFCNEW1.ANS => SOURCE/UNUSED/WFCNEW1.ANS | 0 WFC_COM.ANS => SOURCE/UNUSED/WFC_COM.ANS | 0 WFC_NODE.ANS => SOURCE/UNUSED/WFC_NODE.ANS | 0 .../UNUSED/bootoldback.pas | 0 SOURCE/UNUSED/m.cmd | 1 + VOTE.PAS => SOURCE/VOTE.PAS | 0 WFCMENU.PAS => SOURCE/WFCMENU.PAS | 0 SOURCE/WIN32/overlay.pas | 9 + SOURCE/crc32.obj | Bin 0 -> 1259 bytes SOURCE/execwin.obj | Bin 0 -> 698 bytes SOURCE/spawntp.obj | Bin 0 -> 6308 bytes VPC.CFG | 25 + 390 files changed, 8369 insertions(+), 185 deletions(-) delete mode 100644 .gitattributes create mode 100644 BPC.CFG create mode 100644 BUILDBP.CMD create mode 100644 BUILDVP.CMD create mode 100644 COMPILE.TXT create mode 100644 COPYEXEBP.CMD create mode 100644 COPYEXEVP.CMD create mode 100644 README.md rename ARCHIVE1.PAS => SOURCE/ARCHIVE1.PAS (100%) rename ARCHIVE2.PAS => SOURCE/ARCHIVE2.PAS (100%) rename ARCHIVE3.PAS => SOURCE/ARCHIVE3.PAS (100%) rename ARCVIEW.PAS => SOURCE/ARCVIEW.PAS (100%) rename AUTOMSG.PAS => SOURCE/AUTOMSG.PAS (100%) rename BBSLIST.PAS => SOURCE/BBSLIST.PAS (100%) rename BOOT.PAS => SOURCE/BOOT.PAS (100%) rename BULLETIN.PAS => SOURCE/BULLETIN.PAS (100%) rename COMMON.PAS => SOURCE/COMMON.PAS (100%) rename COMMON1.PAS => SOURCE/COMMON1.PAS (100%) rename COMMON2.PAS => SOURCE/COMMON2.PAS (100%) rename COMMON3.PAS => SOURCE/COMMON3.PAS (100%) rename COMMON4.PAS => SOURCE/COMMON4.PAS (100%) rename COMMON5.PAS => SOURCE/COMMON5.PAS (100%) rename CUSER.PAS => SOURCE/CUSER.PAS (100%) rename DOORS.PAS => SOURCE/DOORS.PAS (100%) create mode 100644 SOURCE/ELECOM/BUFUNIT.PAS create mode 100644 SOURCE/ELECOM/COMBASE.PAS create mode 100644 SOURCE/ELECOM/ELECOM13.PAS create mode 100644 SOURCE/ELECOM/ELEDEF.PAS create mode 100644 SOURCE/ELECOM/ELENORM.PAS create mode 100644 SOURCE/ELECOM/EXAM2.PAS create mode 100644 SOURCE/ELECOM/FOS_COM.PAS create mode 100644 SOURCE/ELECOM/HISTORY.102 create mode 100644 SOURCE/ELECOM/HISTORY.103 create mode 100644 SOURCE/ELECOM/IBMSO32.PAS create mode 100644 SOURCE/ELECOM/IBMTCP32.PAS create mode 100644 SOURCE/ELECOM/OS2COM.PAS create mode 100644 SOURCE/ELECOM/PROCS.TXT create mode 100644 SOURCE/ELECOM/README.TXT create mode 100644 SOURCE/ELECOM/SOCKDEF.PAS create mode 100644 SOURCE/ELECOM/SOCKFUNC.PAS create mode 100644 SOURCE/ELECOM/SOCKFUNC.RC create mode 100644 SOURCE/ELECOM/SOCKFUNC.RES create mode 100644 SOURCE/ELECOM/TELNET.PAS create mode 100644 SOURCE/ELECOM/THREADS.PAS create mode 100644 SOURCE/ELECOM/W32SNGL.PAS create mode 100644 SOURCE/ELECOM/W32SOCK.PAS create mode 100644 SOURCE/ELECOM/WIN32COM.PAS create mode 100644 SOURCE/ELECOM/WINDEF.FPC create mode 100644 SOURCE/ELECOM/dllexam.pas create mode 100644 SOURCE/ELECOM/example.pas rename EMAIL.PAS => SOURCE/EMAIL.PAS (100%) rename EVENTS.PAS => SOURCE/EVENTS.PAS (100%) rename EXECBAT.PAS => SOURCE/EXECBAT.PAS (100%) rename FILE0.PAS => SOURCE/FILE0.PAS (100%) rename FILE1.PAS => SOURCE/FILE1.PAS (100%) rename FILE10.PAS => SOURCE/FILE10.PAS (100%) rename FILE11.PAS => SOURCE/FILE11.PAS (100%) rename FILE12.PAS => SOURCE/FILE12.PAS (100%) rename FILE13.PAS => SOURCE/FILE13.PAS (100%) rename FILE14.PAS => SOURCE/FILE14.PAS (100%) rename FILE2.PAS => SOURCE/FILE2.PAS (100%) rename FILE3.PAS => SOURCE/FILE3.PAS (100%) rename FILE4.PAS => SOURCE/FILE4.PAS (100%) rename FILE5.PAS => SOURCE/FILE5.PAS (100%) rename FILE6.PAS => SOURCE/FILE6.PAS (100%) rename FILE7.PAS => SOURCE/FILE7.PAS (100%) rename FILE8.PAS => SOURCE/FILE8.PAS (100%) rename FILE9.PAS => SOURCE/FILE9.PAS (100%) rename LINECHAT.PAS => SOURCE/LINECHAT.PAS (100%) rename LOGON.PAS => SOURCE/LOGON.PAS (100%) rename MAIL0.PAS => SOURCE/MAIL0.PAS (100%) rename MAIL1.PAS => SOURCE/MAIL1.PAS (100%) rename MAIL2.PAS => SOURCE/MAIL2.PAS (100%) rename MAIL3.PAS => SOURCE/MAIL3.PAS (100%) rename MAIL4.PAS => SOURCE/MAIL4.PAS (100%) rename MAINT.PAS => SOURCE/MAINT.PAS (100%) rename MENUS.PAS => SOURCE/MENUS.PAS (100%) rename MENUS2.PAS => SOURCE/MENUS2.PAS (100%) rename MENUS3.PAS => SOURCE/MENUS3.PAS (100%) rename MISCUSER.PAS => SOURCE/MISCUSER.PAS (100%) rename MSGPACK.PAS => SOURCE/MSGPACK.PAS (100%) rename MULTNODE.PAS => SOURCE/MULTNODE.PAS (100%) rename MYIO.PAS => SOURCE/MYIO.PAS (100%) rename NEWUSERS.PAS => SOURCE/NEWUSERS.PAS (100%) rename NODELIST.PAS => SOURCE/NODELIST.PAS (100%) rename OFFLINE.PAS => SOURCE/OFFLINE.PAS (100%) rename RECORDS.PAS => SOURCE/RECORDS.PAS (100%) rename RENEGADE.PAS => SOURCE/RENEGADE.PAS (100%) rename RENEMAIL.PAS => SOURCE/RENEMAIL.PAS (100%) rename RGLNG.PAS => SOURCE/RGLNG.PAS (100%) rename RGMAIN.PAS => SOURCE/RGMAIN.PAS (100%) rename RGNOTE.PAS => SOURCE/RGNOTE.PAS (100%) rename RGQUOTE.PAS => SOURCE/RGQUOTE.PAS (100%) rename RGSCFG.PAS => SOURCE/RGSCFG.PAS (100%) rename SCRIPT.PAS => SOURCE/SCRIPT.PAS (100%) rename SHORTMSG.PAS => SOURCE/SHORTMSG.PAS (100%) rename SPAWNO.PAS => SOURCE/SPAWNO.PAS (100%) rename SPLITCHA.PAS => SOURCE/SPLITCHA.PAS (100%) rename STATS.PAS => SOURCE/STATS.PAS (100%) rename SYSOP1.PAS => SOURCE/SYSOP1.PAS (100%) rename SYSOP10.PAS => SOURCE/SYSOP10.PAS (100%) rename SYSOP11.PAS => SOURCE/SYSOP11.PAS (100%) rename SYSOP12.PAS => SOURCE/SYSOP12.PAS (100%) rename SYSOP2.PAS => SOURCE/SYSOP2.PAS (100%) rename SYSOP2A.PAS => SOURCE/SYSOP2A.PAS (100%) rename SYSOP2B.PAS => SOURCE/SYSOP2B.PAS (100%) rename SYSOP2C.PAS => SOURCE/SYSOP2C.PAS (100%) rename SYSOP2D.PAS => SOURCE/SYSOP2D.PAS (100%) rename SYSOP2E.PAS => SOURCE/SYSOP2E.PAS (100%) rename SYSOP2F.PAS => SOURCE/SYSOP2F.PAS (100%) rename SYSOP2G.PAS => SOURCE/SYSOP2G.PAS (100%) rename SYSOP2H.PAS => SOURCE/SYSOP2H.PAS (100%) rename SYSOP2I.PAS => SOURCE/SYSOP2I.PAS (100%) rename SYSOP2J.PAS => SOURCE/SYSOP2J.PAS (100%) rename SYSOP2K.PAS => SOURCE/SYSOP2K.PAS (100%) rename SYSOP2L.PAS => SOURCE/SYSOP2L.PAS (100%) rename SYSOP2M.PAS => SOURCE/SYSOP2M.PAS (100%) rename SYSOP2O.PAS => SOURCE/SYSOP2O.PAS (100%) rename SYSOP3.PAS => SOURCE/SYSOP3.PAS (100%) rename SYSOP4.PAS => SOURCE/SYSOP4.PAS (100%) rename SYSOP5.PAS => SOURCE/SYSOP5.PAS (100%) rename SYSOP6.PAS => SOURCE/SYSOP6.PAS (100%) rename SYSOP7.PAS => SOURCE/SYSOP7.PAS (100%) rename SYSOP7M.PAS => SOURCE/SYSOP7M.PAS (100%) rename SYSOP8.PAS => SOURCE/SYSOP8.PAS (100%) rename SYSOP9.PAS => SOURCE/SYSOP9.PAS (100%) rename TAGLINE.PAS => SOURCE/TAGLINE.PAS (100%) rename TIMEBANK.PAS => SOURCE/TIMEBANK.PAS (100%) rename TIMEFUNC.PAS => SOURCE/TIMEFUNC.PAS (100%) rename ACFLAGS.ASC => SOURCE/UNUSED/ACFLAGS.ASC (100%) rename ARCHIVE1.TPU => SOURCE/UNUSED/ARCHIVE1.TPU (100%) rename ARCHIVE2.TPU => SOURCE/UNUSED/ARCHIVE2.TPU (100%) rename ARCHIVE3.TPU => SOURCE/UNUSED/ARCHIVE3.TPU (100%) rename ARCVIEW.TPU => SOURCE/UNUSED/ARCVIEW.TPU (100%) rename AUTOMSG.TPU => SOURCE/UNUSED/AUTOMSG.TPU (100%) rename BATCH6.LST => SOURCE/UNUSED/BATCH6.LST (100%) rename BBSLIST.TPU => SOURCE/UNUSED/BBSLIST.TPU (100%) rename BOOT.TPU => SOURCE/UNUSED/BOOT.TPU (100%) rename BULLETIN.TPU => SOURCE/UNUSED/BULLETIN.TPU (100%) rename CHAIN.TXT => SOURCE/UNUSED/CHAIN.TXT (100%) rename CHAINT~1.TXT => SOURCE/UNUSED/CHAINT~1.TXT (100%) rename CHANGE.TXT => SOURCE/UNUSED/CHANGE.TXT (100%) rename CHANGE1.TXT => SOURCE/UNUSED/CHANGE1.TXT (100%) rename CHANGE10.TXT => SOURCE/UNUSED/CHANGE10.TXT (100%) rename CHANGE11.TXT => SOURCE/UNUSED/CHANGE11.TXT (100%) rename CHANGE12.TXT => SOURCE/UNUSED/CHANGE12.TXT (100%) rename CHANGE13.TXT => SOURCE/UNUSED/CHANGE13.TXT (100%) rename CHANGE14.TXT => SOURCE/UNUSED/CHANGE14.TXT (100%) rename CHANGE2.TXT => SOURCE/UNUSED/CHANGE2.TXT (100%) rename CHANGE3.TXT => SOURCE/UNUSED/CHANGE3.TXT (100%) rename CHANGE4.TXT => SOURCE/UNUSED/CHANGE4.TXT (100%) rename CHANGE5.TXT => SOURCE/UNUSED/CHANGE5.TXT (100%) rename CHANGE6.TXT => SOURCE/UNUSED/CHANGE6.TXT (100%) rename CHANGE7.TXT => SOURCE/UNUSED/CHANGE7.TXT (100%) rename CHANGE8.TXT => SOURCE/UNUSED/CHANGE8.TXT (100%) rename CHANGE9.TXT => SOURCE/UNUSED/CHANGE9.TXT (100%) rename CHANGES.TXT => SOURCE/UNUSED/CHANGES.TXT (100%) rename CHANGES1.TXT => SOURCE/UNUSED/CHANGES1.TXT (100%) rename CHANGES2.TXT => SOURCE/UNUSED/CHANGES2.TXT (100%) rename CHANGES3.TXT => SOURCE/UNUSED/CHANGES3.TXT (100%) rename CHANGES4.TXT => SOURCE/UNUSED/CHANGES4.TXT (100%) rename CHANGES7.TXT => SOURCE/UNUSED/CHANGES7.TXT (100%) rename CHANGES8.TXT => SOURCE/UNUSED/CHANGES8.TXT (100%) rename CHANGES9.TXT => SOURCE/UNUSED/CHANGES9.TXT (100%) rename CHNAGE2.TXT => SOURCE/UNUSED/CHNAGE2.TXT (100%) rename COMMON.TPU => SOURCE/UNUSED/COMMON.TPU (100%) rename COMMON1.TPU => SOURCE/UNUSED/COMMON1.TPU (100%) rename COMMON2.TPU => SOURCE/UNUSED/COMMON2.TPU (100%) rename COMMON3.TPU => SOURCE/UNUSED/COMMON3.TPU (100%) rename COMMON4.TPU => SOURCE/UNUSED/COMMON4.TPU (100%) rename COMMON5.TPU => SOURCE/UNUSED/COMMON5.TPU (100%) rename CRC32.ASM => SOURCE/UNUSED/CRC32.ASM (100%) rename CRC32A.PAS => SOURCE/UNUSED/CRC32A.PAS (100%) rename CUSER.TPU => SOURCE/UNUSED/CUSER.TPU (100%) rename DEZIP.PAS => SOURCE/UNUSED/DEZIP.PAS (100%) rename DOOR.SYS => SOURCE/UNUSED/DOOR.SYS (100%) rename DOOR32.SYS => SOURCE/UNUSED/DOOR32.SYS (100%) rename DOOR32~1.TXT => SOURCE/UNUSED/DOOR32~1.TXT (100%) rename DOORS.TPU => SOURCE/UNUSED/DOORS.TPU (100%) rename DOORSY~1.DOC => SOURCE/UNUSED/DOORSY~1.DOC (100%) rename DORINFO1.DEF => SOURCE/UNUSED/DORINFO1.DEF (100%) rename DORINF~1.TXT => SOURCE/UNUSED/DORINF~1.TXT (100%) rename DRAG_010.PAS => SOURCE/UNUSED/DRAG_010.PAS (100%) rename EC.PAS => SOURCE/UNUSED/EC.PAS (100%) rename EC.TXT => SOURCE/UNUSED/EC.TXT (100%) rename EMAIL.TPU => SOURCE/UNUSED/EMAIL.TPU (100%) rename ERROR.LOG => SOURCE/UNUSED/ERROR.LOG (100%) rename EVENT.PAS => SOURCE/UNUSED/EVENT.PAS (100%) rename EVENT.TPU => SOURCE/UNUSED/EVENT.TPU (100%) rename EVENTS.TPU => SOURCE/UNUSED/EVENTS.TPU (100%) rename EXECBAT.TPU => SOURCE/UNUSED/EXECBAT.TPU (100%) rename FAELNG.EXE => SOURCE/UNUSED/FAELNG.EXE (100%) rename FAELNG.PAS => SOURCE/UNUSED/FAELNG.PAS (100%) rename FAELNG.TXT => SOURCE/UNUSED/FAELNG.TXT (100%) rename FAEPR.DAT => SOURCE/UNUSED/FAEPR.DAT (100%) rename FAETX.DAT => SOURCE/UNUSED/FAETX.DAT (100%) rename FILE0.TPU => SOURCE/UNUSED/FILE0.TPU (100%) rename FILE1.TPU => SOURCE/UNUSED/FILE1.TPU (100%) rename FILE10.LEE => SOURCE/UNUSED/FILE10.LEE (100%) rename FILE10.TPU => SOURCE/UNUSED/FILE10.TPU (100%) rename FILE11.TPU => SOURCE/UNUSED/FILE11.TPU (100%) rename FILE12.TPU => SOURCE/UNUSED/FILE12.TPU (100%) rename FILE13.TPU => SOURCE/UNUSED/FILE13.TPU (100%) rename FILE14.TPU => SOURCE/UNUSED/FILE14.TPU (100%) rename FILE2.TPU => SOURCE/UNUSED/FILE2.TPU (100%) rename FILE3.TPU => SOURCE/UNUSED/FILE3.TPU (100%) rename FILE4.TPU => SOURCE/UNUSED/FILE4.TPU (100%) rename FILE5.TPU => SOURCE/UNUSED/FILE5.TPU (100%) rename FILE6.TPU => SOURCE/UNUSED/FILE6.TPU (100%) rename FILE7.TPU => SOURCE/UNUSED/FILE7.TPU (100%) rename FILE8.TPU => SOURCE/UNUSED/FILE8.TPU (100%) rename FILE9.TPU => SOURCE/UNUSED/FILE9.TPU (100%) rename FILES.BBS => SOURCE/UNUSED/FILES.BBS (100%) rename FSHELP.ASC => SOURCE/UNUSED/FSHELP.ASC (100%) rename FSTR.PAS => SOURCE/UNUSED/FSTR.PAS (100%) rename FTS-0001.016 => SOURCE/UNUSED/FTS-0001.016 (100%) rename GREP.COM => SOURCE/UNUSED/GREP.COM (100%) rename INSTALL.EXE => SOURCE/UNUSED/INSTALL.EXE (100%) rename INSTALL.PAS => SOURCE/UNUSED/INSTALL.PAS (100%) rename IS286.PAS => SOURCE/UNUSED/IS286.PAS (100%) rename LEE.EXE => SOURCE/UNUSED/LEE.EXE (100%) rename LEE.PAS => SOURCE/UNUSED/LEE.PAS (100%) rename LEE.TXT => SOURCE/UNUSED/LEE.TXT (100%) rename LGNQUOTE.DAT => SOURCE/UNUSED/LGNQUOTE.DAT (100%) rename LGNQUOTE.PTR => SOURCE/UNUSED/LGNQUOTE.PTR (100%) rename LGNQUOTE.TXT => SOURCE/UNUSED/LGNQUOTE.TXT (100%) rename LINECHAT.TPU => SOURCE/UNUSED/LINECHAT.TPU (100%) rename LOGON.BAT => SOURCE/UNUSED/LOGON.BAT (100%) rename LOGON.TPU => SOURCE/UNUSED/LOGON.TPU (100%) rename MAIL0.TPU => SOURCE/UNUSED/MAIL0.TPU (100%) rename MAIL1.LEE => SOURCE/UNUSED/MAIL1.LEE (100%) rename MAIL1.TPU => SOURCE/UNUSED/MAIL1.TPU (100%) rename MAIL2.TPU => SOURCE/UNUSED/MAIL2.TPU (100%) rename MAIL3.TPU => SOURCE/UNUSED/MAIL3.TPU (100%) rename MAIL4.TPU => SOURCE/UNUSED/MAIL4.TPU (100%) rename MAIL5.PAS => SOURCE/UNUSED/MAIL5.PAS (100%) rename MAIL5.TPU => SOURCE/UNUSED/MAIL5.TPU (100%) rename MAIL6.PAS => SOURCE/UNUSED/MAIL6.PAS (100%) rename MAIL6.TPU => SOURCE/UNUSED/MAIL6.TPU (100%) rename MAIL7.PAS => SOURCE/UNUSED/MAIL7.PAS (100%) rename MAIL7.TPU => SOURCE/UNUSED/MAIL7.TPU (100%) rename MAINT.TPU => SOURCE/UNUSED/MAINT.TPU (100%) rename MARRIAGE.DAT => SOURCE/UNUSED/MARRIAGE.DAT (100%) rename MARRIAGE.PTR => SOURCE/UNUSED/MARRIAGE.PTR (100%) rename MARRIAGE.TXT => SOURCE/UNUSED/MARRIAGE.TXT (100%) rename MENUS.TPU => SOURCE/UNUSED/MENUS.TPU (100%) rename MENUS2.TPU => SOURCE/UNUSED/MENUS2.TPU (100%) rename MENUS3.TPU => SOURCE/UNUSED/MENUS3.TPU (100%) rename MENUS4.PAS => SOURCE/UNUSED/MENUS4.PAS (100%) rename MENUS4.TPU => SOURCE/UNUSED/MENUS4.TPU (100%) rename MISCCHAT.PAS => SOURCE/UNUSED/MISCCHAT.PAS (100%) rename MISCUSER.TPU => SOURCE/UNUSED/MISCUSER.TPU (100%) rename MSGPACK.TPU => SOURCE/UNUSED/MSGPACK.TPU (100%) rename MSGQUOTE.DAT => SOURCE/UNUSED/MSGQUOTE.DAT (100%) rename MSGQUOTE.PTR => SOURCE/UNUSED/MSGQUOTE.PTR (100%) rename MSGQUOTE.TXT => SOURCE/UNUSED/MSGQUOTE.TXT (100%) rename MULT.PAS => SOURCE/UNUSED/MULT.PAS (100%) rename MULTNODE.TPU => SOURCE/UNUSED/MULTNODE.TPU (100%) rename MYIO.TPU => SOURCE/UNUSED/MYIO.TPU (100%) rename NEWMCI.TXT => SOURCE/UNUSED/NEWMCI.TXT (100%) rename NEWUSERS.TPU => SOURCE/UNUSED/NEWUSERS.TPU (100%) rename NODELIST.TPU => SOURCE/UNUSED/NODELIST.TPU (100%) rename NONAME00.EXE => SOURCE/UNUSED/NONAME00.EXE (100%) rename OFFLINE.TPU => SOURCE/UNUSED/OFFLINE.TPU (100%) rename OVRUMB.DOC => SOURCE/UNUSED/OVRUMB.DOC (100%) rename OVRUMB.PAS => SOURCE/UNUSED/OVRUMB.PAS (100%) rename OVRUMB.TPU => SOURCE/UNUSED/OVRUMB.TPU (100%) rename PCBOAR~1.TXT => SOURCE/UNUSED/PCBOAR~1.TXT (100%) rename PKUNZIP.EXE => SOURCE/UNUSED/PKUNZIP.EXE (100%) rename PKZIP.EXE => SOURCE/UNUSED/PKZIP.EXE (100%) rename PRHELP.ASC => SOURCE/UNUSED/PRHELP.ASC (100%) rename RENEGADE.DAT => SOURCE/UNUSED/RENEGADE.DAT (100%) rename RENEGADE.EXE => SOURCE/UNUSED/RENEGADE.EXE (100%) rename RENEGADE.LNG => SOURCE/UNUSED/RENEGADE.LNG (100%) rename RENEGADE.OVR => SOURCE/UNUSED/RENEGADE.OVR (100%) rename RENEGADE.PIF => SOURCE/UNUSED/RENEGADE.PIF (100%) rename RENEGADE.TPH => SOURCE/UNUSED/RENEGADE.TPH (100%) rename RENEMAIL.EXE => SOURCE/UNUSED/RENEMAIL.EXE (100%) rename RENEMAIL.TPH => SOURCE/UNUSED/RENEMAIL.TPH (100%) rename REUPDATE.PAS => SOURCE/UNUSED/REUPDATE.PAS (100%) rename RGAPI.PAS => SOURCE/UNUSED/RGAPI.PAS (100%) rename RGFLIST.PAS => SOURCE/UNUSED/RGFLIST.PAS (100%) rename RGINTRO.ANS => SOURCE/UNUSED/RGINTRO.ANS (100%) rename RGLNG.EXE => SOURCE/UNUSED/RGLNG.EXE (100%) rename RGLNG.TXT => SOURCE/UNUSED/RGLNG.TXT (100%) rename RGLNGNEW.TXT => SOURCE/UNUSED/RGLNGNEW.TXT (100%) rename RGLNGPR.DAT => SOURCE/UNUSED/RGLNGPR.DAT (100%) rename RGLNGTX.DAT => SOURCE/UNUSED/RGLNGTX.DAT (100%) rename RGMAIN.EXE => SOURCE/UNUSED/RGMAIN.EXE (100%) rename RGMAIN.TXT => SOURCE/UNUSED/RGMAIN.TXT (100%) rename RGMAINPR.DAT => SOURCE/UNUSED/RGMAINPR.DAT (100%) rename RGMAINT.EXE => SOURCE/UNUSED/RGMAINT.EXE (100%) rename RGMAINT.PAS => SOURCE/UNUSED/RGMAINT.PAS (100%) rename RGMAINT1.PAS => SOURCE/UNUSED/RGMAINT1.PAS (100%) rename RGMAINT2.PAS => SOURCE/UNUSED/RGMAINT2.PAS (100%) rename RGMAINTX.DAT => SOURCE/UNUSED/RGMAINTX.DAT (100%) rename RGNOTE.EXE => SOURCE/UNUSED/RGNOTE.EXE (100%) rename RGNOTE.TXT => SOURCE/UNUSED/RGNOTE.TXT (100%) rename RGNOTEPR.DAT => SOURCE/UNUSED/RGNOTEPR.DAT (100%) rename RGNOTETX.DAT => SOURCE/UNUSED/RGNOTETX.DAT (100%) rename RGQUOTE.EXE => SOURCE/UNUSED/RGQUOTE.EXE (100%) rename RGSCFG.EXE => SOURCE/UNUSED/RGSCFG.EXE (100%) rename RGSCFG.TXT => SOURCE/UNUSED/RGSCFG.TXT (100%) rename RGSCFGPR.DAT => SOURCE/UNUSED/RGSCFGPR.DAT (100%) rename RGSCFGTX.DAT => SOURCE/UNUSED/RGSCFGTX.DAT (100%) rename RGSTAT.PAS => SOURCE/UNUSED/RGSTAT.PAS (100%) rename RGUPDATE.EXE => SOURCE/UNUSED/RGUPDATE.EXE (100%) rename RGUPDATE.PAS => SOURCE/UNUSED/RGUPDATE.PAS (100%) rename RGUPDT1.EXE => SOURCE/UNUSED/RGUPDT1.EXE (100%) rename RGUPDT1.PAS => SOURCE/UNUSED/RGUPDT1.PAS (100%) rename RGUPDT2.EXE => SOURCE/UNUSED/RGUPDT2.EXE (100%) rename RGUPDT2.PAS => SOURCE/UNUSED/RGUPDT2.PAS (100%) rename RGUPDT3.EXE => SOURCE/UNUSED/RGUPDT3.EXE (100%) rename RGUPDT3.PAS => SOURCE/UNUSED/RGUPDT3.PAS (100%) rename RGUPDT4.PAS => SOURCE/UNUSED/RGUPDT4.PAS (100%) rename RGV118.EXE => SOURCE/UNUSED/RGV118.EXE (100%) rename RGV118.PAS => SOURCE/UNUSED/RGV118.PAS (100%) rename RGVER.EXE => SOURCE/UNUSED/RGVER.EXE (100%) rename RGVER.PAS => SOURCE/UNUSED/RGVER.PAS (100%) rename RGVERUDT.EXE => SOURCE/UNUSED/RGVERUDT.EXE (100%) rename RGVERUDT.PAS => SOURCE/UNUSED/RGVERUDT.PAS (100%) rename RMAILWKS.PAS => SOURCE/UNUSED/RMAILWKS.PAS (100%) rename RMCHANGE.DOC => SOURCE/UNUSED/RMCHANGE.DOC (100%) rename RMUPDATE.DOC => SOURCE/UNUSED/RMUPDATE.DOC (100%) rename SCRIPT.TPU => SOURCE/UNUSED/SCRIPT.TPU (100%) rename SHORTMSG.TPU => SOURCE/UNUSED/SHORTMSG.TPU (100%) rename SORTING.PAS => SOURCE/UNUSED/SORTING.PAS (100%) rename SPAWNO.TPU => SOURCE/UNUSED/SPAWNO.TPU (100%) rename SPLITCHA.TPU => SOURCE/UNUSED/SPLITCHA.TPU (100%) rename STATS.TPU => SOURCE/UNUSED/STATS.TPU (100%) rename SYSCHAT.PAS => SOURCE/UNUSED/SYSCHAT.PAS (100%) rename SYSCHAT.TPU => SOURCE/UNUSED/SYSCHAT.TPU (100%) rename SYSOP1.TPU => SOURCE/UNUSED/SYSOP1.TPU (100%) rename SYSOP10.TPU => SOURCE/UNUSED/SYSOP10.TPU (100%) rename SYSOP11.TPU => SOURCE/UNUSED/SYSOP11.TPU (100%) rename SYSOP12.TPU => SOURCE/UNUSED/SYSOP12.TPU (100%) rename SYSOP2.TPU => SOURCE/UNUSED/SYSOP2.TPU (100%) rename SYSOP2A.TPU => SOURCE/UNUSED/SYSOP2A.TPU (100%) rename SYSOP2B.TPU => SOURCE/UNUSED/SYSOP2B.TPU (100%) rename SYSOP2C.TPU => SOURCE/UNUSED/SYSOP2C.TPU (100%) rename SYSOP2D.TPU => SOURCE/UNUSED/SYSOP2D.TPU (100%) rename SYSOP2E.TPU => SOURCE/UNUSED/SYSOP2E.TPU (100%) rename SYSOP2F.TPU => SOURCE/UNUSED/SYSOP2F.TPU (100%) rename SYSOP2G.TPU => SOURCE/UNUSED/SYSOP2G.TPU (100%) rename SYSOP2H.TPU => SOURCE/UNUSED/SYSOP2H.TPU (100%) rename SYSOP2I.TPU => SOURCE/UNUSED/SYSOP2I.TPU (100%) rename SYSOP2J.TPU => SOURCE/UNUSED/SYSOP2J.TPU (100%) rename SYSOP2K.TPU => SOURCE/UNUSED/SYSOP2K.TPU (100%) rename SYSOP2L.TPU => SOURCE/UNUSED/SYSOP2L.TPU (100%) rename SYSOP2M.TPU => SOURCE/UNUSED/SYSOP2M.TPU (100%) rename SYSOP2O.TPU => SOURCE/UNUSED/SYSOP2O.TPU (100%) rename SYSOP3.TPU => SOURCE/UNUSED/SYSOP3.TPU (100%) rename SYSOP4.TPU => SOURCE/UNUSED/SYSOP4.TPU (100%) rename SYSOP5.TPU => SOURCE/UNUSED/SYSOP5.TPU (100%) rename SYSOP6.TPU => SOURCE/UNUSED/SYSOP6.TPU (100%) rename SYSOP6~1.PAS => SOURCE/UNUSED/SYSOP6~1.PAS (100%) rename SYSOP7.TPU => SOURCE/UNUSED/SYSOP7.TPU (100%) rename SYSOP7M.TPU => SOURCE/UNUSED/SYSOP7M.TPU (100%) rename SYSOP8.TPU => SOURCE/UNUSED/SYSOP8.TPU (100%) rename SYSOP9.TPU => SOURCE/UNUSED/SYSOP9.TPU (100%) rename TAGLINE.DAT => SOURCE/UNUSED/TAGLINE.DAT (100%) rename TAGLINE.EXE => SOURCE/UNUSED/TAGLINE.EXE (100%) rename TAGLINE.PTR => SOURCE/UNUSED/TAGLINE.PTR (100%) rename TAGLINE.TXT => SOURCE/UNUSED/TAGLINE.TXT (100%) rename TAGSTAT.PAS => SOURCE/UNUSED/TAGSTAT.PAS (100%) rename TEMP6.BAT => SOURCE/UNUSED/TEMP6.BAT (100%) rename TIMEBANK.TPU => SOURCE/UNUSED/TIMEBANK.TPU (100%) rename TIMEFUNC.TPU => SOURCE/UNUSED/TIMEFUNC.TPU (100%) rename TPX.DSK => SOURCE/UNUSED/TPX.DSK (100%) rename TPX.TP => SOURCE/UNUSED/TPX.TP (100%) rename TURBO.DSK => SOURCE/UNUSED/TURBO.DSK (100%) rename USER.PAS => SOURCE/UNUSED/USER.PAS (100%) rename VOTE.TPU => SOURCE/UNUSED/VOTE.TPU (100%) rename WD110107.TXT => SOURCE/UNUSED/WD110107.TXT (100%) rename WD110207.TXT => SOURCE/UNUSED/WD110207.TXT (100%) rename WD110307.TXT => SOURCE/UNUSED/WD110307.TXT (100%) rename WFCMENU.TPU => SOURCE/UNUSED/WFCMENU.TPU (100%) rename WFCNEW1.ANS => SOURCE/UNUSED/WFCNEW1.ANS (100%) rename WFC_COM.ANS => SOURCE/UNUSED/WFC_COM.ANS (100%) rename WFC_NODE.ANS => SOURCE/UNUSED/WFC_NODE.ANS (100%) rename bootoldback.pas => SOURCE/UNUSED/bootoldback.pas (100%) create mode 100644 SOURCE/UNUSED/m.cmd rename VOTE.PAS => SOURCE/VOTE.PAS (100%) rename WFCMENU.PAS => SOURCE/WFCMENU.PAS (100%) create mode 100644 SOURCE/WIN32/overlay.pas create mode 100644 SOURCE/crc32.obj create mode 100644 SOURCE/execwin.obj create mode 100644 SOURCE/spawntp.obj create mode 100644 VPC.CFG diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 412eeda..0000000 --- a/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 5ebd21a..08dc0bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,163 +1,2 @@ -################# -## Eclipse -################# - -*.pydevproject -.project -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results -[Dd]ebug/ -[Rr]elease/ -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.vspscc -.builds -*.dotCover - -## TODO: If you have NuGet Package Restore enabled, uncomment this -#packages/ - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf - -# Visual Studio profiler -*.psess -*.vsp - -# ReSharper is a .NET coding add-in -_ReSharper* - -# Installshield output folder -[Ee]xpress - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish - -# Others -[Bb]in -[Oo]bj -sql -TestResults -*.Cache -ClientBin -stylecop.* -~$* -*.dbmdl -Generated_Code #added for RIA/Silverlight projects - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML - - - -############ -## Windows -############ - -# Windows image file caches -Thumbs.db - -# Folder config file -Desktop.ini - - -############# -## Python -############# - -*.py[co] - -# Packages -*.egg -*.egg-info -dist -build -eggs -parts -bin -var -sdist -develop-eggs -.installed.cfg - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox - -#Translations -*.mo - -#Mr Developer -.mr.developer.cfg - -# Mac crap -.DS_Store +EXE/ +ORIGINAL ARCHIVES/ \ No newline at end of file diff --git a/BPC.CFG b/BPC.CFG new file mode 100644 index 0000000..0d1172d --- /dev/null +++ b/BPC.CFG @@ -0,0 +1,27 @@ +/EZ:\PROGRA~1\RG119SRC\EXE\BP +/IZ:\BP\UNITS; +/OZ:\BP\UNITS; +/UZ:\BP\UNITS; +/R +/$MD64000,0,655360 +/$MP64000 +/$A+ +/$B- +/$D+ +/$E+ +/$F+ +/$G+ +/$I- +/$L+ +/$N- +/$O+ +/$P- +/$Q- +/$R- +/$S- +/$T- +/$V- +/$X+ +/$Y+ +/B +/GD diff --git a/BUILDBP.CMD b/BUILDBP.CMD new file mode 100644 index 0000000..488fd8b --- /dev/null +++ b/BUILDBP.CMD @@ -0,0 +1,63 @@ +@ECHO OFF + +Z: + +ECHO CLEAING UP OUTPUT DIRECTORY +DEL /Q Z:\PROGRAMMING\RG119SRC\EXE\BP\*.* + +ECHO COPYING BPC.CFG TO BP DIRECTORY +COPY Z:\PROGRAMMING\RG119SRC\BPC.CFG Z:\BP\BIN + +CD Z:\PROGRAMMING\RG119SRC\SOURCE + +ECHO. +ECHO COMPILING RENEGADE.EXE +Z:\BP\BIN\BPC.EXE RENEGADE.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RENEMAIL.EXE +Z:\BP\BIN\BPC.EXE RENEMAIL.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGLNG.EXE +Z:\BP\BIN\BPC.EXE RGLNG.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGMAIN.EXE +Z:\BP\BIN\BPC.EXE RGMAIN.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGNOTE.EXE +Z:\BP\BIN\BPC.EXE RGNOTE.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGQUOTE.EXE +Z:\BP\BIN\BPC.EXE RGQUOTE.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGSCFG.EXE +Z:\BP\BIN\BPC.EXE RGSCFG.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING TAGLINE.EXE +Z:\BP\BIN\BPC.EXE TAGLINE.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +:COPY +ECHO. +ECHO BUILD COMPLETE! HIT A KEY TO COPY EXE FILES OR CTRL-C TO SKIP +PAUSE + +CD Z:\PROGRAMMING\RG119SRC +CALL COPYEXEBP +GOTO END + +:END +PAUSE \ No newline at end of file diff --git a/BUILDVP.CMD b/BUILDVP.CMD new file mode 100644 index 0000000..c1b7059 --- /dev/null +++ b/BUILDVP.CMD @@ -0,0 +1,63 @@ +@ECHO OFF + +Z: + +ECHO CLEAING UP OUTPUT DIRECTORY +DEL /Q Z:\PROGRAMMING\RG119SRC\EXE\VP\*.* + +ECHO COPYING VPC.CFG TO VP21 DIRECTORY +COPY Z:\PROGRAMMING\RG119SRC\VPC.CFG Z:\VP21\BIN.W32 + +CD Z:\PROGRAMMING\RG119SRC\SOURCE + +ECHO. +ECHO COMPILING RENEGADE.EXE +Z:\VP21\BIN.W32\VPC RENEGADE.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RENEMAIL.EXE +Z:\VP21\BIN.W32\VPC RENEMAIL.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGLNG.EXE +Z:\VP21\BIN.W32\VPC RGLNG.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGMAIN.EXE +Z:\VP21\BIN.W32\VPC RGMAIN.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGNOTE.EXE +Z:\VP21\BIN.W32\VPC RGNOTE.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGQUOTE.EXE +Z:\VP21\BIN.W32\VPC RGQUOTE.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING RGSCFG.EXE +Z:\VP21\BIN.W32\VPC RGSCFG.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +ECHO. +ECHO COMPILING TAGLINE.EXE +Z:\VP21\BIN.W32\VPC TAGLINE.PAS +IF NOT %ERRORLEVEL% == 0 GOTO END + +:COPY +ECHO. +ECHO BUILD COMPLETE! HIT A KEY TO COPY EXE FILES OR CTRL-C TO SKIP +PAUSE + +CD Z:\PROGRAMMING\RG119SRC +CALL COPYEXEVP +GOTO END + +:END +PAUSE \ No newline at end of file diff --git a/COMPILE.TXT b/COMPILE.TXT new file mode 100644 index 0000000..d69d5f5 --- /dev/null +++ b/COMPILE.TXT @@ -0,0 +1,55 @@ +Step 0) Assumptions: + + The first assumption is that you have Borland Pascal installed in Z:\BP. + If you don't, you'll have to update the BUILDBP.CMD file + + The second assumption is that you have Virtual Pascal installed in Z:\vp21. + If you don't, you'll have to update the BUILDVP.CMD file + + *NOTE* The BUILD*.CMD files will copy a BPC.CFG or VPC.CFG into the relevant bin directory, meaning + if you have cusomized the .CFG file in the bin directory, it will be lost. Make a backup! + +Step 1) Create directories to hold everything: + + Z:\RG119 + Z:\Programming\RG119SRC + Z:\Programming\RG119SRC\EXE\BP + Z:\Programming\RG119SRC\EXE\VP + + If you don't have a Z: drive, you can use SUBST or map a network drive to fake one + You can also put the files in an alternate location if you want, you'll just have to update the BUILD*.CMD scripts + +Step 2) Get the source + + Check out the GIT contents into Z:\Programming\RG119SRC + +Step 3) Edit Z:\vp21\source\rtl\vpsysw32.pas + + For some reason the cursor position isn't always updated in the background thread in the Win32 version. I'm guessing + it's a race condition with the CurXPos and CurYPos variables, so the thread doesn't think an update is needed when + one really is. So I've updated my copy of CursorThreadFunc to take the return value of the SemWaitEvent() call into + account, so the update will also happen if the event is signaled. Can't think of a reason why they wouldn't have done + this in the first place. Here's the entire function to copy/paste into place: + + function CursorThreadFunc(P: Pointer): Longint; + var + LastX, LastY: Longint; + begin + LastX := -1; + LastY := -1; + repeat + if SemWaitEvent(semCursor, 300) or (CurXPos <> LastX) or (CurYPos <> LastY) then + begin + DoSetCursorPosition; + LastX := CurXPos; + LastY := CurYPos; + end; + until tidCursor = -2; + tidCursor := -1; + end; + +Step 4) Build new EXEs + + Run BUILDBP.CMD to build the DOS EXEs and have them copied to Z:\RG119 + + Run BUILDVP.CMD to build the WIN32 EXEs and have them copied to Z:\RG119 \ No newline at end of file diff --git a/COPYEXEBP.CMD b/COPYEXEBP.CMD new file mode 100644 index 0000000..4233d2a --- /dev/null +++ b/COPYEXEBP.CMD @@ -0,0 +1,10 @@ +@ECHO OFF +COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RENEGADE.EXE Z:\RG119\ +COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RENEGADE.OVR Z:\RG119\ +COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RENEMAIL.EXE Z:\RG119\ +COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGLNG.EXE Z:\RG119\DATA\ +COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGMAIN.EXE Z:\RG119\DATA\ +COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGNOTE.EXE Z:\RG119\DATA\ +COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGQUOTE.EXE Z:\RG119\DATA\ +COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGSCFG.EXE Z:\RG119\DATA\ +COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\TAGLINE.EXE Z:\RG119\DATA\ diff --git a/COPYEXEVP.CMD b/COPYEXEVP.CMD new file mode 100644 index 0000000..b6c69e1 --- /dev/null +++ b/COPYEXEVP.CMD @@ -0,0 +1,9 @@ +@ECHO OFF +COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RENEGADE.EXE Z:\RG119\RENEGADE32.EXE +COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RENEMAIL.EXE Z:\RG119\RENEMAIL32.EXE +COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGLNG.EXE Z:\RG119\DATA\RGLNG32.EXE +COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGMAIN.EXE Z:\RG119\DATA\RGMAIN32.EXE +COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGNOTE.EXE Z:\RG119\DATA\RGNOTE32.EXE +COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGQUOTE.EXE Z:\RG119\DATA\RGQUOTE32.EXE +COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGSCFG.EXE Z:\RG119\DATA\RGSCFG32.EXE +COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\TAGLINE.EXE Z:\RG119\DATA\TAGLINE32.EXE diff --git a/README.md b/README.md new file mode 100644 index 0000000..c24703e --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +Renegade v1.19 +============== + +This is a port of the current version of Renegade: v1.19. My port of the older Y2Ka2 version can be found here: https://github.com/rickparrish/Renegade
+
+This is a fork of the official v1.19 release, which can be found here: https://github.com/Renegade-Exodus/RG119SRC
+ +============================== +Copyright Cott Lang, Patrick Spence, Gary Hall, Jeff Herrings, T.J. McMillen, Chris Hoppman, and Lee Palmer
+Ported to Win32 by Rick Parrish
+ +
+ +TODO list:
+ + +Completed list
+ diff --git a/ARCHIVE1.PAS b/SOURCE/ARCHIVE1.PAS similarity index 100% rename from ARCHIVE1.PAS rename to SOURCE/ARCHIVE1.PAS diff --git a/ARCHIVE2.PAS b/SOURCE/ARCHIVE2.PAS similarity index 100% rename from ARCHIVE2.PAS rename to SOURCE/ARCHIVE2.PAS diff --git a/ARCHIVE3.PAS b/SOURCE/ARCHIVE3.PAS similarity index 100% rename from ARCHIVE3.PAS rename to SOURCE/ARCHIVE3.PAS diff --git a/ARCVIEW.PAS b/SOURCE/ARCVIEW.PAS similarity index 100% rename from ARCVIEW.PAS rename to SOURCE/ARCVIEW.PAS diff --git a/AUTOMSG.PAS b/SOURCE/AUTOMSG.PAS similarity index 100% rename from AUTOMSG.PAS rename to SOURCE/AUTOMSG.PAS diff --git a/BBSLIST.PAS b/SOURCE/BBSLIST.PAS similarity index 100% rename from BBSLIST.PAS rename to SOURCE/BBSLIST.PAS diff --git a/BOOT.PAS b/SOURCE/BOOT.PAS similarity index 100% rename from BOOT.PAS rename to SOURCE/BOOT.PAS diff --git a/BULLETIN.PAS b/SOURCE/BULLETIN.PAS similarity index 100% rename from BULLETIN.PAS rename to SOURCE/BULLETIN.PAS diff --git a/COMMON.PAS b/SOURCE/COMMON.PAS similarity index 100% rename from COMMON.PAS rename to SOURCE/COMMON.PAS diff --git a/COMMON1.PAS b/SOURCE/COMMON1.PAS similarity index 100% rename from COMMON1.PAS rename to SOURCE/COMMON1.PAS diff --git a/COMMON2.PAS b/SOURCE/COMMON2.PAS similarity index 100% rename from COMMON2.PAS rename to SOURCE/COMMON2.PAS diff --git a/COMMON3.PAS b/SOURCE/COMMON3.PAS similarity index 100% rename from COMMON3.PAS rename to SOURCE/COMMON3.PAS diff --git a/COMMON4.PAS b/SOURCE/COMMON4.PAS similarity index 100% rename from COMMON4.PAS rename to SOURCE/COMMON4.PAS diff --git a/COMMON5.PAS b/SOURCE/COMMON5.PAS similarity index 100% rename from COMMON5.PAS rename to SOURCE/COMMON5.PAS diff --git a/CUSER.PAS b/SOURCE/CUSER.PAS similarity index 100% rename from CUSER.PAS rename to SOURCE/CUSER.PAS diff --git a/DOORS.PAS b/SOURCE/DOORS.PAS similarity index 100% rename from DOORS.PAS rename to SOURCE/DOORS.PAS diff --git a/SOURCE/ELECOM/BUFUNIT.PAS b/SOURCE/ELECOM/BUFUNIT.PAS new file mode 100644 index 0000000..6f16c24 --- /dev/null +++ b/SOURCE/ELECOM/BUFUNIT.PAS @@ -0,0 +1,140 @@ +unit BufUnit; +{$I-,R-,S-,Q-} +(* +** +** Large char-buffer handling routines for EleCOM +** +** Copyright (c) 1998-2002 by Maarten Bekers +** +** Version : 1.03 +** Created : 05-Jan-1999 +** Last update : 12-Jan-2003 +** +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +Type CharBufType = Array[0..65520] of Char; + +type BufArrayObj = Object + TxtArr : CharBufType; + TxtMaxLen : Longint; + TxtStartPtr: Longint; { Start of buffer ptr } + CurTxtPtr : Longint; { Maximum data entered yet } + TmpBuf : CharBufType; + + constructor Init(TxtSize: Longint); + destructor Done; + + function BufRoom: Longint; + function BufUsed: Longint; + function Put(var Buf; Size: Longint): Longint; + function Get(var Buf; Size: Longint; Remove: Boolean): Longint; + + procedure Clear; + end; { BufArrayObj } + + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +constructor BufArrayObj.Init(TxtSize: Longint); +begin + TxtMaxLen := TxtSize; + CurTxtPtr := -1; + TxtStartPtr := 0; + + FillChar(TxtArr, TxtMaxLen, #00); + FillChar(TmpBuf, TxtMaxLen, #00); +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor BufArrayObj.Done; +begin +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function BufArrayObj.BufRoom: Longint; +begin + BufRoom := (TxtMaxLen - (CurTxtPtr + 1)); +end; { func. BufRoom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function BufArrayObj.BufUsed: Longint; +begin + BufUsed := (CurTxtPtr + 01); +end; { func. BufUsed } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function BufArrayObj.Put(var Buf; Size: Longint): Longint; +var RetSize: Longint; +begin + Put := 0; + if Size < 0 then EXIT; + + if TxtStartPtr > 0 then + if (CurTxtPtr + TxtStartPtr) > TxtMaxLen then + begin + Move(TxtArr[TxtStartPtr], TxtArr[0], Succ(CurTxtPtr)); + TxtStartPtr := 0; + end; { if } + + if Size > BufRoom then RetSize := BufRoom + else RetSize := Size; + + Move(Buf, TxtArr[TxtStartPtr + BufUsed], RetSize); + + Inc(CurTxtPtr, RetSize); + TxtArr[TxtStartPtr + BufUsed + 1] := #0; + Put := RetSize; +end; { func. Put } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function BufArrayObj.Get(var Buf; Size: Longint; Remove: Boolean): Longint; +var RetSize: Longint; +begin + Get := 0; + if Size < 0 then EXIT; + + if Size > BufUsed then RetSize := BufUsed + else RetSize := Size; + + Move(TxtArr[TxtStartPtr], Buf, RetSize); + + Get := RetSize; + + if Remove then + begin + if RetSize = BufUsed then + begin + CurTxtPtr := -1; + TxtStartPtr := 0; + TxtArr[0] := #0; + end + else begin + Inc(TxtStartPtr, RetSize); + Dec(CurTxtPtr, RetSize); + TxtArr[CurTxtPtr + TxtStartPtr + 1] := #0; + end; { if } + end; { if } +end; { func. Get } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure BufArrayObj.Clear; +begin + CurTxtPtr := -1; +end; { proc. Clear } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +end. diff --git a/SOURCE/ELECOM/COMBASE.PAS b/SOURCE/ELECOM/COMBASE.PAS new file mode 100644 index 0000000..dd72401 --- /dev/null +++ b/SOURCE/ELECOM/COMBASE.PAS @@ -0,0 +1,309 @@ +unit ComBase; +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.1, (OS/2, Win32) +** FreePascal v0.99.12 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.01 +** Created : 21-May-1998 +** Last update : 14-May-1999 +** +** Note: (c)1998-2003 by Maarten Bekers +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +{$IFDEF VirtualPascal} +uses Use32; +{$ENDIF} + +{$IFDEF MSDOS} + Type ShortString = String; +{$ENDIF} + +type SliceProc = procedure; + +type TCommObj = Object + DontClose : Boolean; + InitFailed : Boolean; + ErrorStr : ShortString; + BlockAll : Boolean; + + constructor Init; + destructor Done; + + procedure Com_OpenQuick(Handle: Longint); virtual; + function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; virtual; + function Com_OpenKeep(Comport: Byte): Boolean; virtual; + procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); virtual; + + procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); virtual; + function Com_GetBPSrate: Longint; virtual; + + procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); virtual; + procedure Com_SetDtr(State: Boolean); virtual; + + function Com_CharAvail: Boolean; virtual; + function Com_Carrier: Boolean; virtual; + function Com_ReadyToSend(BlockLen: Longint): Boolean; virtual; + + function Com_GetChar: Char; virtual; + function Com_PeekChar: Char; virtual; + function Com_SendChar(C: Char): Boolean; virtual; + function Com_GetDriverInfo: String; virtual; + function Com_GetHandle: Longint; virtual; + function Com_InitSucceeded: Boolean; virtual; + + procedure Com_Close; virtual; + procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); virtual; + procedure Com_SendWait(var Block; BlockLen: Longint; var Written: Longint; Slice: SliceProc); virtual; + procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); virtual; + procedure Com_PurgeOutBuffer; virtual; + procedure Com_PurgeInBuffer; virtual; + procedure Com_PauseCom(CloseCom: Boolean); virtual; + procedure Com_ResumeCom(OpenCom: Boolean); virtual; + procedure Com_FlushOutBuffer(Slice: SliceProc); virtual; + procedure Com_SendString(Temp: ShortString); virtual; + procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); virtual; + + procedure Com_SetDataProc(ReadPtr, WritePtr: Pointer); virtual; + + end; { object TCommObj } + +Type PCommObj = ^TCommObj; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +{-- We disable warnings as this is just an abstract -} + +constructor TCommObj.Init; +begin + DontClose := false; + InitFailed := false; + BlockAll := false; + ErrorStr := ''; +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor TCommObj.Done; +begin +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; +begin + Com_Open := FALSE; +end; { func. Com_Open } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_OpenQuick(Handle: Longint); +begin +end; { proc. TCommObj.Com_OpenQuick } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_Close; +begin +end; { proc. TCommObj.Com_Close } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_GetChar: Char; +begin + Com_GetChar := #0; +end; { func. TCommObj.Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_PeekChar: Char; +begin + Com_PeekChar := #0; +end; { func. TCommObj.Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_SendChar(C: Char): Boolean; +begin + Com_SendChar := FALSE; +end; { proc. TCommObj.Com_SendChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); +begin +end; { proc. TCommObj.Com_SendBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); +begin +end; { proc. TCommObj.Com_ReadBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_CharAvail: Boolean; +begin + Com_CharAvail := FALSE; +end; { func. TCommObj.Com_CharAvail } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_Carrier: Boolean; +begin + Com_Carrier := FALSE; +end; { func. Comm_Carrier } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_SetDtr(State: Boolean); +begin +end; { proc. TCommObj.Com_SetDtr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_OpenKeep(Comport: Byte): Boolean; +begin + Com_OpenKeep := FALSE; +end; { func. TCommObj.Com_OpenKeep } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_ReadyToSend(BlockLen: Longint): Boolean; +begin + Com_ReadyToSend := FALSE; +end; { func. TCommObj.Com_ReadyToSend } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_GetModemStatus(var LineStatus, ModemStatus: Byte); +begin +end; { proc. TCommObj.Com_GetModemStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_GetBPSrate: Longint; +begin + Com_GetBpsRate := -1; +end; { func. TCommObj.Com_GetBPSrate } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); +begin +end; { proc. TCommObj.Com_SetLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); +begin +end; { proc. TCommObj.Com_GetBufferStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_PurgeInBuffer; +begin +end; { proc. TCommObj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_PurgeOutBuffer; +begin +end; { proc. TCommObj.Com_PurgeOutBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_GetDriverInfo: String; +begin + Com_GetDriverInfo := ''; +end; { func. Com_GetDriverInfo } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_GetHandle: Longint; +begin + Com_GetHandle := -1; +end; { func. Com_GetHandle } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_PauseCom(CloseCom: Boolean); +begin +end; { proc. Com_PauseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_ResumeCom(OpenCom: Boolean); +begin +end; { proc. Com_ResumeCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TCommObj.Com_InitSucceeded: Boolean; +begin + Com_InitSucceeded := NOT InitFailed; +end; { func. Com_InitFailed } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_FlushOutBuffer(Slice: SliceProc); +var InFree, + OutFree, + InUsed, + OutUsed : Longint; +begin + Com_GetBufferStatus(InFree, OutFree, InUsed, OutUsed); + + while (OutUsed > 1) AND (Com_Carrier) do + { X00 (fossil) will never go below 1 ! } + begin + Com_GetBufferStatus(InFree, OutFree, InUsed, OutUsed); + + if @Slice <> nil then + begin + Slice; + Slice; + end; { if } + end; { while } +end; { proc. Com_FlushOutBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_SendWait(var Block; BlockLen: Longint; var Written: Longint; Slice: SliceProc); +begin + Com_SendBlock(Block, BlockLen, Written); +end; { proc. Com_SendWait } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_SendString(Temp: ShortString); +var Written: Longint; +begin + Com_SendBlock(Temp[1], Length(Temp), Written); +end; { proc. Com_SendString } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); +begin +end; { proc. Com_Setflow } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TCommObj.Com_SetDataProc(ReadPtr, WritePtr: Pointer); +begin +end; { Com_SetDataProc } + +end. diff --git a/SOURCE/ELECOM/ELECOM13.PAS b/SOURCE/ELECOM/ELECOM13.PAS new file mode 100644 index 0000000..0e2dc44 --- /dev/null +++ b/SOURCE/ELECOM/ELECOM13.PAS @@ -0,0 +1,350 @@ +library ELECOM13; +{$H-} { important, turn off Ansi-Strings } +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.1, (OS/2, Win32) +** FreePascal v0.99.12 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.02 +** Created : 13-Jun-1999 +** Last update : 28-Jun-2000 +** +** Note: (c)1998-1999 by Maarten Bekers. +** If you have any suggestions, please let me know. +** +*) +uses ComBase, + {$IFDEF WIN32} + W32SNGL, + {$ENDIF} + + {$IFDEF OS2} + Os2Com, + {$ENDIF} + + Telnet; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + var ComObj : pCommObj; + ComSystem: Longint; +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Int_ComReadProc(var TempPtr: Pointer); stdcall; +begin + {$IFDEF WIN32} + Case ComSystem of + 1 : PWin32Obj(ComObj)^.Com_DataProc(TempPtr); + 2 : PTelnetObj(ComObj)^.Com_ReadProc(TempPtr); + end; { case } + {$ENDIF} + + {$IFDEF OS2} + Case ComSystem of + 1 : POs2Obj(ComObj)^.Com_ReadProc(TempPtr); + 2 : PTelnetObj(ComObj)^.Com_ReadProc(TempPtr); + end; { case } + {$ENDIF} +end; { proc. Int_ComReadProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Int_ComWriteProc(var TempPtr: Pointer); stdcall; +begin + {$IFDEF WIN32} + Case ComSystem of + 1 : PWin32Obj(ComObj)^.Com_DataProc(TempPtr); + 2 : PTelnetObj(ComObj)^.Com_WriteProc(TempPtr); + end; { case } + {$ENDIF} + + {$IFDEF OS2} + Case ComSystem of + 1 : POs2Obj(ComObj)^.Com_WriteProc(TempPtr); + 2 : PTelnetObj(ComObj)^.Com_WriteProc(TempPtr); + end; { case } + {$ENDIF} +end; { proc. Int_ComWriteProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_Startup(ObjectType: Longint); stdcall; +begin + ComSystem := ObjectType; + + Case Objecttype of + {$IFDEF WIN32} + 01 : ComObj := New(pWin32Obj, Init); + {$ENDIF} + + {$IFDEF OS2} + 01 : ComObj := New(pOs2Obj, Init); + {$ENDIF} + + 02 : ComObj := New(pTelnetObj, Init); + end; { case } + + ComObj^.Com_SetDataProc(@Int_ComReadProc, @Int_ComWriteProc); +end; { proc. Com_Startup } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_OpenQuick(Handle: Longint); stdcall; +begin + ComObj^.Com_OpenQuick(Handle); +end; { proc. Com_OpenQuick } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; stdcall; +begin + Result := ComObj^.Com_Open(Comport, BaudRate, DataBits, Parity, StopBits); +end; { func. Com_Open } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_OpenKeep(Comport: Byte): Boolean; stdcall; +begin + Result := ComObj^.Com_OpenKeep(Comport); +end; { func. Com_OpenKeep } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); stdcall; +begin + ComObj^.Com_GetModemStatus(LineStatus, ModemStatus); +end; { proc. Com_GetModemStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); stdcall; +begin + ComObj^.Com_SetLine(BpsRate, Parity, DataBits, StopBits); +end; { proc. Com_SetLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_GetBPSrate: Longint; stdcall; +begin + Result := ComObj^.Com_GetBpsRate; +end; { func. Com_GetBpsRate } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); stdcall; +begin + ComObj^.Com_GetBufferStatus(InFree, OutFree, InUsed, OutUsed); +end; { proc. Com_GetBufferStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SetDtr(State: Boolean); stdcall; +begin + ComObj^.Com_SetDtr(State); +end; { proc. Com_SetDtr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_CharAvail: Boolean; stdcall; +begin + Result := ComObj^.Com_CharAvail; +end; { func. Com_CharAvail } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_Carrier: Boolean; stdcall; +begin + Result := ComObj^.Com_Carrier; +end; { func. Com_Carrier } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_ReadyToSend(BlockLen: Longint): Boolean; stdcall; +begin + Result := ComObj^.Com_ReadyToSend(BlockLen); +end; { func. Com_ReadyToSend } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_GetChar: Char; stdcall; +begin + Result := ComObj^.Com_GetChar; +end; { func. Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_SendChar(C: Char): Boolean; stdcall; +begin + Result := ComObj^.Com_SendChar(C); +end; { func. Com_SendChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_GetDriverInfo: String; stdcall; +begin + Result := ComObj^.Com_GetDriverInfo; +end; { func. Com_GetDriverInfo } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_GetHandle: Longint; stdcall; +begin + Result := ComObj^.Com_GetHandle; +end; { func. Com_GetHandle } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_InitSucceeded: Boolean; stdcall; +begin + Result := ComObj^.Com_InitSucceeded; +end; { func. Com_InitSucceeded } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_Close; stdcall; +begin + ComObj^.Com_Close; +end; { proc. Com_Close } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); stdcall; +begin + ComObj^.Com_SendBlock(Block, BlockLen, Written); +end; { proc. Com_SendBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SendWait(var Block; BlockLen: Longint; var Written: Longint; Slice: SliceProc); stdcall; +begin + ComObj^.Com_SendWait(Block, BlockLen, Written, Slice); +end; { proc. Com_SendWait } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); stdcall; +begin + ComObj^.Com_ReadBlock(Block, BlockLen, Reads); +end; { proc. Com_ReadBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_PurgeOutBuffer; stdcall; +begin + ComObj^.Com_PurgeOutBuffer; +end; { proc. Com_PurgeOutBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_PurgeInBuffer; stdcall; +begin + ComObj^.Com_PurgeInBuffer; +end; { proc. Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_PauseCom(CloseCom: Boolean); stdcall; +begin + ComObj^.Com_PauseCom(CloseCom); +end; { proc. Com_PauseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_ResumeCom(OpenCom: Boolean); stdcall; +begin + ComObj^.Com_ResumeCom(OpenCom); +end; { proc. Com_ResumeCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_FlushOutBuffer(Slice: SliceProc); stdcall; +begin + ComObj^.Com_FlushOutBuffer(Slice); +end; { proc. Com_FlushOutBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SendString(Temp: String); stdcall; +begin + ComObj^.Com_SendString(Temp); +end; { Com_SendString } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SetDontClose(Value: Boolean); stdcall; +begin + ComObj^.DontClose := Value; +end; { proc. Com_SetDontClose } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); stdcall; +begin + ComObj^.Com_SetFlow(SoftTX, SoftRX, Hard); +end; { proc. Com_Setflow } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_ShutDown; stdcall; +begin + Dispose(ComObj, Done); +end; { proc. Com_ShutDown } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_InitFailed: Boolean; stdcall; +begin + Result := ComObj^.InitFailed; +end; { func. Com_Initfailed } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_ErrorStr: String; stdcall; +begin + Result := ComObj^.ErrorStr; +end; { func. Com_ErrorStr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +exports + Com_Startup index 1 name 'Com_Startup', + Com_Open index 2 name 'Com_Open', + Com_OpenQuick index 3 name 'Com_OpenQuick', + Com_OpenKeep index 4 name 'Com_OpenKeep', + Com_GetModemStatus index 5 name 'Com_GetModemStatus', + Com_SetLine index 6 name 'Com_SetLine', + Com_GetBPSrate index 7 name 'Com_GetBPSrate', + Com_GetBufferStatus index 8 name 'Com_GetBufferStatus', + Com_SetDtr index 09 name 'Com_SetDtr', + Com_CharAvail index 10 name 'Com_CharAvail', + Com_Carrier index 11 name 'Com_Carrier', + Com_ReadyToSend index 12 name 'Com_ReadyToSend', + Com_GetChar index 13 name 'Com_GetChar', + Com_SendChar index 14 name 'Com_SendChar', + Com_GetDriverInfo index 15 name 'Com_GetDriverInfo', + Com_GetHandle index 16 name 'Com_GetHandle', + Com_InitSucceeded index 17 name 'Com_InitSucceeded', + Com_Close index 18 name 'Com_Close', + Com_SendBlock index 19 name 'Com_SendBlock', + Com_SendWait index 20 name 'Com_SendWait', + Com_ReadBlock index 21 name 'Com_ReadBlock', + Com_PurgeOutBuffer index 22 name 'Com_PurgeOutBuffer', + Com_PurgeInBuffer index 23 name 'Com_PurgeInBuffer', + Com_PauseCom index 24 name 'Com_PauseCom', + Com_ResumeCom index 25 name 'Com_ResumeCom', + Com_FlushOutBuffer index 26 name 'Com_FlushOutBuffer', + Com_SendString index 27 name 'Com_SendString', + Com_ShutDown index 28 name 'Com_ShutDown', + Com_SetDontClose index 29 name 'Com_SetDontClose', + Com_SetFlow index 30 name 'Com_SetFlow', + Com_InitFailed index 31 name 'Com_InitFailed', + Com_ErrorStr index 32 name 'Com_ErrorStr'; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +begin + ComObj := nil; +end. diff --git a/SOURCE/ELECOM/ELEDEF.PAS b/SOURCE/ELECOM/ELEDEF.PAS new file mode 100644 index 0000000..d7d88a5 --- /dev/null +++ b/SOURCE/ELECOM/ELEDEF.PAS @@ -0,0 +1,101 @@ +unit ELEDEF; +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.1, (OS/2, Win32) +** FreePascal v0.99.12 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.03 +** Created : 13-Jun-1999 +** Last update : 05-Aug-2000 +** +** Note: (c)1998-1999 by Maarten Bekers. +** If you have any suggestions, please let me know. +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +Const + ComNameDLL = 'elecom13.dll'; + +type SliceProc = procedure; + +procedure Com_Startup(ObjectType: Longint); stdcall; +function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; stdcall; +procedure Com_OpenQuick(Handle: Longint); stdcall; +function Com_OpenKeep(Comport: Byte): Boolean; stdcall; +procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); stdcall; +procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); stdcall; +function Com_GetBPSrate: Longint; stdcall; +procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); stdcall; +procedure Com_SetDtr(State: Boolean); stdcall; +function Com_CharAvail: Boolean; stdcall; +function Com_Carrier: Boolean; stdcall; +function Com_ReadyToSend(BlockLen: Longint): Boolean; +function Com_GetChar: Char; stdcall; +function Com_SendChar(C: Char): Boolean; stdcall; +function Com_GetDriverInfo: String; stdcall; +function Com_GetHandle: Longint; stdcall; +function Com_InitSucceeded: Boolean; stdcall; +procedure Com_Close; stdcall; +procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); stdcall; +procedure Com_SendWait(var Block; BlockLen: Longint; var Written: Longint; Slice: SliceProc); stdcall; +procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); stdcall; +procedure Com_PurgeOutBuffer; stdcall; +procedure Com_PurgeInBuffer; stdcall; +procedure Com_PauseCom(CloseCom: Boolean); stdcall; +procedure Com_ResumeCom(OpenCom: Boolean); stdcall; +procedure Com_FlushOutBuffer(Slice: SliceProc); stdcall; +procedure Com_SendString(Temp: String); stdcall; +procedure Com_ShutDown; stdcall; +procedure Com_SetDontClose(Value: Boolean); stdcall; +procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); stdcall; +function Com_InitFailed: Boolean; stdcall; +function Com_ErrorStr: String; stdcall; + + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_Startup(ObjectType: Longint); external ComNameDLL index 1; +function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; external ComNameDLL index 2; +procedure Com_OpenQuick(Handle: Longint); external ComNameDLL index 3; +function Com_OpenKeep(Comport: Byte): Boolean; external ComNameDLL index 4; +procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); external ComNameDLL index 5; +procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); external ComNameDLL index 6; +function Com_GetBPSrate: Longint; external ComNameDLL index 7; +procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); external ComNameDLL index 8; +procedure Com_SetDtr(State: Boolean); external ComNameDLL index 9; +function Com_CharAvail: Boolean; external ComNameDLL index 10; +function Com_Carrier: Boolean; external ComNameDLL index 11; +function Com_ReadyToSend(BlockLen: Longint): Boolean; external ComNameDLL index 12; +function Com_GetChar: Char; external ComNameDLL index 13; +function Com_SendChar(C: Char): Boolean; external ComNameDLL index 14; +function Com_GetDriverInfo: String; external ComNameDLL index 15; +function Com_GetHandle: Longint; external ComNameDLL index 16; +function Com_InitSucceeded: Boolean; external ComNameDLL index 17; +procedure Com_Close; external ComNameDLL index 18; +procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); external ComNameDLL index 19; +procedure Com_SendWait(var Block; BlockLen: Longint; var Written: Longint; Slice: SliceProc); external ComNameDLL index 20; +procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); external ComNameDLL index 21; +procedure Com_PurgeOutBuffer; external ComNameDLL index 22; +procedure Com_PurgeInBuffer; external ComNameDLL index 23; +procedure Com_PauseCom(CloseCom: Boolean); external ComNameDLL index 24; +procedure Com_ResumeCom(OpenCom: Boolean); external ComNameDLL index 25; +procedure Com_FlushOutBuffer(Slice: SliceProc); external ComNameDLL index 26; +procedure Com_SendString(Temp: String); external ComNameDLL index 27; +procedure Com_ShutDown; external ComNameDLL index 28; +procedure Com_SetDontClose(Value: Boolean); external ComNameDLL index 29; +procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); external ComNameDLL index 30; +function Com_InitFailed: Boolean; external ComNameDLL index 31; +function Com_ErrorStr: String; external ComNameDLL index 32; + +end. diff --git a/SOURCE/ELECOM/ELENORM.PAS b/SOURCE/ELECOM/ELENORM.PAS new file mode 100644 index 0000000..d6b2bc2 --- /dev/null +++ b/SOURCE/ELECOM/ELENORM.PAS @@ -0,0 +1,376 @@ +unit EleNORM; +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.1, (OS/2, Win32) +** FreePascal v0.99.12 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.01 +** Created : 13-Jun-1999 +** Last update : 28-Jun-2000 +** +** Note: (c)1998 - 2000 by Maarten Bekers. This unit tries to make it easier +** to use EleCOM. +** +** Usage: +** Before calling any of these routines, first call Com_StartUp: +** Pass the following number to it: +** 01 - Use the "modem" communications (OS/2, Win32 or FOSSIL) +** 02 - Use the TELNET type (OS/2 or Win32 only). +** +*) +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses ComBase + {$IFDEF WIN32} + , W32SNGL + , Telnet + {$ENDIF} + + {$IFDEF OS2} + , Telnet + , Os2com + {$ENDIF} + + {$IFDEF GO32V2} + , Fos_Com + {$ENDIF} + + {$IFDEF MSDOS} + , Fos_com + {$ENDIF} ; + + +function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; +function Com_OpenKeep(Comport: Byte): Boolean; +function Com_CharAvail: Boolean; +function Com_Carrier: Boolean; +function Com_ReadyToSend(BlockLen: Longint): Boolean; +function Com_GetChar: Char; +function Com_PeekChar: Char; +function Com_SendChar(C: Char): Boolean; +function Com_GetDriverInfo: String; +function Com_GetHandle: Longint; +function Com_InitSucceeded: Boolean; +procedure Com_Startup(ObjectType: Longint); +procedure Com_OpenQuick(Handle: Longint); +procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); +procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); +procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); +procedure Com_SetDtr(State: Boolean); +procedure Com_Close; +procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); +procedure Com_SendWait(var Block; BlockLen: Longint; var Written: Longint; Slice: SliceProc); +procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); +procedure Com_PurgeOutBuffer; +procedure Com_PurgeInBuffer; +procedure Com_PauseCom(CloseCom: Boolean); +procedure Com_ResumeCom(OpenCom: Boolean); +procedure Com_FlushOutBuffer(Slice: SliceProc); +procedure Com_SendString(Temp: String); +procedure Com_SetDontClose(Value: Boolean); +procedure Com_ShutDown; +procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); + + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + var ComObj : pCommObj; + ComSystem: Longint; +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Int_ComReadProc(var TempPtr: Pointer); +begin + {$IFDEF WIN32} + Case ComSystem of + 1 : PWin32Obj(ComObj)^.Com_DataProc(TempPtr); + 2 : PTelnetObj(ComObj)^.Com_ReadProc(TempPtr); + end; { case } + {$ENDIF} + + {$IFDEF OS2} + Case ComSystem of + 1 : POs2Obj(ComObj)^.Com_ReadProc(TempPtr); + 2 : PTelnetObj(ComObj)^.Com_ReadProc(TempPtr); + end; { case } + {$ENDIF} +end; { proc. Int_ComReadProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Int_ComWriteProc(var TempPtr: Pointer); +begin + {$IFDEF WIN32} + Case ComSystem of + 1 : PWin32Obj(ComObj)^.Com_DataProc(TempPtr); + 2 : PTelnetObj(ComObj)^.Com_WriteProc(TempPtr); + end; { case } + {$ENDIF} + + {$IFDEF OS2} + Case ComSystem of + 1 : POs2Obj(ComObj)^.Com_WriteProc(TempPtr); + 2 : PTelnetObj(ComObj)^.Com_WriteProc(TempPtr); + end; { case } + {$ENDIF} +end; { proc. Int_ComWriteProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_Startup(ObjectType: Longint); +begin + ComSystem := ObjectType; + + Case Objecttype of + {$IFDEF WIN32} + 01 : ComObj := New(pWin32Obj, Init); + 02 : ComObj := New(pTelnetObj, Init); + {$ENDIF} + + {$IFDEF OS2} + 01 : ComObj := New(pOs2Obj, Init); + 02 : ComObj := New(pTelnetObj, Init); + {$ENDIF} + + {$IFDEF MSDOS} + 01 : ComObj := New(pFossilObj, Init); + {$ENDIF} + + {$IFDEF GO32V2} + 01 : ComObj := New(pFossilObj, Init); + {$ENDIF} + end; { case } + + {$IFDEF WIN32} + ComObj^.Com_SetDataProc(@Int_ComReadProc, @Int_ComWriteProc); + {$ENDIF} + + {$IFDEF OS2} + ComObj^.Com_SetDataProc(@Int_ComReadProc, @Int_ComWriteProc); + {$ENDIF} +end; { proc. Com_Startup } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_OpenQuick(Handle: Longint); +begin + ComObj^.Com_OpenQuick(Handle); +end; { proc. Com_OpenQuick } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; +begin + Com_Open := ComObj^.Com_Open(Comport, BaudRate, DataBits, Parity, StopBits); +end; { func. Com_Open } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_OpenKeep(Comport: Byte): Boolean; +begin + Com_OpenKeep := ComObj^.Com_OpenKeep(Comport); +end; { func. Com_OpenKeep } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); +begin + ComObj^.Com_GetModemStatus(LineStatus, ModemStatus); +end; { proc. Com_GetModemStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); +begin + ComObj^.Com_SetLine(BpsRate, Parity, DataBits, StopBits); +end; { proc. Com_SetLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_GetBPSrate: Longint; +begin + Com_GetBpsRate := ComObj^.Com_GetBpsRate; +end; { func. Com_GetBpsRate } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); +begin + ComObj^.Com_GetBufferStatus(InFree, OutFree, InUsed, OutUsed); +end; { proc. Com_GetBufferStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SetDtr(State: Boolean); +begin + ComObj^.Com_SetDtr(State); +end; { proc. Com_SetDtr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_CharAvail: Boolean; +begin + Com_CharAvail := ComObj^.Com_CharAvail; +end; { func. Com_CharAvail } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_Carrier: Boolean; +begin + Com_Carrier := ComObj^.Com_Carrier; +end; { func. Com_Carrier } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_ReadyToSend(BlockLen: Longint): Boolean; +begin + Com_ReadyToSend := ComObj^.Com_ReadyToSend(BlockLen); +end; { func. Com_ReadyToSend } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_GetChar: Char; +begin + Com_GetChar := ComObj^.Com_GetChar; +end; { func. Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_PeekChar: Char; +begin + Com_PeekChar := ComObj^.Com_PeekChar; +end; { func. Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_SendChar(C: Char): Boolean; +begin + Com_SendChar := ComObj^.Com_SendChar(C); +end; { func. Com_SendChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_GetDriverInfo: String; +begin + Com_GetDriverInfo := ComObj^.Com_GetDriverInfo; +end; { func. Com_GetDriverInfo } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_GetHandle: Longint; +begin + Com_GetHandle := ComObj^.Com_GetHandle; +end; { func. Com_GetHandle } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function Com_InitSucceeded: Boolean; +begin + Com_InitSucceeded := ComObj^.Com_InitSucceeded; +end; { func. Com_InitSucceeded } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_Close; +begin + ComObj^.Com_Close; +end; { proc. Com_Close } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); +begin + ComObj^.Com_SendBlock(Block, BlockLen, Written); +end; { proc. Com_SendBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SendWait(var Block; BlockLen: Longint; var Written: Longint; Slice: SliceProc); +begin + ComObj^.Com_SendWait(Block, BlockLen, Written, Slice); +end; { proc. Com_SendWait } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); +begin + ComObj^.Com_ReadBlock(Block, BlockLen, Reads); +end; { proc. Com_ReadBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_PurgeOutBuffer; +begin + ComObj^.Com_PurgeOutBuffer; +end; { proc. Com_PurgeOutBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_PurgeInBuffer; +begin + ComObj^.Com_PurgeInBuffer; +end; { proc. Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_PauseCom(CloseCom: Boolean); +begin + ComObj^.Com_PauseCom(CloseCom); +end; { proc. Com_PauseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_ResumeCom(OpenCom: Boolean); +begin + ComObj^.Com_ResumeCom(OpenCom); +end; { proc. Com_ResumeCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_FlushOutBuffer(Slice: SliceProc); +begin + ComObj^.Com_FlushOutBuffer(Slice); +end; { proc. Com_FlushOutBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SendString(Temp: String); +begin + ComObj^.Com_SendString(Temp); +end; { Com_SendString } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SetDontClose(Value: Boolean); +begin + ComObj^.DontClose := Value; +end; { proc. Com_SetDontClose } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_ShutDown; +begin + Dispose(ComObj, Done); +end; { proc. Com_ShutDown } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); +begin + ComObj^.Com_SetFlow(SoftTX, SoftRX, Hard); +end; { proc. Com_SetFlow } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +begin + ComObj := nil; +end. diff --git a/SOURCE/ELECOM/EXAM2.PAS b/SOURCE/ELECOM/EXAM2.PAS new file mode 100644 index 0000000..da00107 --- /dev/null +++ b/SOURCE/ELECOM/EXAM2.PAS @@ -0,0 +1,150 @@ +program Exam2; +(* +** +** EXAMPLE how to use communications +** This is only an example of how to use EleCOM independently of a BBS program, +** to see an example how to use EleCOM as a door from a BBS program, see +** EXAMPLE.PAS +** TELNET is not supported as we dont have a telnet server +** +** version: 1.01 +** Created: 30-Sep-1999 +** +** Fire up line: EXAM2.EXE -C +** eg: EXAM2.EXE -C4 +** +*) + +{.DEFINE FOSSIL} +{.DEFINE OS2COM} +{$DEFINE W32COM} + +{$IFNDEF FOSSIL} + {$IFNDEF OS2COM} + {$IFNDEF W32COM} + You need to define one of these.. + {$ENDIF} + {$ENDIF} +{$ENDIF} + +uses Combase, + {$IFDEF FOSSIL} + Fos_Com + {$ENDIF} + + {$IFDEF OS2COM} + Os2Com + {$ENDIF} + + {$IFDEF W32COM} + W32SNGL + {$ENDIF} ; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +var ComObj : PCommObj; + ComPort : Longint; + ReadCH : Char; + IsTelnet : Boolean; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Int_ComReadProc(var TempPtr: Pointer); +begin + {$IFDEF WIN32} + Case IsTelnet of + FALSE : PWin32Obj(ComObj)^.Com_DataProc(TempPtr); + end; { case } + {$ENDIF} + + {$IFDEF OS2} + Case IsTelnet of + FALSE : POs2Obj(ComObj)^.Com_ReadProc(TempPtr); + end; { case } + {$ENDIF} +end; { proc. Int_ComReadProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Int_ComWriteProc(var TempPtr: Pointer); +begin + {$IFDEF WIN32} + Case IsTelnet of + FALSE : PWin32Obj(ComObj)^.Com_DataProc(TempPtr); + end; { case } + {$ENDIF} + + {$IFDEF OS2} + Case IsTelnet of + FALSE : POs2Obj(ComObj)^.Com_WriteProc(TempPtr); + end; { case } + {$ENDIF} +end; { proc. Int_ComWriteProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure ParseCommandLine; +var Counter: Longint; + TempStr: String; + {$IFDEF MSDOS} + Code : Integer; + {$ELSE} + Code : Longint; + {$ENDIF} +begin + for Counter := 01 to ParamCount do + begin + TempStr := ParamStr(Counter); + + if TempStr[1] in ['/', '-'] then + Case UpCase(TempStr[2]) of + 'C' : begin + + TempStr := Copy(TempStr, 3, Length(TempStr) - 2); + Val(TempStr, ComPort, Code); + + end; { 'C' } + end; { case } + + end; { for } +end; { proc. ParseCommandLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + + +begin + IsTelnet := false; + ParseCommandLine; + + {$IFDEF W32COM} + ComObj := New(PWin32Obj, Init); + {$ENDIF} + + {$IFDEF FOSSIL} + ComObj := New(PFossilObj, Init); + {$ENDIF} + + {$IFDEF OS2COM} + ComObj := New(POs2Obj, Init); + {$ENDIF} + + {$IFDEF WIN32} + ComObj^.Com_SetDataProc(@Int_ComReadProc, @Int_ComWriteProc); + {$ENDIF} + + {$IFDEF OS2} + ComObj^.Com_SetDataProc(@Int_ComReadProc, @Int_ComWriteProc); + {$ENDIF} + + ComObj^.Com_OpenKeep(Comport); { Dont change any comport settings } + ComObj^.Com_SendString('Hello there!' + #13#10); + + repeat + ReadCH := ComObj^.Com_GetChar; + + if ReadCH <> #13 then + Writeln('Other..'); + until (ReadCH = #13) OR (NOT ComObj^.Com_Carrier); + + Dispose(ComObj, Done); { Dispose the communications object } +end. diff --git a/SOURCE/ELECOM/FOS_COM.PAS b/SOURCE/ELECOM/FOS_COM.PAS new file mode 100644 index 0000000..92d0a4a --- /dev/null +++ b/SOURCE/ELECOM/FOS_COM.PAS @@ -0,0 +1,550 @@ +unit FOS_COM; +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.1, (OS/2, Win32) +** FreePascal v0.99.12 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.01 +** Created : 21-May-1998 +** Last update : 07-Apr-1999 +** +** Note: (c) 1998-1999 by Maarten Bekers +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses Dos, Combase; + +type TFossilObj = Object(TCommObj) + Regs : Registers; + FosPort: Byte; + + constructor Init; + destructor Done; + + function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; virtual; + function Com_OpenKeep(Comport: Byte): Boolean; virtual; + function Com_GetChar: Char; virtual; + function Com_CharAvail: Boolean; virtual; + function Com_Carrier: Boolean; virtual; + function Com_SendChar(C: Char): Boolean; virtual; + function Com_ReadyToSend(BlockLen: Longint): Boolean; virtual; + function Com_GetBPSrate: Longint; virtual; + function Com_GetDriverInfo: String; virtual; + function Com_GetHandle: longint; virtual; + + procedure Com_OpenQuick(Handle: Longint); virtual; + procedure Com_Close; virtual; + procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); virtual; + procedure Com_SendWait(var Block; BlockLen: Longint; var Written: Longint; Slice: SliceProc); virtual; + procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); virtual; + procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); virtual; + procedure Com_SetDtr(State: Boolean); virtual; + procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); virtual; + procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); virtual; + procedure Com_PurgeInBuffer; virtual; + procedure Com_PurgeOutBuffer; virtual; + procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); virtual; + end; { object TFossilObj } + +Type PFossilObj = ^TFossilObj; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses Strings + {$IFDEF GO32V2} + ,Go32 + {$ENDIF} ; + + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure DosAlloc(var Selector: Word; var SegMent: Word; Size: Longint); +var Res: Longint; +begin + {$IFDEF GO32V2} + Res := Global_DOS_Alloc(Size); + Selector := Word(Res); + + Segment := Word(RES SHR 16); + {$ENDIF} +end; { proc. DosAlloc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure DosFree(Selector: Word); +begin + {$IFDEF GO32V2} + Global_DOS_Free(Selector); + {$ENDIF} +end; { proc. DosFree } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +constructor TFossilObj.Init; +begin + inherited Init; +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor TFossilObj.Done; +begin + inherited Done; +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure FossilIntr(var Regs: Registers); +begin + Intr($14, Regs); +end; { proc. FossilIntr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; +begin + {-------------------------- Open the comport -----------------------------} + FosPort := (ComPort - 01); + + Regs.AH := $04; + Regs.DX := FosPort; + Regs.BX := $4F50; + + FossilIntr(Regs); + + Com_Open := (Regs.AX = $1954); + InitFailed := (Regs.AX <> $1954); + Com_SetLine(BaudRate, Parity, DataBits, StopBits); +end; { func. TFossilObj.Com_OpenCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_OpenKeep(Comport: Byte): Boolean; +begin + FosPort := (ComPort - 01); + + Regs.AH := $04; + Regs.DX := FosPort; + Regs.BX := $4F50; + + FossilIntr(Regs); + + Com_OpenKeep := (Regs.AX = $1954); + InitFailed := (Regs.AX <> $1954); +end; { func. Com_OpenKeep } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_OpenQuick(Handle: Longint); +begin + {-------------------------- Open the comport -----------------------------} + FosPort := (Handle - 01); + + Regs.AH := $04; + Regs.DX := FosPort; + Regs.BX := $4F50; + + FossilIntr(Regs); + InitFailed := (Regs.AX <> $1954); +end; { proc. Com_OpenQuick } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); +var BPS: Byte; +begin + if BpsRate > 65534 then + BpsRate := 65534; + + Case Word(BpsRate) of { have to typecast to word, else will rte201 in dos } + 1200 : BPS := 128; + 2400 : BPS := 160; + 4800 : BPS := 192; + 9600 : BPS := 224; + 19200 : BPS := 0 + else BPS := 32; + end; { case } + + if DataBits in [6..8] then + BPS := BPS + (DataBits - 5); + + if Parity = 'O' then BPS := BPS + 8 else + If Parity = 'E' then BPS := BPS + 24; + + if StopBits = 2 then BPS := BPS + 04; + + Regs.AH := $00; + Regs.AL := BPS; + Regs.DX := FosPort; + FossilIntr(Regs); +end; { proc. TFossilObj.Com_SetLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_GetBPSrate: Longint; +begin + Com_GetBpsRate := 115200; +end; { func. TFossilObj.Com_GetBpsRate } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_Close; +begin + if Dontclose then EXIT; + + Regs.AH := $05; + Regs.DX := FosPort; + FossilIntr(Regs); +end; { proc. TFossilObj.Com_Close } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_SendChar(C: Char): Boolean; +var Written: Longint; +begin + Com_SendWait(C, SizeOf(c), Written, nil); + + Com_SendChar := (Written >= SizeOf(c)); +end; { proc. TFossilObj.Com_SendChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_GetChar: Char; +begin + Regs.AH := $02; + Regs.DX := FosPort; + FossilIntr(Regs); + + Com_GetChar := Chr(Regs.AL); +end; { proc. TFossilObj.Com_ReadChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); +{$IFDEF GO32V2} +var Selector, + Segment : Word; +{$ENDIF} +begin + {$IFDEF MSDOS} + Regs.AH := $18; + Regs.DX := FosPort; + Regs.CX := Blocklen; + Regs.ES := Seg(Block); + Regs.DI := Ofs(Block); + FossilIntr(Regs); + + Reads := Regs.AX; + {$ENDIF} + + {$IFDEF GO32V2} + DosAlloc(Selector, Segment, BlockLen); + + if Int31Error <> 0 then EXIT; + DosmemPut(Segment, 0, Block, BlockLen); + + Regs.AH := $18; + Regs.DX := FosPort; + Regs.CX := Blocklen; + Regs.ES := Segment; + Regs.DI := 0; + FossilIntr(Regs); + + Reads := Regs.AX; + + DosMemGet(Segment, 0, Block, BlockLen); + DosFree(Selector); + {$ENDIF} +end; { proc. TFossilObj.Com_ReadBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); +{$IFDEF GO32V2} +var Selector, + Segment : Word; +{$ENDIF} +begin + {$IFDEF MSDOS} + Regs.AH := $19; + Regs.DX := FosPort; + Regs.CX := Blocklen; + Regs.ES := Seg(Block); + Regs.DI := Ofs(Block); + FossilIntr(Regs); + + Written := Regs.AX; + {$ENDIF} + + {$IFDEF GO32V2} + DosAlloc(Selector, Segment, BlockLen); + + if Int31Error <> 0 then EXIT; + DosmemPut(Segment, 0, Block, BlockLen); + + Regs.AH := $19; + Regs.DX := FosPort; + Regs.CX := Blocklen; + Regs.ES := Segment; + Regs.DI := 0; + FossilIntr(Regs); + + Written := Regs.AX; + + DosMemGet(Segment, 0, Block, BlockLen); + DosFree(Selector); + {$ENDIF} +end; { proc. TFossilObj.Com_SendBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_CharAvail: Boolean; +begin + Regs.AH := $03; + Regs.DX := FosPort; + FossilIntr(Regs); + + Com_CharAvail := (Regs.AH AND 01) <> 00; +end; { func. TFossilObj.Com_CharAvail } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_ReadyToSend(BlockLen: Longint): Boolean; +begin + Regs.AH := $03; + Regs.DX := FosPort; + FossilIntr(Regs); + + Com_ReadyToSend := (Regs.AH AND $20) = $20; +end; { func. TFossilObj.Com_ReadyToSend } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_Carrier: Boolean; +begin + Regs.AH := $03; + Regs.DX := FosPort; + FossilIntr(Regs); + + Com_Carrier := (Regs.AL AND 128) <> 00; +end; { func. TFossilObj.Com_Carrier } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_SetDtr(State: Boolean); +begin + Regs.AH := $06; + Regs.AL := Byte(State); + Regs.DX := Fosport; + FossilIntr(Regs); +end; { proc. TFossilObj.Com_SetDtr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_GetModemStatus(var LineStatus, ModemStatus: Byte); +begin + Regs.AH := $03; + Regs.DX := FosPort; + FossilIntr(Regs); + + ModemStatus := Regs.AL; + LineStatus := Regs.AH; +end; { proc. TFossilObj.Com_GetModemStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); +type + FosRec = record + Size : Word; + Spec : Byte; + Rev : Byte; + ID : Pointer; + InSize : Word; + InFree : Word; + OutSize : Word; + OutFree : Word; + SWidth : Byte; + SHeight : Byte; + BaudMask : Byte; + Junk : Word; + end; + +var Com_Info: FosRec; + + Selector, + Segment : Word; +begin + {$IFDEF MSDOS} + Regs.AH := $1B; + Regs.DX := FosPort; + Regs.ES := Seg(Com_Info); + Regs.DI := Ofs(Com_Info); + Regs.CX := SizeOf(Com_Info); + {$ENDIF} + + {$IFDEF GO32V2} + DosAlloc(Selector, Segment, SizeOf(Com_Info)); + if Int31Error <> 0 then EXIT; + + DosmemPut(Segment, 0, Com_Info, SizeOf(Com_Info)); + + Regs.AH := $1B; + Regs.DX := FosPort; + Regs.ES := Segment; + Regs.DI := 0; + Regs.CX := SizeOf(Com_Info); + FossilIntr(Regs); + + DosMemGet(Segment, 0, Com_Info, SizeOf(Com_Info)); + DosFree(Selector); + {$ENDIF} + + FossilIntr(Regs); + + InFree := Com_Info.InFree; + InUsed := Com_Info.InSize - Com_Info.InFree; + + OutFree := Com_Info.OutFree; + OutUsed := Com_Info.OutSize - Com_Info.OutFree; +end; { proc. TFossilObj.Com_GetBufferStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_GetDriverInfo: String; +type + FosRec = record + Size : Word; + Spec : Byte; + Rev : Byte; + ID : PChar; + InSize : Word; + InFree : Word; + OutSize : Word; + OutFree : Word; + SWidth : Byte; + SHeight : Byte; + BaudMask : Byte; + Junk : Word; + end; + +var Com_Info: FosRec; + Segment, + Selector: Word; +begin + FillChar(Com_Info, SizeOf(FosRec), #00); + + {$IFDEF MSDOS} + Regs.AH := $1B; + Regs.DX := FosPort; + Regs.ES := Seg(Com_Info); + Regs.DI := Ofs(Com_Info); + Regs.CX := SizeOf(Com_Info); + {$ENDIF} + + {$IFDEF GO32V2} + DosAlloc(Selector, Segment, SizeOf(Com_Info)); + if Int31Error <> 0 then EXIT; + + DosmemPut(Segment, 0, Com_Info, SizeOf(Com_Info)); + + Regs.AH := $1B; + Regs.DX := FosPort; + Regs.ES := Segment; + Regs.DI := 0; + Regs.CX := SizeOf(Com_Info); + FossilIntr(Regs); + + DosMemGet(Segment, 0, Com_Info, SizeOf(Com_Info)); + DosFree(Selector); + {$ENDIF} + + FossilIntr(Regs); + Com_GetDriverInfo := StrPas(Com_Info.ID); +end; { proc. TFossilObj.Com_GetDriverInfo } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_PurgeInBuffer; +begin + Regs.AH := $0A; + Regs.DX := FosPort; + + FossilIntr(Regs); +end; { proc. TFossilObj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_PurgeOutBuffer; +begin + Regs.AH := $09; + Regs.DX := FosPort; + + FossilIntr(Regs); +end; { proc. TFossilObj.Com_PurgeOutBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TFossilObj.Com_GetHandle: longint; +begin + Com_GetHandle := FosPort; +end; { func. Com_GetHandle } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_SendWait(var Block; BlockLen: Longint; var Written: Longint; Slice: SliceProc); +var RestLen : Longint; + Temp : Array[0..(1024 * 50)] of Char ABSOLUTE Block; + MaxTries: Longint; +begin + RestLen := BlockLen; + MaxTries := (Com_GetBpsRate div 8); + + repeat + Com_SendBlock(Temp[BlockLen - RestLen], RestLen, Written); + + Dec(RestLen, Written); + Dec(MaxTries); + + if RestLen <> 0 then + if @Slice <> nil then + Slice; + until (RestLen <= 0) OR (NOT COM_Carrier) OR (MaxTries < 0); + + Written := (BlockLen - RestLen); +end; { proc. Com_SendWait } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TFossilObj.Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); +begin + Regs.AH := $0F; + + if SoftTX then + Regs.AL := $01 + else Regs.AL := $00; + + if SoftRX then + Regs.AL := Regs.AL OR $08; + + if Hard then + Regs.AL := Regs.AL OR $02; + + Regs.DX := FosPort; + FossilIntr(Regs); +end; { proc. Com_SetFlow } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +end. diff --git a/SOURCE/ELECOM/HISTORY.102 b/SOURCE/ELECOM/HISTORY.102 new file mode 100644 index 0000000..a8b34f6 --- /dev/null +++ b/SOURCE/ELECOM/HISTORY.102 @@ -0,0 +1,19 @@ +WHATSNEW +======== + +30 July 2000 : Initial DoRxEvent and DoTxEvent were set in true state + which could cause initial very high CPU usage. +18 June 2000 : Changed the way EleCOM calls it threaded functions, making + EleCOM useful for applications where more than one comport + has to be controlled at a time. +20 February 2000 : W32SNGL.PAS or WIN32COM.PAS now include WINDEF.FPC if + compiled with the FPC compiler. This include file redefines + (some) of the Win32 API calls to make sure they are the + correct calling format for us (= the same as with Delphi + and VirtualPascal) +09 September 1999: W32SNGL.PAS - Reduced the number of threads used by this + engine. This one works better on Win9x systems. +05 September 1999: TELNET.PAS added some extra error information to make sure + errors can be more easily diagnosed. +29 August 1999 : ELENORM.PAS - "Plain, vanilly" Pascal version you can use + as a wrapper around the OOP code. diff --git a/SOURCE/ELECOM/HISTORY.103 b/SOURCE/ELECOM/HISTORY.103 new file mode 100644 index 0000000..c9a944f --- /dev/null +++ b/SOURCE/ELECOM/HISTORY.103 @@ -0,0 +1,24 @@ +WHATSNEW +======== + +16 June 2002 : Added a very small state machine to the IAC parser of the + telnet code, to prevent misses of IAC's on the last + character of the buffer. +23 December 2000 : Increased buffersizes that Win32 allocates for in/out + communications. It now uses 3k, instead of 256 bytes. +30 July 2000 : Initial DoRxEvent and DoTxEvent were set in true state + which could cause initial very high CPU usage. +18 June 2000 : Changed the way EleCOM calls it threaded functions, making + EleCOM useful for applications where more than one comport + has to be controlled at a time. +20 February 2000 : W32SNGL.PAS or WIN32COM.PAS now include WINDEF.FPC if + compiled with the FPC compiler. This include file redefines + (some) of the Win32 API calls to make sure they are the + correct calling format for us (= the same as with Delphi + and VirtualPascal) +09 September 1999: W32SNGL.PAS - Reduced the number of threads used by this + engine. This one works better on Win9x systems. +05 September 1999: TELNET.PAS added some extra error information to make sure + errors can be more easily diagnosed. +29 August 1999 : ELENORM.PAS - "Plain, vanilly" Pascal version you can use + as a wrapper around the OOP code. diff --git a/SOURCE/ELECOM/IBMSO32.PAS b/SOURCE/ELECOM/IBMSO32.PAS new file mode 100644 index 0000000..583e395 --- /dev/null +++ b/SOURCE/ELECOM/IBMSO32.PAS @@ -0,0 +1,113 @@ +unit IBMSO32; + +{$OrgName+ } + +interface + +uses OS2Def; + +{$CDECL+} + (****************************************************************************) + function IBM_accept(SFamily: ULong; + SAddr: pointer; + SAddrL: pointer): APIRET; + (****************************************************************************) + function IBM_bind(SSocket: ULong; + SAddr: pointer; + SAddrLen: ULong): APIRET; + (****************************************************************************) + function IBM_connect(SSocket: ULong; + SAddr: pointer; + SAddrLen:ULong): APIRET; + (****************************************************************************) + function IBM_gethostid: APIRET; + (****************************************************************************) + function IBM_select( Sockets: pointer; + noreads, nowrites, noexcepts: longint; + timeout: longint ): ApiRet; + (****************************************************************************) + function IBM_getsockname(SSocket: ULong; + SName: pointer; + SLength: pointer): APIRET; + (****************************************************************************) + function IBM_ioctl(SSocket: ULong; + SRequest: longint; + SArgp: pointer; + ArgSize: longint): APIRET; + (****************************************************************************) + function IBM_listen(SSocket: ULong; + SQueue: ULong): APIRET; + (****************************************************************************) + function IBM_getsockopt(SSocket: uLong; + sLevel: LongInt; + sOptname: LongInt; + sOptVal: pchar; + var sOptLen: LongInt ): ApiRet; + (****************************************************************************) + FUNCTION IBM_setsockopt(sSocket: ulong; + sLevel: uLong; + sOptName: uLong; + sOptVal: pointer; + sOptLen: uLong ): ApiRet; + (****************************************************************************) + function IBM_recv(SSocket: ULong; + SBuffer: pointer; + SLength: ULong; + SFlags: ULong): APIRET; + (****************************************************************************) + function IBM_send(SSocket: ULong; + SBuffer: pointer; + SLength: ULong; + SFlags: ULong): APIRET; + (****************************************************************************) + function IBM_socket(SDomain: ULong; + SType: ULong; + SProtocol: ULong): APIRET; + (****************************************************************************) + function IBM_soclose(SProtocol: ULong): APIRET; + (****************************************************************************) + function IBM_sock_errno: APIRET; + (****************************************************************************) + function IBM_shutdown(SSocket: ULong; + SFlags: ULong): APIRET; + (****************************************************************************) + function IBM_sock_init: APIRET; + (****************************************************************************) + function IBM_so_cancel(SProtocol: ULong): APIRET; + (****************************************************************************) +{$CDECL-} + +implementation + +const + Version = '00.90'; + UseString: string = '@(#)import interface unit for IBM TCP/IP so32dll.dll'+#0; + CopyRight1: string = '@(#)ibmso32dll Version '+Version+' - 10.10.96'+#0; + CopyRight2: string = '@(#)(C) Chr.Hohmann BfS ST2.2 1996'+#0; + +const + sockets = 'SO32DLL'; + network = 'TCP32DLL'; + +{$CDECL+} + function IBM_accept; external sockets index 1; + function IBM_bind; external sockets index 2; + function IBM_connect; external sockets index 3; + function IBM_gethostid; external sockets index 4; + function IBM_getsockname; external sockets index 6; + function IBM_ioctl; external sockets index 8; + function IBM_listen; external sockets index 9; + function IBM_recv; external sockets index 10; + function IBM_send; external sockets index 13; + function IBM_socket; external sockets index 16; + function IBM_soclose; external sockets index 17; + function IBM_sock_errno; external sockets index 20; + function IBM_shutdown; external sockets index 25; + function IBM_sock_init; external sockets index 26; + function IBM_so_cancel; external sockets index 18; + function IBM_getsockopt; external sockets index 7; + function IBM_setsockopt; external sockets index 15; + function IBM_select; external sockets index 12; +{$CDECL-} + +end. diff --git a/SOURCE/ELECOM/IBMTCP32.PAS b/SOURCE/ELECOM/IBMTCP32.PAS new file mode 100644 index 0000000..4b97627 --- /dev/null +++ b/SOURCE/ELECOM/IBMTCP32.PAS @@ -0,0 +1,53 @@ +unit IBMTCP32; + +{$OrgName+ } + +interface + +uses OS2Def, SockDef; + +{$CDECL+} + (****************************************************************************) + function IBM_gethostbyname(HName: pointer): pointer; + (****************************************************************************) + function IBM_gethostbyaddr(HAddr: pointer; + HAddrLen: longint; + HAddrType: ULong): pointer; + (****************************************************************************) + function IBM_gethostname(HName: pointer; + HLength:ULong): APIRET; + (****************************************************************************) + function IBM_getservbyname(_Name, _Proto: pChar): pServEnt; + function inet_addr(_s: pChar): ULONG; + + function getprotobyname(_Name: pChar): pProtoEnt; + + function htonl(_a: LongInt): LongInt; + function ntohl(_a: LongInt): LongInt; +{ function htons(_a: LongInt): LongInt; } +{ function ntohs(_a: SmallInt): SmallInt; } +{$CDECL-} + +implementation + +const + Version = '00.90'; + UseString: string = '@(#)import interface unit for IBM TCP/IP tcp32dll.dll'+#0; + CopyRight1: string = '@(#)ibmTCP32 Version '+Version+' - 10.10.96'+#0; + CopyRight2: string = '@(#)(C) Chr.Hohmann BfS ST2.2 1996'+#0; + +const + sockets = 'SO32DLL'; + network = 'TCP32DLL'; + +{$CDECL+} + function inet_addr; external network index 5; + function IBM_gethostbyname; external network index 11; + function IBM_gethostbyaddr; external network index 12; + function IBM_gethostname; external network index 44; + function getprotobyname; external network index 21; + function IBM_getservbyname; external network index 24; + function htonl; external network index 3; + function ntohl; external network index 3; +{$CDECL-} +end. diff --git a/SOURCE/ELECOM/OS2COM.PAS b/SOURCE/ELECOM/OS2COM.PAS new file mode 100644 index 0000000..57f620f --- /dev/null +++ b/SOURCE/ELECOM/OS2COM.PAS @@ -0,0 +1,786 @@ +unit OS2COM; +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.1, (OS/2, Win32) +** FreePascal v0.99.12 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.01 +** Created : 21-May-1998 +** Last update : 12-May-1999 +** +** Note: (c) 1998-1999 by Maarten Bekers +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses Combase, BufUnit, Threads, + {$IFDEF OS2} + Os2Base + {$ENDIF} + + {$IFDEF VirtualPascal} + ,Use32 + {$ENDIF}; + +Const WriteTimeout = 20000; { Wait max. 20 secs } + ReadTimeOut = 5000; { General event, 5 secs max } + + InBufSize = 1024 * 32; + OutBufSize = 1024 * 32; + +type TOs2Obj = Object(TCommObj) + ReadProcPtr: Pointer; { Pointer to TX/RX handler (thread) } + WriteProcPtr: Pointer; { Pointer to TX/RX handler (thread) } + ThreadsInitted: Boolean; { Are the thread(s) up and running? } + + ClientHandle : Longint; + + InBuffer : ^BufArrayObj; { Buffer system internally used } + OutBuffer : ^BufArrayObj; + + DoTxEvent : PSysEventObj; { Event manually set when we have to transmit } + DoRxEvent : PSysEventObj; { Event manually set when we need data } + + TxClosedEvent : PSysEventObj; { Event set when the Tx thread is closed } + RxClosedEvent : PSysEventObj; { Event set when the Rx thread is closed } + + CriticalTx : PExclusiveObj; { Critical sections } + CriticalRx : PExclusiveObj; + + TxThread : PThreadsObj; { The Transmit and Receive threads } + RxThread : PThreadsObj; + + EndThreads : Boolean; { Set to true when we have to end the threads } + + constructor Init; + destructor Done; + + function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; virtual; + function Com_OpenKeep(Comport: Byte): Boolean; virtual; + function Com_GetChar: Char; virtual; + function Com_CharAvail: Boolean; virtual; + function Com_Carrier: Boolean; virtual; + function Com_SendChar(C: Char): Boolean; virtual; + function Com_ReadyToSend(BlockLen: Longint): Boolean; virtual; + function Com_GetBPSrate: Longint; virtual; + function Com_GetHandle: Longint; virtual; + + procedure Com_OpenQuick(Handle: Longint); virtual; + procedure Com_Close; virtual; + procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); virtual; + procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); virtual; + procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); virtual; + procedure Com_SetDtr(State: Boolean); virtual; + procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); virtual; + procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); virtual; + procedure Com_PurgeInBuffer; virtual; + procedure Com_PurgeOutBuffer; virtual; + procedure Com_FlushOutBuffer(Slice: SliceProc); virtual; + + procedure Com_PauseCom(CloseCom: Boolean); virtual; + procedure Com_ResumeCom(OpenCom: Boolean); virtual; + procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); virtual; + + procedure Com_SetDataProc(ReadPtr, WritePtr: Pointer); virtual; + + procedure Com_ReadProc(var TempPtr: Pointer); + procedure Com_WriteProc(var TempPtr: Pointer); + + function Com_StartThread: Boolean; + procedure Com_InitVars; + procedure Com_StopThread; + end; { object TOs2Obj } + +Type POs2Obj = ^TOs2Obj; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses SysUtils; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +constructor TOs2Obj.Init; +begin + inherited Init; + + Com_InitVars; + ThreadsInitted := FALSE; +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor TOs2Obj.Done; +begin + inherited done; +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_ReadProc(var TempPtr: Pointer); +Type TBuffRec = Record + BytesIn : SmallWord; { Number of bytes in the buffer } + MaxSize : SmallWord; { Full size of the buffer } + end; { TBuffRec } + +var Available : Boolean; + BytesRead : Longint; + BlockLen : Longint; + ReturnCode: Longint; + BufferRec : TBuffRec; +begin + repeat + if DoRxEvent.WaitForEvent(ReadTimeOut) then + if NOT EndThreads then + begin + CriticalRx.EnterExclusive; + ReturnCode := 0; + DosDevIoCtl(ClientHandle, { File-handle } + ioctl_Async, { Category } + async_GetInQueCount, { Function } + nil, { Params } + ReturnCode, { Max param length } + @ReturnCode, { Param Length } + @BufferRec, { Returned data } + SizeOf(TBuffRec), { Max data length } + @ReturnCode); { Data length } + + Available := (BufferRec.BytesIn > 00); + + DoRxEvent.ResetEvent; + + if Available then + begin + {----------- Start reading the gathered date -------------------} + + if InBuffer^.BufRoom > 0 then + begin + BlockLen := BufferRec.BytesIn; + if BlockLen > InBuffer^.BufRoom then + BlockLen := InBuffer^.BufRoom; + if BlockLen > 1024 then + BlockLen := 1024; + + if BlockLen > 00 then + begin + DosRead(ClientHandle, + InBuffer^.TmpBuf, + BlockLen, + BytesRead); + + InBuffer^.Put(InBuffer^.TmpBuf, BytesRead); + end; { if } + + end; { if } + end; { if available } + + CriticalRx.LeaveExclusive; + end; { if RxEvent } + until EndThreads; + + RxClosedEvent.SignalEvent; + ExitThisThread; +end; { proc. ComReadProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_WriteProc(var TempPtr: Pointer); +var BlockLen : Longint; + Written : Longint; + ReturnCode : Longint; + TempBuf : ^CharBufType; +begin + New(TempBuf); + + repeat + if DoTxEvent.WaitForEvent(WriteTimeOut) then + if NOT EndThreads then + begin + CriticalTx.EnterExclusive; + DoTxEvent.ResetEvent; + + if OutBuffer^.BufUsed > 00 then + begin + Written := 00; + BlockLen := OutBuffer^.Get(OutBuffer^.TmpBuf, OutBuffer^.BufUsed, false); + + DosWrite(ClientHandle, + OutBuffer^.TmpBuf, + BlockLen, + Written); + + ReturnCode := OutBuffer^.Get(OutBuffer^.TmpBuf, Written, true); + if Written <> BlockLen then + DoTxEvent.SignalEvent; + end; { if } + + CriticalTx.LeaveExclusive; + end; { if } + + until EndThreads; + + Dispose(TempBuf); + TxClosedEvent.SignalEvent; + ExitThisThread; +end; { proc. ComWriteProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TOs2Obj.Com_StartThread: Boolean; +begin + Result := false; + EndThreads := false; + if ThreadsInitted then EXIT; + ThreadsInitted := true; + + {----------------------- Create all the events ----------------------------} + New(DoTxEvent, Init); + if NOT DoTxEvent.CreateEvent(false) then EXIT; + + New(DoRxEvent, Init); + if NOT DoRxEvent.CreateEvent(false) then EXIT; + + New(RxClosedEvent, Init); + if NOT RxClosedEvent.CreateEvent(false) then EXIT; + + New(TxClosedEvent, Init); + if NOT TxClosedEvent.CreateEvent(false) then EXIT; + + + {-------------- Startup the buffers and overlapped events -----------------} + New(InBuffer, Init(InBufSize)); + New(OutBuffer, Init(OutBufSize)); + + {-------------------- Startup a seperate write thread ---------------------} + New(CriticalTx, Init); + CriticalTx.CreateExclusive; + + New(TxThread, Init); + if NOT TxThread.CreateThread(16384, { Stack size } + WriteProcPtr, { Actual procedure } + nil, { Parameters } + 0) { Creation flags } + then EXIT; + + {-------------------- Startup a seperate read thread ----------------------} + New(CriticalRx, Init); + CriticalRx.CreateExclusive; + + New(RxThread, Init); + if NOT RxThread.CreateThread(16384, { Stack size } + ReadProcPtr, { Actual procedure } + nil, { Parameters } + 0) { Creation flags } + then EXIT; + + Result := true; +end; { proc. Com_StartThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_InitVars; +begin + DoTxEvent := nil; + DoRxEvent := nil; + RxClosedEvent := nil; + TxClosedEvent := nil; + TxThread := nil; + RxThread := nil; + + InBuffer := nil; + OutBuffer := nil; + CriticalRx := nil; + CriticalTx := nil; +end; { proc. Com_InitVars } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_StopThread; +begin + EndThreads := true; + ThreadsInitted := false; + + if DoTxEvent <> nil then DoTxEvent.SignalEvent; + if DoTxEvent <> nil then DoRxEvent.SignalEvent; + + + if TxThread <> nil then TxThread.CloseThread; + if RxThread <> nil then RxThread.CloseThread; + + if TxClosedEvent <> nil then + if NOT TxClosedEvent^.WaitForEvent(1000) then + TxThread.TerminateThread(0); + + if RxClosedEvent <> nil then + if NOT RxClosedEvent^.WaitForEvent(1000) then + RxThread.TerminateThread(0); + + if TxThread <> nil then TxThread.Done; + if RxThread <> nil then RxThread.Done; + + if DoTxEvent <> nil then Dispose(DoTxEvent, Done); + if DoRxEvent <> nil then Dispose(DoRxEvent, Done); + if RxClosedEvent <> nil then Dispose(RxClosedEvent, Done); + if TxClosedEvent <> nil then Dispose(TxClosedEvent, Done); + + if CriticalTx <> nil then Dispose(CriticalTx, Done); + if CriticalRx <> nil then Dispose(CriticalRx, Done); + + if InBuffer <> nil then Dispose(InBuffer, Done); + if OutBuffer <> nil then Dispose(OutBuffer, Done); + + Com_InitVars; +end; { proc. Com_StopThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TOs2Obj.Com_GetHandle: Longint; +begin + Result := ClientHandle; +end; { func. Com_GetHandle } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_OpenQuick(Handle: Longint); +begin + ClientHandle := Handle; + + InitFailed := NOT Com_StartThread; +end; { proc. TOs2Obj.Com_OpenQuick } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TOs2Obj.Com_OpenKeep(Comport: Byte): Boolean; +var ReturnCode: Longint; + OpenAction: Longint; + Temp : Array[0..15] of Char; +begin + InitFailed := NOT Com_StartThread; + + if NOT InitFailed then + begin + OpenAction := file_Open; + StrpCopy(Temp, 'COM' + IntToStr(ComPort)); + + ReturnCode := + DosOpen(Temp, { Filename, eg: COM2 } + ClientHandle, + OpenAction, + 0, { Filesize } + 0, { Attributes } + FILE_OPEN or OPEN_ACTION_OPEN_IF_EXISTS, { Open flags } + OPEN_ACCESS_READWRITE or OPEN_SHARE_DENYNONE or { OpenMode } + OPEN_FLAGS_FAIL_ON_ERROR, + nil); { Extended attributes } + + InitFailed := (ReturnCode <> 0); + end; { if } + + Com_OpenKeep := NOT InitFailed; +end; { func. Com_OpenKeep } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TOs2Obj.Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; +begin + InitFailed := true; + + if Com_OpenKeep(Comport) then + begin + Com_SetLine(BaudRate, Parity, DataBits, StopBits); + + InitFailed := false; + end; { if } + + Com_Open := NOT InitFailed; +end; { func. TOs2Obj.Com_OpenCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); +type TBpsRec = Record + Rate : Longint; + Frac : Byte; + end; { record } + +var TempRec : Array[1..3] of Byte; + BpsRec : TBpsRec; + RetLength : Longint; + Temp_Parity : Byte; + Temp_StopBits: Byte; +begin + if NOT (DataBits in [5,7,8]) then DataBits := 8; + if NOT (Parity in ['O', 'E', 'N', 'M', 'S']) then Parity := 'N'; + if NOT (StopBits in [0..2]) then StopBits := 1; + + Temp_Parity := 00; + Case Parity of + 'N' : Temp_Parity := 00; + 'O' : Temp_Parity := 01; + 'E' : Temp_Parity := 02; + 'M' : Temp_Parity := 03; + 'S' : Temp_Parity := 04; + end; { case } + + Temp_Stopbits := 00; + Case StopBits of + 1 : StopBits := 0; + 2 : StopBits := 2; + end; { case } + + Fillchar(TempRec, SizeOf(TempRec), 00); + TempRec[01] := DataBits; + TempRec[02] := Temp_Parity; + TempRec[03] := Temp_StopBits; + + {------------------------- Set line parameters ----------------------------} + DosDevIoCtl(ClientHandle, { File-handle } + ioctl_Async, { Category } + async_SetLineCtrl, { Function } + @TempRec, { Params } + SizeOf(TempRec), { Max param length } + @RetLength, { Param Length } + @TempRec, { Returned data } + SizeOf(TempRec), { Max data length } + @RetLength); { Data length } + + {------------------------- Set speed parameters ---------------------------} + BpsRec.Rate := BpsRate; + BpsRec.Frac := 00; + DosDevIoCtl(ClientHandle, { File-handle } + ioctl_Async, { Category } + async_ExtSetBaudRate, { Function } + @BpsRec, { Params } + SizeOf(BpsRec), { Max param length } + @RetLength, { Param Length } + @BpsRec, { Returned data } + SizeOf(BpsRec), { Max data length } + @RetLength); { Data length } +end; { proc. TOs2Obj.Com_SetLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_Close; +begin + if DontClose then EXIT; + + if ClientHandle <> -1 then + begin + Com_StopThread; + DosClose(ClientHandle); + + ClientHandle := -1; + end; { if } + +end; { func. TOs2Obj.Com_CloseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TOs2Obj.Com_SendChar(C: Char): Boolean; +var Written: Longint; +begin + Com_SendBlock(C, SizeOf(C), Written); + Com_SendChar := (Written = SizeOf(c)); +end; { proc. TOs2Obj.Com_SendChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TOs2Obj.Com_GetChar: Char; +var Reads: Longint; +begin + Com_ReadBlock(Result, SizeOf(Result), Reads); +end; { func. TOs2Obj.Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); +begin + if OutBuffer^.BufRoom < BlockLen then + repeat + {$IFDEF OS2} + DosSleep(1); + {$ENDIF} + until (OutBuffer^.BufRoom >= BlockLen) OR (NOT Com_Carrier); + + CriticalTx.EnterExclusive; + Written := OutBuffer^.Put(Block, BlockLen); + CriticalTx.LeaveExclusive; + + DoTxEvent.SignalEvent; +end; { proc. TOs2Obj.Com_SendBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); +begin + if InBuffer^.BufUsed < BlockLen then + begin + repeat + if Com_CharAvail then + DoRxEvent.SignalEvent; + + DosSleep(1); + until (InBuffer^.BufUsed >= BlockLen) OR (NOT Com_Carrier); + end; { if } + + CriticalRx.EnterExclusive; + Reads := InBuffer^.Get(Block, BlockLen, true); + CriticalRx.LeaveExclusive; +end; { proc. TOs2Obj.Com_ReadBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TOs2Obj.Com_CharAvail: Boolean; + +Type TBuffRec = Record + BytesIn : SmallWord; { Number of bytes in the buffer } + MaxSize : SmallWord; { Full size of the buffer } + end; { TBuffRec } + +var ReturnCode: Longint; + BufferRec : TBuffRec; +begin + if InBuffer^.BufUsed < 1 then + begin + ReturnCode := 0; + DosDevIoCtl(ClientHandle, { File-handle } + ioctl_Async, { Category } + async_GetInQueCount, { Function } + nil, { Params } + ReturnCode, { Max param length } + @ReturnCode, { Param Length } + @BufferRec, { Returned data } + SizeOf(TBuffRec), { Max data length } + @ReturnCode); { Data length } + + if (BufferRec.BytesIn > 0) then + DoRxEvent.SignalEvent; + end; { if } + + Result := (InBuffer^.BufUsed > 0); +end; { func. TOs2Obj.Com_CharAvail } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TOs2Obj.Com_Carrier: Boolean; +var Status : Byte; + RetLength : Longint; +begin + DosDevIoCtl(ClientHandle, { File-handle } + ioctl_Async, { Category } + async_GetModemInput, { Function } + nil, { Params } + 00, { Max param length } + @RetLength, { Param Length } + @Status, { Returned data } + SizeOf(Status), { Max data length } + @RetLength); { Data length } + + Com_Carrier := Status AND 128 <> 00; +end; { func. TOs2Obj.Com_Carrier } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_GetModemStatus(var LineStatus, ModemStatus: Byte); +begin + LineStatus := 00; + ModemStatus := 08; + + if Com_Carrier then ModemStatus := ModemStatus OR (1 SHL 7); +end; { proc. TOs2Obj.Com_GetModemStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_SetDtr(State: Boolean); +type + TRtsDtrRec = record + Onmask, + Offmask : Byte; + end; { record } + +var MaskRec : TRtsDtrRec; + RetLength : Longint; +begin + if State then + begin + MaskRec.OnMask := $01; + MaskRec.OffMask := $FF; + end + else begin + MaskRec.OnMask := $00; + MaskRec.OffMask := $FE; + end; { if } + + DosDevIoCtl(ClientHandle, { File-handle } + ioctl_Async, { Category } + async_SetModemCtrl, { Function } + @MaskRec, { Params } + SizeOf(MaskRec), { Max param length } + @RetLength, { Param Length } + @MaskRec, { Returned data } + SizeOf(MaskRec), { Max data length } + @RetLength); { Data length } +end; { proc. TOs2Obj.Com_SetDtr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TOs2Obj.Com_GetBpsRate: Longint; +type + TBpsRec = record + CurBaud : Longint; { Current BaudRate } + CurFrac : Byte; { Current Fraction } + MinBaud : Longint; { Minimum BaudRate } + MinFrac : Byte; { Minimum Fraction } + MaxBaud : Longint; { Maximum BaudRate } + MaxFrac : Byte; { Maximum Fraction } + end; { TBpsRec } + +var BpsRec : TBpsRec; + Status : Byte; + RetLength: Longint; +begin + DosDevIoCtl(ClientHandle, { File-handle } + ioctl_Async, { Category } + async_ExtGetBaudRate, { Function } + nil, { Params } + 00, { Max param length } + @RetLength, { Param Length } + @BpsRec, { Returned data } + SizeOf(BpsRec), { Max data length } + @RetLength); { Data length } + + Com_GetBpsRate := BpsRec.CurBaud; +end; { func. TOs2Obj.Com_GetBpsRate } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); +begin + DoRxEvent.SignalEvent; + DoTxEvent.SignalEvent; + + InFree := InBuffer^.BufRoom; + OutFree := OutBuffer^.BufRoom; + InUsed := InBuffer^.BufUsed; + OutUsed := OutBuffer^.BufUsed; +end; { proc. TOs2Obj.Com_GetBufferStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_PurgeInBuffer; +begin + CriticalRx.EnterExclusive; + + InBuffer^.Clear; + + CriticalRx.LeaveExclusive; +end; { proc. TOs2Obj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_PurgeOutBuffer; +begin + CriticalTx.EnterExclusive; + + OutBuffer^.Clear; + + CriticalTx.LeaveExclusive; +end; { proc. TOs2Obj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_FlushOutBuffer(Slice: SliceProc); +begin + DosResetBuffer(ClientHandle); + + inherited Com_FlushOutBuffer(Slice); +end; { proc. Com_FlushOutBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + + +function TOs2Obj.Com_ReadyToSend(BlockLen: Longint): Boolean; +begin + Result := OutBuffer^.BufRoom >= BlockLen; +end; { func. ReadyToSend } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_PauseCom(CloseCom: Boolean); +begin + if CloseCom then Com_Close + else Com_StopThread; +end; { proc. Com_PauseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_ResumeCom(OpenCom: Boolean); +begin + if OpenCom then Com_OpenKeep(0) + else Com_StartThread; +end; { proc. Com_ResumeCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); +var Dcb : DCBINFO; + RetLength: Longint; +begin + FillChar(Dcb, SizeOF(Dcb), 0); + + DosDevIoCtl(ClientHandle, { File-handle } + ioctl_Async, { Category } + async_GetDcbInfo, { Function } + nil, { Params } + 00, { Max param length } + @RetLength, { Param Length } + @Dcb, { Returned data } + SizeOf(DcbInfo), { Max data length } + @RetLength); { Data length } + + if (SoftTX) or (SoftRX) then + begin + dcb.fbFlowReplace := dcb.fbFlowReplace + MODE_AUTO_RECEIVE + MODE_AUTO_TRANSMIT; + end + else begin + dcb.fbFlowReplace := MODE_RTS_HANDSHAKE; + dcb.fbCtlHndShake := dcb.fbCtlHndShake + MODE_CTS_HANDSHAKE; + end; { if } + + dcb.fbTimeout := MODE_NO_WRITE_TIMEOUT + MODE_WAIT_READ_TIMEOUT; + dcb.bXONChar := $11; + dcb.bXOFFChar := $13; + + RetLength := SizeOf(DcbInfo); + DosDevIoCtl(ClientHandle, { File-handle } + ioctl_Async, { Category } + async_SetDcbInfo, { Function } + @Dcb, { Params } + SizeOf(DcbInfo), { Max param length } + @RetLength, { Param Length } + nil, { Returned data } + RetLength, { Max data length } + @RetLength); { Data length } + +end; { proc. Com_SetFlow } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TOs2Obj.Com_SetDataProc(ReadPtr, WritePtr: Pointer); +begin + ReadProcPtr := ReadPtr; + WriteProcPtr := WritePtr; +end; { proc. Com_SetDataProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +end. diff --git a/SOURCE/ELECOM/PROCS.TXT b/SOURCE/ELECOM/PROCS.TXT new file mode 100644 index 0000000..c745fc8 --- /dev/null +++ b/SOURCE/ELECOM/PROCS.TXT @@ -0,0 +1,109 @@ +Procedure overview +================== + ++---------------------+---------------+----------------------------------------+ +| Name | Parameters | Explanation | ++---------------------+---------------+----------------------------------------+ +| Com_OpenQuick | | Open the comport without init. | +| | Handle | Use these two handles for quickinit | ++------------------------------------------------------------------------------+ +| Com_Open | | Opens the connection and set params | +| | Comport | Comport to open (COM1 = 1) | +| | BaudRate | | +| | DataBits, | | +| | Parity | | +| | StopBits | | ++------------------------------------------------------------------------------+ +| Com_Openkeep | | Open the comport without setting params| +| | Comport | | ++------------------------------------------------------------------------------+ +| Com_GetModemStatus | | Get the line/modem parameters | +| | LineStatus | | +| | ModemStatus | | ++------------------------------------------------------------------------------+ +| Com_SetLine | | Set the comm. parameters | +| | BPSrate | | +| | Parity | | +| | DataBits | | +| | StopBits | | ++------------------------------------------------------------------------------+ +| Com_GetBPSrate | | Returns the current line-speed | +| | | | ++------------------------------------------------------------------------------+ +| Com_GetBufferStatus | | Get the current buffer statusses | +| | InFree | Bytes free in input buffer | +| | OutFree | Bytes free in output buffer | +| | InUsed | Bytes currently used in input buffer | +| | OutUsed | Bytes currently used in output buffer | ++------------------------------------------------------------------------------+ +| Com_SetDTR | | Set DTR setting | +| | State | ++------------------------------------------------------------------------------+ +| Com_CharAvail | | Returns TRUE if there's a char avail. | +| | | | ++------------------------------------------------------------------------------+ +| Com_Carrier | | Returns TRUE if the DTR signal is high | +| | | | ++------------------------------------------------------------------------------+ +| Com_ReadyToSend | | Room enough for this block? | +| | Blocklen | Number of bytes we want to send | ++------------------------------------------------------------------------------+ +| Com_GetChar | | Get one character from the input buffer| +| | | | ++------------------------------------------------------------------------------+ +| Com_SendChar | | Send one character to the remote | +| | | | ++------------------------------------------------------------------------------+ +| Com_GetDriverInfo | | Returns the driver info (FOSSIL only) | +| | | | ++------------------------------------------------------------------------------+ +| Com_GetHandle | | Get the current used handle | +| | | | ++------------------------------------------------------------------------------+ +| Com_InitSucceeded | | Returns TRUE if the initialization | +| | | succeeded | ++------------------------------------------------------------------------------+ +| Com_Close | | Closes the comport and stop the | +| | | threads | ++------------------------------------------------------------------------------+ +| Com_SendBlock | | Sends a block to the remote. | +| | Block | Warning: Make sure that the block you | +| | BlockLen | send isn't larger than the | +| | Written | available buffer size, else | +| | | this routine will block | +| | | indefinitaly | ++------------------------------------------------------------------------------+ +| Com_SendWait | | Sends a block to the remote, this | +| | Block | routine will wait till all the size is | +| | BlockLen | sent under FOSSIL, else it's the same | +| | Written | as Com_SendBlock. | +| | Slice | Slice is called when waiting for all to| +| | | get out. | ++------------------------------------------------------------------------------+ +| Com_ReadBlock | | Gets a block from the remote | +| | Block | Block to read into | +| | BlockLen | Amount of bytes we want (will block!) | +| | Reads | Amount of bytes we actually gotten | ++------------------------------------------------------------------------------+ +| Com_PurgeOutBuffer | | Kill all the pending output | +| | | | ++------------------------------------------------------------------------------+ +| Com_PurgeInBuffer | | Kill all the pending input | +| | | | ++------------------------------------------------------------------------------+ +| Com_PauseCom | | Pause the communications. Stop threads | +| | CloseCom | ++------------------------------------------------------------------------------+ +| Com_ResumeCom | | Resums communications. Start threads | +| | CloseCom | | ++------------------------------------------------------------------------------+ +| Com_FlushOutBuffer | | Wait till all pending output is done | +| | SliceProc | Procedure is called while waiting.. | ++------------------------------------------------------------------------------+ +| Com_SendString | | Send this string to the remote | +| | Temp | String to send | ++------------------------------------------------------------------------------+ +| Com_SetDataProc | | Set read/write thread handlers | +| | ReadPtr | Pointer to read thread procedure | +| | WritePtr | Pointer to write thread procedure | ++----------------------------------------------------(c)2000 by Maarten Bekers-+ diff --git a/SOURCE/ELECOM/README.TXT b/SOURCE/ELECOM/README.TXT new file mode 100644 index 0000000..4b4ae4f --- /dev/null +++ b/SOURCE/ELECOM/README.TXT @@ -0,0 +1,17 @@ +ELECOM v1.03 - release notes +============================ + +These communication routines are released as freeware. You are free to do with +these routines whatever you want, but please give me proper credit when you do +use them (a small email to me mentioning that you are using them would be +great as well). + +When you make any changes, enhancements or additions, please send me a copy +of the changes so I can include them in the next release. + +Have fun, + +groeten, Maarten Bekers + +website: www.elebbs.com +email : maarten@elebbs.com diff --git a/SOURCE/ELECOM/SOCKDEF.PAS b/SOURCE/ELECOM/SOCKDEF.PAS new file mode 100644 index 0000000..fa52e1a --- /dev/null +++ b/SOURCE/ELECOM/SOCKDEF.PAS @@ -0,0 +1,606 @@ +unit SockDef; +(* +** +** SOCKDEF routines +** +** Copyright (c) 1998 by Thomas W. Mueller +** +** Created : 24-Oct-1998 +** Last update : 24-Oct-1998 +** +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses + Sysutils, +{$IFDEF OS2} + Os2def; +{$ENDIF} +{$IFDEF LINUX} + Linux; +{$ENDIF} +{$IFDEF WIN32} + Windows; +{$ENDIF} + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +{$IFDEF VER0_99_13} +type pInteger = ^Integer; + tFarProc = pointer; + SmallInt = System.Integer; +{$ENDIF} + +{$IFDEF LINUX} +type ULONG = longint; +{$ENDIF} + +type + tSockDesc = LongInt; + SmallWord = System.Word; + +type + eSocketErr = class(Exception); + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +const + MaxHostNameLen = 120; + +(* +** Option flags per-socket. +*) +{$IFNDEF LINUX} +(* +** Level number for (get/set)sockopt() to apply to socket itself. +*) + SOL_SOCKET =$ffff; // options for socket level + + SO_DEBUG =$0001; // turn on debugging info recording + SO_ACCEPTCONN =$0002; // socket has had listen() + SO_REUSEADDR =$0004; // allow local address reuse + SO_KEEPALIVE =$0008; // keep connections alive + SO_DONTROUTE =$0010; // just use interface addresses + SO_BROADCAST =$0020; // permit sending of broadcast msgs + SO_USELOOPBACK =$0040; // bypass hardware when possible + SO_LINGER =$0080; // linger on close if data present + SO_OOBINLINE =$0100; // leave received OOB data in line + +(* +** Additional options, not kept in so_options. +*) + SO_SNDBUF =$1001; // send buffer size + SO_RCVBUF =$1002; // receive buffer size + SO_SNDLOWAT =$1003; // send low-water mark + SO_RCVLOWAT =$1004; // receive low-water mark + SO_SNDTIMEO =$1005; // send timeout + SO_RCVTIMEO =$1006; // receive timeout + SO_ERROR =$1007; // get error status and clear + SO_TYPE =$1008; // get socket type + +{$ELSE} + SOL_SOCKET = 1; + + SO_DEBUG = 1; + SO_REUSEADDR = 2; + SO_TYPE = 3; + SO_ERROR = 4; + SO_DONTROUTE = 5; + SO_BROADCAST = 6; + SO_SNDBUF = 7; + SO_RCVBUF = 8; + SO_KEEPALIVE = 9; + SO_OOBINLINE = 10; + SO_NO_CHECK = 11; + SO_PRIORITY = 12; + SO_LINGER = 13; + SO_BSDCOMPAT = 14; +{$ENDIF} + + +(* +** Address families. +*) + AF_UNSPEC = 0; // unspecified + AF_UNIX = 1; // local to host (pipes, portals) + AF_INET = 2; // internetwork: UDP, TCP, etc. + AF_IMPLINK = 3; // arpanet imp addresses + AF_PUP = 4; // pup protocols: e.g. BSP + AF_CHAOS = 5; // mit CHAOS protocols + AF_NS = 6; // XEROX NS protocols + AF_NBS = 7; // nbs protocols + AF_ECMA = 8; // european computer manufacturers + AF_DATAKIT = 9; // datakit protocols + AF_CCITT = 10; // CCITT protocols, X.25 etc + AF_SNA = 11; // IBM SNA + AF_DECnet = 12; // DECnet + AF_DLI = 13; // Direct data link interface + AF_LAT = 14; // LAT + AF_HYLINK = 15; // NSC Hyperchannel + AF_APPLETALK = 16; // Apple Talk + + AF_OS2 = AF_UNIX; + + AF_NB = 17; // Netbios + AF_NETBIOS = AF_NB; + + AF_MAX = 18; + +(* +** Protocol families, same as address families for now. +*) + PF_UNSPEC = AF_UNSPEC; + PF_UNIX = AF_UNIX; + PF_INET = AF_INET; + PF_IMPLINK = AF_IMPLINK; + PF_PUP = AF_PUP; + PF_CHAOS = AF_CHAOS; + PF_NS = AF_NS; + PF_NBS = AF_NBS; + PF_ECMA = AF_ECMA; + PF_DATAKIT = AF_DATAKIT; + PF_CCITT = AF_CCITT; + PF_SNA = AF_SNA; + PF_DECnet = AF_DECnet; + PF_DLI = AF_DLI; + PF_LAT = AF_LAT; + PF_HYLINK = AF_HYLINK; + PF_APPLETALK = AF_APPLETALK; + PF_NETBIOS = AF_NB; + PF_NB = AF_NB; + PF_OS2 = PF_UNIX; + PF_MAX = AF_MAX; + +(* +** Maximum queue length specifiable by listen. +*) + + SOMAXCONN = 5; + + FREAD =1; + FWRITE =2; + + MSG_OOB =$1; // process out-of-band data + MSG_PEEK =$2; // peek at incoming message + MSG_DONTROUTE =$4; // send without using routing tables + MSG_FULLREAD =$8; // send without using routing tables + + MSG_MAXIOVLEN =16; + +const +{ All Windows Sockets error constants are biased by WSABASEERR from the "normal" } + + WSABASEERR = 10000; + +{ Windows Sockets definitions of regular Microsoft C error constants } + + WSAEINTR = (WSABASEERR+4); + WSAEBADF = (WSABASEERR+9); + WSAEACCES = (WSABASEERR+13); + WSAEFAULT = (WSABASEERR+14); + WSAEINVAL = (WSABASEERR+22); + WSAEMFILE = (WSABASEERR+24); + +{ Windows Sockets definitions of regular Berkeley error constants } + +{$IFNDEF LINUX} + WSAEWOULDBLOCK = (WSABASEERR+35); + WSAEINPROGRESS = (WSABASEERR+36); + WSAEALREADY = (WSABASEERR+37); + WSAENOTSOCK = (WSABASEERR+38); + WSAEDESTADDRREQ = (WSABASEERR+39); + WSAEMSGSIZE = (WSABASEERR+40); + WSAEPROTOTYPE = (WSABASEERR+41); + WSAENOPROTOOPT = (WSABASEERR+42); + WSAEPROTONOSUPPORT = (WSABASEERR+43); + WSAESOCKTNOSUPPORT = (WSABASEERR+44); + WSAEOPNOTSUPP = (WSABASEERR+45); + WSAEPFNOSUPPORT = (WSABASEERR+46); + WSAEAFNOSUPPORT = (WSABASEERR+47); + WSAEADDRINUSE = (WSABASEERR+48); + WSAEADDRNOTAVAIL = (WSABASEERR+49); + WSAENETDOWN = (WSABASEERR+50); + WSAENETUNREACH = (WSABASEERR+51); + WSAENETRESET = (WSABASEERR+52); + WSAECONNABORTED = (WSABASEERR+53); + WSAECONNRESET = (WSABASEERR+54); + WSAENOBUFS = (WSABASEERR+55); + WSAEISCONN = (WSABASEERR+56); + WSAENOTCONN = (WSABASEERR+57); + WSAESHUTDOWN = (WSABASEERR+58); + WSAETOOMANYREFS = (WSABASEERR+59); + WSAETIMEDOUT = (WSABASEERR+60); + WSAECONNREFUSED = (WSABASEERR+61); + WSAELOOP = (WSABASEERR+62); + WSAENAMETOOLONG = (WSABASEERR+63); + WSAEHOSTDOWN = (WSABASEERR+64); + WSAEHOSTUNREACH = (WSABASEERR+65); + WSAENOTEMPTY = (WSABASEERR+66); + WSAEPROCLIM = (WSABASEERR+67); + WSAEUSERS = (WSABASEERR+68); + WSAEDQUOT = (WSABASEERR+69); + WSAESTALE = (WSABASEERR+70); + WSAEREMOTE = (WSABASEERR+71); + + WSAEDISCON = (WSABASEERR+101); +{$ENDIF} + +{$IFDEF LINUX} + WSAEWOULDBLOCK = 11; + WSAEINPROGRESS = 115; + WSAEALREADY = 114; + WSAENOTSOCK = 88; + WSAEDESTADDRREQ = 89; + WSAEMSGSIZE = 90; + WSAEPROTOTYPE = 91; + WSAENOPROTOOPT = 92; + WSAEPROTONOSUPPORT = 93; + WSAESOCKTNOSUPPORT = 94; + WSAEOPNOTSUPP = 95; + WSAEPFNOSUPPORT = 96; + WSAEAFNOSUPPORT = 97; + WSAEADDRINUSE = 98; + WSAEADDRNOTAVAIL = 99; + WSAENETDOWN = 100; + WSAENETUNREACH = 101; + WSAENETRESET = 102; + WSAECONNABORTED = 103; + WSAECONNRESET = 104; + WSAENOBUFS = 105; + WSAEISCONN = 106; + WSAENOTCONN = 107; + WSAESHUTDOWN = 108; + WSAETOOMANYREFS = 109; + WSAETIMEDOUT = 110; + WSAECONNREFUSED = 111; + WSAELOOP = 40; + WSAENAMETOOLONG = 36; + WSAEHOSTDOWN = 112; + WSAEHOSTUNREACH = 113; + WSAENOTEMPTY = 39; + WSAEPROCLIM = 00; + WSAEUSERS = 87; + WSAEDQUOT = 122; + WSAESTALE = 116; + WSAEREMOTE = 66; +{$ENDIF} + +{ Extended Windows Sockets error constant definitions } + + WSASYSNOTREADY = (WSABASEERR+91); + WSAVERNOTSUPPORTED = (WSABASEERR+92); + WSANOTINITIALISED = (WSABASEERR+93); + +{ Error return codes from gethostbyname() and gethostbyaddr() + (when using the resolver). Note that these errors are + retrieved via WSAGetLastError() and must therefore follow + the rules for avoiding clashes with error numbers from + specific implementations or language run-time systems. + For this reason the codes are based at WSABASEERR+1001. + Note also that [WSA]NO_ADDRESS is defined only for + compatibility purposes. } + +{ Authoritative Answer: Host not found } + + WSAHOST_NOT_FOUND = (WSABASEERR+1001); + HOST_NOT_FOUND = WSAHOST_NOT_FOUND; + +{ Non-Authoritative: Host not found, or SERVERFAIL } + + WSATRY_AGAIN = (WSABASEERR+1002); + TRY_AGAIN = WSATRY_AGAIN; + +{ Non recoverable errors, FORMERR, REFUSED, NOTIMP } + + WSANO_RECOVERY = (WSABASEERR+1003); + NO_RECOVERY = WSANO_RECOVERY; + +{ Valid name, no data record of requested type } + + WSANO_DATA = (WSABASEERR+1004); + NO_DATA = WSANO_DATA; + +{ no address, look for MX record } + + WSANO_ADDRESS = WSANO_DATA; + NO_ADDRESS = WSANO_ADDRESS; + +{ Windows Sockets errors redefined as regular Berkeley error constants. + These are commented out in Windows NT to avoid conflicts with errno.h. + Use the WSA constants instead. } + + EWOULDBLOCK = WSAEWOULDBLOCK; + EINPROGRESS = WSAEINPROGRESS; + EALREADY = WSAEALREADY; + ENOTSOCK = WSAENOTSOCK; + EDESTADDRREQ = WSAEDESTADDRREQ; + EMSGSIZE = WSAEMSGSIZE; + EPROTOTYPE = WSAEPROTOTYPE; + ENOPROTOOPT = WSAENOPROTOOPT; + EPROTONOSUPPORT = WSAEPROTONOSUPPORT; + ESOCKTNOSUPPORT = WSAESOCKTNOSUPPORT; + EOPNOTSUPP = WSAEOPNOTSUPP; + EPFNOSUPPORT = WSAEPFNOSUPPORT; + EAFNOSUPPORT = WSAEAFNOSUPPORT; + EADDRINUSE = WSAEADDRINUSE; + EADDRNOTAVAIL = WSAEADDRNOTAVAIL; + ENETDOWN = WSAENETDOWN; + ENETUNREACH = WSAENETUNREACH; + ENETRESET = WSAENETRESET; + ECONNABORTED = WSAECONNABORTED; + ECONNRESET = WSAECONNRESET; + ENOBUFS = WSAENOBUFS; + EISCONN = WSAEISCONN; + ENOTCONN = WSAENOTCONN; + ESHUTDOWN = WSAESHUTDOWN; + ETOOMANYREFS = WSAETOOMANYREFS; + ETIMEDOUT = WSAETIMEDOUT; + ECONNREFUSED = WSAECONNREFUSED; + ELOOP = WSAELOOP; + ENAMETOOLONG = WSAENAMETOOLONG; + EHOSTDOWN = WSAEHOSTDOWN; + EHOSTUNREACH = WSAEHOSTUNREACH; + ENOTEMPTY = WSAENOTEMPTY; + EPROCLIM = WSAEPROCLIM; + EUSERS = WSAEUSERS; + EDQUOT = WSAEDQUOT; + ESTALE = WSAESTALE; + EREMOTE = WSAEREMOTE; + + SockAddr_Len = 16; + In_Addr_Len = 4; + InAddr_Any = 0; + InAddr_Loopback = $7F000001; + InAddr_Broadcast = $FFFFFFFF; + InAddr_None = $FFFFFFFF; + + SOCK_NULL = 0; + SOCK_STREAM = 1; // stream socket + SOCK_DGRAM = 2; // datagram socket + SOCK_RAW = 3; // raw-protocol interface + SOCK_RDM = 4; // reliably-delivered message + SOCK_SEQPACKET = 5; // sequenced packet stream + + IPPROTO_NULL = 0; + IPPROTO_UDP = 17; + IPPROTO_TCP = 6; + + +const + IOCPARM_MASK = $7f; + IOC_VOID = $20000000; + IOC_OUT = $40000000; + IOC_IN = $80000000; + IOC_INOUT = (IOC_IN or IOC_OUT); + +{$IFNDEF LINUX} + FIONREAD = IOC_OUT or { get # bytes to read } + ((Longint(SizeOf(Longint)) and IOCPARM_MASK) shl 16) or + (Longint(Byte('f')) shl 8) or 127; + FIONBIO = IOC_IN or { set/clear non-blocking i/o } + ((Longint(SizeOf(Longint)) and IOCPARM_MASK) shl 16) or + (Longint(Byte('f')) shl 8) or 126; + FIOASYNC = IOC_IN or { set/clear async i/o } + ((Longint(SizeOf(Longint)) and IOCPARM_MASK) shl 16) or + (Longint(Byte('f')) shl 8) or 125; +{$ENDIF} + +type + pLongInt = ^LongInt; + + pIoVec = ^tIoVec; + tIoVec = packed record + iov_base: POINTER; + iov_len: LongInt; + end; + +(* +** Structure used for manipulating linger option. +*) + tLinger = packed record + l_onoff: LongInt; // option on/off + l_linger: LongInt; // linger time + END; + +(* +** Structure used by kernel to pass protocol +** information in raw sockets. +*) + + tSockProto = packed record + sp_family: WORD; // address family + sp_protocol: WORD; // protocol + END; + + off_t = LongInt; + + tuio = packed record + uio_iov: pIoVec; + uio_iovcnt: LongInt; + uio_offset: off_t; + uio_segflg: LongInt; + uio_resid: LongInt; + END; + + pIn_Addr = ^tIn_Addr; + tIn_Addr = packed record + case integer of + 0: (IPAddr: ULong); + 1: (ClassA: byte; + ClassB: byte; + ClassC: byte; + ClassD: byte) + end; + +(* +** Structure used by kernel to store most +** addresses. +*) + pSockAddr=^tSockAddr; + tSockAddr=packed record + case integer of + 0: (Sin_Family: SmallWord; + Sin_Port: SmallWord; + Sin_Addr: tIn_Addr; + Sin_Zero: array[1.. 8] of byte); + 1: (Sa_Family: SmallWord; + Sa_Addr: array[1..14] of byte); + end; + +(* +** Message header for recvmsg and sendmsg calls. +*) + pMsgHdr = ^tMsgHdr; + tMsgHdr = packed record + msg_name: pChar; // optional address + msg_namelen: LongInt; // size of address + msg_iov: pIoVec; // scatter/gather array + msg_iovlen: LongInt; // # elements in msg_iov + msg_accrights: pChar; // access rights sent/received + msg_accrightslen: LongInt; + END; + + uio_rw = ( UIO_READ, UIO_WRITE ); + + pHostEnt = ^tHostEnt; + tHostEnt = packed record + H_Name: ^string; + H_Alias: pointer; +{$IFNDEF WIN32} + H_AddrType: longint; + H_Length: longint; +{$ELSE} + h_addrtype: Smallint; + h_length: Smallint; +{$ENDIF} + H_Addr_List: ^pIn_Addr; + END; + + pProtoEnt = ^tProtoEnt; + TProtoEnt = packed record + p_name: pChar; (* official protocol name *) + p_aliases: ^pChar; (* alias list *) + p_proto: SmallInt; (* protocol # *) + end; + + pServEnt = ^tServEnt; + tServEnt = packed record + s_name: pChar; // official service name + s_aliases: ^pChar; // alias list + s_port: SmallInt; // port # + s_proto: pChar; // protocol to use + END; + +// these types are only used in windows version +const + FD_SETSIZE = 64; + +type + PFDSet = ^TFDSet; + TFDSet = packed record + fd_count: ULONG; + fd_array: array[0..FD_SETSIZE-1] of ULONG; + end; + + PTimeVal = ^TTimeVal; + TTimeVal = packed record + tv_sec: Longint; + tv_usec: Longint; + end; + +const + WSADESCRIPTION_LEN = 256; + WSASYS_STATUS_LEN = 128; + +type + PWSAData = ^TWSAData; + TWSAData = packed record + wVersion: Word; + wHighVersion: Word; + szDescription: array[0..WSADESCRIPTION_LEN] of Char; + szSystemStatus: array[0..WSASYS_STATUS_LEN] of Char; + iMaxSockets: Word; + iMaxUdpDg: Word; + lpVendorInfo: PChar; + end; + +(* +** The re-defination of error constants are necessary to avoid conflict with +** standard IBM C Set/2 V1.0 error constants. +** +** All OS/2 SOCKET API error constants are biased by SOCBASEERR from the "normal" +** +*) + +const + SOCBASEERR = 10000; + +(* +** OS/2 SOCKET API definitions of regular Microsoft C 6.0 error constants +*) + +const + SOCEPERM = (SOCBASEERR+1); (* Not owner *) + SOCESRCH = (SOCBASEERR+3); (* No such process *) + SOCEINTR = (SOCBASEERR+4); (* Interrupted system call *) + SOCENXIO = (SOCBASEERR+6); (* No such device or address *) + SOCEBADF = (SOCBASEERR+9); (* Bad file number *) + SOCEACCES = (SOCBASEERR+13); (* Permission denied *) + SOCEFAULT = (SOCBASEERR+14); (* Bad address *) + SOCEINVAL = (SOCBASEERR+22); (* Invalid argument *) + SOCEMFILE = (SOCBASEERR+24); (* Too many open files *) + SOCEPIPE = (SOCBASEERR+32); (* Broken pipe *) + + SOCEOS2ERR = (SOCBASEERR+100); (* OS/2 Error *) + +(* +** OS/2 SOCKET API definitions of regular BSD error constants +*) + +const + SOCEWOULDBLOCK = (SOCBASEERR+35); (* Operation would block *) + SOCEINPROGRESS = (SOCBASEERR+36); (* Operation now in progress *) + SOCEALREADY = (SOCBASEERR+37); (* Operation already in progress *) + SOCENOTSOCK = (SOCBASEERR+38); (* Socket operation on non-socket *) + SOCEDESTADDRREQ = (SOCBASEERR+39); (* Destination address required *) + SOCEMSGSIZE = (SOCBASEERR+40); (* Message too long *) + SOCEPROTOTYPE = (SOCBASEERR+41); (* Protocol wrong type for socket *) + SOCENOPROTOOPT = (SOCBASEERR+42); (* Protocol not available *) + SOCEPROTONOSUPPORT = (SOCBASEERR+43); (* Protocol not supported *) + SOCESOCKTNOSUPPORT = (SOCBASEERR+44); (* Socket type not supported *) + SOCEOPNOTSUPP = (SOCBASEERR+45); (* Operation not supported on socket *) + SOCEPFNOSUPPORT = (SOCBASEERR+46); (* Protocol family not supported *) + SOCEAFNOSUPPORT = (SOCBASEERR+47); (* Address family not supported by protocol family *) + SOCEADDRINUSE = (SOCBASEERR+48); (* Address already in use *) + SOCEADDRNOTAVAIL = (SOCBASEERR+49); (* Can't assign requested address *) + SOCENETDOWN = (SOCBASEERR+50); (* Network is down *) + SOCENETUNREACH = (SOCBASEERR+51); (* Network is unreachable *) + SOCENETRESET = (SOCBASEERR+52); (* Network dropped connection on reset *) + SOCECONNABORTED = (SOCBASEERR+53); (* Software caused connection abort *) + SOCECONNRESET = (SOCBASEERR+54); (* Connection reset by peer *) + SOCENOBUFS = (SOCBASEERR+55); (* No buffer space available *) + SOCEISCONN = (SOCBASEERR+56); (* Socket is already connected *) + SOCENOTCONN = (SOCBASEERR+57); (* Socket is not connected *) + SOCESHUTDOWN = (SOCBASEERR+58); (* Can't send after socket shutdown *) + SOCETOOMANYREFS = (SOCBASEERR+59); (* Too many references: can't splice *) + SOCETIMEDOUT = (SOCBASEERR+60); (* Connection timed out *) + SOCECONNREFUSED = (SOCBASEERR+61); (* Connection refused *) + SOCELOOP = (SOCBASEERR+62); (* Too many levels of symbolic links *) + SOCENAMETOOLONG = (SOCBASEERR+63); (* File name too long *) + SOCEHOSTDOWN = (SOCBASEERR+64); (* Host is down *) + SOCEHOSTUNREACH = (SOCBASEERR+65); (* No route to host *) + SOCENOTEMPTY = (SOCBASEERR+66); (* Directory not empty *) + +(* +** OS/2 SOCKET API errors redefined as regular BSD error constants +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +end. { unit SockDef } diff --git a/SOURCE/ELECOM/SOCKFUNC.PAS b/SOURCE/ELECOM/SOCKFUNC.PAS new file mode 100644 index 0000000..af25063 --- /dev/null +++ b/SOURCE/ELECOM/SOCKFUNC.PAS @@ -0,0 +1,831 @@ +unit SockFunc; +(* +** +** SOCKFUNC routines +** +** Copyright (c) 1998 by Thomas W. Mueller +** Linux additions (c)1999 by Maarten Bekers +** +** Created : 24-Oct-1998 +** Last update : 24-Oct-1998 +** +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*- +** Copyright (c) 1982, 1985, 1986 Regents of the University of California. +** All rights reserved. +** +** Redistribution and use in source and binary forms are permitted +** provided that this notice is preserved and that due credit is given +** to the University of California at Berkeley. The name of the University +** may not be used to endorse or promote products derived from this +** software without specific prior written permission. This software +** is provided ``as is'' without express or implied warranty. +s** +** @(#)socket.h 7.2 (Berkeley) 12/30/87 +-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses +{$IFDEF OS2} + OS2Def, + IBMSO32, + IBMTCP32, +{$ENDIF} + +{$IFDEF WIN32} + windows, + W32Sock, +{$ENDIF} + +{$IFDEF LINUX} + linux, + Linsock, +{$ENDIF} + + Sysutils, + SockDef; + +Const SockInitted : Boolean = false; + +function SockErrorNo: Longint; +function SockGetErrStr(_ErrNo: integer): ShortString; +procedure SockRaiseError(const _prefix: String; _ErrNo: integer); +procedure SockRaiseLastError(const _prefix: String); + +function SockAccept(_SockDesc: tSockDesc; _SockAddr: pSockAddr; + var _SockAddrLen: Longint): tSockDesc; +function SockBind(_SockDesc: tSockDesc; var _SockAddr: tSockAddr): Longint; +function SockCancel(_SockDesc: tSockDesc): Longint; +function SockConnect(_SockDesc: tSockDesc; var _SockAddr: tSockAddr): Longint; +function SockGetHostByName(Hostname: ShortString): phostent; +function SockShutdown(_SockDesc: tSockDesc; _how: ULong): Longint; +function SockGetSockAddr(_SockDesc: tSockDesc; var _SockAddr: tSockAddr): Longint; +function SockGetSockOpt(_SockDesc: tSockDesc; _Level, _OptName: Integer; + _OptVal: PChar; var _OptLen: Integer): Longint; +function SockSetSockOpt(_SockDesc: tSockDesc; _Level: uLong; _OptName: Ulong; + _OptVal: pChar; _OptLen: uLong ): Longint; +function SockSetBlockingIO(_SockDesc: tSockDesc; _BlockingIO: boolean): Longint; +function SockIoCtlSocket(_SockDesc: tSockDesc; Func: Longint): Longint; +function SockListen(_SockDesc: tSockDesc; _SockQueue: ULong): Longint; +function SockRecv(_SockDesc: tSockDesc; _SockBuffer: pointer; + _SockBufLen: ULong; _SockFlags: ULong): Longint; +function SockSend(_SockDesc: tSockDesc; _SockBuffer: pointer; + _SockBufLen: ULong; _SockFlags: ULong ): Longint; +function SockSocket(_SockFamily: word; _SockType: word; + _SockProtocol: word ): tSockDesc; +function SockClose(_SockDesc: tSockDesc): Longint; +function SockInit: Longint; +function SockClientAlive(_SockDesc: tSockDesc): Boolean; + +function SockGetHostAddrByName(_HostName: ShortString): ULONG; +function SockGetHostNameByAddr(_HostAddr: pIn_Addr): ShortString; +function SockGetHostname: ShortString; + +function SockGetServByName(_Name, _Proto: ShortString): pServEnt; +function SockGetServPortByName(_Name, _Proto: ShortString): Longint; + +function SockHtonl(_Input: LongInt): longint; +function SockHtons(_Input: SmallWord): SmallWord; + +function SockNtohl(_Input: LongInt): longint; +function SockNtohs(_Input: SmallWord): longint; +function SockDataAvail(_SockDesc: tSockDesc): Boolean; +function SockSelect(_SockDesc: tSockDesc): Longint; +function SockInetAddr(_s: ShortString):tIn_Addr; + +{$IFNDEF LINUX} + {$IFNDEF FPC} + {$R SOCKFUNC.RES} + {$ENDIF} +{$ENDIF} + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +Const + Version = '1.00'; + UseString: ShortString = '@(#)socket interface unit for IBM TCP/IP and WinSock'#0; + CopyRight1: ShortString = '@(#)socket Version '+Version+' - 26.08.1998'#0; + CopyRight2: ShortString = '@(#}(C) Thomas Mueller 1998'#0; + CopyRight3: ShortString = '@(#)(C) Chr.Hohmann BfS ST2.2 1996'#0; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + + +function SockErrorNo: Longint; +begin + {$IFDEF OS2} + Result := IBM_sock_errno; + {$ENDIF} + + {$IFDEF WIN32} + Result := WsaGetLastError; + {$ENDIF} + + {$IFDEF LINUX} + Result := SocketError; + {$ENDIF} +end; { func. SockErrorNo } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockGetErrStr(_ErrNo: integer): ShortString; +begin + Result:=LoadStr(_ErrNo); +end; { func. SockGetErrStr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure SockRaiseError(const _prefix: String; _ErrNo: integer); +begin + raise eSocketErr.CreateFmt('%s: %s (%d)', + [_prefix, SockGetErrStr(_ErrNo), _ErrNo]); +end; { proc. SockRaiseError } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure SockRaiseLastError(const _prefix: String); +begin + SockRaiseError(_Prefix, SockErrorNo); +end; { proc. SockRaiseLastError } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + + +function SockGetServByName(_Name, _Proto: ShortString): pServEnt; +begin + _Name := _Name + #00; + _Proto := _Proto + #00; + + {$IFDEF WIN32} + Result := getservbyname(@_Name[01], @_Proto[01]); + {$ENDIF} + + {$IFDEF OS2} + Result := ibm_getservbyname(@_Name[01], @_Proto[01]); + {$ENDIF} + + {$IFDEF LINUX} + Result := getservbyname(@_Name[1], @_Proto[01]); + {$ENDIF} +end; { func. SockGetServByName } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockGetServPortByName(_Name, _Proto: ShortString): longint; +var ServEnt: pServEnt; +begin + ServEnt := SockGetServByName(_Name, _Proto); + + if Assigned(ServEnt) then + Result := ServEnt^.s_Port + else Result := -01; +end; { func. SockGetServPortByName } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockHtonl( _Input: longint): longint; +type SwapLong = packed record + case integer of + 0: (SLong: longint); + 1: (SArray: packed array[1..4] of byte); + end; +var Inp, + Tmp: SwapLong; +begin + Inp.SLong := _Input; + Tmp.SArray[1] := Inp.SArray[4]; + Tmp.SArray[2] := Inp.SArray[3]; + Tmp.SArray[3] := Inp.SArray[2]; + Tmp.SArray[4] := Inp.SArray[1]; + result := Tmp.SLong; +end; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockHtons( _Input: SmallWord): SmallWord; +type SwapWord = packed record + case integer of + 0: (SWord: SmallWord); + 1: (SArray: packed array[1..2] of byte); + end; +var Inp,Tmp: SwapWord; +begin + Inp.SWord := _Input; + Tmp.SArray[1] := Inp.SArray[2]; + Tmp.SArray[2] := Inp.SArray[1]; + Result := Tmp.SWord; +end; { func. SockhToNl } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockNtohl( _Input: longint): longint; +begin + {$IFNDEF LINUX} + Result:=ntohl(_Input); + {$ELSE} + {!!!!!!!!!!!!!!!!!!!!!!!} + Result := _Input; + {$ENDIF} +end; { func. sockNToHl } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockNtohs( _Input: SmallWord): longint; +begin + {$IFDEF WIN32} + Result := ntohs( _input); + {$ENDIF} + + {$IFDEF OS2} +{!!!!! Result := ntohs( _input);} + Result := Lo(_Input) * 256 + Hi(_Input); + {$ENDIF} + + {$IFDEF LINUX} + Result := ntohs(_input); + {$ENDIF} +end; { func. SockNToHs } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockAccept(_SockDesc: tSockDesc; + _SockAddr: pSockAddr; + var _SockAddrLen: Longint): longint; +begin + {$IFDEF WIN32} + Result := Accept(_SockDesc, _SockAddr, @_SockAddrLen); + {$ENDIF} + + {$IFDEF OS2} + Result := IBM_Accept(_SockDesc, _SockAddr, @_SockAddrLen); + {$ENDIF} + + {$IFDEF LINUX} + Result := Accept(_SockDesc, _SockAddr^, _SockAddrLen); + {$ENDIF} +end; { func. SockAccept } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockBind(_SockDesc: tSockDesc; + var _SockAddr: tSockAddr ): Longint; +begin + {$IFDEF WIN32} + SockBind := Bind(_SockDesc, @_SockAddr, SockAddr_Len); + {$ENDIF} + + {$IFDEF OS2} + SockBind := IBM_Bind(_SockDesc, @_SockAddr, SockAddr_Len); + {$ENDIF} + + {$IFDEF LINUX} + SockBind := Longint(Bind(_SockDesc, _SockAddr, SockAddr_Len)); + {$ENDIF} +end; { func. SockBind } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockConnect(_SockDesc: tSockDesc; + var _SockAddr: tSockAddr): Longint; +begin + {$IFDEF WIN32} + SockConnect := connect(_SockDesc, @_SockAddr, SockAddr_Len); + {$ENDIF} + + {$IFDEF OS2} + SockConnect := ibm_connect(_SockDesc, @_SockAddr, SockAddr_Len); + {$ENDIF} + + {$IFDEF LINUX} + SockConnect := connect(_SockDesc, _SockAddr, sockAddr_Len); + {$ENDIF} +end; { func. SockConnect } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockCancel(_SockDesc: tSockDesc): Longint; +begin + {$IFDEF WIN32} + Result := SockCancel(_SockDesc); + {$ENDIF} + + {$IFDEF OS2} + Result := IBM_So_Cancel(_SockDesc); + {$ENDIF} + + {$IFDEF LINUX} + Result := longint(true); + if _SockDesc=0 then ; + + {$WARNING SockCancel function not implemented } + {!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!} + {$ENDIF} +end; { func. SockCancel } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockShutdown(_SockDesc: tSockDesc; + _how: ULong): Longint; +begin + {$IFDEF WIN32} + SockShutdown := ShutDown(_SockDesc, _How); + {$ENDIF} + + {$IFDEF OS2} + SockShutDown := IBM_ShutDown(_SockDesc, _How); + {$ENDIF} + + {$IFDEF LINUX} + SockShutDown := ShutDown(_SockDesc, _How); + {$ENDIF} +end; { func. SockShutDown } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockGetSockAddr(_SockDesc: tSockDesc; var _SockAddr: tSockAddr): Longint; +var sLength: Integer; +begin + FillChar(_SockAddr, SizeOf(_SockAddr), #00); + sLength := SizeOf(_SockAddr); + + {$IFDEF WIN32} + Result := GetSockName(_SockDesc, @_SockAddr, sLength); + {$ENDIF} + + {$IFDEF OS2} + Result := IBM_GetSockName(_SockDesc, @_SockAddr, @sLength); + {$ENDIF} + + {$IFDEF LINUX} + Result := GetSocketName(_SockDesc, _SockAddr, sLength); + {$ENDIF} +end; { func. sockGetSockAddr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockSetBlockingIO(_SockDesc: tSockDesc; + _BlockingIO: boolean): Longint; +var Arg: ULONG; +begin + {$IFDEF OS2} + if _BlockingIO then Arg := 00 + else Arg := 01; + + Result := IBM_IOCtl(_SockDesc, FIONBIO, @Arg, SizeOf(Arg)); + {$ENDIF} + + {$IFDEF WIN32} + if _BlockingIO then Arg := 00 + else Arg := 01; + + Result := IOCtlSocket(_SockDesc, FIONBIO, Arg); + {$ENDIF} + + {$IFDEF LINUX} + if _BlockingIO then Arg := 00 + else Arg := 01; + + Result := Longint(ioctl(_SockDesc, Linux.FIONBIO, @Arg)); + {$ENDIF} +end; { func. SockSetBlockingIO } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockIoCtlSocket(_SockDesc: tSockDesc; Func: Longint): Longint; +var Arg: ULONG; +begin + Arg := 0; + + {$IFDEF OS2} + Result := IBM_IOCtl(_SockDesc, FUNC, @Arg, SizeOf(Arg)); + {$ENDIF} + + {$IFDEF WIN32} + Result := IOCtlSocket(_SockDesc, FUNC, Arg); + {$ENDIF} + + {$IFDEF LINUX} + Result := Longint(IoCtl(_SockDesc, Func, @Arg)); + {$ENDIF} +end; { func. SockIoCtlSocket } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockGetSockOpt(_SockDesc: tSockDesc; _Level, _OptName: Integer; + _OptVal: PChar; var _OptLen: Integer): Longint; +begin + {$IFDEF WIN32} + Result := GetSockOpt(_SockDesc, _Level, _OptName, _OptVal, _OptLen); + {$ENDIF} + + {$IFDEF OS2} + Result := IBM_GetSockOpt(_SockDesc, _Level, _OptName, _OptVal, _OptLen); + {$ENDIF} + + {$IFDEF LINUX} + Result := SetSocketOptions(_SockDesc, _Level, _OptName, _OptVal, _OptLen); + {$ENDIF} +end; { func. SockGetSockOpt } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockSetSockOpt(_SockDesc: tSockDesc; _Level: uLong; _OptName: Ulong; + _OptVal: pChar; _OptLen: uLong ): Longint; +begin + {$IFDEF WIN32} + Result := SetSockOpt(_SockDesc, _Level, _OptName, _OptVal, _OptLen); + {$ENDIF} + + {$IFDEF OS2} + Result := IBM_SetSockOpt(_SockDesc, _Level, _OptName, _OptVal, _OptLen); + {$ENDIF} + + {$IFDEF LINUX} + Result := SetSocketOptions(_SockDesc, _Level, _OptName, _OptVal, _OptLen); + {$ENDIF} +end; { func. SockSetSockOpt } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockDataAvail(_SockDesc: tSockDesc): Boolean; +{$IFDEF LINUX} + var ReadFDS : FDSet; + Temp : Longint; +{$ENDIF} +begin + {$IFNDEF LINUX} + Result := (SockSelect(_SockDesc) > 00); + {$ELSE} + fd_Zero(ReadFDS); + fd_Set(_SockDesc, ReadFDS); + + Temp := Select(_SockDesc + 01, @ReadFDS, nil, nil, 0); + if (Temp > 0) then + begin + SockDataAvail := FD_ISSET(_SockDesc, ReadFDS); + end { if } + else SockDataAvail := false; + {$ENDIF} +(* + {$IFDEF OS2} + Arg := 00; + Result := IBM_IOCTL(_SockDesc, FIONREAD, @Arg, SizeOf(Arg)); + + if Arg > 00 then Result := Arg + else Result := $FFFFFFFF; + {$ENDIF} + + {$IFDEF WIN32} + Result := IOCtlSocket(_SockDesc, FIONREAD, Arg); + if Arg > 00 then Result := Arg + else Result := $FFFFFFFF; + {$ENDIF} +*) +end; { func. SockDataAvail } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockListen(_SockDesc: tSockDesc; + _SockQueue: ULong): Longint; +begin + {$IFDEF WIN32} + SockListen := listen(_SockDesc, _SockQueue); + {$ENDIF} + + {$IFDEF OS2} + SockListen := ibm_listen(_SockDesc, _SockQueue); + {$ENDIF} + + {$IFDEF LINUX} + SockListen := Longint(Listen(_SockDesc, _SockQueue)); + {$ENDIF} +end; { func. SockListen } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockSelect(_SockDesc: tSockDesc ): Longint; +{$IFDEF OS2} +var SockCopy: ULONG; +{$ENDIF} + +{$IFDEF WIN32} +var SockArr : TFDSet; + Timeout : TTimeVal; +{$ENDIF} + +{$IFDEF LINUX} +var ReadFDS : FDSet; +{$ENDIF} +begin + {$IFDEF OS2} + SockCopy := _SockDesc; + Result := IBM_Select(@SockCopy, 1, 0, 0, 0); + {$ENDIF} + + {$IFDEF WIN32} + SockArr.fd_Count := 01; + SockArr.fd_Array[00] := _SockDesc; + Timeout.tv_sec := 00; + Timeout.tv_usec := 00; + + Result := Select(00, @SockArr, NIL, NIL, @Timeout); + {$ENDIF} + + {$IFDEF LINUX} + fd_Zero(ReadFDS); + fd_Set(_SockDesc, ReadFDS); + + SockSelect := Select(_SockDesc + 01, @ReadFDS, nil, nil, 0); + {$ENDIF} +end; { func. SockSelect } + +(*-+-*-+-*-+-*-+-*-+-*-+ -*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockRecv(_SockDesc: tSockDesc; + _SockBuffer: pointer; + _SockBufLen: ULong; + _SockFlags: ULong): Longint; +var Counter: Longint; +begin + {$IFDEF WIN32} + SockRecv := recv(_SockDesc, + _SockBuffer, + _SockBufLen, + _SockFlags); + {$ENDIF} + + {$IFDEF OS2} + SockRecv := ibm_recv(_SockDesc, + _SockBuffer, + _SockBufLen, + _SockFlags); + {$ENDIF} + + {$IFDEF LINUX} + SockRecv := Recv(_SockDesc, + _SockBuffer^, + _SockBufLen, + _SockFlags); + {$ENDIF} +end; { func. SockRecv } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockSend(_SockDesc: tSockDesc; + _SockBuffer: pointer; + _SockBufLen: ULong; + _SockFlags: ULong): Longint; +begin + {$IFDEF WIN32} + SockSend := Send(_SockDesc, + _SockBuffer, + _SockBufLen, + _SockFlags); + {$ENDIF} + + {$IFDEF OS2} + SockSend := IBM_Send(_SockDesc, + _SockBuffer, + _SockBufLen, + _SockFlags); + {$ENDIF} + + {$IFDEF LINUX} + SockSend := Send(_SockDesc, + _SockBuffer^, + _SockBufLen, + _SockFlags); + {$ENDIF} +end; { func. SockSend } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockSocket(_SockFamily: word; + _SockType: word; + _SockProtocol: word): tSockDesc; +begin + {$IFDEF WIN32} + SockSocket := Socket(_SockFamily, _SockType, _SockProtocol); + {$ENDIF} + + {$IFDEF OS2} + SockSocket := ibm_Socket(_SockFamily, _SockType, _SockProtocol); + {$ENDIF} + + {$IFDEF LINUX} + SockSocket := Socket(_SockFamily, _SockType, _SockProtocol); + {$ENDIF} +end; { func. SockSocket } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockClose(_SockDesc: tSockDesc): Longint; +begin + {$IFDEF OS2} + Result := IBM_soclose(_SockDesc); + {$ENDIF} + + {$IFDEF WIN32} + Result := Closesocket(_SockDesc); + {$ENDIF} + + {$IFDEF LINUX} + Result := Longint(fdClose(_SockDesc)); + {$ENDIF} +end; { func. SockClose } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockInit: Longint; +{$IFDEF WIN32} +var Data: TWSAData; +{$ENDIF} +begin + if SockInitted then EXIT; + SockInitted := true; + + {$IFDEF OS2} + SockInit := IBM_Sock_Init; + {$ENDIF} + + {$IFDEF WIN32} + SockInit := WsaStartup($0101, Data); + {$ENDIF} + + {$IFDEF LINUX} + SockInit := 0; + {$ENDIF} +end; { func. SockInit } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockGetHostByName(Hostname: ShortString): phostent; +begin + HostName := HostName + #00; + {$IFDEF WIN32} + Result := GetHostByName(@HostName[01]); + {$ENDIF} + + {$IFDEF OS2} + Result := IBM_GetHostByName(@HostName[01]); + {$ENDIF} + + {$IFDEF LINUX} + Result := GetHostByName(@HostName[1]); + {$ENDIF} +end; { func. SockGetHostByName } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockGetHostAddrByName(_HostName: ShortString): ULong; +var ReturnCode: pHostEnt; + InAddr : tIn_Addr; +begin + ReturnCode := SockGetHostbyName(_HostName); + if Assigned(ReturnCode) then + begin + InAddr := ReturnCode^.H_Addr_List^^; + Result := InAddr.IpAddr; + end + else Result:=$FFFFFFFF; +end; { func. SockGetHostAddrByName } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockGetHostByAddr(HostAddr: pIn_Addr; + HostAddrLen: ULong; + HostAddrType: ULong): pointer; +begin + {$IFDEF WIN32} + SockGetHostByAddr := GetHostbyAddr(HostAddr, + HostAddrLen, + HostAddrType); + {$ENDIF} + + {$IFDEF OS2} + SockGetHostByAddr := IBM_GetHostbyAddr(HostAddr, + HostAddrLen, + HostAddrType); + {$ENDIF} + + {$IFDEF LINUX} + Result := GetHostByAddr(HostAddr, HostAddrLen, HostAddrtype); + {$ENDIF} +end; { func. SockGetHostbyAddr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockGetHostNameByAddr(_HostAddr: pIn_Addr): ShortString; +var Counter : Integer; + ReturnCode: pHostEnt; + HName : ShortString; +begin + ReturnCode := SockGetHostByAddr(_HostAddr, + In_Addr_Len, + AF_INET); + + if (ULong(ReturnCode) <> 00) then + begin + HName := ''; + Counter := 00; + + While ReturnCode^.H_Name^[Counter] <> #00 do + begin + HName := HName + ReturnCode^.H_Name^[Counter]; + Inc(Counter); + end; { while } + end + else HName := 'Hostname not found'; + + SockGetHostNameByAddr := HName; +end; { func. SockGetHostNameByAddr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockGetHostname: ShortString; +var Counter : Longint; + sResult : Longint; + HostName : ShortString; + InAddr : TIn_Addr; +begin + FillChar(HostName, SizeOf(HostName), #00); + + {$IFDEF WIN32} + sResult := GetHostName(@HostName[01], SizeOf(HostName)); + {$ENDIF} + + {$IFDEF OS2} + sResult := IBM_GetHostName(@HostName[01], SizeOf(HostName)); + {$ENDIF} + + {$IFDEF LINUX} + {!!!!!!!!!!!!!!!!!!!} + InAddr.ClassA := 127; + InAddr.ClassB := 0; + InAddr.ClassC := 0; + InAddr.ClassD := 1; + + HostName := SockGetHostNameByAddr(@InAddr) + #00; + sResult := Length(HostName); + {$ENDIF} + + Counter := 01; + While (Counter < SizeOf(HostName)) AND (HostName[Counter] <> #00) do + Inc(Counter); + + if (Counter > 01) then + SetLength(HostName, Counter) + else HostName := 'amnesiac'; + + SockGetHostname := HostName; +end; { func. SockGetHostName } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockInetAddr(_s: ShortString): tIn_Addr; +begin + _s := _s + #00; + + {$IFNDEF LINUX} + Result.IpAddr := INet_Addr(@_S[01]); + {$ELSE} + {$WARNING SockInetAddr function not implemented! } + Result.IpAddr := INADDR_NONE; + {$ENDIF} +end; { func. SockInetAddr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function SockClientAlive(_SockDesc: tSockDesc): Boolean; +var TempCH : Char; + Returncode : Longint; + TempError : Longint; + TempStr : String; +begin + Result := true; + + ReturnCode := SockRecv(_SockDesc, @TempCH, SizeOf(TempCH), MSG_PEEK); + TempError := SockErrorNo; + + TempStr := SockGetErrStr(TempError); + + if ReturnCode = 0 then Result := false; { was: = 0 } + if (TempError <> WSAEWOULDBLOCK) AND (TempError <> 00) then + Result := false; +end; { func. SockClientAlive } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +initialization + {!! SockInit; } + +finalization + {$IFDEF WIN32} + //WsaCleanUp; + {$ENDIF} +end. { unit SockFunc } diff --git a/SOURCE/ELECOM/SOCKFUNC.RC b/SOURCE/ELECOM/SOCKFUNC.RC new file mode 100644 index 0000000..7123018 --- /dev/null +++ b/SOURCE/ELECOM/SOCKFUNC.RC @@ -0,0 +1,92 @@ +#define SOCEPERM 10001 +#define SOCESRCH 10003 +#define SOCEINTR 10004 +#define SOCENXIO 10006 +#define SOCEBADF 10009 +#define SOCEACCES 10013 +#define SOCEFAULT 10014 +#define SOCEINVAL 10022 +#define SOCEMFILE 10024 +#define SOCEPIPE 10032 +#define SOCEOS2ERR 10100 +#define SOCEWOULDBLOCK 10035 +#define SOCEINPROGRESS 10036 +#define SOCEALREADY 10037 +#define SOCENOTSOCK 10038 +#define SOCEDESTADDRREQ 10039 +#define SOCEMSGSIZE 10040 +#define SOCEPROTOTYPE 10041 +#define SOCENOPROTOOPT 10042 +#define SOCEPROTONOSUPPORT 10043 +#define SOCESOCKTNOSUPPORT 10044 +#define SOCEOPNOTSUPP 10045 +#define SOCEPFNOSUPPORT 10046 +#define SOCEAFNOSUPPORT 10047 +#define SOCEADDRINUSE 10048 +#define SOCEADDRNOTAVAIL 10049 +#define SOCENETDOWN 10050 +#define SOCENETUNREACH 10051 +#define SOCENETRESET 10052 +#define SOCECONNABORTED 10053 +#define SOCECONNRESET 10054 +#define SOCENOBUFS 10055 +#define SOCEISCONN 10056 +#define SOCENOTCONN 10057 +#define SOCESHUTDOWN 10058 +#define SOCETOOMANYREFS 10059 +#define SOCETIMEDOUT 10060 +#define SOCECONNREFUSED 10061 +#define SOCELOOP 10062 +#define SOCENAMETOOLONG 10063 +#define SOCEHOSTDOWN 10064 +#define SOCEHOSTUNREACH 10065 +#define SOCENOTEMPTY 10066 + + +STRINGTABLE +{ + SOCEPERM, "Not owner" + SOCESRCH, "No such process" + SOCEINTR, "Interrupted system call" + SOCENXIO, "No such device or address" + SOCEBADF, "Bad file number" + SOCEACCES, "Permission denied" + SOCEFAULT, "Bad address" + SOCEINVAL, "Invalid argument" + SOCEMFILE, "Too many open files" + SOCEPIPE, "Broken pipe" + SOCEOS2ERR, "OS/2 Error" + SOCEWOULDBLOCK, "Operation would block" + SOCEINPROGRESS, "Operation now in progress" + SOCEALREADY, "Operation already in progress" + SOCENOTSOCK, "Socket operation on non-socket" + SOCEDESTADDRREQ, "Destination address required" + SOCEMSGSIZE, "Message too long" + SOCEPROTOTYPE, "Protocol wrong type for socket" + SOCENOPROTOOPT, "Protocol not available" + SOCEPROTONOSUPPORT, "Protocol not supported" + SOCESOCKTNOSUPPORT, "Socket type not supported" + SOCEOPNOTSUPP, "Operation not supported on socket" + SOCEPFNOSUPPORT, "Protocol family not supported" + SOCEAFNOSUPPORT, "Address family not supported by protocol family" + SOCEADDRINUSE, "Address already in use" + SOCEADDRNOTAVAIL, "Can't assign requested address" + SOCENETDOWN, "Network is down" + SOCENETUNREACH, "Network is unreachable" + SOCENETRESET, "Network dropped connection on reset" + SOCECONNABORTED, "Software caused connection abort" + SOCECONNRESET, "Connection reset by peer" + SOCENOBUFS, "No buffer space available" + SOCEISCONN, "Socket is already connected" + SOCENOTCONN, "Socket is not connected" + SOCESHUTDOWN, "Can't send after socket shutdown" + SOCETOOMANYREFS, "Too many references: can't splice" + SOCETIMEDOUT, "Connection timed out" + SOCECONNREFUSED, "Connection refused" + SOCELOOP, "Too many levels of symbolic links" + SOCENAMETOOLONG, "File name too long" + SOCEHOSTDOWN, "Host is down" + SOCEHOSTUNREACH, "No route to host" + SOCENOTEMPTY, "Directory not empty" +} + diff --git a/SOURCE/ELECOM/SOCKFUNC.RES b/SOURCE/ELECOM/SOCKFUNC.RES new file mode 100644 index 0000000000000000000000000000000000000000..272dc2da319249f1f519c69647b61b4ef61d1a0c GIT binary patch literal 2392 zcma)8OK;Oa5FS9P#6xPJkb&JhX2Pc@~`1Veu7Xc6%qOt7Qrq z24lNrobo`NK&-BT^L^z!n?o+G&Sd6nqP7BjNAeREEJ0gQLaxg67a0u3aRAZxTq2}&C#Z1!@zEOKp#iQ?h!0W z@MPp;`4=}UEyYb8teyxMwPRLW;x%;loCPuJ=O+@ZlcrB60iUMufwh%5jQi!C%Ntl; zS1_aYe><6-%pc9VCK^o%KU(!scIso;(I3vw5+29E{vE8d@~py3JIBmLggMPj(!3)c z``w8>lG(`$%TQCy{T$B--|VEr9(oCyRt!6<&yA-YZbp$kgY`}A%ub6t#;mSy#ZNn? z))up7>g-})V$QP*tH=FvXou$BLqsK{sj0(b6+?cu>+NG`nd0Ueb1H>io*1E8c)XY0 z8oPb8+CDQ5$H9F*BfI>jg)vdL6_$*Vx3umxwEGf%6gwQx0==BEP(LY8PsP_&qiwRW62}GT#D#sjkb6Cxs?nnuvWXpLg^{={WDe+Q%#)IRjg}bqw#e2Tnm%I9 zpQx;WE4 r{zLH3Vgv2{*DH_=hT8YLW1ru73%&6|&gCVzKR^?$^8XK>$G`sqgb$tE literal 0 HcmV?d00001 diff --git a/SOURCE/ELECOM/TELNET.PAS b/SOURCE/ELECOM/TELNET.PAS new file mode 100644 index 0000000..dcf5485 --- /dev/null +++ b/SOURCE/ELECOM/TELNET.PAS @@ -0,0 +1,863 @@ +unit TELNET; +{$h-} +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.1, (OS/2, Win32) +** FreePascal v0.99.12 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.01 +** Created : 21-May-1998 +** Last update : 04-Apr-1999 +** +** Note: (c) 1998-1999 by Maarten Bekers +** +** Note: Same story of what we said in Win32, only we have here 2 seperate +** threads. The Write-thread has no problems, the read-thread is run +** max every 5 seconds, or whenever a carrier-check is performed. This +** carrier check is run on most BBS programs each second. You can +** optimize this by making the ReadThread a blocking select() call on +** the fd_read socket, but this can have other issues. A better approach +** on Win32 would be to call the WsaAsyncSelect() call, but this is +** non portable. +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses SockFunc, SockDef, Combase, BufUnit, Threads + + {$IFDEF WIN32} + ,Windows + {$ENDIF} + + {$IFDEF OS2} + ,Os2Base + {$ENDIF} + + {$IFDEF VirtualPascal} + ,Use32 + {$ENDIF}; + +Const WriteTimeout = 5000; { Wait max. 5 secs } + ReadTimeOut = 5000; { General event, 5 secs max } + + InBufSize = 1024 * 32; + OutBufSize = 1024 * 32; + + +type TTelnetObj = Object(TCommObj) + ReadProcPtr: Pointer; { Pointer to TX/RX handler (thread) } + WriteProcPtr: Pointer; { Pointer to TX/RX handler (thread) } + ThreadsInitted : Boolean; + NeedNewCarrier : Boolean; + TelnetCarrier : Boolean; + + IacDontDo : Longint; { ugly hack to prevent missed IACs } + IacState : Longint; { 0 = nothing } + { 1 = received IAC } + { 2 = handing the IAC } + ClientRC : Longint; + + InBuffer : ^BufArrayObj; { Buffer system internally used } + OutBuffer : ^BufArrayObj; + + DoTxEvent : PSysEventObj; { Event manually set when we have to transmit } + DoRxEvent : PSysEventObj; { Event manually set when we need data } + + TxClosedEvent : PSysEventObj; { Event set when the Tx thread is closed } + RxClosedEvent : PSysEventObj; { Event set when the Rx thread is closed } + + CriticalTx : PExclusiveObj; { Critical sections } + CriticalRx : PExclusiveObj; + + TxThread : PThreadsObj; { The Transmit and Receive threads } + RxThread : PThreadsObj; + + EndThreads : Boolean; { Set to true when we have to end the threads } + + constructor Init; + destructor Done; + + function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; virtual; + function Com_OpenKeep(Comport: Byte): Boolean; virtual; + function Com_GetChar: Char; virtual; + function Com_PeekChar: Char; virtual; + function Com_CharAvail: Boolean; virtual; + function Com_Carrier: Boolean; virtual; + function Com_SendChar(C: Char): Boolean; virtual; + function Com_ReadyToSend(BlockLen: Longint): Boolean; virtual; + function Com_GetBPSrate: Longint; virtual; + function Com_GetHandle: Longint; virtual; + + procedure Com_OpenQuick(Handle: Longint); virtual; + procedure Com_Close; virtual; + procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); virtual; + procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); virtual; + procedure Com_PeekBlock(var Block; BlockLen: Longint; var Reads: Longint); virtual; + procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); virtual; + procedure Com_SetDtr(State: Boolean); virtual; + procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); virtual; + procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); virtual; + procedure Com_PurgeInBuffer; virtual; + procedure Com_PurgeOutBuffer; virtual; + + procedure Com_PauseCom(CloseCom: Boolean); virtual; + procedure Com_ResumeCom(OpenCom: Boolean); virtual; + + procedure Com_ReadProc(var TempPtr: Pointer); + procedure Com_WriteProc(var TempPtr: Pointer); + + procedure Com_SetDataProc(ReadPtr, WritePtr: Pointer); virtual; + + function Com_StartThread: Boolean; + procedure Com_InitVars; + procedure Com_StopThread; + + function Com_SendWill(Option: Char): String; + function Com_SendWont(Option: Char): String; + function Com_SendDo(Option: Char): String; + procedure Com_SendRawStr(TempStr: String); + procedure Com_PrepareBufferRead(var CurBuffer: CharBufType; var TempOut: BufArrayObj; BlockLen: Longint); + procedure Com_PrepareBufferWrite(var CurBuffer, TmpOutBuffer: CharBufType; var BlockLen: Longint); + end; { object TTelnetObj } + +Type PTelnetObj = ^TTelnetObj; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses SysUtils; + +{$IFDEF FPC} + {$I WINDEF.FPC} +{$ENDIF} + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + + +Const + { Telnet Options } + TELNET_IAC = #255; { Interpret as Command } + TELNET_DONT = #254; { Stop performing, or not expecting him to perform } + TELNET_DO = #253; { Perform, or expect him to perform } + TELNET_WONT = #252; { Refusal to perform } + TELNET_WILL = #251; { Desire to perform } + + TELNET_SB = #250; { What follow is sub-negotiation of indicated option } + TELNET_GA = #249; { Go ahead signal } + TELNET_EL = #248; { Erase Line function } + TELNET_EC = #247; { Erase Character function } + TELNET_AYT = #246; { Are You There function } + TELNET_AO = #245; { Abort Output function } + TELNET_IP = #244; { Interrupt Process function } + TELNET_BRK = #243; { NVT break character } + TELNET_DM = #242; { Data stream portion of a Synch } + TELNET_NOP = #241; { No operation } + TELNET_SE = #240; { End of sub-negotiation parameters } + TELNET_EOR = #239; { End of record } + TELNET_ABORT = #238; { Abort process } + TELNET_SUSP = #237; { Suspend current process } + TELNET_EOF = #236; { End of file } + + TELNETOPT_BINARY = #0; { Transmit binary } + TELNETOPT_ECHO = #1; { Echo mode } + TELNETOPT_SUPGA = #3; { Suppress Go-Ahead } + TELNETOPT_TERM = #24; { Terminal Type } + TELNETOPT_SPEED = #32; { Terminal Speed } + TELNETOPT_FLOWCNT= #33; { Toggle flow-control } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +constructor TTelnetObj.Init; +begin + inherited Init; + + ThreadsInitted := false; + NeedNewCarrier := true; + TelnetCarrier := TRUE; + IacState := 0; { default to none } + Com_InitVars; +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor TTelnetObj.Done; +begin + inherited done; +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_SendRawStr(TempStr: String); +var BytesSnt: Longint; + TmpByte : Longint; + BufFlag : Longint; + TmpError: Longint; +begin + BufFlag := 00; + TmpByte := 01; + + REPEAT + BytesSnt := SockSend(ClientRC, + @TempStr[TmpByte], + Length(TempStr), + BufFlag); + + if BytesSnt > 0 then + Inc(TmpByte, BytesSnt) + else begin + TmpError := SockErrorNo; + if TmpError <> WSAEWOULDBLOCK then EXIT; + end; { else } + + UNTIL (TmpByte > Length(TempStr)); +end; { proc. Com_SendRawStr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_SendWill(Option: Char): String; +begin + Result[1] := TELNET_IAC; + Result[2] := TELNET_WILL; + Result[3] := Option; + SetLength(Result, 3); +end; { func. Com_SendWill } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_SendWont(Option: Char): String; +begin + Result[1] := TELNET_IAC; + Result[2] := TELNET_WONT; + Result[3] := Option; + SetLength(Result, 3); +end; { func. Com_SendWont } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_SendDo(Option: Char): String; +begin + Result[1] := TELNET_IAC; + Result[2] := TELNET_DO; + Result[3] := Option; + SetLength(Result, 3); +end; { func. Com_SendDo } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_PrepareBufferRead(var CurBuffer: CharBufType; var TempOut: BufArrayObj; BlockLen: Longint); +var Counter : Longint; +begin + Counter := 00; + if BlockLen = 0 then EXIT; + + While Counter <= (Blocklen - 01) do + begin + {-- and now handle the IAC state ---------------------------------------} + Case IacState of + 1 : begin { DO / DONT } + {-- we received an IAC, and this is the next char --------------} + if CurBuffer[Counter] = TELNET_IAC then + begin + TempOut.Put(CurBuffer[Counter], 1); + IacState := 0; { reset parser state } + end + else begin + IacState := 2; + + Case CurBuffer[Counter] of + TELNET_DONT, + TELNET_DO : IacDontDo := 1; + else IacDontDo := 0; + end; { case } + end; { else } + end; { DO/DONT } + 2 : begin { WHAT } +{ if IacDontDo = 1 then } + begin + Case CurBuffer[Counter] of + TELNETOPT_BINARY, + TELNETOPT_SUPGA, + TELNETOPT_ECHO : begin + Com_SendRawStr(Com_SendWill(CurBuffer[Counter])); + end + else begin + Com_SendRawStr(Com_SendWont(CurBuffer[Counter])); + end; { if } + end; { case } + end; { if this is a state we will reply to } + + IacState := 0; { reset IAC state machine } + end; { WHAT } + else begin + if CurBuffer[Counter] = TELNET_IAC then + begin + IacState := 1 + end + else TempOut.Put(CurBuffer[Counter], 1); + end; { else } + end; { case } + + {-- and loop through the buffer ----------------------------------------} + Inc(Counter); + end; { while } + +end; { proc. Com_PrepareBufferRead } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_PrepareBufferWrite(var CurBuffer, TmpOutBuffer: CharBufType; var BlockLen: Longint); +var Counter : Longint; + NewCounter: Longint; +begin + Counter := 00; + NewCounter := 00; + if BlockLen = 0 then EXIT; + + While Counter <= Blocklen do + begin + Case CurBuffer[Counter] of + TELNET_IAC : begin { Escape command character } + TmpOutBuffer[NewCounter] := TELNET_IAC; + Inc(NewCounter); + TmpOutBuffer[NewCounter] := TELNET_IAC; + Inc(NewCounter); + end; { if } + else begin + TmpOutBuffer[NewCounter] := CurBuffer[Counter]; + Inc(NewCounter); + end; { if } + end; { case } + + Inc(Counter); + end; { while } + + BlockLen := NewCounter - 1; +end; { proc. Com_PrepareBufferWrite } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_ReadProc(var TempPtr: Pointer); +var Available : Boolean; + BytesRead : Longint; + BlockLen : Longint; + ReturnCode: Longint; +begin + repeat + if DoRxEvent^.WaitForEvent(ReadTimeOut) then + if NOT EndThreads then + begin + CriticalRx^.EnterExclusive; + Available := (SockSelect(ClientRC) > 00); + + DoRxEvent^.ResetEvent; + + if (Available) OR (NeedNewCarrier) then + begin + {----------- Start reading the gathered date -------------------} + NeedNewCarrier := false; + + if InBuffer^.BufRoom > 0 then + begin + BlockLen := InBuffer^.BufRoom; + if BlockLen > 1024 then + BlockLen := 1024; + + if BlockLen > 00 then + begin + BytesRead := SockRecv(ClientRC, + @InBuffer^.TmpBuf, + BlockLen, + 0); + + if BytesRead = 0 then + begin + TelnetCarrier := false; + + ReturnCode := SockErrorNo; + + ErrorStr := 'Error in communications(1), #'+IntToStr(Returncode)+ ' / '+SysErrorMessage(Returncode); + end; { if } + + if BytesRead = -1 then + begin + ReturnCode := SockErrorNo; + + if ReturnCode <> WSAEWOULDBLOCK then + begin + TelnetCarrier := false; + + ErrorStr := 'Error in communications(2), #'+IntToStr(ReturnCode)+ ' / '+SysErrorMessage(ReturnCode); + EndThreads := true; + end; { if } + end; { error } + + if BytesRead > 00 then + begin + Com_PrepareBufferRead(InBuffer^.TmpBuf, InBuffer^, BytesRead); + end; { if } + end; { if } + end; { if } + end; { if available } + + CriticalRx^.LeaveExclusive; + end; { if RxEvent } + until EndThreads; + + RxClosedEvent^.SignalEvent; + ExitThisThread; +end; { proc. Com_ReadProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_WriteProc(var TempPtr: Pointer); +var BlockLen : Longint; + Written : Longint; + ReturnCode : Longint; + TempBuf : ^CharBufType; +begin + New(TempBuf); + + repeat + if DoTxEvent^.WaitForEvent(WriteTimeOut) then + if NOT EndThreads then + begin + CriticalTx^.EnterExclusive; + DoTxEvent^.ResetEvent; + + if OutBuffer^.BufUsed > 00 then + begin + BlockLen := OutBuffer^.Get(OutBuffer^.TmpBuf, OutBuffer^.BufUsed, false); + + Com_PrepareBufferWrite(OutBuffer^.TmpBuf, TempBuf^, BlockLen); + Written := SockSend(ClientRC, + TempBuf, + BlockLen, + 0); + {-- remove the data from the buffer, but only remove the data ---} + {-- thats actually written --------------------------------------} + ReturnCode := OutBuffer^.Get(OutBuffer^.TmpBuf, Written, true); + + if ReturnCode <> Longint(Written) then + begin + { not everything is removed! } + end; { if } + + {-- if theres data in the buffer left, run this event again -----} + if Written <> BlockLen then + begin + DoTxEvent^.SignalEvent; + end; { if } + end; { if } + + CriticalTx^.LeaveExclusive; + end; { if } + + until EndThreads; + + Dispose(TempBuf); + + TxClosedEvent^.SignalEvent; + ExitThisThread; +end; { proc. Com_WriteProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_StartThread: Boolean; +begin + Result := false; + EndThreads := false; + if ThreadsInitted then EXIT; + ThreadsInitted := true; + + {----------------------- Create all the events ----------------------------} + New(DoTxEvent, Init); + if NOT DoTxEvent^.CreateEvent(false) then EXIT; + + New(DoRxEvent, Init); + if NOT DoRxEvent^.CreateEvent(false) then EXIT; + + New(RxClosedEvent, Init); + if NOT RxClosedEvent^.CreateEvent(false) then EXIT; + + New(TxClosedEvent, Init); + if NOT TxClosedEvent^.CreateEvent(false) then EXIT; + + {-------------- Startup the buffers and overlapped events -----------------} + New(InBuffer, Init(InBufSize)); + New(OutBuffer, Init(OutBufSize)); + + {-------------------- Startup a seperate write thread ---------------------} + New(CriticalTx, Init); + CriticalTx^.CreateExclusive; + + New(TxThread, Init); + if NOT TxThread^.CreateThread(16384, { Stack size } + WriteProcPtr, { Actual procedure } + nil, { Parameters } + 0) { Creation flags } + then EXIT; + + {-------------------- Startup a seperate read thread ----------------------} + New(CriticalRx, Init); + CriticalRx^.CreateExclusive; + + New(RxThread, Init); + if NOT RxThread^.CreateThread(16384, { Stack size } + ReadProcPtr, { Actual procedure } + nil, { Parameters } + 0) { Creation flags } + then EXIT; + + Result := true; +end; { proc. Com_StartThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_InitVars; +begin + DoTxEvent := nil; + DoRxEvent := nil; + RxClosedEvent := nil; + TxClosedEvent := nil; + TxThread := nil; + RxThread := nil; + + InBuffer := nil; + OutBuffer := nil; + CriticalRx := nil; + CriticalTx := nil; +end; { proc. Com_InitVars } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_StopThread; +begin + EndThreads := true; + ThreadsInitted := false; + + if DoTxEvent <> nil then DoTxEvent^.SignalEvent; + if DoTxEvent <> nil then DoRxEvent^.SignalEvent; + + if TxThread <> nil then TxThread^.CloseThread; + if RxThread <> nil then RxThread^.CloseThread; + + if TxClosedEvent <> nil then + if NOT TxClosedEvent^.WaitForEvent(1000) then + TxThread^.TerminateThread(0); + + if RxClosedEvent <> nil then + if NOT RxClosedEvent^.WaitForEvent(1000) then + RxThread^.TerminateThread(0); + + if TxThread <> nil then Dispose(TxThread, Done); + if RxThread <> nil then Dispose(RxThread, Done); + + if DoTxEvent <> nil then Dispose(DoTxEvent, Done); + if DoRxEvent <> nil then Dispose(DoRxEvent, Done); + if RxClosedEvent <> nil then Dispose(RxClosedEvent, Done); + if TxClosedEvent <> nil then Dispose(TxClosedEvent, Done); + + if CriticalTx <> nil then Dispose(CriticalTx, Done); + if CriticalRx <> nil then Dispose(CriticalRx, Done); + + if InBuffer <> nil then Dispose(InBuffer, Done); + if OutBuffer <> nil then Dispose(OutBuffer, Done); + + Com_InitVars; +end; { proc. Com_StopThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_GetHandle: Longint; +begin + Result := ClientRC; +end; { func. Com_GetHandle } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_OpenQuick(Handle: Longint); +var ReturnCode: Longint; +begin + ClientRC := Handle; + + if (NOT (SockInit=0)) then + begin + ReturnCode := SockErrorNo; + + ErrorStr := 'Error in initializing socket, #'+IntToStr(Returncode)+ ' / '+SysErrorMessage(Returncode); + InitFailed := true; + end + else InitFailed := NOT Com_StartThread; + + { Set the telnet to binary transmission } + Com_SendRawStr(Com_SendWill(TELNETOPT_ECHO)); + Com_SendRawStr(Com_SendWill(TELNETOPT_BINARY)); +end; { proc. TTelnetObj.Com_OpenQuick } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_OpenKeep(Comport: Byte): Boolean; +begin + InitFailed := NOT Com_StartThread; + Com_OpenKeep := InitFailed; +end; { func. Com_OpenKeep } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; +begin + Com_Open := true; +end; { func. TTelnetObj.Com_OpenCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); +begin + // Duhhh ;) +end; { proc. TTelnetObj.Com_SetLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_Close; +begin + if DontClose then EXIT; + + if ClientRC <> -1 then + begin + Com_StopThread; + SockShutdown(ClientRC, 02); + SockClose(ClientRC); + + ClientRC := -1; + end; { if } + +end; { func. TTelnetObj.Com_CloseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_SendChar(C: Char): Boolean; +var Written: Longint; +begin + Com_SendBlock(C, SizeOf(C), Written); + Com_SendChar := (Written = SizeOf(c)); +end; { proc. TTelnetObj.Com_SendChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_GetChar: Char; +var Reads: Longint; +begin + Com_ReadBlock(Result, SizeOf(Result), Reads); +end; { func. TTelnetObj.Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_PeekChar: Char; +var Reads: Longint; +begin + Com_PeekBlock(Result, SizeOf(Result), Reads); +end; { func. TTelnetObj.Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); +begin + if OutBuffer^.BufRoom < BlockLen then + repeat + {$IFDEF WIN32} + Sleep(1); + {$ENDIF} + + {$IFDEF OS2} + DosSleep(1); + {$ENDIF} + until (OutBuffer^.BufRoom >= BlockLen) OR (NOT Com_Carrier); + + CriticalTx^.EnterExclusive; + Written := OutBuffer^.Put(Block, BlockLen); + CriticalTx^.LeaveExclusive; + + DoTxEvent^.SignalEvent; +end; { proc. TTelnetObj.Com_SendBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); +begin + if InBuffer^.BufUsed < BlockLen then + begin + DoRxEvent^.SignalEvent; + + repeat + {$IFDEF OS2} + DosSleep(1); + {$ENDIF} + + {$IFDEF WIN32} + Sleep(1); + {$ENDIF} + + if Com_CharAvail then + DoRxEvent^.SignalEvent; + until (InBuffer^.BufUsed >= BlockLen) OR (NOT Com_Carrier); + end; { if } + + Reads := InBuffer^.Get(Block, BlockLen, true); +end; { proc. TTelnetObj.Com_ReadBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_PeekBlock(var Block; BlockLen: Longint; var Reads: Longint); +begin + if InBuffer^.BufUsed < BlockLen then + begin + DoRxEvent^.SignalEvent; + + repeat + {$IFDEF OS2} + DosSleep(1); + {$ENDIF} + + {$IFDEF WIN32} + Sleep(1); + {$ENDIF} + + if Com_CharAvail then + DoRxEvent^.SignalEvent; + until (InBuffer^.BufUsed >= BlockLen) OR (NOT Com_Carrier); + end; { if } + + Reads := InBuffer^.Get(Block, BlockLen, false); +end; { proc. TTelnetObj.Com_PeekBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_CharAvail: Boolean; +begin + if InBuffer^.BufUsed < 1 then + begin + if (SockSelect(ClientRC) > 0) then + DoRxEvent^.SignalEvent; + end; { if } + + Result := (InBuffer^.BufUsed > 0); +end; { func. TTelnetObj.Com_CharAvail } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_Carrier: Boolean; +begin + if TelnetCarrier then { Carrier is only lost in 'read' sections } + begin + DoRxEvent^.SignalEvent; + NeedNewCarrier := true; + end; { if } + + Result := TelnetCarrier; +end; { func. TTelnetObj.Com_Carrier } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_GetModemStatus(var LineStatus, ModemStatus: Byte); +begin + LineStatus := 00; + ModemStatus := 08; + + if Com_Carrier then ModemStatus := ModemStatus OR (1 SHL 7); +end; { proc. TTelnetObj.Com_GetModemStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_SetDtr(State: Boolean); +begin + if NOT State then + begin + Com_Close; + end; { if } +end; { proc. TTelnetObj.Com_SetDtr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_GetBpsRate: Longint; +begin + Com_GetBpsRate := 115200; +end; { func. TTelnetObj.Com_GetBpsRate } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); +begin + DoRxEvent^.SignalEvent; + DoTxEvent^.SignalEvent; + + InFree := InBuffer^.BufRoom; + OutFree := OutBuffer^.BufRoom; + InUsed := InBuffer^.BufUsed; + OutUsed := OutBuffer^.BufUsed; +end; { proc. TTelnetObj.Com_GetBufferStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_PurgeInBuffer; +begin + CriticalRx^.EnterExclusive; + + InBuffer^.Clear; + + CriticalRx^.LeaveExclusive; +end; { proc. TTelnetObj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_PurgeOutBuffer; +begin + CriticalTx^.EnterExclusive; + + OutBuffer^.Clear; + + CriticalTx^.LeaveExclusive; +end; { proc. TTelnetObj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TTelnetObj.Com_ReadyToSend(BlockLen: Longint): Boolean; +begin + Result := OutBuffer^.BufRoom >= BlockLen; +end; { func. ReadyToSend } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_PauseCom(CloseCom: Boolean); +begin + if CloseCom then Com_Close + else Com_StopThread; +end; { proc. Com_PauseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_ResumeCom(OpenCom: Boolean); +begin + if OpenCom then Com_OpenKeep(0) + else Com_StartThread; +end; { proc. Com_ResumeCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TTelnetObj.Com_SetDataProc(ReadPtr, WritePtr: Pointer); +begin + ReadProcPtr := ReadPtr; + WriteProcPtr := WritePtr; +end; { proc. Com_SetDataProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +end. diff --git a/SOURCE/ELECOM/THREADS.PAS b/SOURCE/ELECOM/THREADS.PAS new file mode 100644 index 0000000..2928452 --- /dev/null +++ b/SOURCE/ELECOM/THREADS.PAS @@ -0,0 +1,421 @@ +unit THREADS; +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.1, (OS/2, Win32) +** FreePascal v0.99.12 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.01 +** Created : 07-Mar-1999 +** Last update : 26-Sep-1999 +** +** Note: (c) 1998-1999 by Maarten Bekers +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +{$IFDEF OS2} + uses Os2Base; +{$ENDIF} + +{$IFDEF WIN32} + uses Windows; +{$ENDIF} + +{$IFDEF OS2} + Type THandle = Longint; + DWORD = Longint; +{$ENDIF} + +{$IFDEF WIN32} + {$IFDEF FPC} + Type THandle = Handle; + {$ENDIF} +{$ENDIF} + +type TSysEventObj = Object + {$IFDEF OS2} + SemHandle: HEV; + {$ENDIF} + + {$IFDEF WIN32} + SemHandle: THandle; + {$ENDIF} + + constructor init; + destructor done; + + procedure DisposeEvent; + procedure SignalEvent; + procedure ResetEvent; + function CreateEvent(InitialState: Boolean): Boolean; + function WaitForEvent(TimeOut: Longint): Boolean; + end; { TSysEventObj } + +Type PSysEventObj = ^TSysEventObj; + +type TExclusiveObj = Object + {$IFDEF OS2} + Exclusive: PHMtx; + {$ENDIF} + + {$IFDEF WIN32} + Exclusive: PRTLCriticalSection; + {$ENDIF} + + constructor Init; + destructor Done; + + procedure CreateExclusive; + procedure DisposeExclusive; + + procedure EnterExclusive; + procedure LeaveExclusive; + end; { TExclusiveObj } + +Type PExclusiveObj = ^TExclusiveObj; + + +type TThreadsObj = Object + ThreadHandle : THandle; + ThreadID : DWORD; + ThreadClosed : Boolean; + + constructor Init; + destructor Done; + + function CreateThread(StackSize : Longint; + CallProc, + Parameters : Pointer; + CreationFlags: Longint): Boolean; + procedure CloseThread; + procedure TerminateThread(ExitCode: Longint); + end; { TThreadsObj } + +Type PThreadsObj = ^TThreadsObj; + +procedure ExitThisThread; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +constructor TSysEventObj.Init; +begin + SemHandle := 0; +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor TSysEventObj.Done; +begin + if Longint(SemHandle) <> -1 then + begin + SignalEvent; + DisposeEvent; + end; { if } +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TSysEventObj.CreateEvent(InitialState: Boolean): Boolean; +{$IFDEF OS2} +var Returncode: longint; +{$ENDIF} +begin + CreateEvent := true; + + {$IFDEF WIN32} + SemHandle := Windows.CreateEvent(nil, true, InitialState, nil); + if Longint(SemHandle) = -1 then CreateEvent := false; + {$ENDIF} + + {$IFDEF OS2} + returncode := DosCreateEventSem(nil, SemHandle, 0, InitialState); + CreateEvent := (returncode=0); + {$ENDIF} +end; { func. CreateEvent } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TSysEventObj.SignalEvent; +{$IFDEF OS2} +var RC: Longint; +{$ENDIF} +begin + {$IFDEF WIN32} + if Longint(SemHandle) <> -1 then + SetEvent(SemHandle); + {$ENDIF} + + {$IFDEF OS2} + if SemHandle <> -1 then + RC := DosPostEventSem(SemHandle); + {$ENDIF} +end; { proc. SignalEvent } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TSysEventObj.ResetEvent; +{$IFDEF OS2} +var Flag: Longint; + RC : Longint; +{$ENDIF} +begin + {$IFDEF WIN32} + if SemHandle <> THandle(-1) then + Windows.ResetEvent(SemHandle); + {$ENDIF} + + {$IFDEF OS2} + Flag := 0; + if SemHandle <> -1 then + RC := DosResetEventSem(SemHandle, Flag); + {$ENDIF} +end; { proc. ResetEvent } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TSysEventObj.WaitForEvent(TimeOut: Longint): Boolean; +var ReturnCode: Longint; +{$IFDEF OS2} + Flag : Longint; +{$ENDIF} +begin + {$IFDEF WIN32} + if SemHandle <> THandle(-1) then + ReturnCode := WaitForSingleObject(SemHandle, Timeout) + else ReturnCode := 0; + + WaitForEvent := (ReturnCode = WAIT_OBJECT_0); + {$ENDIF} + + {$IFDEF OS2} + if SemHandle <> -1 then + ReturnCode := DosWaitEventSem(SemHandle, TimeOut); + + Flag := 0; + DosResetEventSem(SemHandle, Flag); + WaitForEvent := (ReturnCode = 0); +{$ENDIF} +end; { func. WaitForEvent } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TSysEventObj.DisposeEvent; +{$IFDEF OS2} +var Flag: Longint; +{$ENDIF} +begin + {$IFDEF WIN32} + if SemHandle <> THandle(-1) then CloseHandle(SemHandle); + SemHandle := 0; + {$ENDIF} + + {$IFDEF OS2} + Flag := 0; + if SemHandle <> -1 then DosCloseEventSem(SemHandle); + SemHandle := -1; + {$ENDIF} +end; { proc. DisposeEvent } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +constructor TExclusiveObj.Init; +begin + Exclusive := nil; +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor TExclusiveObj.Done; +begin + if Exclusive <> nil then + DisposeExclusive; +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TExclusiveObj.CreateExclusive; +begin + {$IFDEF WIN32} + New(Exclusive); + InitializeCriticalSection(Exclusive^); + {$ENDIF} + + {$IFDEF OS2} + New(Exclusive); + DosCreateMutexSem(nil, Exclusive^, dcmw_Wait_All, false); + {$ENDIF} +end; { proc. CreateExclusive } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TExclusiveObj.DisposeExclusive; +begin + {$IFDEF WIN32} + if Exclusive <> nil then + begin + DeleteCriticalSection(Exclusive^); + Dispose(Exclusive); + end; { if } + + Exclusive := nil; + {$ENDIF} + + {$IFDEF OS2} + if Exclusive <> nil then + begin + DosCloseMutexSem(Exclusive^); + Dispose(Exclusive); + end; { if } + + Exclusive := nil; + {$ENDIF} +end; { proc. DisposeExclusive } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TExclusiveObj.EnterExclusive; +begin + {$IFDEF WIN32} + EnterCriticalSection(Exclusive^); + {$ENDIF} + + {$IFDEF OS2} + DosRequestMutexSem(Exclusive^, sem_Indefinite_Wait); + {$ENDIF} +end; { proc. EnterExclusive } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TExclusiveObj.LeaveExclusive; +begin + {$IFDEF WIN32} + LeaveCriticalSection(Exclusive^); + {$ENDIF} + + {$IFDEF OS2} + DosReleaseMutexSem(Exclusive^); + {$ENDIF} +end; { proc. LeaveExclusive } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +constructor TThreadsObj.Init; +begin + ThreadHandle := 0; + ThreadId := 0; +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor TThreadsObj.Done; +begin + CloseThread; + ThreadHandle := 0; +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TThreadsObj.CreateThread(StackSize : Longint; + CallProc, + Parameters : Pointer; + CreationFlags: Longint): Boolean; +var ReturnCode: Longint; +begin + ThreadClosed := FALSE; + + {$IFNDEF VirtualPascal} + {$IFDEF WIN32} + ThreadHandle := Windows.CreateThread(nil, { Security attrs } + StackSize, { Stack size } + CallProc, { Actual procedure } + Parameters, { Parameters } + CreationFlags, { Creation flags } + ThreadID); { Thread ID ?? } + + CreateThread := (ThreadHandle <> THandle(-1)); + {$ENDIF} + + {$IFDEF OS2} + ReturnCode := + DosCreateThread(ThreadHandle, { ThreadHandle } + CallProc, { Actual procedure } + Longint(Parameters), { Parameters } + CreationFlags, { Creation flags } + StackSize); { Stacksize } + + CreateThread := (ReturnCode = 0); + if ReturnCode <> 0 then ThreadHandle := -1; + {$ENDIF} + + {$IFDEF LINUX} + + {$ENDIF} + + + {$ELSE} + ThreadHandle := BeginThread(nil, StackSize, CallProc, Parameters, 0, ReturnCode); + CreateThread := (ThreadHandle > THandle(-1)); + {$ENDIF} +end; { proc. CreateThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TThreadsObj.CloseThread; +begin + ThreadClosed := TRUE; + + {$IFDEF WIN32} + if ThreadHandle <> Thandle(-1) then CloseHandle(ThreadHandle); + ThreadHandle := 0; + {$ENDIF} + + {$IFDEF OS2} + {!! DosClose() on a ThreadHandle doesn't work - will eventually close } + {!! other handles ... } + { if ThreadHandle <> -1 then DosClose(ThreadHandle); } + ThreadHandle := -1; + {$ENDIF} +end; { proc. CloseThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TThreadsObj.TerminateThread(ExitCode: Longint); +begin + ThreadClosed := TRUE; + + {$IFDEF WIN32} + if ThreadHandle <> Thandle(-1) then + Windows.TerminateThread(ThreadHandle, ExitCode); + ThreadHandle := 00; + {$ENDIF} + + {$IFDEF OS2} + if ThreadHandle <> -1 then DosKillThread(ThreadHandle); + ThreadHandle := -1; + {$ENDIF} +end; { proc. TerminateThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure ExitThisThread; +begin + {$IFDEF WIN32} + Windows.ExitThread(0); + {$ENDIF} + + {$IFDEF OS2} + Os2Base.DosExit(exit_Thread, 0); + {$ENDIF} +end; { proc. ExitThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +end. diff --git a/SOURCE/ELECOM/W32SNGL.PAS b/SOURCE/ELECOM/W32SNGL.PAS new file mode 100644 index 0000000..c1afec6 --- /dev/null +++ b/SOURCE/ELECOM/W32SNGL.PAS @@ -0,0 +1,824 @@ +unit W32SNGL; +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.1, (OS/2, Win32) +** FreePascal v0.99.15 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.02 +** Created : 09-Sep-1999 +** Last update : 21-Jul-2001 +** +** Note: (c) 1998-2000 by Maarten Bekers +** +** Note2: The problem with this approach that we only retrieve the data when +** we want to. If data arrives and we dont call either Com_ReadBlock(), +** Com_CharAvail or Com_GetBufferStatus() we dont receive the data. +** Therefore, we rely on Windows to actually buffer the data. We do this +** by calling SetupComm() with the buffer-sizes as defined by +** Win32OutBufSize and Win32InBufSize. +** If you want to avoid this, you can implement another mutex that you +** let set by Win32's API calls SetEventMask() and WaitCommEvent(). +** That way, you can also monitor other events which would eliminate +** some overhead. In general, this approach will suffice. +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses Windows, Combase, BufUnit, Threads + {$IFDEF VirtualPascal} + ,Use32 + {$ENDIF}; + +Const DataTimeout = 20000; { Wait max. 20 secs } + + InBufSize = 1024 * 32; + OutBufSize = 1024 * 32; + Win32OutBufSize = 1024 * 3; + Win32InBufSize = 1024 * 3; + + +type TWin32Obj = Object(TCommObj) + DataProcPtr: Pointer; { Pointer to TX/RX handler (thread) } + ThreadsInitted: Boolean; { Are the thread(s) up and running? } + + SaveHandle : THandle; + + InitPortNr : Longint; + InitHandle : Longint; + + ReadOL : TOverLapped; { Overlapped structure for ReadFile } + WriteOL : TOverLapped; { Overlapped structure for WriteFile } + + InBuffer : ^BufArrayObj; { Buffer system internally used } + OutBuffer : ^BufArrayObj; + + ReadEvent : PSysEventObj; { Event set by ReadFile overlapped routine } + WriteEvent : PSysEventObj; { Event set by WriteFile overlapped routine } + + DoTxEvent : PSysEventObj;{ Event manually set when we have to transmit } + DoRxEvent : PSysEventObj; { Event manually set when we want data } + + DataClosedEvent: PSysEventObj; { Event set when the Tx thread is closed } + + CriticalTx : PExclusiveObj; { Critical sections } + CriticalRx : PExclusiveObj; + + DataThread : PThreadsObj; + EndThreads : Boolean; { Set to true when we have to end the threads } + + + constructor Init; + destructor Done; + + function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; virtual; + function Com_OpenKeep(Comport: Byte): Boolean; virtual; + function Com_GetChar: Char; virtual; + function Com_CharAvail: Boolean; virtual; + function Com_Carrier: Boolean; virtual; + function Com_SendChar(C: Char): Boolean; virtual; + function Com_ReadyToSend(BlockLen: Longint): Boolean; virtual; + function Com_GetBPSrate: Longint; virtual; + function Com_GetHandle: Longint; virtual; + + procedure Com_OpenQuick(Handle: Longint); virtual; + procedure Com_Close; virtual; + procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); virtual; + procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); virtual; + procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); virtual; + procedure Com_SetDtr(State: Boolean); virtual; + procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); virtual; + procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); virtual; + procedure Com_PurgeInBuffer; virtual; + procedure Com_PurgeOutBuffer; virtual; + procedure Com_FlushOutBuffer(Slice: SliceProc); virtual; + + procedure Com_PauseCom(CloseCom: Boolean); virtual; + procedure Com_ResumeCom(OpenCom: Boolean); virtual; + procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); virtual; + + procedure Com_SetDataProc(ReadPtr, WritePtr: Pointer); virtual; + procedure Com_DataProc(var TempPtr: Pointer); virtual; + + function Com_StartThread: Boolean; + procedure Com_InitVars; + procedure Com_StopThread; + procedure Com_InitDelayTimes; + end; { object TWin32Obj } + +type PWin32Obj = ^TWin32Obj; + + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses SysUtils; + +{$IFDEF FPC} + {$I WINDEF.FPC} +{$ENDIF} + +const + dcb_Binary = $00000001; + dcb_ParityCheck = $00000002; + dcb_OutxCtsFlow = $00000004; + dcb_OutxDsrFlow = $00000008; + dcb_DtrControlMask = $00000030; + dcb_DtrControlDisable = $00000000; + dcb_DtrControlEnable = $00000010; + dcb_DtrControlHandshake = $00000020; + dcb_DsrSensivity = $00000040; + dcb_TXContinueOnXoff = $00000080; + dcb_OutX = $00000100; + dcb_InX = $00000200; + dcb_ErrorChar = $00000400; + dcb_NullStrip = $00000800; + dcb_RtsControlMask = $00003000; + dcb_RtsControlDisable = $00000000; + dcb_RtsControlEnable = $00001000; + dcb_RtsControlHandshake = $00002000; + dcb_RtsControlToggle = $00003000; + dcb_AbortOnError = $00004000; + dcb_Reserveds = $FFFF8000; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +constructor TWin32Obj.Init; +begin + inherited Init; + + InitPortNr := -1; + InitHandle := -1; + ThreadsInitted := false; + Com_Initvars; +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor TWin32Obj.Done; +begin + inherited done; +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_DataProc(var TempPtr: Pointer); +var Success : Boolean; + Props : TCommProp; + ObjectCode : Longint; + ReturnCode : Longint; + DidRead : DWORD; + Written : DWORD; + BlockLen : DWORD; + ObjectArray : Array[0..1] of THandle; + TryReading : Boolean; + Stats : TComStat; + ErrMask : DWORD; +begin + ObjectArray[0] := DoTxEvent^.SemHandle; + ObjectArray[1] := DoRxEvent^.SemHandle; + + repeat + ObjectCode := WaitForMultipleObjects(2, + @ObjectArray, + false, + DataTimeOut); + if EndThreads then EXIT; + + {-----------------------------------------------------------------------} + {-------------------------- Receive signalled --------------------------} + {-----------------------------------------------------------------------} + if (ObjectCode - WAIT_OBJECT_0) = 1 then { DoReceive } + begin + DidRead := 00; + if (EndThreads) then EXIT; + + {-- Make sure there is something to be read ------------------------} + ErrMask := 0; + TryReading := FALSE; + + if ClearCommError(SaveHandle, ErrMask, @Stats) then + if Stats.cbInQue > 0 then + TryReading := TRUE; + + + {----------------- Start reading the gathered date -----------------} + if TryReading then + begin + CriticalRx^.EnterExclusive; + + FillChar(Props, SizeOf(TCommProp), 0); + if GetCommProperties(SaveHandle, Props) then + if InBuffer^.BufRoom > 0 then + begin + BlockLen := Props.dwCurrentRxQueue; + { We want the complete BUFFER size, and not } + { the actual queue size. The queue may have } + { grown since last query, and we always } + { want as much data as possible } + + if Longint(BlockLen) > InBuffer^.BufRoom then + BlockLen := InBuffer^.BufRoom; + + Success := ReadFile(SaveHandle, + InBuffer^.TmpBuf, + BlockLen, + DidRead, + @ReadOL); + + if NOT Success then + begin + ReturnCode := GetLastError; + + if ReturnCode = ERROR_IO_PENDING then + begin + ReturnCode := WaitForSingleObject(ReadOL.hEvent, DataTimeOut); + + if ReturnCode = WAIT_OBJECT_0 then + begin + GetOverLappedResult(SaveHandle, ReadOL, DidRead, false); + end; { if } + end; { if } + end + else GetOverlappedResult(SaveHandle, ReadOL, DidRead, false); + + if DidRead > 00 then + begin + InBuffer^.Put(InBuffer^.TmpBuf, DidRead); + DoRxEvent^.ResetEvent; + end; { if } + end; { if } + + CriticalRx^.LeaveExclusive; + end; { try reading } + end; { DoReceive call } + + {-----------------------------------------------------------------------} + {-------------------------- Transmit signalled -------------------------} + {-----------------------------------------------------------------------} + if (ObjectCode - WAIT_OBJECT_0) = 0 then { DoTransmit } + begin + CriticalTx^.EnterExclusive; + DoTxEvent^.ResetEvent; + + if OutBuffer^.BufUsed > 00 then + begin + Written := 00; + BlockLen := OutBuffer^.Get(OutBuffer^.TmpBuf, OutBuffer^.BufUsed, false); + + Success := WriteFile(SaveHandle, + OutBuffer^.TmpBuf, + BlockLen, + Written, + @WriteOL); + if NOT Success then + begin + ReturnCode := GetLastError; + + if ReturnCode = ERROR_IO_PENDING then + begin + ReturnCode := WaitForSingleObject(WriteOL.hEvent, DataTimeOut); + + if ReturnCode = WAIT_OBJECT_0 then + begin + if GetOverLappedResult(SaveHandle, WriteOL, Written, false) then + begin + ResetEvent(WriteOL.hEvent); + end; { if } + end; { if } + end; { result is pending } + end { if } + else begin + + if GetOverLappedResult(SaveHandle, WriteOL, Written, false) then + begin + ResetEvent(WriteOL.hEvent); + end; { if } + end; { if (did succeed) } + + {-- remove the data from the buffer, but only remove the data ---} + {-- thats actually written --------------------------------------} + ReturnCode := OutBuffer^.Get(OutBuffer^.TmpBuf, Written, true); + if ReturnCode <> Longint(Written) then + begin + { not everything is removed! } + end; { if } + + {-- if theres data in the buffer left, run this event again -----} + if Written <> BlockLen then + DoTxEvent^.SignalEvent; + end; { if } + + CriticalTx^.LeaveExclusive; + end; { DoTransmit call } + + + until EndThreads; + + DataClosedEvent^.SignalEvent; + ExitThisThread; +end; { proc. ComDataProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_StartThread: Boolean; +begin + Result := false; + EndThreads := false; + if ThreadsInitted then EXIT; + ThreadsInitted := true; + + {----------------------- Create all the events ----------------------------} + New(ReadEvent, Init); + if NOT ReadEvent^.CreateEvent(true) then EXIT; + + New(WriteEvent, Init); + if NOT WriteEvent^.CreateEvent(true) then EXIT; + + New(DoTxEvent, Init); + if NOT DoTxEvent^.CreateEvent(false) then EXIT; + + New(DoRxEvent, Init); + if NOT DoRxEvent^.CreateEvent(false) then EXIT; + + New(DataClosedEvent, Init); + if NOT DataClosedEvent^.CreateEvent(false) then EXIT; + + {-------------- Startup the buffers and overlapped events -----------------} + FillChar(WriteOL, SizeOf(tOverLapped), 0); + FillChar(ReadOL, SizeOf(tOverLapped), 0); + WriteOl.hEvent := WriteEvent^.SemHandle; + ReadOl.hEvent := ReadEvent^.SemHandle; + + New(InBuffer, Init(InBufSize)); + New(OutBuffer, Init(OutBufSize)); + + {-------------------- Startup the critical section objects ----------------} + New(CriticalTx, Init); + CriticalTx^.CreateExclusive; + + New(CriticalRx, Init); + CriticalRx^.CreateExclusive; + + {-------------------- Startup a seperate tx / rx thread -------------------} + New(DataThread, Init); + if NOT DataThread^.CreateThread(16384, { Stack size } + DataProcPtr, { Actual procedure } + nil, { Parameters } + 0) { Creation flags } + then EXIT; + + Result := true; +end; { proc. Com_StartThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_InitVars; +begin + DoTxEvent := nil; + DoRxEvent := nil; + DataClosedEvent := nil; + DataThread := nil; + ReadEvent := nil; + WriteEvent := nil; + + InBuffer := nil; + OutBuffer := nil; + CriticalRx := nil; + CriticalTx := nil; +end; { proc. Com_InitVars } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_StopThread; +begin + EndThreads := true; + ThreadsInitted := false; + + if DoTxEvent <> nil then DoTxEvent^.SignalEvent; + if DoTxEvent <> nil then DoRxEvent^.SignalEvent; + if DataThread <> nil then DataThread^.CloseThread; + + if DataClosedEvent <> nil then + if NOT DataClosedEvent^.WaitForEvent(1000) then + DataThread^.TerminateThread(0); + + if DataThread <> nil then Dispose(DataThread, Done); + if DoTxEvent <> nil then Dispose(DoTxEvent, Done); + if DoRxEvent <> nil then Dispose(DoRxEvent, Done); + if DataClosedEvent <> nil then Dispose(DataClosedEvent, Done); + if ReadEvent <> nil then Dispose(ReadEvent, Done); + if WriteEvent <> nil then Dispose(WriteEvent, Done); + + if CriticalTx <> nil then Dispose(CriticalTx, Done); + if CriticalRx <> nil then Dispose(CriticalRx, Done); + + if InBuffer <> nil then Dispose(InBuffer, Done); + if OutBuffer <> nil then Dispose(OutBuffer, Done); + + Com_InitVars; +end; { proc. Com_StopThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_InitDelayTimes; +var CommTimeOut: TCommTimeouts; + RC : Longint; +begin + FillChar(CommTimeOut, SizeOf(TCommTimeOuts), 00); + CommTimeOut.ReadIntervalTimeout := MAXDWORD; + + if NOT SetCommTimeOuts(SaveHandle, CommTimeOut) then + begin + RC := GetLastError; + ErrorStr := 'Error setting communications timeout: #'+IntToStr(RC) + ' / ' + SysErrorMessage(rc); + end; { if } + +end; { proc. InitDelayTimes } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_GetHandle: Longint; +begin + Result := SaveHandle; +end; { func. Com_GetHandle } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_OpenQuick(Handle: Longint); +var LastError: Longint; +begin + SaveHandle := Handle; + InitHandle := Handle; + + FillChar(ReadOl, SizeOf(ReadOl), 00); + FillChar(WriteOl, SizeOf(WriteOl), 00); + + if NOT SetupComm(Com_GetHandle, Win32InBufSize, Win32OutBufSize) then + begin + LastError := GetLastError; + + ErrorStr := 'Error setting up communications buffer: #'+IntToStr(LastError) + ' / '+SysErrorMessage(LastError); + end; { if } + + Com_InitDelayTimes; + InitFailed := NOT Com_StartThread; + Com_SetLine(-1, 'N', 8, 1); +end; { proc. TWin32Obj.Com_OpenQuick } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_OpenKeep(Comport: Byte): Boolean; +var TempSave : THandle; + Security : TSECURITYATTRIBUTES; + LastError : Longint; +begin + InitPortNr := Comport; + + FillChar(ReadOl, SizeOf(ReadOl), 00); + FillChar(WriteOl, SizeOf(WriteOl), 00); + + FillChar(Security, SizeOf(TSECURITYATTRIBUTES), 0); + Security.nLength := SizeOf(TSECURITYATTRIBUTES); + Security.lpSecurityDescriptor := nil; + Security.bInheritHandle := true; + + TempSave := CreateFile(PChar('\\.\COM' + IntToStr(ComPort)), + GENERIC_READ or GENERIC_WRITE, + 0, + @Security, { No Security } + OPEN_EXISTING, { Creation action } + FILE_ATTRIBUTE_NORMAL or FILE_FLAG_OVERLAPPED, + 0); { No template } + LastError := GetLastError; + if LastError <> 0 then + ErrorStr := 'Unable to open communications port'; + + SaveHandle := TempSave; + Result := (TempSave <> INVALID_HANDLE_VALUE); + + if Result then { Make sure that "CharAvail" isn't going to wait } + begin + Com_InitDelayTimes; + end; { if } + + if NOT SetupComm(Com_GetHandle, Win32InBufSize, Win32OutBufSize) then + begin + LastError := GetLastError; + + ErrorStr := 'Error setting up communications buffer: #'+IntToStr(LastError) + ' / '+SysErrorMessage(LastError); + end; { if } + + InitFailed := NOT Com_StartThread; +end; { func. Com_OpenKeep } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; +begin + Com_Open := Com_OpenKeep(Comport); + Com_SetLine(Baudrate, Parity, DataBits, StopBits); +end; { func. TWin32Obj.Com_OpenCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); +var DCB : TDCB; + BPSID : Longint; +begin + if BpsRate = 11520 then { small fix for EleBBS inability to store the bps } + BpsRate := 115200; { rate in anything larger than a 16-bit integer } + + GetCommState(Com_GetHandle, DCB); + + if NOT (Parity in ['N', 'E', 'O', 'M']) then Parity := 'N'; + if BpsRate >= 0 then dcb.BaudRate := BpsRate; + dcb.StopBits := ONESTOPBIT; + + Case Parity of + 'N' : dcb.Parity := NOPARITY; + 'E' : dcb.Parity := EVENPARITY; + 'O' : dcb.Parity := ODDPARITY; + 'M' : dcb.Parity := MARKPARITY; + end; { case } + + Case StopBits of + 1 : dcb.StopBits := ONESTOPBIT; + 2 : dcb.StopBits := TWOSTOPBITS; + 3 : dcb.StopBits := ONE5STOPBITS; + end; { case } + + dcb.ByteSize := DataBits; + dcb.Flags := dcb.Flags OR dcb_Binary OR Dcb_DtrControlEnable; + + if not SetCommState (Com_GetHandle, DCB) then + begin + BPSId := GetLastError; + + ErrorStr := 'Error setting up communications parameters: #'+IntToStr(BpsId) + ' / '+SysErrorMessage(BpsId); + end; { if } +end; { proc. TWin32Obj.Com_SetLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_Close; +begin + if DontClose then EXIT; + + if DWORD(Com_GetHandle) <> INVALID_HANDLE_VALUE then + begin + Com_StopThread; + CloseHandle(Com_GetHandle); + + SaveHandle := INVALID_HANDLE_VALUE; + end; + +end; { func. TWin32Obj.Com_CloseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_SendChar(C: Char): Boolean; +var Written: Longint; +begin + Com_SendBlock(C, SizeOf(C), Written); + Com_SendChar := (Written = SizeOf(c)); +end; { proc. TWin32Obj.Com_SendChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_GetChar: Char; +var Reads: Longint; +begin + Com_ReadBlock(Result, SizeOf(Result), Reads); +end; { func. TWin32Obj.Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); +begin + if OutBuffer^.BufRoom < BlockLen then + repeat + {$IFDEF WIN32} + Sleep(1); + {$ENDIF} + until (OutBuffer^.BufRoom >= BlockLen) OR (NOT Com_Carrier); + + CriticalTx^.EnterExclusive; + Written := OutBuffer^.Put(Block, BlockLen); + CriticalTx^.LeaveExclusive; + + DoTxEvent^.SignalEvent; +end; { proc. TWin32Obj.Com_SendBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); +begin + if InBuffer^.BufUsed < BlockLen then + begin + DoRxEvent^.SignalEvent; + + while (InBuffer^.BufUsed < BlockLen) AND (Com_Carrier) do + begin + Sleep(1); + + if Com_CharAvail then + DoRxEvent^.SignalEvent; + end; { while } + end; { if } + + CriticalRx^.EnterExclusive; + Reads := InBuffer^.Get(Block, BlockLen, true); + CriticalRx^.LeaveExclusive; +end; { proc. TWin32Obj.Com_ReadBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_CharAvail: Boolean; +var Props : TComStat; + ErrMask : DWORD; +begin + if InBuffer^.BufUsed < 1 then + begin + ErrMask := 0; + + if ClearCommError(Com_GetHandle, ErrMask, @Props) then + if Props.cbInQue > 0 then + DoRxEvent^.SignalEvent; + end; { if } + + Result := (InBuffer^.BufUsed > 0); +end; { func. TWin32Obj.Com_CharAvail } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_Carrier: Boolean; +var Status: DWORD; +begin + if Com_GetHandle <> INVALID_HANDLE_VALUE then + begin + GetCommModemStatus(Com_GetHandle, + Status); + + Result := (Status AND MS_RLSD_ON) <> 00; + end + else Result := FALSE; +end; { func. TWin32Obj.Com_Carrier } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_GetModemStatus(var LineStatus, ModemStatus: Byte); +var Data: DWORD; +begin + GetCommModemStatus(Com_GetHandle, Data); + + ModemStatus := ModemStatus and $0F; + ModemStatus := ModemStatus or Byte(Data); +end; { proc. TWin32Obj.Com_GetModemStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SetDtr(State: Boolean); +begin + if State then + EscapeCommFunction(Com_GetHandle, SETDTR) + else EscapeCommFunction(Com_GetHandle, CLRDTR); +end; { proc. TWin32Obj.Com_SetDtr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_GetBpsRate: Longint; +var DCB : TDCB; +begin + GetCommState(Com_GetHandle, DCB); + + Com_GetBpsRate := dcb.Baudrate; +end; { func. TWin32Obj.Com_GetBpsRate } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); +var Stats : TComStat; + ErrMask : DWORD; +begin + if ClearCommError(Com_GetHandle, ErrMask, @Stats) then + begin + if Stats.cbInQue > 0 then + begin + DoRxEvent^.SignalEvent; + Sleep(1); + end; { if } + end; { if } + + + InFree := InBuffer^.BufRoom; + OutFree := OutBuffer^.BufRoom; + InUsed := InBuffer^.BufUsed; + OutUsed := OutBuffer^.BufUsed; +end; { proc. TWin32Obj.Com_GetBufferStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_PurgeInBuffer; +begin + CriticalRx^.EnterExclusive; + + InBuffer^.Clear; + PurgeComm(Com_GetHandle, PURGE_RXCLEAR); + + CriticalRx^.LeaveExclusive; +end; { proc. TWin32Obj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_PurgeOutBuffer; +begin + CriticalTx^.EnterExclusive; + + OutBuffer^.Clear; + PurgeComm(Com_GetHandle, PURGE_TXCLEAR); + + CriticalTx^.LeaveExclusive; +end; { proc. TWin32Obj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_ReadyToSend(BlockLen: Longint): Boolean; +begin + Result := OutBuffer^.BufRoom >= BlockLen; +end; { func. ReadyToSend } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_PauseCom(CloseCom: Boolean); +begin + if CloseCom then Com_Close + else Com_StopThread; +end; { proc. Com_PauseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_ResumeCom(OpenCom: Boolean); +begin + if OpenCom then + begin + if InitPortNr <> -1 then Com_OpenKeep(InitPortNr) + else Com_OpenQuick(InitHandle); + end + else InitFailed := NOT Com_StartThread; +end; { proc. Com_ResumeCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_FlushOutBuffer(Slice: SliceProc); +begin + Windows.FlushFileBuffers(Com_GetHandle); + + inherited Com_FlushOutBuffer(Slice); +end; { proc. Com_FlushOutBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); +var DCB : TDCB; + BPSID : Longint; +begin + GetCommState(Com_GetHandle, DCB); + + if Hard then + dcb.Flags := dcb.Flags OR NOT dcb_OutxCtsFlow OR NOT dcb_RtsControlHandshake; + + if SoftTX then + dcb.Flags := dcb.Flags OR NOT dcb_OutX; + + if SoftRX then + dcb.Flags := dcb.Flags OR NOT dcb_InX; + + if not SetCommState(Com_GetHandle, DCB) then + begin + BPSId := GetLastError; + + ErrorStr := 'Error setting up communications parameters: #'+IntToStr(BpsId) + ' / '+SysErrorMessage(BpsId); + end; { if } + + Com_InitDelayTimes; +end; { proc. Com_SetFlow } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SetDataProc(ReadPtr, WritePtr: Pointer); +begin + DataProcPtr := ReadPtr; +end; { proc. Com_SetDataProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +end. diff --git a/SOURCE/ELECOM/W32SOCK.PAS b/SOURCE/ELECOM/W32SOCK.PAS new file mode 100644 index 0000000..7885dbb --- /dev/null +++ b/SOURCE/ELECOM/W32SOCK.PAS @@ -0,0 +1,205 @@ +unit W32sock; +{&Orgname+} +(* +** +** WINDOWS TCP/IP routines +** +** Copyright (c) 1998 by Thomas W. Mueller +** +** Created : 24-Oct-1998 +** Last update : 20-Feb-2000 +** +** +*) + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses + Windows, + SockDef; + +type + u_char = Char; + u_short = Word; + u_int = Integer; + u_long = Longint; + +{$IFDEF FPC} + type pInteger = ^Integer; +{$ENDIF} + + +{ Socket function prototypes } + +function accept(_s: ULONG; _addr: pSockAddr; _addrlen: PInteger): ULONG; {$IFNDEF FPC} stdcall; {$ENDIF} +function bind(_s: ULONG; _addr: pSockAddr; _namelen: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function connect(_s: ULONG; _name: pSockAddr; _namelen: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function closesocket(s: ULONG): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function select(nfds: Integer; readfds, writefds, exceptfds: PFDSet; + timeout: PTimeVal): Longint; {$IFNDEF FPC} stdcall; {$ENDIF} +function ioctlsocket(_s: ULONG; _cmd: Longint; var _arg: ULONG): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function getpeername(_s: ULONG; _name: pSockAddr; var _namelen: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function getsockname(_s: ULONG; _name: pSockAddr; var _namelen: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function getsockopt(_s: ULONG; _level, _optname: Integer; _optval: PChar; var _optlen: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function htonl(_hostlong: ULONG): ULONG; {$IFNDEF FPC} stdcall; {$ENDIF} +function htons(_hostshort: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function inet_addr(_cp: PChar): ULONG; {$IFNDEF FPC} stdcall; {$ENDIF} +function inet_ntoa(_inaddr: tIn_Addr): PChar; {$IFNDEF FPC} stdcall; {$ENDIF} +function listen(_s: ULONG; _backlog: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function ntohl(_netlong: ULONG): ULONG; {$IFNDEF FPC} stdcall; {$ENDIF} +function ntohs(_netshort: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function recv(_s: ULONG; _Buf: pointer; _len, _flags: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} + +function recvfrom(s: ULONG; _Buf: pointer; _len, _flags: Integer; + var _from: TSockAddr; var _fromlen: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function send(_s: ULONG; _Buf: pointer; _len, _flags: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function sendto(_s: ULONG; _Buf: pointer; _len, _flags: Integer; var _addrto: TSockAddr; + _tolen: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function setsockopt(_s: ULONG; _level, _optname: Integer; _optval: PChar; + _optlen: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function shutdown(_s: ULONG; _how: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function socket(_af, _struct, _protocol: Integer): ULONG; {$IFNDEF FPC} stdcall; {$ENDIF} + +function gethostbyaddr(_addr: Pointer; _len, _struct: Integer): PHostEnt; {$IFNDEF FPC} stdcall; {$ENDIF} +function gethostbyname(_name: PChar): PHostEnt; {$IFNDEF FPC} stdcall; {$ENDIF} +function gethostname(_name: PChar; _len: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function getservbyport(_port: Integer; _proto: PChar): PServEnt; {$IFNDEF FPC} stdcall; {$ENDIF} +function getservbyname(_name, _proto: PChar): PServEnt; {$IFNDEF FPC} stdcall; {$ENDIF} +function getprotobynumber(_proto: Integer): PProtoEnt; {$IFNDEF FPC} stdcall; {$ENDIF} +function getprotobyname(_name: PChar): PProtoEnt; {$IFNDEF FPC} stdcall; {$ENDIF} + +function WSAStartup(wVersionRequired: word; var WSData: TWSAData): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSACleanup: Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +procedure WSASetLastError(iError: Integer); {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAGetLastError: Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAIsBlocking: BOOL; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAUnhookBlockingHook: Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSASetBlockingHook(lpBlockFunc: TFarProc): TFarProc; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSACancelBlockingCall: Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAAsyncGetServByName(HWindow: HWND; wMsg: u_int; + name, proto, buf: PChar; buflen: Integer): THandle; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAAsyncGetServByPort( HWindow: HWND; wMsg, port: u_int; + proto, buf: PChar; buflen: Integer): THandle; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAAsyncGetProtoByName(HWindow: HWND; wMsg: u_int; + name, buf: PChar; buflen: Integer): THandle; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAAsyncGetProtoByNumber(HWindow: HWND; wMsg: u_int; number: Integer; + buf: PChar; buflen: Integer): THandle; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAAsyncGetHostByName(HWindow: HWND; wMsg: u_int; + name, buf: PChar; buflen: Integer): THandle; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAAsyncGetHostByAddr(HWindow: HWND; wMsg: u_int; addr: PChar; + len, struct: Integer; buf: PChar; buflen: Integer): THandle; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSACancelAsyncRequest(hAsyncTaskHandle: THandle): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSAAsyncSelect(s: ULONG; HWindow: HWND; wMsg: u_int; lEvent: Longint): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} +function WSARecvEx(s: ULONG; var buf; len: Integer; var flags: Integer): Integer; {$IFNDEF FPC} stdcall; {$ENDIF} + +function WSAMakeSyncReply(Buflen, Error: Word): Longint; +function WSAMakeSelectReply(Event, Error: Word): Longint; +function WSAGetAsyncBuflen(Param: Longint): Word; +function WSAGetAsyncError(Param: Longint): Word; +function WSAGetSelectEvent(Param: Longint): Word; +function WSAGetSelectError(Param: Longint): Word; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +const + winsocket = 'wsock32.dll'; + +function WSAMakeSyncReply(Buflen, Error: Word): Longint; +begin + WSAMakeSyncReply:= MakeLong(Buflen, Error); +end; + +function WSAMakeSelectReply(Event, Error: Word): Longint; +begin + WSAMakeSelectReply:= MakeLong(Event, Error); +end; + +function WSAGetAsyncBuflen(Param: Longint): Word; +begin + WSAGetAsyncBuflen:= LOWORD(Param); +end; + +function WSAGetAsyncError(Param: Longint): Word; +begin + WSAGetAsyncError:= HIWORD(Param); +end; + +function WSAGetSelectEvent(Param: Longint): Word; +begin + WSAGetSelectEvent:= LOWORD(Param); +end; + +function WSAGetSelectError(Param: Longint): Word; +begin + WSAGetSelectError:= HIWORD(Param); +end; + +function accept(_s: ULONG; _addr: pSockAddr; _addrlen: PInteger): ULONG; external winsocket name 'accept'; +function bind(_s: ULONG; _addr: pSockAddr; _namelen: Integer): Integer; external winsocket name 'bind'; +function connect(_s: ULONG; _name: pSockAddr; _namelen: Integer): Integer; external winsocket name 'connect'; +function closesocket(s: ULONG): Integer; external winsocket name 'closesocket'; +function select(nfds: Integer; readfds, writefds, exceptfds: PFDSet; + timeout: PTimeVal): Longint; external winsocket name 'select'; +function ioctlsocket(_s: ULONG; _cmd: Longint; var _arg: ULONG): Integer; external winsocket name 'ioctlsocket'; +function getpeername(_s: ULONG; _name: pSockAddr; var _namelen: Integer): Integer; external winsocket name 'getpeername'; +function getsockname(_s: ULONG; _name: pSockAddr; var _namelen: Integer): Integer; external winsocket name 'getsockname'; +function getsockopt(_s: ULONG; _level, _optname: Integer; _optval: PChar; var _optlen: Integer): Integer; external winsocket name 'getsockopt'; +function htonl(_hostlong: ULONG): ULONG; external winsocket name 'htonl'; +function htons(_hostshort: Integer): Integer; external winsocket name 'htons'; +function inet_addr(_cp: PChar): ULONG; external winsocket name 'inet_addr'; +function inet_ntoa(_inaddr: tIn_Addr): PChar; external winsocket name 'inet_ntoa'; +function listen(_s: ULONG; _backlog: Integer): Integer; external winsocket name 'listen'; +function ntohl(_netlong: ULONG): ULONG; external winsocket name 'ntohl'; +function ntohs(_netshort: Integer): Integer; external winsocket name 'ntohs'; +function recv(_s: ULONG; _Buf: pointer; _len, _flags: Integer): Integer; external winsocket name 'recv'; + + +function recvfrom(s: ULONG; _Buf: pointer; _len, _flags: Integer; + var _from: TSockAddr; var _fromlen: Integer): Integer; external winsocket name 'recvfrom'; +function send(_s: ULONG; _Buf: pointer; _len, _flags: Integer): Integer; external winsocket name 'send'; +function sendto(_s: ULONG; _Buf: pointer; _len, _flags: Integer; var _addrto: TSockAddr; + _tolen: Integer): Integer; external winsocket name 'sendto'; +function setsockopt(_s: ULONG; _level, _optname: Integer; _optval: PChar; + _optlen: Integer): Integer; external winsocket name 'setsockopt'; +function shutdown(_s: ULONG; _how: Integer): Integer; external winsocket name 'shutdown'; +function socket(_af, _struct, _protocol: Integer): ULONG; external winsocket name 'socket'; + + +function gethostbyaddr(_addr: Pointer; _len, _struct: Integer): PHostEnt; external winsocket name 'gethostbyaddr'; +function gethostbyname(_name: PChar): PHostEnt; external winsocket name 'gethostbyname'; +function gethostname(_name: PChar; _len: Integer): Integer; external winsocket name 'gethostname'; +function getservbyport(_port: Integer; _proto: PChar): PServEnt; external winsocket name 'getservbyport'; +function getservbyname(_name, _proto: PChar): PServEnt; external winsocket name 'getservbyname'; +function getprotobynumber(_proto: Integer): PProtoEnt; external winsocket name 'getprotobynumber'; +function getprotobyname(_name: PChar): PProtoEnt; external winsocket name 'getprotobyname'; + + +function WSAStartup(wVersionRequired: word; var WSData: TWSAData): Integer; external winsocket name 'WSAStartup'; +function WSACleanup: Integer; external winsocket name 'WSACleanup'; +procedure WSASetLastError(iError: Integer); external winsocket name 'WSASetLastError'; +function WSAGetLastError: Integer; external winsocket name 'WSAGetLastError'; +function WSAIsBlocking: BOOL; external winsocket name 'WSAIsBlocking'; +function WSAUnhookBlockingHook: Integer; external winsocket name 'WSAUnhookBlockingHook'; +function WSASetBlockingHook(lpBlockFunc: TFarProc): TFarProc; external winsocket name 'WSASetBlockingHook'; +function WSACancelBlockingCall: Integer; external winsocket name 'WSACancelBlockingCall'; +function WSAAsyncGetServByName(HWindow: HWND; wMsg: u_int; + name, proto, buf: PChar; buflen: Integer): THandle; external winsocket name 'WSAAsyncGetServByName'; +function WSAAsyncGetServByPort( HWindow: HWND; wMsg, port: u_int; + proto, buf: PChar; buflen: Integer): THandle; external winsocket name 'WSAAsyncGetServByPort'; +function WSAAsyncGetProtoByName(HWindow: HWND; wMsg: u_int; + name, buf: PChar; buflen: Integer): THandle; external winsocket name 'WSAAsyncGetProtoByName'; +function WSAAsyncGetProtoByNumber(HWindow: HWND; wMsg: u_int; number: Integer; + buf: PChar; buflen: Integer): THandle; external winsocket name 'WSAAsyncGetProtoByNumber'; +function WSAAsyncGetHostByName(HWindow: HWND; wMsg: u_int; + name, buf: PChar; buflen: Integer): THandle; external winsocket name 'WSAAsyncGetHostByName'; +function WSAAsyncGetHostByAddr(HWindow: HWND; wMsg: u_int; addr: PChar; + len, struct: Integer; buf: PChar; buflen: Integer): THandle; external winsocket name 'WSAAsyncGetHostByAddr'; +function WSACancelAsyncRequest(hAsyncTaskHandle: THandle): Integer; external winsocket name 'WSACancelAsyncRequest'; +function WSAAsyncSelect(s: ULONG; HWindow: HWND; wMsg: u_int; lEvent: Longint): Integer; external winsocket name 'WSAAsyncSelect'; +function WSARecvEx(s: ULONG; var buf; len: Integer; var flags: Integer): Integer; external winsocket name 'WSARecvEx'; + +end. { unit. W32SOCK } diff --git a/SOURCE/ELECOM/WIN32COM.PAS b/SOURCE/ELECOM/WIN32COM.PAS new file mode 100644 index 0000000..008434b --- /dev/null +++ b/SOURCE/ELECOM/WIN32COM.PAS @@ -0,0 +1,790 @@ +unit WIN32COM; +(* +** +** Serial and TCP/IP communication routines for DOS, OS/2 and Win9x/NT. +** Tested with: TurboPascal v7.0, (DOS) +** VirtualPascal v2.0, (OS/2, Win32) +** FreePascal v0.99.15 (DOS, Win32) +** Delphi v4.0. (Win32) +** +** Version : 1.01 +** Created : 21-May-1998 +** Last update : 20-Feb-2000 +** +** Note: (c) 1998-2000 by Maarten Bekers +** +*) + +This unit is not supported anymore. +Remove this in order to be compiled anyway. The next release of EleCOM will +not include WIN32COM.PAS anymore. W32SNGL.PAS is the replacement unit. + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + INTERFACE +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses Windows, Combase, BufUnit, Threads + {$IFDEF VirtualPascal} + ,Use32 + {$ENDIF}; + +Const WriteTimeout = 20000; { Wait max. 20 secs } + ReadTimeOut = 20000; { General event, 20 secs max } + + InBufSize = 1024 * 32; + OutBufSize = 1024 * 32; + + +type TWin32Obj = Object(TCommObj) + ReadProcPtr: Pointer; { Pointer to TX/RX handler (thread) } + WriteProcPtr: Pointer; { Pointer to TX/RX handler (thread) } + ThreadsInitted: Boolean; { Are the thread(s) up and running? } + + SaveHandle : THandle; + + InitPortNr : Longint; + InitHandle : Longint; + + ReadOL : TOverLapped; { Overlapped structure for ReadFile } + WriteOL : TOverLapped; { Overlapped structure for WriteFile } + + InBuffer : ^BufArrayObj; { Buffer system internally used } + OutBuffer : ^BufArrayObj; + + ReadEvent : PSysEventObj; { Event set by ReadFile overlapped routine } + WriteEvent : PSysEventObj; { Event set by WriteFile overlapped routine } + RecvEvent : PSysEventObj; + + DoTxEvent : PSysEventObj;{ Event manually set when we have to transmit } + + TxClosedEvent : PSysEventObj; { Event set when the Tx thread is closed } + RxClosedEvent : PSysEventObj; { Event set when the Rx thread is closed } + + CriticalTx : PExclusiveObj; { Critical sections } + CriticalRx : PExclusiveObj; + + TxThread : PThreadsObj; { The Transmit and Receive threads } + RxThread : PThreadsObj; + + EndThreads : Boolean; { Set to true when we have to end the threads } + + constructor Init; + destructor Done; + + function Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; virtual; + function Com_OpenKeep(Comport: Byte): Boolean; virtual; + function Com_GetChar: Char; virtual; + function Com_CharAvail: Boolean; virtual; + function Com_Carrier: Boolean; virtual; + function Com_SendChar(C: Char): Boolean; virtual; + function Com_ReadyToSend(BlockLen: Longint): Boolean; virtual; + function Com_GetBPSrate: Longint; virtual; + function Com_GetHandle: Longint; virtual; + + procedure Com_OpenQuick(Handle: Longint); virtual; + procedure Com_Close; virtual; + procedure Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); virtual; + procedure Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); virtual; + procedure Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); virtual; + procedure Com_SetDtr(State: Boolean); virtual; + procedure Com_GetModemStatus(var LineStatus, ModemStatus: Byte); virtual; + procedure Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); virtual; + procedure Com_PurgeInBuffer; virtual; + procedure Com_PurgeOutBuffer; virtual; + + procedure Com_PauseCom(CloseCom: Boolean); virtual; + procedure Com_ResumeCom(OpenCom: Boolean); virtual; + procedure Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); virtual; + + procedure Com_SetDataProc(ReadPtr, WritePtr: Pointer); virtual; + + procedure Com_ReadProc(var TempPtr: Pointer); + procedure Com_WriteProc(var TempPtr: Pointer); + + function Com_StartThread: Boolean; + procedure Com_InitVars; + procedure Com_StopThread; + procedure Com_InitDelayTimes; + end; { object TWin32Obj } + +type PWin32Obj = ^TWin32Obj; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + IMPLEMENTATION +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +uses SysUtils; + +{$IFDEF FPC} + {$I WINDEF.FPC} +{$ENDIF} + +const + dcb_Binary = $00000001; + dcb_ParityCheck = $00000002; + dcb_OutxCtsFlow = $00000004; + dcb_OutxDsrFlow = $00000008; + dcb_DtrControlMask = $00000030; + dcb_DtrControlDisable = $00000000; + dcb_DtrControlEnable = $00000010; + dcb_DtrControlHandshake = $00000020; + dcb_DsrSensivity = $00000040; + dcb_TXContinueOnXoff = $00000080; + dcb_OutX = $00000100; + dcb_InX = $00000200; + dcb_ErrorChar = $00000400; + dcb_NullStrip = $00000800; + dcb_RtsControlMask = $00003000; + dcb_RtsControlDisable = $00000000; + dcb_RtsControlEnable = $00001000; + dcb_RtsControlHandshake = $00002000; + dcb_RtsControlToggle = $00003000; + dcb_AbortOnError = $00004000; + dcb_Reserveds = $FFFF8000; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +constructor TWin32Obj.Init; +begin + inherited Init; + + InitPortNr := -1; + InitHandle := -1; + ThreadsInitted := false; + Com_InitVars; +end; { constructor Init } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +destructor TWin32Obj.Done; +begin + inherited done; +end; { destructor Done } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_ReadProc(var TempPtr: Pointer); +var EventMask : DWORD; + Success : Boolean; + Props : TCommProp; + ReturnCode: Longint; + DidRead : DWORD; + BlockLen : Longint; + + RecvOL : tOverlapped; +begin + New(RecvEvent, Init); + if NOT RecvEvent^.CreateEvent(true) then EXIT; + + FillChar(RecvOL, SizeOf(tOverLapped), 0); + RecvOL.hEvent := RecvEvent^.SemHandle; + + EventMask := EV_RXCHAR; + SetCommMask(SaveHandle, EventMask); { Signal us if anything is received } + + repeat + WaitCommEvent(SaveHandle, EventMask, @RecvOL); + if EndThreads then EXIT; + + repeat + ReturnCode := WaitForSingleObject(RecvOL.hEvent, 500); + if ReturnCode = WAIT_OBJECT_0 then + begin + Success := true + end { if } + else Success := false; + + if EndThreads then BREAK; + until (Success); + + DidRead := 00; + + if (NOT Success) OR (EventMask = 0) then EXIT; + if (EndThreads) then EXIT; + + {----------------- Start reading the gathered date ---------------------} + CriticalRx^.EnterExclusive; + + FillChar(Props, SizeOf(TCommProp), 0); + + if GetCommProperties(SaveHandle, Props) then + if InBuffer^.BufRoom > 0 then + begin + BlockLen := Props.dwCurrentRxQueue; + + if BlockLen > InBuffer^.BufRoom then + BlockLen := InBuffer^.BufRoom; + + Success := ReadFile(SaveHandle, + InBuffer^.TmpBuf^, + BlockLen, + DidRead, + @ReadOL); + + if NOT Success then + begin + ReturnCode := GetLastError; + + if ReturnCode = ERROR_IO_PENDING then + begin + ReturnCode := WaitForSingleObject(ReadOL.hEvent, ReadTimeOut); + + if ReturnCode = WAIT_OBJECT_0 then + begin + GetOverLappedResult(SaveHandle, ReadOL, DidRead, false); + end; { if } + end; { if } + end + else GetOverlappedResult(SaveHandle, ReadOL, DidRead, false); + + if DidRead > 00 then + InBuffer^.Put(InBuffer^.TmpBuf^, DidRead); + end; { if } + + CriticalRx^.LeaveExclusive; + until EndThreads; + + RxClosedEvent^.SignalEvent; + ExitThisThread; +end; { proc. ComReadProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_WriteProc(var TempPtr: Pointer); +var BlockLen : Longint; + Written : DWORD; + ReturnCode: Longint; + Success : Boolean; +begin + repeat + if DoTxEvent^.WaitForEvent(WriteTimeOut) then + if NOT EndThreads then + begin + CriticalTx^.EnterExclusive; + DoTxEvent^.ResetEvent; + + if OutBuffer^.BufUsed > 00 then + begin + Written := 00; + BlockLen := OutBuffer^.Get(OutBuffer^.TmpBuf^, OutBuffer^.BufUsed, false); + + Success := WriteFile(SaveHandle, + OutBuffer^.TmpBuf^, + BlockLen, + Written, + @WriteOL); + if NOT Success then + begin + ReturnCode := GetLastError; + + if ReturnCode = ERROR_IO_PENDING then + begin + ReturnCode := WaitForSingleObject(WriteOL.hEvent, WriteTimeOut); + + if ReturnCode = WAIT_OBJECT_0 then + begin + if GetOverLappedResult(SaveHandle, WriteOL, Written, false) then + begin + ResetEvent(WriteOL.hEvent); + end; { if } + end; { if } + end; { result is pending } + end { if } + else begin + + if GetOverLappedResult(SaveHandle, WriteOL, Written, false) then + begin + ResetEvent(WriteOL.hEvent); + end; { if } + end; { if (did succeed) } + + ReturnCode := OutBuffer^.Get(OutBuffer^.TmpBuf^, Written, true); + if Written <> BlockLen then + DoTxEvent^.SignalEvent; + end; { if } + + CriticalTx^.LeaveExclusive; + end; { if } + + until EndThreads; + + TxClosedEvent^.SignalEvent; + ExitThisThread; +end; { proc. ComWriteProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_StartThread: Boolean; +begin + Result := false; + EndThreads := false; + if ThreadsInitted then EXIT; + ThreadsInitted := true; + + {----------------------- Create all the events ----------------------------} + New(ReadEvent, Init); + if NOT ReadEvent^.CreateEvent(true) then EXIT; + + New(WriteEvent, Init); + if NOT WriteEvent^.CreateEvent(true) then EXIT; + + New(DoTxEvent, Init); + if NOT DoTxEvent^.CreateEvent(false) then EXIT; + + New(RxClosedEvent, Init); + if NOT RxClosedEvent^.CreateEvent(false) then EXIT; + + New(TxClosedEvent, Init); + if NOT TxClosedEvent^.CreateEvent(false) then EXIT; + + {-------------- Startup the buffers and overlapped events -----------------} + FillChar(WriteOL, SizeOf(tOverLapped), 0); + FillChar(ReadOL, SizeOf(tOverLapped), 0); + WriteOl.hEvent := WriteEvent^.SemHandle; + ReadOl.hEvent := ReadEvent^.SemHandle; + + New(InBuffer, Init(InBufSize)); + New(OutBuffer, Init(OutBufSize)); + + if (InBuffer^.TxtArr=nil) OR (InBuffer^.TmpBuf=nil) then EXIT; + if (OutBuffer^.TxtArr=nil) OR (OutBuffer^.TmpBuf=nil) then EXIT; + + {-------------------- Startup a seperate write thread ---------------------} + New(CriticalTx, Init); + CriticalTx^.CreateExclusive; + + New(TxThread, Init); + if NOT TxThread^.CreateThread(16384, { Stack size } + @WriteProcPtr, { Actual procedure } + nil, { Parameters } + 0) { Creation flags } + then EXIT; + + {-------------------- Startup a seperate read thread ----------------------} + New(CriticalRx, Init); + CriticalRx^.CreateExclusive; + + New(RxThread, Init); + if NOT RxThread^.CreateThread(16384, { Stack size } + @ReadProcPtr, { Actual procedure } + nil, { Parameters } + 0) { Creation flags } + then EXIT; + + Result := true; +end; { proc. Com_StartThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_InitVars; +begin + DoTxEvent := nil; + RxClosedEvent := nil; + TxClosedEvent := nil; + RecvEvent := nil; + ReadEvent := nil; + WriteEvent := nil; + TxThread := nil; + RxThread := nil; + + InBuffer := nil; + OutBuffer := nil; + CriticalRx := nil; + CriticalTx := nil; +end; { proc. Com_InitVars } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_StopThread; +begin + EndThreads := true; + ThreadsInitted := false; + + if DoTxEvent <> nil then DoTxEvent^.SignalEvent; + + if TxThread <> nil then TxThread^.CloseThread; + if RxThread <> nil then RxThread^.CloseThread; + + if TxClosedEvent <> nil then + if NOT TxClosedEvent^.WaitForEvent(1000) then + TxThread^.TerminateThread(0); + + if RxClosedEvent <> nil then + if NOT RxClosedEvent^.WaitForEvent(1000) then + RxThread^.TerminateThread(0); + + if TxThread <> nil then Dispose(TxThread, Done); + if RxThread <> nil then Dispose(RxThread, Done); + if DoTxEvent <> nil then Dispose(DoTxEvent, Done); + if RxClosedEvent <> nil then Dispose(RxClosedEvent, Done); + if TxClosedEvent <> nil then Dispose(TxClosedEvent, Done); + + if CriticalTx <> nil then Dispose(CriticalTx, Done); + if CriticalRx <> nil then Dispose(CriticalRx, Done); + + if InBuffer <> nil then Dispose(InBuffer, Done); + if OutBuffer <> nil then Dispose(OutBuffer, Done); + + if RecvEvent <> nil then Dispose(RecvEvent, Done); + if ReadEvent <> nil then Dispose(ReadEvent, Done); + if WriteEvent <> nil then Dispose(WriteEvent, Done); + + Com_InitVars; +end; { proc. Com_StopThread } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_InitDelayTimes; +var CommTimeOut: TCommTimeouts; + RC : Longint; +begin + FillChar(CommTimeOut, SizeOf(TCommTimeOuts), 00); + CommTimeOut.ReadIntervalTimeout := MAXDWORD; + + if NOT SetCommTimeOuts(SaveHandle, CommTimeOut) then + begin + RC := GetLastError; + { ErrorStr := 'Error setting communications timeout: #'+IntToStr(RC) + ' / ' + SysErrorMessage(rc)); } + end; { if } + +end; { proc. InitDelayTimes } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_GetHandle: Longint; +begin + Result := SaveHandle; +end; { func. Com_GetHandle } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_OpenQuick(Handle: Longint); +var LastError: Longint; +begin + SaveHandle := Handle; + InitHandle := Handle; + + FillChar(ReadOl, SizeOf(ReadOl), 00); + FillChar(WriteOl, SizeOf(WriteOl), 00); + + Com_InitDelayTimes; + + if NOT SetupComm(Com_GetHandle, 1024, 1024) then + begin + LastError := GetLastError; + + { ErrorStr := 'Error setting up communications buffer: #'+IntToStr(LastError) + ' / '+SysErrorMessage(LastError); } + end; { if } + + InitFailed := NOT Com_StartThread; + Com_SetLine(-1, 'N', 8, 1); +end; { proc. TWin32Obj.Com_OpenQuick } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_OpenKeep(Comport: Byte): Boolean; +var TempSave : THandle; + Security : TSECURITYATTRIBUTES; + LastError : Longint; +begin + InitPortNr := Comport; + + FillChar(ReadOl, SizeOf(ReadOl), 00); + FillChar(WriteOl, SizeOf(WriteOl), 00); + + FillChar(Security, SizeOf(TSECURITYATTRIBUTES), 0); + Security.nLength := SizeOf(TSECURITYATTRIBUTES); + Security.lpSecurityDescriptor := nil; + Security.bInheritHandle := true; + + TempSave := CreateFile(PChar('\\.\COM' + IntToStr(ComPort)), + GENERIC_READ or GENERIC_WRITE, + 0, + @Security, { No Security } + OPEN_EXISTING, { Creation action } + FILE_ATTRIBUTE_NORMAL or FILE_FLAG_OVERLAPPED, + 0); { No template } + LastError := GetLastError; + if LastError <> 0 then + ErrorStr := 'Unable to open communications port'; + + SaveHandle := TempSave; + Result := (TempSave <> INVALID_HANDLE_VALUE); + + if Result then { Make sure that "CharAvail" isn't going to wait } + begin + Com_InitDelayTimes; + end; { if } + + if NOT SetupComm(Com_GetHandle, 1024, 1024) then + begin + LastError := GetLastError; + + { ErrorStr := 'Error setting up communications buffer: #'+IntToStr(LastError) + ' / '+SysErrorMessage(LastError); } + end; { if } + + InitFailed := NOT Com_StartThread; +end; { func. Com_OpenKeep } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_Open(Comport: Byte; BaudRate: Longint; DataBits: Byte; + Parity: Char; StopBits: Byte): Boolean; +begin + Com_Open := Com_OpenKeep(Comport); + Com_SetLine(Baudrate, Parity, DataBits, StopBits); +end; { func. TWin32Obj.Com_OpenCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SetLine(BpsRate: longint; Parity: Char; DataBits, Stopbits: Byte); +var DCB : TDCB; + BPSID : Longint; +begin + if BpsRate = 11520 then + BpsRate := 115200; + + GetCommState(Com_GetHandle, DCB); + + if NOT (Parity in ['N', 'E', 'O', 'M']) then Parity := 'N'; + if BpsRate >= 0 then dcb.BaudRate := BpsRate; + dcb.StopBits := ONESTOPBIT; + + Case Parity of + 'N' : dcb.Parity := NOPARITY; + 'E' : dcb.Parity := EVENPARITY; + 'O' : dcb.Parity := ODDPARITY; + 'M' : dcb.Parity := MARKPARITY; + end; { case } + + if StopBits = 1 then + dcb.StopBits := ONESTOPBIT; + dcb.ByteSize := DataBits; + dcb.Flags := dcb.Flags OR dcb_Binary or Dcb_DtrControlEnable; + + if not SetCommState (Com_GetHandle, DCB) then + begin + BPSId := GetLastError; + + { ErrorStr := 'Error setting up communications parameters: #'+IntToStr(BpsId) + ' / '+SysErrorMessage(BpsId); } + end; { if } +end; { proc. TWin32Obj.Com_SetLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_Close; +begin + if DontClose then EXIT; + + if Com_GetHandle <> INVALID_HANDLE_VALUE then + begin + Com_StopThread; + CloseHandle(Com_GetHandle); + + SaveHandle := INVALID_HANDLE_VALUE; + end; + +end; { func. TWin32Obj.Com_CloseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_SendChar(C: Char): Boolean; +var Written: Longint; +begin + Com_SendBlock(C, SizeOf(C), Written); + Com_SendChar := (Written = SizeOf(c)); +end; { proc. TWin32Obj.Com_SendChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_GetChar: Char; +var Reads: Longint; +begin + Com_ReadBlock(Result, SizeOf(Result), Reads); +end; { func. TWin32Obj.Com_GetChar } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SendBlock(var Block; BlockLen: Longint; var Written: Longint); +begin + if OutBuffer^.BufRoom < BlockLen then + repeat + {$IFDEF WIN32} + Sleep(1); + {$ENDIF} + + {$IFDEF OS2} + DosSleep(1); + {$ENDIF} + until (OutBuffer^.BufRoom >= BlockLen) OR (NOT Com_Carrier); + + CriticalTx^.EnterExclusive; + Written := OutBuffer^.Put(Block, BlockLen); + CriticalTx^.LeaveExclusive; + + DoTxEvent^.SignalEvent; +end; { proc. TWin32Obj.Com_SendBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_ReadBlock(var Block; BlockLen: Longint; var Reads: Longint); +begin + if InBuffer^.BufUsed < BlockLen then + begin + repeat + Sleep(1); + until (InBuffer^.BufUsed >= BlockLen) OR (NOT Com_Carrier); + end; { if } + + CriticalRx^.EnterExclusive; + Reads := InBuffer^.Get(Block, BlockLen, true); + CriticalRx^.LeaveExclusive; +end; { proc. TWin32Obj.Com_ReadBlock } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_CharAvail: Boolean; +begin + Result := (InBuffer^.BufUsed > 0); +end; { func. TWin32Obj.Com_CharAvail } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_Carrier: Boolean; +var Status: DWORD; +begin + GetCommModemStatus(Com_GetHandle, + Status); + + Result := (Status AND MS_RLSD_ON) <> 00; +end; { func. TWin32Obj.Com_Carrier } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_GetModemStatus(var LineStatus, ModemStatus: Byte); +var Data: DWORD; +begin + GetCommModemStatus(Com_GetHandle, Data); + + ModemStatus := ModemStatus and $0F; + ModemStatus := ModemStatus or Byte(Data); +end; { proc. TWin32Obj.Com_GetModemStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SetDtr(State: Boolean); +begin + if State then + EscapeCommFunction(Com_GetHandle, SETDTR) + else EscapeCommFunction(Com_GetHandle, CLRDTR); +end; { proc. TWin32Obj.Com_SetDtr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_GetBpsRate: Longint; +var DCB : TDCB; + BPSID : Longint; +begin + GetCommState(Com_GetHandle, DCB); + + Com_GetBpsRate := dcb.Baudrate; +end; { func. TWin32Obj.Com_GetBpsRate } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_GetBufferStatus(var InFree, OutFree, InUsed, OutUsed: Longint); +begin + InFree := InBuffer^.BufRoom; + OutFree := OutBuffer^.BufRoom; + InUsed := InBuffer^.BufUsed; + OutUsed := OutBuffer^.BufUsed; +end; { proc. TWin32Obj.Com_GetBufferStatus } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_PurgeInBuffer; +begin + CriticalRx^.EnterExclusive; + + InBuffer^.Clear; + PurgeComm(Com_GetHandle, PURGE_RXCLEAR); + + CriticalRx^.LeaveExclusive; +end; { proc. TWin32Obj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_PurgeOutBuffer; +begin + CriticalTx^.EnterExclusive; + + OutBuffer^.Clear; + PurgeComm(Com_GetHandle, PURGE_TXCLEAR); + + CriticalTx^.LeaveExclusive; +end; { proc. TWin32Obj.Com_PurgeInBuffer } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +function TWin32Obj.Com_ReadyToSend(BlockLen: Longint): Boolean; +begin + Result := OutBuffer^.BufRoom >= BlockLen; +end; { func. ReadyToSend } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_PauseCom(CloseCom: Boolean); +begin + if CloseCom then Com_Close + else Com_StopThread; +end; { proc. Com_PauseCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_ResumeCom(OpenCom: Boolean); +begin + if OpenCom then + begin + if InitPortNr <> -1 then Com_OpenKeep(InitPortNr) + else Com_OpenQuick(InitHandle); + end + else InitFailed := NOT Com_StartThread; +end; { proc. Com_ResumeCom } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SetFlow(SoftTX, SoftRX, Hard: Boolean); +var DCB : TDCB; + BPSID : Longint; +begin + GetCommState(Com_GetHandle, DCB); + + if Hard then + dcb.Flags := dcb.Flags OR dcb_OutxCtsFlow OR dcb_RtsControlHandshake; + + if SoftTX then + dcb.Flags := dcb.Flags OR dcb_OutX; + + if SoftRX then + dcb.Flags := dcb.Flags OR dcb_InX; + + if not SetCommState (Com_GetHandle, DCB) then + begin + BPSId := GetLastError; + + { ErrorStr := 'Error setting up communications parameters: #'+IntToStr(BpsId) + ' / '+SysErrorMessage(BpsId); } + end; { if } +end; { proc. Com_SetFlow } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure TWin32Obj.Com_SetDataProc(ReadPtr, WritePtr: Pointer); +begin + ReadProcPtr := ReadPtr; + WriteProcPtr := WritePtr; +end; { proc. Com_SetDataProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +end. diff --git a/SOURCE/ELECOM/WINDEF.FPC b/SOURCE/ELECOM/WINDEF.FPC new file mode 100644 index 0000000..c8b4756 --- /dev/null +++ b/SOURCE/ELECOM/WINDEF.FPC @@ -0,0 +1,79 @@ +(* +** +** Include file to make FPC more Delphi compatible +** +*) + +{$IFDEF FPC} +type DCB = record + DCBlength : DWORD; + BaudRate : DWORD; + flags : longint; + wReserved : WORD; + XonLim : WORD; + XoffLim : WORD; + ByteSize : BYTE; + Parity : BYTE; + StopBits : BYTE; + XonChar : char; + XoffChar : char; + ErrorChar : char; + EofChar : char; + EvtChar : char; + wReserved1 : WORD; + end; + + TDcb = DCB; + pInteger = ^Integer; + + PSecurityAttributes = ^TSecurityAttributes; + TSecurityAttributes = record + nLength: Longint; + lpSecurityDescriptor: Pointer; + bInheritHandle: Bool; + end; + + function GetCommState(hFile:HANDLE; var lpDCB:TDCB):WINBOOL; external 'kernel32' name 'GetCommState'; + function SetCommState(hFile:HANDLE; var lpDCB:TDCB):WINBOOL; external 'kernel32' name 'SetCommState'; + function WaitForMultipleObjects(nCount:DWORD; lpHandles:Pointer; bWaitAll:WINBOOL; dwMilliseconds:DWORD):DWORD; external 'kernel32' name 'WaitForMultipleObjects'; + + +{-- Apparently, FPC 1.0 doesnt have the "SysErrorMessage" defined in its ------} +{-- SYSUTILS unit. We create this function here. ------------------------------} +function FormatMessageA(dwFlags : DWORD; + lpSource : Pointer; + dwMessageId : DWORD; + dwLanguageId: DWORD; + lpBuffer : PCHAR; + nSize : DWORD; + Arguments : Pointer): DWORD; external 'kernel32' name 'FormatMessageA'; + + +function SysErrorMessage(ErrorCode: Integer): String; +const + MaxMsgSize = Format_Message_Max_Width_Mask; + +var MsgBuffer: pChar; +begin + {-- Allocate memory for error message ---------------------------------------} + GetMem(MsgBuffer, MaxMsgSize); + FillChar(MsgBuffer^, MaxMsgSize, #0); + + {-- Retrieve the message ----------------------------------------------------} + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, + nil, + ErrorCode, + MakeLangId(LANG_NEUTRAL, SUBLANG_DEFAULT), + MsgBuffer, { This function allocs the memory } + MaxMsgSize, { Maximum message size } + nil); + + {-- Return the string and release the memory --------------------------------} + SysErrorMessage := StrPas(MsgBuffer); + + FreeMem(MsgBuffer, MaxMsgSize); +end; { func. SysErrorMessage } + +{$ENDIF} + + diff --git a/SOURCE/ELECOM/dllexam.pas b/SOURCE/ELECOM/dllexam.pas new file mode 100644 index 0000000..0ef7dc2 --- /dev/null +++ b/SOURCE/ELECOM/dllexam.pas @@ -0,0 +1,86 @@ +program DLLEXAM; +{$H-} { important, turn off Ansi-Strings } +(* +** +** Example how to use communications with the DLL file +** You can install this program from within EleBBS and test how it works :) +** +** version: 1.02 +** Created: 13-Jun-1999 +** +** EleBBS install lines: +** +** DOS install line: DLLEXAM.EXE -H*P +** Win32 install line: DLLEXAM.EXE -H*W +** Win32 (telnet) install line: DLLEXAM.EXE -H*W -XT +** OS/2 install line: DLLEXAM.EXE -H*W +** OS/2 (telnet) install line: DLLEXAM.EXE -H*W -XT +** +*) + +uses EleDEF; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +var IsTelnet : Boolean; + ComHandle : Longint; + ReadCH : Char; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure ParseCommandLine; +var Counter: Longint; + TempStr: String; + {$IFDEF MSDOS} + Code : Integer; + {$ELSE} + Code : Longint; + {$ENDIF} +begin + for Counter := 01 to ParamCount do + begin + TempStr := ParamStr(Counter); + + if TempStr[1] in ['/', '-'] then + Case UpCase(TempStr[2]) of + 'H' : begin + + TempStr := Copy(TempStr, 3, Length(TempStr) - 2); + Val(TempStr, ComHandle, Code); + + + end; { 'H' } + 'X' : begin + + if UpCase(TempStr[3]) = 'T' then { XT } + IsTelnet := true; + + end; { 'X' } + end; { case } + + end; { for } +end; { proc. ParseCommandLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +begin + IsTelnet := false; + ParseCommandLine; + + Case IsTelnet of + FALSE : Com_StartUp(1); + TRUE : Com_StartUp(2); + end; { case } + + Com_SetDontClose(true); { We use an inherited handle, never close it! } + Com_OpenQuick(ComHandle); { Open the comport using the handle } + + Com_SendString('Hello there!' + #13#10); + Com_SendString('Press [ENTER]'); + + repeat + ReadCH := Com_GetChar; + until (ReadCH = #13) OR (NOT Com_Carrier); + + Com_ShutDown; +end. diff --git a/SOURCE/ELECOM/example.pas b/SOURCE/ELECOM/example.pas new file mode 100644 index 0000000..159cfd4 --- /dev/null +++ b/SOURCE/ELECOM/example.pas @@ -0,0 +1,181 @@ +program Example; +(* +** +** EXAMPLE how to use communications +** You can install this program from within EleBBS and test how it works :) +** This is only an example of how to use EleCOM for writing so-called "doors", +** to see an example how to use EleCOM independent off a BBS program, see +** EXAM2.PAS +** +** version: 1.01 +** Created: 08-Apr-1999 +** +** EleBBS install lines: +** +** DOS install line: EXAMPLE.EXE -H*P +** Win32 install line: EXAMPLE.EXE -H*W +** Win32 (telnet) install line: EXAMPLE.EXE -H*W -XT +** OS/2 install line: EXAMPLE.EXE -H*W +** OS/2 (telnet) install line: EXAMPLE.EXE -H*W -XT +** +*) + +{.DEFINE FOSSIL} +{.DEFINE OS2COM} +{$DEFINE W32COM} + +{$IFNDEF FOSSIL} + {$IFNDEF OS2COM} + {$IFNDEF W32COM} + You need to define one of these.. + {$ENDIF} + {$ENDIF} +{$ENDIF} + +uses Combase, + {$IFDEF FOSSIL} + Fos_Com + {$ENDIF} + + {$IFDEF OS2COM} + Os2Com, + Telnet + {$ENDIF} + + {$IFDEF W32COM} + W32SNGL, + Telnet + {$ENDIF} ; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +var ComObj : PCommObj; + IsTelnet : Boolean; + ComHandle : Longint; + ReadCH : Char; + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Int_ComReadProc(var TempPtr: Pointer); +begin + {$IFDEF WIN32} + Case IsTelnet of + FALSE : PWin32Obj(ComObj)^.Com_DataProc(TempPtr); + TRUE : PTelnetObj(ComObj)^.Com_ReadProc(TempPtr); + end; { case } + {$ENDIF} + + {$IFDEF OS2} + Case IsTelnet of + FALSE : POs2Obj(ComObj)^.Com_ReadProc(TempPtr); + TRUE : PTelnetObj(ComObj)^.Com_ReadProc(TempPtr); + end; { case } + {$ENDIF} +end; { proc. Int_ComReadProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure Int_ComWriteProc(var TempPtr: Pointer); +begin + {$IFDEF WIN32} + Case IsTelnet of + FALSE : PWin32Obj(ComObj)^.Com_DataProc(TempPtr); + TRUE : PTelnetObj(ComObj)^.Com_WriteProc(TempPtr); + end; { case } + {$ENDIF} + + {$IFDEF OS2} + Case IsTelnet of + FALSE : POs2Obj(ComObj)^.Com_WriteProc(TempPtr); + TRUE : PTelnetObj(ComObj)^.Com_WriteProc(TempPtr); + end; { case } + {$ENDIF} +end; { proc. Int_ComWriteProc } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +procedure ParseCommandLine; +var Counter: Longint; + TempStr: String; + {$IFDEF MSDOS} + Code : Integer; + {$ELSE} + Code : Longint; + {$ENDIF} +begin + for Counter := 01 to ParamCount do + begin + TempStr := ParamStr(Counter); + + if TempStr[1] in ['/', '-'] then + Case UpCase(TempStr[2]) of + 'H' : begin + + TempStr := Copy(TempStr, 3, Length(TempStr) - 2); + Val(TempStr, ComHandle, Code); + + + end; { 'H' } + 'X' : begin + + if UpCase(TempStr[3]) = 'T' then { XT } + IsTelnet := true; + + end; { 'X' } + end; { case } + + end; { for } +end; { proc. ParseCommandLine } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +Function FStr (N : LongInt) : String; { Convert integer to string } +var Temp: String; +begin + Str(n,temp); + FStr:=Temp; +end; { func. FStr } + +(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*) + +begin + IsTelnet := false; + ParseCommandLine; + + {$IFDEF W32COM} + if IsTelnet then ComObj := New(PTelnetObj, Init) + else ComObj := New(PWin32Obj, Init); + {$ENDIF} + + {$IFDEF FOSSIL} + ComObj := New(PFossilObj, Init); + {$ENDIF} + + {$IFDEF OS2COM} + if IsTelnet then ComObj := New(PTelnetObj, Init) + else ComObj := New(POs2Obj, Init); + {$ENDIF} + + {$IFDEF WIN32} + ComObj^.Com_SetDataProc(@Int_ComReadProc, @Int_ComWriteProc); + {$ENDIF} + + {$IFDEF OS2} + ComObj^.Com_SetDataProc(@Int_ComReadProc, @Int_ComWriteProc); + {$ENDIF} + + ComObj^.DontClose := true; { We use an inherited handle, never close it! } + ComObj^.Com_OpenQuick(ComHandle); { Open the comport using the handle } + ComObj^.Com_SendString('Hello there!' + #13#10); + ComObj^.Com_SendString('We are using handle #' + FStr(ComHandle) + #13#10); + + + repeat + ReadCH := ComObj^.Com_GetChar; + + if ReadCH <> #13 then + Writeln('Other..'); + until (ReadCH = #13) OR (NOT ComObj^.Com_Carrier); + + Dispose(ComObj, Done); { Dispose the communications object } +end. diff --git a/EMAIL.PAS b/SOURCE/EMAIL.PAS similarity index 100% rename from EMAIL.PAS rename to SOURCE/EMAIL.PAS diff --git a/EVENTS.PAS b/SOURCE/EVENTS.PAS similarity index 100% rename from EVENTS.PAS rename to SOURCE/EVENTS.PAS diff --git a/EXECBAT.PAS b/SOURCE/EXECBAT.PAS similarity index 100% rename from EXECBAT.PAS rename to SOURCE/EXECBAT.PAS diff --git a/FILE0.PAS b/SOURCE/FILE0.PAS similarity index 100% rename from FILE0.PAS rename to SOURCE/FILE0.PAS diff --git a/FILE1.PAS b/SOURCE/FILE1.PAS similarity index 100% rename from FILE1.PAS rename to SOURCE/FILE1.PAS diff --git a/FILE10.PAS b/SOURCE/FILE10.PAS similarity index 100% rename from FILE10.PAS rename to SOURCE/FILE10.PAS diff --git a/FILE11.PAS b/SOURCE/FILE11.PAS similarity index 100% rename from FILE11.PAS rename to SOURCE/FILE11.PAS diff --git a/FILE12.PAS b/SOURCE/FILE12.PAS similarity index 100% rename from FILE12.PAS rename to SOURCE/FILE12.PAS diff --git a/FILE13.PAS b/SOURCE/FILE13.PAS similarity index 100% rename from FILE13.PAS rename to SOURCE/FILE13.PAS diff --git a/FILE14.PAS b/SOURCE/FILE14.PAS similarity index 100% rename from FILE14.PAS rename to SOURCE/FILE14.PAS diff --git a/FILE2.PAS b/SOURCE/FILE2.PAS similarity index 100% rename from FILE2.PAS rename to SOURCE/FILE2.PAS diff --git a/FILE3.PAS b/SOURCE/FILE3.PAS similarity index 100% rename from FILE3.PAS rename to SOURCE/FILE3.PAS diff --git a/FILE4.PAS b/SOURCE/FILE4.PAS similarity index 100% rename from FILE4.PAS rename to SOURCE/FILE4.PAS diff --git a/FILE5.PAS b/SOURCE/FILE5.PAS similarity index 100% rename from FILE5.PAS rename to SOURCE/FILE5.PAS diff --git a/FILE6.PAS b/SOURCE/FILE6.PAS similarity index 100% rename from FILE6.PAS rename to SOURCE/FILE6.PAS diff --git a/FILE7.PAS b/SOURCE/FILE7.PAS similarity index 100% rename from FILE7.PAS rename to SOURCE/FILE7.PAS diff --git a/FILE8.PAS b/SOURCE/FILE8.PAS similarity index 100% rename from FILE8.PAS rename to SOURCE/FILE8.PAS diff --git a/FILE9.PAS b/SOURCE/FILE9.PAS similarity index 100% rename from FILE9.PAS rename to SOURCE/FILE9.PAS diff --git a/LINECHAT.PAS b/SOURCE/LINECHAT.PAS similarity index 100% rename from LINECHAT.PAS rename to SOURCE/LINECHAT.PAS diff --git a/LOGON.PAS b/SOURCE/LOGON.PAS similarity index 100% rename from LOGON.PAS rename to SOURCE/LOGON.PAS diff --git a/MAIL0.PAS b/SOURCE/MAIL0.PAS similarity index 100% rename from MAIL0.PAS rename to SOURCE/MAIL0.PAS diff --git a/MAIL1.PAS b/SOURCE/MAIL1.PAS similarity index 100% rename from MAIL1.PAS rename to SOURCE/MAIL1.PAS diff --git a/MAIL2.PAS b/SOURCE/MAIL2.PAS similarity index 100% rename from MAIL2.PAS rename to SOURCE/MAIL2.PAS diff --git a/MAIL3.PAS b/SOURCE/MAIL3.PAS similarity index 100% rename from MAIL3.PAS rename to SOURCE/MAIL3.PAS diff --git a/MAIL4.PAS b/SOURCE/MAIL4.PAS similarity index 100% rename from MAIL4.PAS rename to SOURCE/MAIL4.PAS diff --git a/MAINT.PAS b/SOURCE/MAINT.PAS similarity index 100% rename from MAINT.PAS rename to SOURCE/MAINT.PAS diff --git a/MENUS.PAS b/SOURCE/MENUS.PAS similarity index 100% rename from MENUS.PAS rename to SOURCE/MENUS.PAS diff --git a/MENUS2.PAS b/SOURCE/MENUS2.PAS similarity index 100% rename from MENUS2.PAS rename to SOURCE/MENUS2.PAS diff --git a/MENUS3.PAS b/SOURCE/MENUS3.PAS similarity index 100% rename from MENUS3.PAS rename to SOURCE/MENUS3.PAS diff --git a/MISCUSER.PAS b/SOURCE/MISCUSER.PAS similarity index 100% rename from MISCUSER.PAS rename to SOURCE/MISCUSER.PAS diff --git a/MSGPACK.PAS b/SOURCE/MSGPACK.PAS similarity index 100% rename from MSGPACK.PAS rename to SOURCE/MSGPACK.PAS diff --git a/MULTNODE.PAS b/SOURCE/MULTNODE.PAS similarity index 100% rename from MULTNODE.PAS rename to SOURCE/MULTNODE.PAS diff --git a/MYIO.PAS b/SOURCE/MYIO.PAS similarity index 100% rename from MYIO.PAS rename to SOURCE/MYIO.PAS diff --git a/NEWUSERS.PAS b/SOURCE/NEWUSERS.PAS similarity index 100% rename from NEWUSERS.PAS rename to SOURCE/NEWUSERS.PAS diff --git a/NODELIST.PAS b/SOURCE/NODELIST.PAS similarity index 100% rename from NODELIST.PAS rename to SOURCE/NODELIST.PAS diff --git a/OFFLINE.PAS b/SOURCE/OFFLINE.PAS similarity index 100% rename from OFFLINE.PAS rename to SOURCE/OFFLINE.PAS diff --git a/RECORDS.PAS b/SOURCE/RECORDS.PAS similarity index 100% rename from RECORDS.PAS rename to SOURCE/RECORDS.PAS diff --git a/RENEGADE.PAS b/SOURCE/RENEGADE.PAS similarity index 100% rename from RENEGADE.PAS rename to SOURCE/RENEGADE.PAS diff --git a/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS similarity index 100% rename from RENEMAIL.PAS rename to SOURCE/RENEMAIL.PAS diff --git a/RGLNG.PAS b/SOURCE/RGLNG.PAS similarity index 100% rename from RGLNG.PAS rename to SOURCE/RGLNG.PAS diff --git a/RGMAIN.PAS b/SOURCE/RGMAIN.PAS similarity index 100% rename from RGMAIN.PAS rename to SOURCE/RGMAIN.PAS diff --git a/RGNOTE.PAS b/SOURCE/RGNOTE.PAS similarity index 100% rename from RGNOTE.PAS rename to SOURCE/RGNOTE.PAS diff --git a/RGQUOTE.PAS b/SOURCE/RGQUOTE.PAS similarity index 100% rename from RGQUOTE.PAS rename to SOURCE/RGQUOTE.PAS diff --git a/RGSCFG.PAS b/SOURCE/RGSCFG.PAS similarity index 100% rename from RGSCFG.PAS rename to SOURCE/RGSCFG.PAS diff --git a/SCRIPT.PAS b/SOURCE/SCRIPT.PAS similarity index 100% rename from SCRIPT.PAS rename to SOURCE/SCRIPT.PAS diff --git a/SHORTMSG.PAS b/SOURCE/SHORTMSG.PAS similarity index 100% rename from SHORTMSG.PAS rename to SOURCE/SHORTMSG.PAS diff --git a/SPAWNO.PAS b/SOURCE/SPAWNO.PAS similarity index 100% rename from SPAWNO.PAS rename to SOURCE/SPAWNO.PAS diff --git a/SPLITCHA.PAS b/SOURCE/SPLITCHA.PAS similarity index 100% rename from SPLITCHA.PAS rename to SOURCE/SPLITCHA.PAS diff --git a/STATS.PAS b/SOURCE/STATS.PAS similarity index 100% rename from STATS.PAS rename to SOURCE/STATS.PAS diff --git a/SYSOP1.PAS b/SOURCE/SYSOP1.PAS similarity index 100% rename from SYSOP1.PAS rename to SOURCE/SYSOP1.PAS diff --git a/SYSOP10.PAS b/SOURCE/SYSOP10.PAS similarity index 100% rename from SYSOP10.PAS rename to SOURCE/SYSOP10.PAS diff --git a/SYSOP11.PAS b/SOURCE/SYSOP11.PAS similarity index 100% rename from SYSOP11.PAS rename to SOURCE/SYSOP11.PAS diff --git a/SYSOP12.PAS b/SOURCE/SYSOP12.PAS similarity index 100% rename from SYSOP12.PAS rename to SOURCE/SYSOP12.PAS diff --git a/SYSOP2.PAS b/SOURCE/SYSOP2.PAS similarity index 100% rename from SYSOP2.PAS rename to SOURCE/SYSOP2.PAS diff --git a/SYSOP2A.PAS b/SOURCE/SYSOP2A.PAS similarity index 100% rename from SYSOP2A.PAS rename to SOURCE/SYSOP2A.PAS diff --git a/SYSOP2B.PAS b/SOURCE/SYSOP2B.PAS similarity index 100% rename from SYSOP2B.PAS rename to SOURCE/SYSOP2B.PAS diff --git a/SYSOP2C.PAS b/SOURCE/SYSOP2C.PAS similarity index 100% rename from SYSOP2C.PAS rename to SOURCE/SYSOP2C.PAS diff --git a/SYSOP2D.PAS b/SOURCE/SYSOP2D.PAS similarity index 100% rename from SYSOP2D.PAS rename to SOURCE/SYSOP2D.PAS diff --git a/SYSOP2E.PAS b/SOURCE/SYSOP2E.PAS similarity index 100% rename from SYSOP2E.PAS rename to SOURCE/SYSOP2E.PAS diff --git a/SYSOP2F.PAS b/SOURCE/SYSOP2F.PAS similarity index 100% rename from SYSOP2F.PAS rename to SOURCE/SYSOP2F.PAS diff --git a/SYSOP2G.PAS b/SOURCE/SYSOP2G.PAS similarity index 100% rename from SYSOP2G.PAS rename to SOURCE/SYSOP2G.PAS diff --git a/SYSOP2H.PAS b/SOURCE/SYSOP2H.PAS similarity index 100% rename from SYSOP2H.PAS rename to SOURCE/SYSOP2H.PAS diff --git a/SYSOP2I.PAS b/SOURCE/SYSOP2I.PAS similarity index 100% rename from SYSOP2I.PAS rename to SOURCE/SYSOP2I.PAS diff --git a/SYSOP2J.PAS b/SOURCE/SYSOP2J.PAS similarity index 100% rename from SYSOP2J.PAS rename to SOURCE/SYSOP2J.PAS diff --git a/SYSOP2K.PAS b/SOURCE/SYSOP2K.PAS similarity index 100% rename from SYSOP2K.PAS rename to SOURCE/SYSOP2K.PAS diff --git a/SYSOP2L.PAS b/SOURCE/SYSOP2L.PAS similarity index 100% rename from SYSOP2L.PAS rename to SOURCE/SYSOP2L.PAS diff --git a/SYSOP2M.PAS b/SOURCE/SYSOP2M.PAS similarity index 100% rename from SYSOP2M.PAS rename to SOURCE/SYSOP2M.PAS diff --git a/SYSOP2O.PAS b/SOURCE/SYSOP2O.PAS similarity index 100% rename from SYSOP2O.PAS rename to SOURCE/SYSOP2O.PAS diff --git a/SYSOP3.PAS b/SOURCE/SYSOP3.PAS similarity index 100% rename from SYSOP3.PAS rename to SOURCE/SYSOP3.PAS diff --git a/SYSOP4.PAS b/SOURCE/SYSOP4.PAS similarity index 100% rename from SYSOP4.PAS rename to SOURCE/SYSOP4.PAS diff --git a/SYSOP5.PAS b/SOURCE/SYSOP5.PAS similarity index 100% rename from SYSOP5.PAS rename to SOURCE/SYSOP5.PAS diff --git a/SYSOP6.PAS b/SOURCE/SYSOP6.PAS similarity index 100% rename from SYSOP6.PAS rename to SOURCE/SYSOP6.PAS diff --git a/SYSOP7.PAS b/SOURCE/SYSOP7.PAS similarity index 100% rename from SYSOP7.PAS rename to SOURCE/SYSOP7.PAS diff --git a/SYSOP7M.PAS b/SOURCE/SYSOP7M.PAS similarity index 100% rename from SYSOP7M.PAS rename to SOURCE/SYSOP7M.PAS diff --git a/SYSOP8.PAS b/SOURCE/SYSOP8.PAS similarity index 100% rename from SYSOP8.PAS rename to SOURCE/SYSOP8.PAS diff --git a/SYSOP9.PAS b/SOURCE/SYSOP9.PAS similarity index 100% rename from SYSOP9.PAS rename to SOURCE/SYSOP9.PAS diff --git a/TAGLINE.PAS b/SOURCE/TAGLINE.PAS similarity index 100% rename from TAGLINE.PAS rename to SOURCE/TAGLINE.PAS diff --git a/TIMEBANK.PAS b/SOURCE/TIMEBANK.PAS similarity index 100% rename from TIMEBANK.PAS rename to SOURCE/TIMEBANK.PAS diff --git a/TIMEFUNC.PAS b/SOURCE/TIMEFUNC.PAS similarity index 100% rename from TIMEFUNC.PAS rename to SOURCE/TIMEFUNC.PAS diff --git a/ACFLAGS.ASC b/SOURCE/UNUSED/ACFLAGS.ASC similarity index 100% rename from ACFLAGS.ASC rename to SOURCE/UNUSED/ACFLAGS.ASC diff --git a/ARCHIVE1.TPU b/SOURCE/UNUSED/ARCHIVE1.TPU similarity index 100% rename from ARCHIVE1.TPU rename to SOURCE/UNUSED/ARCHIVE1.TPU diff --git a/ARCHIVE2.TPU b/SOURCE/UNUSED/ARCHIVE2.TPU similarity index 100% rename from ARCHIVE2.TPU rename to SOURCE/UNUSED/ARCHIVE2.TPU diff --git a/ARCHIVE3.TPU b/SOURCE/UNUSED/ARCHIVE3.TPU similarity index 100% rename from ARCHIVE3.TPU rename to SOURCE/UNUSED/ARCHIVE3.TPU diff --git a/ARCVIEW.TPU b/SOURCE/UNUSED/ARCVIEW.TPU similarity index 100% rename from ARCVIEW.TPU rename to SOURCE/UNUSED/ARCVIEW.TPU diff --git a/AUTOMSG.TPU b/SOURCE/UNUSED/AUTOMSG.TPU similarity index 100% rename from AUTOMSG.TPU rename to SOURCE/UNUSED/AUTOMSG.TPU diff --git a/BATCH6.LST b/SOURCE/UNUSED/BATCH6.LST similarity index 100% rename from BATCH6.LST rename to SOURCE/UNUSED/BATCH6.LST diff --git a/BBSLIST.TPU b/SOURCE/UNUSED/BBSLIST.TPU similarity index 100% rename from BBSLIST.TPU rename to SOURCE/UNUSED/BBSLIST.TPU diff --git a/BOOT.TPU b/SOURCE/UNUSED/BOOT.TPU similarity index 100% rename from BOOT.TPU rename to SOURCE/UNUSED/BOOT.TPU diff --git a/BULLETIN.TPU b/SOURCE/UNUSED/BULLETIN.TPU similarity index 100% rename from BULLETIN.TPU rename to SOURCE/UNUSED/BULLETIN.TPU diff --git a/CHAIN.TXT b/SOURCE/UNUSED/CHAIN.TXT similarity index 100% rename from CHAIN.TXT rename to SOURCE/UNUSED/CHAIN.TXT diff --git a/CHAINT~1.TXT b/SOURCE/UNUSED/CHAINT~1.TXT similarity index 100% rename from CHAINT~1.TXT rename to SOURCE/UNUSED/CHAINT~1.TXT diff --git a/CHANGE.TXT b/SOURCE/UNUSED/CHANGE.TXT similarity index 100% rename from CHANGE.TXT rename to SOURCE/UNUSED/CHANGE.TXT diff --git a/CHANGE1.TXT b/SOURCE/UNUSED/CHANGE1.TXT similarity index 100% rename from CHANGE1.TXT rename to SOURCE/UNUSED/CHANGE1.TXT diff --git a/CHANGE10.TXT b/SOURCE/UNUSED/CHANGE10.TXT similarity index 100% rename from CHANGE10.TXT rename to SOURCE/UNUSED/CHANGE10.TXT diff --git a/CHANGE11.TXT b/SOURCE/UNUSED/CHANGE11.TXT similarity index 100% rename from CHANGE11.TXT rename to SOURCE/UNUSED/CHANGE11.TXT diff --git a/CHANGE12.TXT b/SOURCE/UNUSED/CHANGE12.TXT similarity index 100% rename from CHANGE12.TXT rename to SOURCE/UNUSED/CHANGE12.TXT diff --git a/CHANGE13.TXT b/SOURCE/UNUSED/CHANGE13.TXT similarity index 100% rename from CHANGE13.TXT rename to SOURCE/UNUSED/CHANGE13.TXT diff --git a/CHANGE14.TXT b/SOURCE/UNUSED/CHANGE14.TXT similarity index 100% rename from CHANGE14.TXT rename to SOURCE/UNUSED/CHANGE14.TXT diff --git a/CHANGE2.TXT b/SOURCE/UNUSED/CHANGE2.TXT similarity index 100% rename from CHANGE2.TXT rename to SOURCE/UNUSED/CHANGE2.TXT diff --git a/CHANGE3.TXT b/SOURCE/UNUSED/CHANGE3.TXT similarity index 100% rename from CHANGE3.TXT rename to SOURCE/UNUSED/CHANGE3.TXT diff --git a/CHANGE4.TXT b/SOURCE/UNUSED/CHANGE4.TXT similarity index 100% rename from CHANGE4.TXT rename to SOURCE/UNUSED/CHANGE4.TXT diff --git a/CHANGE5.TXT b/SOURCE/UNUSED/CHANGE5.TXT similarity index 100% rename from CHANGE5.TXT rename to SOURCE/UNUSED/CHANGE5.TXT diff --git a/CHANGE6.TXT b/SOURCE/UNUSED/CHANGE6.TXT similarity index 100% rename from CHANGE6.TXT rename to SOURCE/UNUSED/CHANGE6.TXT diff --git a/CHANGE7.TXT b/SOURCE/UNUSED/CHANGE7.TXT similarity index 100% rename from CHANGE7.TXT rename to SOURCE/UNUSED/CHANGE7.TXT diff --git a/CHANGE8.TXT b/SOURCE/UNUSED/CHANGE8.TXT similarity index 100% rename from CHANGE8.TXT rename to SOURCE/UNUSED/CHANGE8.TXT diff --git a/CHANGE9.TXT b/SOURCE/UNUSED/CHANGE9.TXT similarity index 100% rename from CHANGE9.TXT rename to SOURCE/UNUSED/CHANGE9.TXT diff --git a/CHANGES.TXT b/SOURCE/UNUSED/CHANGES.TXT similarity index 100% rename from CHANGES.TXT rename to SOURCE/UNUSED/CHANGES.TXT diff --git a/CHANGES1.TXT b/SOURCE/UNUSED/CHANGES1.TXT similarity index 100% rename from CHANGES1.TXT rename to SOURCE/UNUSED/CHANGES1.TXT diff --git a/CHANGES2.TXT b/SOURCE/UNUSED/CHANGES2.TXT similarity index 100% rename from CHANGES2.TXT rename to SOURCE/UNUSED/CHANGES2.TXT diff --git a/CHANGES3.TXT b/SOURCE/UNUSED/CHANGES3.TXT similarity index 100% rename from CHANGES3.TXT rename to SOURCE/UNUSED/CHANGES3.TXT diff --git a/CHANGES4.TXT b/SOURCE/UNUSED/CHANGES4.TXT similarity index 100% rename from CHANGES4.TXT rename to SOURCE/UNUSED/CHANGES4.TXT diff --git a/CHANGES7.TXT b/SOURCE/UNUSED/CHANGES7.TXT similarity index 100% rename from CHANGES7.TXT rename to SOURCE/UNUSED/CHANGES7.TXT diff --git a/CHANGES8.TXT b/SOURCE/UNUSED/CHANGES8.TXT similarity index 100% rename from CHANGES8.TXT rename to SOURCE/UNUSED/CHANGES8.TXT diff --git a/CHANGES9.TXT b/SOURCE/UNUSED/CHANGES9.TXT similarity index 100% rename from CHANGES9.TXT rename to SOURCE/UNUSED/CHANGES9.TXT diff --git a/CHNAGE2.TXT b/SOURCE/UNUSED/CHNAGE2.TXT similarity index 100% rename from CHNAGE2.TXT rename to SOURCE/UNUSED/CHNAGE2.TXT diff --git a/COMMON.TPU b/SOURCE/UNUSED/COMMON.TPU similarity index 100% rename from COMMON.TPU rename to SOURCE/UNUSED/COMMON.TPU diff --git a/COMMON1.TPU b/SOURCE/UNUSED/COMMON1.TPU similarity index 100% rename from COMMON1.TPU rename to SOURCE/UNUSED/COMMON1.TPU diff --git a/COMMON2.TPU b/SOURCE/UNUSED/COMMON2.TPU similarity index 100% rename from COMMON2.TPU rename to SOURCE/UNUSED/COMMON2.TPU diff --git a/COMMON3.TPU b/SOURCE/UNUSED/COMMON3.TPU similarity index 100% rename from COMMON3.TPU rename to SOURCE/UNUSED/COMMON3.TPU diff --git a/COMMON4.TPU b/SOURCE/UNUSED/COMMON4.TPU similarity index 100% rename from COMMON4.TPU rename to SOURCE/UNUSED/COMMON4.TPU diff --git a/COMMON5.TPU b/SOURCE/UNUSED/COMMON5.TPU similarity index 100% rename from COMMON5.TPU rename to SOURCE/UNUSED/COMMON5.TPU diff --git a/CRC32.ASM b/SOURCE/UNUSED/CRC32.ASM similarity index 100% rename from CRC32.ASM rename to SOURCE/UNUSED/CRC32.ASM diff --git a/CRC32A.PAS b/SOURCE/UNUSED/CRC32A.PAS similarity index 100% rename from CRC32A.PAS rename to SOURCE/UNUSED/CRC32A.PAS diff --git a/CUSER.TPU b/SOURCE/UNUSED/CUSER.TPU similarity index 100% rename from CUSER.TPU rename to SOURCE/UNUSED/CUSER.TPU diff --git a/DEZIP.PAS b/SOURCE/UNUSED/DEZIP.PAS similarity index 100% rename from DEZIP.PAS rename to SOURCE/UNUSED/DEZIP.PAS diff --git a/DOOR.SYS b/SOURCE/UNUSED/DOOR.SYS similarity index 100% rename from DOOR.SYS rename to SOURCE/UNUSED/DOOR.SYS diff --git a/DOOR32.SYS b/SOURCE/UNUSED/DOOR32.SYS similarity index 100% rename from DOOR32.SYS rename to SOURCE/UNUSED/DOOR32.SYS diff --git a/DOOR32~1.TXT b/SOURCE/UNUSED/DOOR32~1.TXT similarity index 100% rename from DOOR32~1.TXT rename to SOURCE/UNUSED/DOOR32~1.TXT diff --git a/DOORS.TPU b/SOURCE/UNUSED/DOORS.TPU similarity index 100% rename from DOORS.TPU rename to SOURCE/UNUSED/DOORS.TPU diff --git a/DOORSY~1.DOC b/SOURCE/UNUSED/DOORSY~1.DOC similarity index 100% rename from DOORSY~1.DOC rename to SOURCE/UNUSED/DOORSY~1.DOC diff --git a/DORINFO1.DEF b/SOURCE/UNUSED/DORINFO1.DEF similarity index 100% rename from DORINFO1.DEF rename to SOURCE/UNUSED/DORINFO1.DEF diff --git a/DORINF~1.TXT b/SOURCE/UNUSED/DORINF~1.TXT similarity index 100% rename from DORINF~1.TXT rename to SOURCE/UNUSED/DORINF~1.TXT diff --git a/DRAG_010.PAS b/SOURCE/UNUSED/DRAG_010.PAS similarity index 100% rename from DRAG_010.PAS rename to SOURCE/UNUSED/DRAG_010.PAS diff --git a/EC.PAS b/SOURCE/UNUSED/EC.PAS similarity index 100% rename from EC.PAS rename to SOURCE/UNUSED/EC.PAS diff --git a/EC.TXT b/SOURCE/UNUSED/EC.TXT similarity index 100% rename from EC.TXT rename to SOURCE/UNUSED/EC.TXT diff --git a/EMAIL.TPU b/SOURCE/UNUSED/EMAIL.TPU similarity index 100% rename from EMAIL.TPU rename to SOURCE/UNUSED/EMAIL.TPU diff --git a/ERROR.LOG b/SOURCE/UNUSED/ERROR.LOG similarity index 100% rename from ERROR.LOG rename to SOURCE/UNUSED/ERROR.LOG diff --git a/EVENT.PAS b/SOURCE/UNUSED/EVENT.PAS similarity index 100% rename from EVENT.PAS rename to SOURCE/UNUSED/EVENT.PAS diff --git a/EVENT.TPU b/SOURCE/UNUSED/EVENT.TPU similarity index 100% rename from EVENT.TPU rename to SOURCE/UNUSED/EVENT.TPU diff --git a/EVENTS.TPU b/SOURCE/UNUSED/EVENTS.TPU similarity index 100% rename from EVENTS.TPU rename to SOURCE/UNUSED/EVENTS.TPU diff --git a/EXECBAT.TPU b/SOURCE/UNUSED/EXECBAT.TPU similarity index 100% rename from EXECBAT.TPU rename to SOURCE/UNUSED/EXECBAT.TPU diff --git a/FAELNG.EXE b/SOURCE/UNUSED/FAELNG.EXE similarity index 100% rename from FAELNG.EXE rename to SOURCE/UNUSED/FAELNG.EXE diff --git a/FAELNG.PAS b/SOURCE/UNUSED/FAELNG.PAS similarity index 100% rename from FAELNG.PAS rename to SOURCE/UNUSED/FAELNG.PAS diff --git a/FAELNG.TXT b/SOURCE/UNUSED/FAELNG.TXT similarity index 100% rename from FAELNG.TXT rename to SOURCE/UNUSED/FAELNG.TXT diff --git a/FAEPR.DAT b/SOURCE/UNUSED/FAEPR.DAT similarity index 100% rename from FAEPR.DAT rename to SOURCE/UNUSED/FAEPR.DAT diff --git a/FAETX.DAT b/SOURCE/UNUSED/FAETX.DAT similarity index 100% rename from FAETX.DAT rename to SOURCE/UNUSED/FAETX.DAT diff --git a/FILE0.TPU b/SOURCE/UNUSED/FILE0.TPU similarity index 100% rename from FILE0.TPU rename to SOURCE/UNUSED/FILE0.TPU diff --git a/FILE1.TPU b/SOURCE/UNUSED/FILE1.TPU similarity index 100% rename from FILE1.TPU rename to SOURCE/UNUSED/FILE1.TPU diff --git a/FILE10.LEE b/SOURCE/UNUSED/FILE10.LEE similarity index 100% rename from FILE10.LEE rename to SOURCE/UNUSED/FILE10.LEE diff --git a/FILE10.TPU b/SOURCE/UNUSED/FILE10.TPU similarity index 100% rename from FILE10.TPU rename to SOURCE/UNUSED/FILE10.TPU diff --git a/FILE11.TPU b/SOURCE/UNUSED/FILE11.TPU similarity index 100% rename from FILE11.TPU rename to SOURCE/UNUSED/FILE11.TPU diff --git a/FILE12.TPU b/SOURCE/UNUSED/FILE12.TPU similarity index 100% rename from FILE12.TPU rename to SOURCE/UNUSED/FILE12.TPU diff --git a/FILE13.TPU b/SOURCE/UNUSED/FILE13.TPU similarity index 100% rename from FILE13.TPU rename to SOURCE/UNUSED/FILE13.TPU diff --git a/FILE14.TPU b/SOURCE/UNUSED/FILE14.TPU similarity index 100% rename from FILE14.TPU rename to SOURCE/UNUSED/FILE14.TPU diff --git a/FILE2.TPU b/SOURCE/UNUSED/FILE2.TPU similarity index 100% rename from FILE2.TPU rename to SOURCE/UNUSED/FILE2.TPU diff --git a/FILE3.TPU b/SOURCE/UNUSED/FILE3.TPU similarity index 100% rename from FILE3.TPU rename to SOURCE/UNUSED/FILE3.TPU diff --git a/FILE4.TPU b/SOURCE/UNUSED/FILE4.TPU similarity index 100% rename from FILE4.TPU rename to SOURCE/UNUSED/FILE4.TPU diff --git a/FILE5.TPU b/SOURCE/UNUSED/FILE5.TPU similarity index 100% rename from FILE5.TPU rename to SOURCE/UNUSED/FILE5.TPU diff --git a/FILE6.TPU b/SOURCE/UNUSED/FILE6.TPU similarity index 100% rename from FILE6.TPU rename to SOURCE/UNUSED/FILE6.TPU diff --git a/FILE7.TPU b/SOURCE/UNUSED/FILE7.TPU similarity index 100% rename from FILE7.TPU rename to SOURCE/UNUSED/FILE7.TPU diff --git a/FILE8.TPU b/SOURCE/UNUSED/FILE8.TPU similarity index 100% rename from FILE8.TPU rename to SOURCE/UNUSED/FILE8.TPU diff --git a/FILE9.TPU b/SOURCE/UNUSED/FILE9.TPU similarity index 100% rename from FILE9.TPU rename to SOURCE/UNUSED/FILE9.TPU diff --git a/FILES.BBS b/SOURCE/UNUSED/FILES.BBS similarity index 100% rename from FILES.BBS rename to SOURCE/UNUSED/FILES.BBS diff --git a/FSHELP.ASC b/SOURCE/UNUSED/FSHELP.ASC similarity index 100% rename from FSHELP.ASC rename to SOURCE/UNUSED/FSHELP.ASC diff --git a/FSTR.PAS b/SOURCE/UNUSED/FSTR.PAS similarity index 100% rename from FSTR.PAS rename to SOURCE/UNUSED/FSTR.PAS diff --git a/FTS-0001.016 b/SOURCE/UNUSED/FTS-0001.016 similarity index 100% rename from FTS-0001.016 rename to SOURCE/UNUSED/FTS-0001.016 diff --git a/GREP.COM b/SOURCE/UNUSED/GREP.COM similarity index 100% rename from GREP.COM rename to SOURCE/UNUSED/GREP.COM diff --git a/INSTALL.EXE b/SOURCE/UNUSED/INSTALL.EXE similarity index 100% rename from INSTALL.EXE rename to SOURCE/UNUSED/INSTALL.EXE diff --git a/INSTALL.PAS b/SOURCE/UNUSED/INSTALL.PAS similarity index 100% rename from INSTALL.PAS rename to SOURCE/UNUSED/INSTALL.PAS diff --git a/IS286.PAS b/SOURCE/UNUSED/IS286.PAS similarity index 100% rename from IS286.PAS rename to SOURCE/UNUSED/IS286.PAS diff --git a/LEE.EXE b/SOURCE/UNUSED/LEE.EXE similarity index 100% rename from LEE.EXE rename to SOURCE/UNUSED/LEE.EXE diff --git a/LEE.PAS b/SOURCE/UNUSED/LEE.PAS similarity index 100% rename from LEE.PAS rename to SOURCE/UNUSED/LEE.PAS diff --git a/LEE.TXT b/SOURCE/UNUSED/LEE.TXT similarity index 100% rename from LEE.TXT rename to SOURCE/UNUSED/LEE.TXT diff --git a/LGNQUOTE.DAT b/SOURCE/UNUSED/LGNQUOTE.DAT similarity index 100% rename from LGNQUOTE.DAT rename to SOURCE/UNUSED/LGNQUOTE.DAT diff --git a/LGNQUOTE.PTR b/SOURCE/UNUSED/LGNQUOTE.PTR similarity index 100% rename from LGNQUOTE.PTR rename to SOURCE/UNUSED/LGNQUOTE.PTR diff --git a/LGNQUOTE.TXT b/SOURCE/UNUSED/LGNQUOTE.TXT similarity index 100% rename from LGNQUOTE.TXT rename to SOURCE/UNUSED/LGNQUOTE.TXT diff --git a/LINECHAT.TPU b/SOURCE/UNUSED/LINECHAT.TPU similarity index 100% rename from LINECHAT.TPU rename to SOURCE/UNUSED/LINECHAT.TPU diff --git a/LOGON.BAT b/SOURCE/UNUSED/LOGON.BAT similarity index 100% rename from LOGON.BAT rename to SOURCE/UNUSED/LOGON.BAT diff --git a/LOGON.TPU b/SOURCE/UNUSED/LOGON.TPU similarity index 100% rename from LOGON.TPU rename to SOURCE/UNUSED/LOGON.TPU diff --git a/MAIL0.TPU b/SOURCE/UNUSED/MAIL0.TPU similarity index 100% rename from MAIL0.TPU rename to SOURCE/UNUSED/MAIL0.TPU diff --git a/MAIL1.LEE b/SOURCE/UNUSED/MAIL1.LEE similarity index 100% rename from MAIL1.LEE rename to SOURCE/UNUSED/MAIL1.LEE diff --git a/MAIL1.TPU b/SOURCE/UNUSED/MAIL1.TPU similarity index 100% rename from MAIL1.TPU rename to SOURCE/UNUSED/MAIL1.TPU diff --git a/MAIL2.TPU b/SOURCE/UNUSED/MAIL2.TPU similarity index 100% rename from MAIL2.TPU rename to SOURCE/UNUSED/MAIL2.TPU diff --git a/MAIL3.TPU b/SOURCE/UNUSED/MAIL3.TPU similarity index 100% rename from MAIL3.TPU rename to SOURCE/UNUSED/MAIL3.TPU diff --git a/MAIL4.TPU b/SOURCE/UNUSED/MAIL4.TPU similarity index 100% rename from MAIL4.TPU rename to SOURCE/UNUSED/MAIL4.TPU diff --git a/MAIL5.PAS b/SOURCE/UNUSED/MAIL5.PAS similarity index 100% rename from MAIL5.PAS rename to SOURCE/UNUSED/MAIL5.PAS diff --git a/MAIL5.TPU b/SOURCE/UNUSED/MAIL5.TPU similarity index 100% rename from MAIL5.TPU rename to SOURCE/UNUSED/MAIL5.TPU diff --git a/MAIL6.PAS b/SOURCE/UNUSED/MAIL6.PAS similarity index 100% rename from MAIL6.PAS rename to SOURCE/UNUSED/MAIL6.PAS diff --git a/MAIL6.TPU b/SOURCE/UNUSED/MAIL6.TPU similarity index 100% rename from MAIL6.TPU rename to SOURCE/UNUSED/MAIL6.TPU diff --git a/MAIL7.PAS b/SOURCE/UNUSED/MAIL7.PAS similarity index 100% rename from MAIL7.PAS rename to SOURCE/UNUSED/MAIL7.PAS diff --git a/MAIL7.TPU b/SOURCE/UNUSED/MAIL7.TPU similarity index 100% rename from MAIL7.TPU rename to SOURCE/UNUSED/MAIL7.TPU diff --git a/MAINT.TPU b/SOURCE/UNUSED/MAINT.TPU similarity index 100% rename from MAINT.TPU rename to SOURCE/UNUSED/MAINT.TPU diff --git a/MARRIAGE.DAT b/SOURCE/UNUSED/MARRIAGE.DAT similarity index 100% rename from MARRIAGE.DAT rename to SOURCE/UNUSED/MARRIAGE.DAT diff --git a/MARRIAGE.PTR b/SOURCE/UNUSED/MARRIAGE.PTR similarity index 100% rename from MARRIAGE.PTR rename to SOURCE/UNUSED/MARRIAGE.PTR diff --git a/MARRIAGE.TXT b/SOURCE/UNUSED/MARRIAGE.TXT similarity index 100% rename from MARRIAGE.TXT rename to SOURCE/UNUSED/MARRIAGE.TXT diff --git a/MENUS.TPU b/SOURCE/UNUSED/MENUS.TPU similarity index 100% rename from MENUS.TPU rename to SOURCE/UNUSED/MENUS.TPU diff --git a/MENUS2.TPU b/SOURCE/UNUSED/MENUS2.TPU similarity index 100% rename from MENUS2.TPU rename to SOURCE/UNUSED/MENUS2.TPU diff --git a/MENUS3.TPU b/SOURCE/UNUSED/MENUS3.TPU similarity index 100% rename from MENUS3.TPU rename to SOURCE/UNUSED/MENUS3.TPU diff --git a/MENUS4.PAS b/SOURCE/UNUSED/MENUS4.PAS similarity index 100% rename from MENUS4.PAS rename to SOURCE/UNUSED/MENUS4.PAS diff --git a/MENUS4.TPU b/SOURCE/UNUSED/MENUS4.TPU similarity index 100% rename from MENUS4.TPU rename to SOURCE/UNUSED/MENUS4.TPU diff --git a/MISCCHAT.PAS b/SOURCE/UNUSED/MISCCHAT.PAS similarity index 100% rename from MISCCHAT.PAS rename to SOURCE/UNUSED/MISCCHAT.PAS diff --git a/MISCUSER.TPU b/SOURCE/UNUSED/MISCUSER.TPU similarity index 100% rename from MISCUSER.TPU rename to SOURCE/UNUSED/MISCUSER.TPU diff --git a/MSGPACK.TPU b/SOURCE/UNUSED/MSGPACK.TPU similarity index 100% rename from MSGPACK.TPU rename to SOURCE/UNUSED/MSGPACK.TPU diff --git a/MSGQUOTE.DAT b/SOURCE/UNUSED/MSGQUOTE.DAT similarity index 100% rename from MSGQUOTE.DAT rename to SOURCE/UNUSED/MSGQUOTE.DAT diff --git a/MSGQUOTE.PTR b/SOURCE/UNUSED/MSGQUOTE.PTR similarity index 100% rename from MSGQUOTE.PTR rename to SOURCE/UNUSED/MSGQUOTE.PTR diff --git a/MSGQUOTE.TXT b/SOURCE/UNUSED/MSGQUOTE.TXT similarity index 100% rename from MSGQUOTE.TXT rename to SOURCE/UNUSED/MSGQUOTE.TXT diff --git a/MULT.PAS b/SOURCE/UNUSED/MULT.PAS similarity index 100% rename from MULT.PAS rename to SOURCE/UNUSED/MULT.PAS diff --git a/MULTNODE.TPU b/SOURCE/UNUSED/MULTNODE.TPU similarity index 100% rename from MULTNODE.TPU rename to SOURCE/UNUSED/MULTNODE.TPU diff --git a/MYIO.TPU b/SOURCE/UNUSED/MYIO.TPU similarity index 100% rename from MYIO.TPU rename to SOURCE/UNUSED/MYIO.TPU diff --git a/NEWMCI.TXT b/SOURCE/UNUSED/NEWMCI.TXT similarity index 100% rename from NEWMCI.TXT rename to SOURCE/UNUSED/NEWMCI.TXT diff --git a/NEWUSERS.TPU b/SOURCE/UNUSED/NEWUSERS.TPU similarity index 100% rename from NEWUSERS.TPU rename to SOURCE/UNUSED/NEWUSERS.TPU diff --git a/NODELIST.TPU b/SOURCE/UNUSED/NODELIST.TPU similarity index 100% rename from NODELIST.TPU rename to SOURCE/UNUSED/NODELIST.TPU diff --git a/NONAME00.EXE b/SOURCE/UNUSED/NONAME00.EXE similarity index 100% rename from NONAME00.EXE rename to SOURCE/UNUSED/NONAME00.EXE diff --git a/OFFLINE.TPU b/SOURCE/UNUSED/OFFLINE.TPU similarity index 100% rename from OFFLINE.TPU rename to SOURCE/UNUSED/OFFLINE.TPU diff --git a/OVRUMB.DOC b/SOURCE/UNUSED/OVRUMB.DOC similarity index 100% rename from OVRUMB.DOC rename to SOURCE/UNUSED/OVRUMB.DOC diff --git a/OVRUMB.PAS b/SOURCE/UNUSED/OVRUMB.PAS similarity index 100% rename from OVRUMB.PAS rename to SOURCE/UNUSED/OVRUMB.PAS diff --git a/OVRUMB.TPU b/SOURCE/UNUSED/OVRUMB.TPU similarity index 100% rename from OVRUMB.TPU rename to SOURCE/UNUSED/OVRUMB.TPU diff --git a/PCBOAR~1.TXT b/SOURCE/UNUSED/PCBOAR~1.TXT similarity index 100% rename from PCBOAR~1.TXT rename to SOURCE/UNUSED/PCBOAR~1.TXT diff --git a/PKUNZIP.EXE b/SOURCE/UNUSED/PKUNZIP.EXE similarity index 100% rename from PKUNZIP.EXE rename to SOURCE/UNUSED/PKUNZIP.EXE diff --git a/PKZIP.EXE b/SOURCE/UNUSED/PKZIP.EXE similarity index 100% rename from PKZIP.EXE rename to SOURCE/UNUSED/PKZIP.EXE diff --git a/PRHELP.ASC b/SOURCE/UNUSED/PRHELP.ASC similarity index 100% rename from PRHELP.ASC rename to SOURCE/UNUSED/PRHELP.ASC diff --git a/RENEGADE.DAT b/SOURCE/UNUSED/RENEGADE.DAT similarity index 100% rename from RENEGADE.DAT rename to SOURCE/UNUSED/RENEGADE.DAT diff --git a/RENEGADE.EXE b/SOURCE/UNUSED/RENEGADE.EXE similarity index 100% rename from RENEGADE.EXE rename to SOURCE/UNUSED/RENEGADE.EXE diff --git a/RENEGADE.LNG b/SOURCE/UNUSED/RENEGADE.LNG similarity index 100% rename from RENEGADE.LNG rename to SOURCE/UNUSED/RENEGADE.LNG diff --git a/RENEGADE.OVR b/SOURCE/UNUSED/RENEGADE.OVR similarity index 100% rename from RENEGADE.OVR rename to SOURCE/UNUSED/RENEGADE.OVR diff --git a/RENEGADE.PIF b/SOURCE/UNUSED/RENEGADE.PIF similarity index 100% rename from RENEGADE.PIF rename to SOURCE/UNUSED/RENEGADE.PIF diff --git a/RENEGADE.TPH b/SOURCE/UNUSED/RENEGADE.TPH similarity index 100% rename from RENEGADE.TPH rename to SOURCE/UNUSED/RENEGADE.TPH diff --git a/RENEMAIL.EXE b/SOURCE/UNUSED/RENEMAIL.EXE similarity index 100% rename from RENEMAIL.EXE rename to SOURCE/UNUSED/RENEMAIL.EXE diff --git a/RENEMAIL.TPH b/SOURCE/UNUSED/RENEMAIL.TPH similarity index 100% rename from RENEMAIL.TPH rename to SOURCE/UNUSED/RENEMAIL.TPH diff --git a/REUPDATE.PAS b/SOURCE/UNUSED/REUPDATE.PAS similarity index 100% rename from REUPDATE.PAS rename to SOURCE/UNUSED/REUPDATE.PAS diff --git a/RGAPI.PAS b/SOURCE/UNUSED/RGAPI.PAS similarity index 100% rename from RGAPI.PAS rename to SOURCE/UNUSED/RGAPI.PAS diff --git a/RGFLIST.PAS b/SOURCE/UNUSED/RGFLIST.PAS similarity index 100% rename from RGFLIST.PAS rename to SOURCE/UNUSED/RGFLIST.PAS diff --git a/RGINTRO.ANS b/SOURCE/UNUSED/RGINTRO.ANS similarity index 100% rename from RGINTRO.ANS rename to SOURCE/UNUSED/RGINTRO.ANS diff --git a/RGLNG.EXE b/SOURCE/UNUSED/RGLNG.EXE similarity index 100% rename from RGLNG.EXE rename to SOURCE/UNUSED/RGLNG.EXE diff --git a/RGLNG.TXT b/SOURCE/UNUSED/RGLNG.TXT similarity index 100% rename from RGLNG.TXT rename to SOURCE/UNUSED/RGLNG.TXT diff --git a/RGLNGNEW.TXT b/SOURCE/UNUSED/RGLNGNEW.TXT similarity index 100% rename from RGLNGNEW.TXT rename to SOURCE/UNUSED/RGLNGNEW.TXT diff --git a/RGLNGPR.DAT b/SOURCE/UNUSED/RGLNGPR.DAT similarity index 100% rename from RGLNGPR.DAT rename to SOURCE/UNUSED/RGLNGPR.DAT diff --git a/RGLNGTX.DAT b/SOURCE/UNUSED/RGLNGTX.DAT similarity index 100% rename from RGLNGTX.DAT rename to SOURCE/UNUSED/RGLNGTX.DAT diff --git a/RGMAIN.EXE b/SOURCE/UNUSED/RGMAIN.EXE similarity index 100% rename from RGMAIN.EXE rename to SOURCE/UNUSED/RGMAIN.EXE diff --git a/RGMAIN.TXT b/SOURCE/UNUSED/RGMAIN.TXT similarity index 100% rename from RGMAIN.TXT rename to SOURCE/UNUSED/RGMAIN.TXT diff --git a/RGMAINPR.DAT b/SOURCE/UNUSED/RGMAINPR.DAT similarity index 100% rename from RGMAINPR.DAT rename to SOURCE/UNUSED/RGMAINPR.DAT diff --git a/RGMAINT.EXE b/SOURCE/UNUSED/RGMAINT.EXE similarity index 100% rename from RGMAINT.EXE rename to SOURCE/UNUSED/RGMAINT.EXE diff --git a/RGMAINT.PAS b/SOURCE/UNUSED/RGMAINT.PAS similarity index 100% rename from RGMAINT.PAS rename to SOURCE/UNUSED/RGMAINT.PAS diff --git a/RGMAINT1.PAS b/SOURCE/UNUSED/RGMAINT1.PAS similarity index 100% rename from RGMAINT1.PAS rename to SOURCE/UNUSED/RGMAINT1.PAS diff --git a/RGMAINT2.PAS b/SOURCE/UNUSED/RGMAINT2.PAS similarity index 100% rename from RGMAINT2.PAS rename to SOURCE/UNUSED/RGMAINT2.PAS diff --git a/RGMAINTX.DAT b/SOURCE/UNUSED/RGMAINTX.DAT similarity index 100% rename from RGMAINTX.DAT rename to SOURCE/UNUSED/RGMAINTX.DAT diff --git a/RGNOTE.EXE b/SOURCE/UNUSED/RGNOTE.EXE similarity index 100% rename from RGNOTE.EXE rename to SOURCE/UNUSED/RGNOTE.EXE diff --git a/RGNOTE.TXT b/SOURCE/UNUSED/RGNOTE.TXT similarity index 100% rename from RGNOTE.TXT rename to SOURCE/UNUSED/RGNOTE.TXT diff --git a/RGNOTEPR.DAT b/SOURCE/UNUSED/RGNOTEPR.DAT similarity index 100% rename from RGNOTEPR.DAT rename to SOURCE/UNUSED/RGNOTEPR.DAT diff --git a/RGNOTETX.DAT b/SOURCE/UNUSED/RGNOTETX.DAT similarity index 100% rename from RGNOTETX.DAT rename to SOURCE/UNUSED/RGNOTETX.DAT diff --git a/RGQUOTE.EXE b/SOURCE/UNUSED/RGQUOTE.EXE similarity index 100% rename from RGQUOTE.EXE rename to SOURCE/UNUSED/RGQUOTE.EXE diff --git a/RGSCFG.EXE b/SOURCE/UNUSED/RGSCFG.EXE similarity index 100% rename from RGSCFG.EXE rename to SOURCE/UNUSED/RGSCFG.EXE diff --git a/RGSCFG.TXT b/SOURCE/UNUSED/RGSCFG.TXT similarity index 100% rename from RGSCFG.TXT rename to SOURCE/UNUSED/RGSCFG.TXT diff --git a/RGSCFGPR.DAT b/SOURCE/UNUSED/RGSCFGPR.DAT similarity index 100% rename from RGSCFGPR.DAT rename to SOURCE/UNUSED/RGSCFGPR.DAT diff --git a/RGSCFGTX.DAT b/SOURCE/UNUSED/RGSCFGTX.DAT similarity index 100% rename from RGSCFGTX.DAT rename to SOURCE/UNUSED/RGSCFGTX.DAT diff --git a/RGSTAT.PAS b/SOURCE/UNUSED/RGSTAT.PAS similarity index 100% rename from RGSTAT.PAS rename to SOURCE/UNUSED/RGSTAT.PAS diff --git a/RGUPDATE.EXE b/SOURCE/UNUSED/RGUPDATE.EXE similarity index 100% rename from RGUPDATE.EXE rename to SOURCE/UNUSED/RGUPDATE.EXE diff --git a/RGUPDATE.PAS b/SOURCE/UNUSED/RGUPDATE.PAS similarity index 100% rename from RGUPDATE.PAS rename to SOURCE/UNUSED/RGUPDATE.PAS diff --git a/RGUPDT1.EXE b/SOURCE/UNUSED/RGUPDT1.EXE similarity index 100% rename from RGUPDT1.EXE rename to SOURCE/UNUSED/RGUPDT1.EXE diff --git a/RGUPDT1.PAS b/SOURCE/UNUSED/RGUPDT1.PAS similarity index 100% rename from RGUPDT1.PAS rename to SOURCE/UNUSED/RGUPDT1.PAS diff --git a/RGUPDT2.EXE b/SOURCE/UNUSED/RGUPDT2.EXE similarity index 100% rename from RGUPDT2.EXE rename to SOURCE/UNUSED/RGUPDT2.EXE diff --git a/RGUPDT2.PAS b/SOURCE/UNUSED/RGUPDT2.PAS similarity index 100% rename from RGUPDT2.PAS rename to SOURCE/UNUSED/RGUPDT2.PAS diff --git a/RGUPDT3.EXE b/SOURCE/UNUSED/RGUPDT3.EXE similarity index 100% rename from RGUPDT3.EXE rename to SOURCE/UNUSED/RGUPDT3.EXE diff --git a/RGUPDT3.PAS b/SOURCE/UNUSED/RGUPDT3.PAS similarity index 100% rename from RGUPDT3.PAS rename to SOURCE/UNUSED/RGUPDT3.PAS diff --git a/RGUPDT4.PAS b/SOURCE/UNUSED/RGUPDT4.PAS similarity index 100% rename from RGUPDT4.PAS rename to SOURCE/UNUSED/RGUPDT4.PAS diff --git a/RGV118.EXE b/SOURCE/UNUSED/RGV118.EXE similarity index 100% rename from RGV118.EXE rename to SOURCE/UNUSED/RGV118.EXE diff --git a/RGV118.PAS b/SOURCE/UNUSED/RGV118.PAS similarity index 100% rename from RGV118.PAS rename to SOURCE/UNUSED/RGV118.PAS diff --git a/RGVER.EXE b/SOURCE/UNUSED/RGVER.EXE similarity index 100% rename from RGVER.EXE rename to SOURCE/UNUSED/RGVER.EXE diff --git a/RGVER.PAS b/SOURCE/UNUSED/RGVER.PAS similarity index 100% rename from RGVER.PAS rename to SOURCE/UNUSED/RGVER.PAS diff --git a/RGVERUDT.EXE b/SOURCE/UNUSED/RGVERUDT.EXE similarity index 100% rename from RGVERUDT.EXE rename to SOURCE/UNUSED/RGVERUDT.EXE diff --git a/RGVERUDT.PAS b/SOURCE/UNUSED/RGVERUDT.PAS similarity index 100% rename from RGVERUDT.PAS rename to SOURCE/UNUSED/RGVERUDT.PAS diff --git a/RMAILWKS.PAS b/SOURCE/UNUSED/RMAILWKS.PAS similarity index 100% rename from RMAILWKS.PAS rename to SOURCE/UNUSED/RMAILWKS.PAS diff --git a/RMCHANGE.DOC b/SOURCE/UNUSED/RMCHANGE.DOC similarity index 100% rename from RMCHANGE.DOC rename to SOURCE/UNUSED/RMCHANGE.DOC diff --git a/RMUPDATE.DOC b/SOURCE/UNUSED/RMUPDATE.DOC similarity index 100% rename from RMUPDATE.DOC rename to SOURCE/UNUSED/RMUPDATE.DOC diff --git a/SCRIPT.TPU b/SOURCE/UNUSED/SCRIPT.TPU similarity index 100% rename from SCRIPT.TPU rename to SOURCE/UNUSED/SCRIPT.TPU diff --git a/SHORTMSG.TPU b/SOURCE/UNUSED/SHORTMSG.TPU similarity index 100% rename from SHORTMSG.TPU rename to SOURCE/UNUSED/SHORTMSG.TPU diff --git a/SORTING.PAS b/SOURCE/UNUSED/SORTING.PAS similarity index 100% rename from SORTING.PAS rename to SOURCE/UNUSED/SORTING.PAS diff --git a/SPAWNO.TPU b/SOURCE/UNUSED/SPAWNO.TPU similarity index 100% rename from SPAWNO.TPU rename to SOURCE/UNUSED/SPAWNO.TPU diff --git a/SPLITCHA.TPU b/SOURCE/UNUSED/SPLITCHA.TPU similarity index 100% rename from SPLITCHA.TPU rename to SOURCE/UNUSED/SPLITCHA.TPU diff --git a/STATS.TPU b/SOURCE/UNUSED/STATS.TPU similarity index 100% rename from STATS.TPU rename to SOURCE/UNUSED/STATS.TPU diff --git a/SYSCHAT.PAS b/SOURCE/UNUSED/SYSCHAT.PAS similarity index 100% rename from SYSCHAT.PAS rename to SOURCE/UNUSED/SYSCHAT.PAS diff --git a/SYSCHAT.TPU b/SOURCE/UNUSED/SYSCHAT.TPU similarity index 100% rename from SYSCHAT.TPU rename to SOURCE/UNUSED/SYSCHAT.TPU diff --git a/SYSOP1.TPU b/SOURCE/UNUSED/SYSOP1.TPU similarity index 100% rename from SYSOP1.TPU rename to SOURCE/UNUSED/SYSOP1.TPU diff --git a/SYSOP10.TPU b/SOURCE/UNUSED/SYSOP10.TPU similarity index 100% rename from SYSOP10.TPU rename to SOURCE/UNUSED/SYSOP10.TPU diff --git a/SYSOP11.TPU b/SOURCE/UNUSED/SYSOP11.TPU similarity index 100% rename from SYSOP11.TPU rename to SOURCE/UNUSED/SYSOP11.TPU diff --git a/SYSOP12.TPU b/SOURCE/UNUSED/SYSOP12.TPU similarity index 100% rename from SYSOP12.TPU rename to SOURCE/UNUSED/SYSOP12.TPU diff --git a/SYSOP2.TPU b/SOURCE/UNUSED/SYSOP2.TPU similarity index 100% rename from SYSOP2.TPU rename to SOURCE/UNUSED/SYSOP2.TPU diff --git a/SYSOP2A.TPU b/SOURCE/UNUSED/SYSOP2A.TPU similarity index 100% rename from SYSOP2A.TPU rename to SOURCE/UNUSED/SYSOP2A.TPU diff --git a/SYSOP2B.TPU b/SOURCE/UNUSED/SYSOP2B.TPU similarity index 100% rename from SYSOP2B.TPU rename to SOURCE/UNUSED/SYSOP2B.TPU diff --git a/SYSOP2C.TPU b/SOURCE/UNUSED/SYSOP2C.TPU similarity index 100% rename from SYSOP2C.TPU rename to SOURCE/UNUSED/SYSOP2C.TPU diff --git a/SYSOP2D.TPU b/SOURCE/UNUSED/SYSOP2D.TPU similarity index 100% rename from SYSOP2D.TPU rename to SOURCE/UNUSED/SYSOP2D.TPU diff --git a/SYSOP2E.TPU b/SOURCE/UNUSED/SYSOP2E.TPU similarity index 100% rename from SYSOP2E.TPU rename to SOURCE/UNUSED/SYSOP2E.TPU diff --git a/SYSOP2F.TPU b/SOURCE/UNUSED/SYSOP2F.TPU similarity index 100% rename from SYSOP2F.TPU rename to SOURCE/UNUSED/SYSOP2F.TPU diff --git a/SYSOP2G.TPU b/SOURCE/UNUSED/SYSOP2G.TPU similarity index 100% rename from SYSOP2G.TPU rename to SOURCE/UNUSED/SYSOP2G.TPU diff --git a/SYSOP2H.TPU b/SOURCE/UNUSED/SYSOP2H.TPU similarity index 100% rename from SYSOP2H.TPU rename to SOURCE/UNUSED/SYSOP2H.TPU diff --git a/SYSOP2I.TPU b/SOURCE/UNUSED/SYSOP2I.TPU similarity index 100% rename from SYSOP2I.TPU rename to SOURCE/UNUSED/SYSOP2I.TPU diff --git a/SYSOP2J.TPU b/SOURCE/UNUSED/SYSOP2J.TPU similarity index 100% rename from SYSOP2J.TPU rename to SOURCE/UNUSED/SYSOP2J.TPU diff --git a/SYSOP2K.TPU b/SOURCE/UNUSED/SYSOP2K.TPU similarity index 100% rename from SYSOP2K.TPU rename to SOURCE/UNUSED/SYSOP2K.TPU diff --git a/SYSOP2L.TPU b/SOURCE/UNUSED/SYSOP2L.TPU similarity index 100% rename from SYSOP2L.TPU rename to SOURCE/UNUSED/SYSOP2L.TPU diff --git a/SYSOP2M.TPU b/SOURCE/UNUSED/SYSOP2M.TPU similarity index 100% rename from SYSOP2M.TPU rename to SOURCE/UNUSED/SYSOP2M.TPU diff --git a/SYSOP2O.TPU b/SOURCE/UNUSED/SYSOP2O.TPU similarity index 100% rename from SYSOP2O.TPU rename to SOURCE/UNUSED/SYSOP2O.TPU diff --git a/SYSOP3.TPU b/SOURCE/UNUSED/SYSOP3.TPU similarity index 100% rename from SYSOP3.TPU rename to SOURCE/UNUSED/SYSOP3.TPU diff --git a/SYSOP4.TPU b/SOURCE/UNUSED/SYSOP4.TPU similarity index 100% rename from SYSOP4.TPU rename to SOURCE/UNUSED/SYSOP4.TPU diff --git a/SYSOP5.TPU b/SOURCE/UNUSED/SYSOP5.TPU similarity index 100% rename from SYSOP5.TPU rename to SOURCE/UNUSED/SYSOP5.TPU diff --git a/SYSOP6.TPU b/SOURCE/UNUSED/SYSOP6.TPU similarity index 100% rename from SYSOP6.TPU rename to SOURCE/UNUSED/SYSOP6.TPU diff --git a/SYSOP6~1.PAS b/SOURCE/UNUSED/SYSOP6~1.PAS similarity index 100% rename from SYSOP6~1.PAS rename to SOURCE/UNUSED/SYSOP6~1.PAS diff --git a/SYSOP7.TPU b/SOURCE/UNUSED/SYSOP7.TPU similarity index 100% rename from SYSOP7.TPU rename to SOURCE/UNUSED/SYSOP7.TPU diff --git a/SYSOP7M.TPU b/SOURCE/UNUSED/SYSOP7M.TPU similarity index 100% rename from SYSOP7M.TPU rename to SOURCE/UNUSED/SYSOP7M.TPU diff --git a/SYSOP8.TPU b/SOURCE/UNUSED/SYSOP8.TPU similarity index 100% rename from SYSOP8.TPU rename to SOURCE/UNUSED/SYSOP8.TPU diff --git a/SYSOP9.TPU b/SOURCE/UNUSED/SYSOP9.TPU similarity index 100% rename from SYSOP9.TPU rename to SOURCE/UNUSED/SYSOP9.TPU diff --git a/TAGLINE.DAT b/SOURCE/UNUSED/TAGLINE.DAT similarity index 100% rename from TAGLINE.DAT rename to SOURCE/UNUSED/TAGLINE.DAT diff --git a/TAGLINE.EXE b/SOURCE/UNUSED/TAGLINE.EXE similarity index 100% rename from TAGLINE.EXE rename to SOURCE/UNUSED/TAGLINE.EXE diff --git a/TAGLINE.PTR b/SOURCE/UNUSED/TAGLINE.PTR similarity index 100% rename from TAGLINE.PTR rename to SOURCE/UNUSED/TAGLINE.PTR diff --git a/TAGLINE.TXT b/SOURCE/UNUSED/TAGLINE.TXT similarity index 100% rename from TAGLINE.TXT rename to SOURCE/UNUSED/TAGLINE.TXT diff --git a/TAGSTAT.PAS b/SOURCE/UNUSED/TAGSTAT.PAS similarity index 100% rename from TAGSTAT.PAS rename to SOURCE/UNUSED/TAGSTAT.PAS diff --git a/TEMP6.BAT b/SOURCE/UNUSED/TEMP6.BAT similarity index 100% rename from TEMP6.BAT rename to SOURCE/UNUSED/TEMP6.BAT diff --git a/TIMEBANK.TPU b/SOURCE/UNUSED/TIMEBANK.TPU similarity index 100% rename from TIMEBANK.TPU rename to SOURCE/UNUSED/TIMEBANK.TPU diff --git a/TIMEFUNC.TPU b/SOURCE/UNUSED/TIMEFUNC.TPU similarity index 100% rename from TIMEFUNC.TPU rename to SOURCE/UNUSED/TIMEFUNC.TPU diff --git a/TPX.DSK b/SOURCE/UNUSED/TPX.DSK similarity index 100% rename from TPX.DSK rename to SOURCE/UNUSED/TPX.DSK diff --git a/TPX.TP b/SOURCE/UNUSED/TPX.TP similarity index 100% rename from TPX.TP rename to SOURCE/UNUSED/TPX.TP diff --git a/TURBO.DSK b/SOURCE/UNUSED/TURBO.DSK similarity index 100% rename from TURBO.DSK rename to SOURCE/UNUSED/TURBO.DSK diff --git a/USER.PAS b/SOURCE/UNUSED/USER.PAS similarity index 100% rename from USER.PAS rename to SOURCE/UNUSED/USER.PAS diff --git a/VOTE.TPU b/SOURCE/UNUSED/VOTE.TPU similarity index 100% rename from VOTE.TPU rename to SOURCE/UNUSED/VOTE.TPU diff --git a/WD110107.TXT b/SOURCE/UNUSED/WD110107.TXT similarity index 100% rename from WD110107.TXT rename to SOURCE/UNUSED/WD110107.TXT diff --git a/WD110207.TXT b/SOURCE/UNUSED/WD110207.TXT similarity index 100% rename from WD110207.TXT rename to SOURCE/UNUSED/WD110207.TXT diff --git a/WD110307.TXT b/SOURCE/UNUSED/WD110307.TXT similarity index 100% rename from WD110307.TXT rename to SOURCE/UNUSED/WD110307.TXT diff --git a/WFCMENU.TPU b/SOURCE/UNUSED/WFCMENU.TPU similarity index 100% rename from WFCMENU.TPU rename to SOURCE/UNUSED/WFCMENU.TPU diff --git a/WFCNEW1.ANS b/SOURCE/UNUSED/WFCNEW1.ANS similarity index 100% rename from WFCNEW1.ANS rename to SOURCE/UNUSED/WFCNEW1.ANS diff --git a/WFC_COM.ANS b/SOURCE/UNUSED/WFC_COM.ANS similarity index 100% rename from WFC_COM.ANS rename to SOURCE/UNUSED/WFC_COM.ANS diff --git a/WFC_NODE.ANS b/SOURCE/UNUSED/WFC_NODE.ANS similarity index 100% rename from WFC_NODE.ANS rename to SOURCE/UNUSED/WFC_NODE.ANS diff --git a/bootoldback.pas b/SOURCE/UNUSED/bootoldback.pas similarity index 100% rename from bootoldback.pas rename to SOURCE/UNUSED/bootoldback.pas diff --git a/SOURCE/UNUSED/m.cmd b/SOURCE/UNUSED/m.cmd new file mode 100644 index 0000000..89287c4 --- /dev/null +++ b/SOURCE/UNUSED/m.cmd @@ -0,0 +1 @@ +move %1.pas .. \ No newline at end of file diff --git a/VOTE.PAS b/SOURCE/VOTE.PAS similarity index 100% rename from VOTE.PAS rename to SOURCE/VOTE.PAS diff --git a/WFCMENU.PAS b/SOURCE/WFCMENU.PAS similarity index 100% rename from WFCMENU.PAS rename to SOURCE/WFCMENU.PAS diff --git a/SOURCE/WIN32/overlay.pas b/SOURCE/WIN32/overlay.pas new file mode 100644 index 0000000..eac3c90 --- /dev/null +++ b/SOURCE/WIN32/overlay.pas @@ -0,0 +1,9 @@ +unit overlay; + +// Dummy unit for Win32, so I don't have to IFDEF the USES OVERLAY out of dozens of files! + +interface + +implementation + +end. \ No newline at end of file diff --git a/SOURCE/crc32.obj b/SOURCE/crc32.obj new file mode 100644 index 0000000000000000000000000000000000000000..e821fa58be391f36646ee5016e5f7e2a053136a8 GIT binary patch literal 1259 zcmVV>I zGcGcjh!Frl>8!b36A5E-V>2=?K~qh%hywsX=}eXa003x+0{}pwl$Hhn1Vc|mMMang z04O*F0s#T}mIeR>L_t(RMwkZxNB{r>0Ra?{5&!@J3sq1=K~zOUQbRK`00aO|hy(yY zq5+Yha5bf4>7$ioo-&Br4y3r;c^>K2 z;E37Mmn%%R3B7!=eg`eM=aC)1kYo_I9r7TsYDjUp^WH(egniW78tdfUZBez<^v8wM zgI1Vq6TqlzWP15x{p`tQiceet6xnPBV`DuJ`t=P6jmRKwJ6;fJOyoge)pBuXqS537 zJV(?7OZ|ln(rdK}rTVC~HEfu&Le|N<+d%oetmAChGId=SgRdj z!96Wzwva*Gb_Q|V0lXm6m?{v}?}>%6aUZp|2BqY`pEK0B=%UF7cr^I{500n_mKc~0 z;kylLe=R+22$yVRkpWy|=JZi(Yhqz+9M~{rg-!rs^6ixdY*>3^~Tw- zWl-t266(0Vi+qT={NEkjVo5F974v-4jAcyJ`&ePJP0mrZI&=WMqv9~T)Ip`+O4pUx zJ#EC%r2F*N(`xByL;TrpG)9PLtyr}-8^vxP^v)!ClC+| zzJ?$S$tAUDSF?q0APLlFxu4`=&JOwBUYN<*DI%EAu(YVx#}_@bS%D3-E<0Skx2aTawofRhA1cMgba}o<<xE|rauZho1%gVyl@xlo;;t*PdpH}m44aP9k`2Dq z<+tzLd?DZ43)IrnhC<@h@%XddXl{erAI%oNfm>sl}eV-ha=sN9q5yFdXu|y^6xR$}p3&Q>LS|Bn39m zx|0Ui%_&#jRKI80BT%4R00H0wE_!COxJqHf0vl*ulq+v4H@*wBp^gm08{Y+5jqd_2 zRg3H%#dZk9MhuL?i%td$$#ftx|BBeGGT4g5isFjaGWOBq(c><}p8xot&2BTyE<24ZTVEQN79dalPr_{dzONy`HuQV9Z#rMj%x$Q_z34XMXOJYT=V%^Pl9b z>IJ2?o7vOn8iaSwH7M`cGkxnBQ{%!{Jp{^jJ)KDv)8c+1S1z6bf+xS4?7=Yi- zZ~7g4*x$)d_`A8QdJhKMuV}^j0LA`^bmnT&KverNbdEsQwMtmwFo4)Jh5;(h+E#0$ zRx!$MWc4+>{KXfAn0J1^9W0?9(SgyRPT|1$mu)N9xQ literal 0 HcmV?d00001 diff --git a/SOURCE/spawntp.obj b/SOURCE/spawntp.obj new file mode 100644 index 0000000000000000000000000000000000000000..eb36f7b2dd968f7d2afe2ade35269676fcdeebb6 GIT binary patch literal 6308 zcmY+I4SW+-w!rVblT6YN(iUmDC`=N8Vl7OO2rjfhp-@19hJtNcq?J_{zwxD$*7f}s zQgM}bV%DdwA8g&%5ZL#7ExPDNH*NjVw38-+2KiXEfL{x!Qvxe)g|<+ccTNhv_uAk2 z&$)N*+}yeM+;h$yPYN-tb1bf0v))ni3M1sfS9qc;DOde8oukrOV69?smvKbwsDJjou8Bp6sZsc3F9OSvh&_g>*uwK3Uh3MYtEn zLosdTnw9Ho$J$NGBAu;aMhPjJFY!eM5-Yk#xm!M0!B+}~(QZmQ9AqCUqW^lUEXor? zguZ%RqqdgRW$kTKKi1rQE>_djuzSGr9x0Q*dWV!XYLrOUW_^+9PDwrL7CeWH2|@jn zCZ!kMD(Q+AxxaXaCXRa!Wy)8gdU1J7e=7+V#BKb#^3Jq%$@Do##XyCJcnpv@}+2|G{JL7m&j;bw9M&Ffm_Sm zoaYb=mL=X3455;;uGQpHl)5K`mN~nYfy&$|_OSirrKnCaw986+7bVqB!Pk!iu+$oA z(oVJ#vauH?RzHQdvDxsNHr7O6W3RJksE;kA^NE!#TfN!|f3v8s*M72-kPulK-<*2J z{b`60Uw;R&+ArC)!959B)Dmx4PjtSpsF_|M+ddUz{If8hQry???Nz+Jz7xK%((xos za2>y;cgqQ1xU%B8gXPenEO?0gNwV8KS$LYr#~KqvH*~V_c)d|RPN60NZxVQ#XuOAr z{xZt-7KW?cQ-yNvDE|Cf`NJds!2i*~JyqN>UvIS~|3mkl;hNfw%1B~_uc!=do)foq zr;`11Xor!E+QWn5pWW%fCHR}NA~Acow#J}{o`nlwVefNvkm67#aSWXr`XTTPX)-@c z(vG@yD>_NB7^tCQlUbrL9uI*bRXed&+EIxXJJgr8s=^-El;GmzyWAu;31u``A|Fo{ z(}T<7o8?|HP(p{55k)>6ToKra=8Pkm(?KAo(COK?>H>s16!Lr-CvUdWhmEqNPx}3&eqibqEPcJ3w|~ z;SB^1EsA4^wn6<~khehgfxH6}1bJ^geQKA9(Dzv;q3{pej%;n6KpC;Z&?))2*kllQRI&}#3U@%HrbA5hm=7}o>Zhpo zGoq~RAUas?P!75m?3CWHDnP5oMv%;oY2(1-<}i)VxBPgeh`Rh{~0wS4f% z!0EJWm8r1(hieQ~N>%kpVrXs0r!3K#uzE&!NcyuITC61Ui}f@z83blFatp`;n8nBv zL?hs6E4)u52b*g6%0ULN>1<6Q)W;=X`S#Z5D1C){sn7f*31v@<+e{Xdp<5!AV9Q|2 z?cFbujubN3UeiGc4#%|HF zB0cCR58a$;KN-(XJ1Oa$&O~LX0Je@doTf-OhS**9lXlG)ix)se%>8x9QyMQw3rn9> zm#g1imGq6hM7Kf=^m4F8V%(9laOvQj9p{i92;tp6vF(7lGJkN=gKhMNW^Y;vw^jk6T64w8L3uPx?1GeOEInm2+&*gLUR&a$hk@;%N<0Nt~tlocv zfcZw=1%WL^BPU>UWP{uYB7ooqf@Mx_nz?W-1X&KU3Zxd~K9J2IkAOT5@&t$r1oll| zJ;;+FPpzjHTT=r;c0EjZv|^nj@B(QPUL;*F6aNk(o0?K`3lIY=0h6Kk8hDv#OAL+;> zgKf1*Uuf17X(g%FiJ=L?pfwU4($q+m8kp#chJg;yPB? zO|`L-)e;3B}Xfl)zbnd&V1f>%INmOZmV#lJq$+G6)}GiQ|r}fZ15Zi-B6cLLL$f zf=@U{Mm0^SYDRIrvFOGIU1@3aVWEPzbiW2atSfE{ z&A+Ez9)eh7tFi1=1H)3*ntdd9zFta!Lr%r~dTCLiWN2&DP7v2WEzQd` zwQgAA;BMz@q=OO9!fz=HRyRxtl~uHd%2&0kH)|nrYWu#a?ZKjbq%Cf%;|8iUxj(oN zrz*r2B%hGjzFknBEcg4*k}(&2P(G|qA;Dt%0eB`Ao2$2z0YOt!iL8i$mHhC4RkI(k z9}STuahswJYAzFmMVrgGZmjnW%GebK29edK=pYmjI+oqdx7JCU?t8>4ZP{Y2du-FA zkIt~V9*|tWdFb)Y<5I6TdBEk`;)41|w`{r}ZdjjiZQ1PF^w(2=vqGQ>*6D#U}}8@7PBv9J@A z{{%SzatP!YNI%GzApgJy-+-c`avpI3aT$ETd!Y0w;9>frsC^DqUqed`t`vj=(SsO3 zQb5u`&O*az4x$WkFCrOt;di4WP>S7Sh6uhH>t6>PXpIv3x-odCEaWp-Bcom0&&WWK z@IF34p#VAZEd+8ae+Fyczr*Ma!v@>aj{jy$M=`Nq8r)+Mc+37;5~6vqaOp*wWZWK0 zPnIl|6~d^G&tP^`5d;Qex^`S={?3NzOX-s-Q_!pN!{hq z-Fw<+W|N`*07ozdUk%=XlG+-}W!Y2!y}=l9e7Ik`9FUjZbvCbM0f|6%!p1VC8&SKy zSTs_D#rqKtA{r3SBK9KQ1$@s4xa`3vkTFUTWq52Gp11sh(B<_%fAE<2lo^Bt}xtaaI_MVI}CkAee z-W9Tvq0?NCK8wiaA)00$p^^?BV)?^ObAO^u3pHvobiHm=v$X(aU0YJrbS=QKu1Q%c zrv>!PxuL42R`DBPY-eag$_m+>&6X_Dj``0}SzV#r&38SPqJE|M!nvM>uypR5z2RJr z=SZbMyy~(iK9xVY)7N{g`6STr<`TFj+os69@Mv&l+?F^I zT+yXzaoezABmBGG?&j-77ULS&_tAYpq-!RmfS6vgv z`ahW~C&yB(PP|%o2;O1^Ja=utU~1R9^P?%OVx9LGe_l5@N^U=w3Wv#x&{Rk5y(+?W#L?T}&FV3+W+k`{LBg0tebUEk6W0mIq#9St$O zs#I(ierZ(S{3*B=`#nQ_FxR>M86;p}aw!iFae*2z*b3K!))g4Xgrph5QijL^@cCg#p&%Yy;pBeUrRQmI zQHP0io~K~jYzg}IxGivnqVLCd@hRTJxrO{J0vV{=Bu8@dd6DQdlE)vhkhdG_bfVvG zT);>j7h+_AnbdROD*`!8Hl3mH&bT;!js&vVHCtHe>q%DRF%I@haq(i92Q<8DX}b4k zODcvnrlj!5rk00jBnvlv@<25SH7nvaL=i$p{2q}!Rkfgo=a)!3;;)EK#6iR%#1Dvz zfU(n;9<@|(#+j(x0LnyEZbsxI3J`M<7(e>p0M+*wkO&qgfuH6;iQ*Y9isOso_@dy; zXmk;3B?t^MV<)a^c%T*peOh!I;yHvDs$N9}kAKl!2=sN)zaZX0e2O@M_yTbX5JLwV zOGV&lW782hbRoI{54Y~+=%R6MLvk}EzJP=B z@wAifPrORv2wc;>3Y@I@Tu$IfNs}-@yC%|gqHJ-5wh@tAo{82b%H}!7LUSIg*U7-b z-a01taJGz&!j`3s^ zLLLMydwADkrf$28J8}P>l_4-W3$ zceX7wJG0&ULA#~4#y=C>Qgy})7-+j0d9!`bp6zFIO1KlbO_P0!U2AIsUnn1Y&dd|<@nq<=fJbbHE!e(X z?roQQ+F`AxkG*h%!I0Y|+>W_|fuVmksP|s>PlvcLKpWCRIV2C1JYJ)Ijn2#>h5QYy zULVkC!s@3iS@9Ev3d#~0{;aVIj@7S1ua=;)08?dx0BA}Ez~d#0OW>(|1rC2bbp_C4 zevjObUDn+!3mhx)>#yCc9}k^fYi9^eAR`Ia3r#`>gHcXr@P*F^-~HszwnueBMc?h- z{fSNFVE?sbS+;&;?p+(7HQCBuv>T+7Zf{F}olLKuC zbFMtdxtwn}TE@Kn>=B{QJeegI+yd%Eh$Oh;$;h(;ZSPtPdc#@AsTYSF>JP)%6L>`o z0I;0T*I$CzH@F+DaF4SFKJ7ik=+9%*p$bDlY(4_#IJO+I8nG6Ea~!)5 zfet+ezC88{h#%IawKbp8?=r`ZH`e;w#oK0CZ@DkeTC(Md-?$#y{GepLZQi_DGXS?C zW?RcQJ^E|w64#c7#|fk>0(=k^4BhKlUw!)M-sTV9C8tw7BiriP+uOiXkv8}gYLRPF z?cpH>z6jA`an}O)+&Kj2u4LgHd@UVPAVI)8X1!c$6a#aN$%I7Gp;2x85YD5Oxy|FC z<5b=v50#E}YpAg(c&EjF0Bdohaf=hfr_4MUTF_E zm0oQs9gS=?s_mM$^m5bIVIj1hIU-xr)tyjrscGwve5LvM(jOgKJ#SK99D!R#^>qy! pyrem6!R9}#X|a&VBACO-!(eU=AkTovATXbiA-GY|3}3IM{{fb~?|A?K literal 0 HcmV?d00001 diff --git a/VPC.CFG b/VPC.CFG new file mode 100644 index 0000000..c9350a5 --- /dev/null +++ b/VPC.CFG @@ -0,0 +1,25 @@ +/OZ:\PROGRA~1\RG119SRC\EXE\VP +/I.\ELECOM;Z:\VP21\SOURCE\RTL;Z:\VP21\SOURCE\TV +/U.\ELECOM;.\WIN32;Z:\VP21\UNITS.W32;Z:\VP21\SOURCE\RTL;Z:\VP21\SOURCE\W32;Z:\VP21\SOURCE\TV;Z:\VP21\EXAMPLES\W32\OPENGL\SHARED +/L.\ELECOM;Z:\VP21\LIB.W32;Z:\VP21\UNITS.W32 +/R.\ELECOM;Z:\VP21\RES.W32 +/$A+ +/$B- +/$D+ +/$E+ +/$F+ +/$G+ +/$I- +/$L+ +/$N- +/$O+ +/$P- +/$Q- +/$R- +/$S- +/$T- +/$V- +/$X+ +/$Y+ +/B +/GD From 541b9cdbfd92964ad238ad827f02bb58c53fadab Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 13:07:05 -0500 Subject: [PATCH 02/17] They were all combined into RGLNG.PAS --- BUILDBP.CMD | 15 --------------- BUILDVP.CMD | 15 --------------- COPYEXEBP.CMD | 3 --- COPYEXEVP.CMD | 3 --- SOURCE/{ => UNUSED}/RGMAIN.PAS | 4 ++++ SOURCE/{ => UNUSED}/RGNOTE.PAS | 4 ++++ SOURCE/{ => UNUSED}/RGSCFG.PAS | 4 ++++ 7 files changed, 12 insertions(+), 36 deletions(-) rename SOURCE/{ => UNUSED}/RGMAIN.PAS (98%) rename SOURCE/{ => UNUSED}/RGNOTE.PAS (99%) rename SOURCE/{ => UNUSED}/RGSCFG.PAS (99%) diff --git a/BUILDBP.CMD b/BUILDBP.CMD index 488fd8b..5dccab0 100644 --- a/BUILDBP.CMD +++ b/BUILDBP.CMD @@ -25,26 +25,11 @@ ECHO COMPILING RGLNG.EXE Z:\BP\BIN\BPC.EXE RGLNG.PAS IF NOT %ERRORLEVEL% == 0 GOTO END -ECHO. -ECHO COMPILING RGMAIN.EXE -Z:\BP\BIN\BPC.EXE RGMAIN.PAS -IF NOT %ERRORLEVEL% == 0 GOTO END - -ECHO. -ECHO COMPILING RGNOTE.EXE -Z:\BP\BIN\BPC.EXE RGNOTE.PAS -IF NOT %ERRORLEVEL% == 0 GOTO END - ECHO. ECHO COMPILING RGQUOTE.EXE Z:\BP\BIN\BPC.EXE RGQUOTE.PAS IF NOT %ERRORLEVEL% == 0 GOTO END -ECHO. -ECHO COMPILING RGSCFG.EXE -Z:\BP\BIN\BPC.EXE RGSCFG.PAS -IF NOT %ERRORLEVEL% == 0 GOTO END - ECHO. ECHO COMPILING TAGLINE.EXE Z:\BP\BIN\BPC.EXE TAGLINE.PAS diff --git a/BUILDVP.CMD b/BUILDVP.CMD index c1b7059..636c97e 100644 --- a/BUILDVP.CMD +++ b/BUILDVP.CMD @@ -25,26 +25,11 @@ ECHO COMPILING RGLNG.EXE Z:\VP21\BIN.W32\VPC RGLNG.PAS IF NOT %ERRORLEVEL% == 0 GOTO END -ECHO. -ECHO COMPILING RGMAIN.EXE -Z:\VP21\BIN.W32\VPC RGMAIN.PAS -IF NOT %ERRORLEVEL% == 0 GOTO END - -ECHO. -ECHO COMPILING RGNOTE.EXE -Z:\VP21\BIN.W32\VPC RGNOTE.PAS -IF NOT %ERRORLEVEL% == 0 GOTO END - ECHO. ECHO COMPILING RGQUOTE.EXE Z:\VP21\BIN.W32\VPC RGQUOTE.PAS IF NOT %ERRORLEVEL% == 0 GOTO END -ECHO. -ECHO COMPILING RGSCFG.EXE -Z:\VP21\BIN.W32\VPC RGSCFG.PAS -IF NOT %ERRORLEVEL% == 0 GOTO END - ECHO. ECHO COMPILING TAGLINE.EXE Z:\VP21\BIN.W32\VPC TAGLINE.PAS diff --git a/COPYEXEBP.CMD b/COPYEXEBP.CMD index 4233d2a..1844aac 100644 --- a/COPYEXEBP.CMD +++ b/COPYEXEBP.CMD @@ -3,8 +3,5 @@ COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RENEGADE.EXE Z:\RG119\ COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RENEGADE.OVR Z:\RG119\ COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RENEMAIL.EXE Z:\RG119\ COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGLNG.EXE Z:\RG119\DATA\ -COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGMAIN.EXE Z:\RG119\DATA\ -COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGNOTE.EXE Z:\RG119\DATA\ COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGQUOTE.EXE Z:\RG119\DATA\ -COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\RGSCFG.EXE Z:\RG119\DATA\ COPY Z:\PROGRAMMING\RG119SRC\EXE\BP\TAGLINE.EXE Z:\RG119\DATA\ diff --git a/COPYEXEVP.CMD b/COPYEXEVP.CMD index b6c69e1..9c22858 100644 --- a/COPYEXEVP.CMD +++ b/COPYEXEVP.CMD @@ -2,8 +2,5 @@ COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RENEGADE.EXE Z:\RG119\RENEGADE32.EXE COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RENEMAIL.EXE Z:\RG119\RENEMAIL32.EXE COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGLNG.EXE Z:\RG119\DATA\RGLNG32.EXE -COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGMAIN.EXE Z:\RG119\DATA\RGMAIN32.EXE -COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGNOTE.EXE Z:\RG119\DATA\RGNOTE32.EXE COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGQUOTE.EXE Z:\RG119\DATA\RGQUOTE32.EXE -COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\RGSCFG.EXE Z:\RG119\DATA\RGSCFG32.EXE COPY Z:\PROGRAMMING\RG119SRC\EXE\VP\TAGLINE.EXE Z:\RG119\DATA\TAGLINE32.EXE diff --git a/SOURCE/RGMAIN.PAS b/SOURCE/UNUSED/RGMAIN.PAS similarity index 98% rename from SOURCE/RGMAIN.PAS rename to SOURCE/UNUSED/RGMAIN.PAS index ba5ee80..8c9dbad 100644 --- a/SOURCE/RGMAIN.PAS +++ b/SOURCE/UNUSED/RGMAIN.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + PROGRAM RGMAIN; USES diff --git a/SOURCE/RGNOTE.PAS b/SOURCE/UNUSED/RGNOTE.PAS similarity index 99% rename from SOURCE/RGNOTE.PAS rename to SOURCE/UNUSED/RGNOTE.PAS index 42b30aa..1a29748 100644 --- a/SOURCE/RGNOTE.PAS +++ b/SOURCE/UNUSED/RGNOTE.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + PROGRAM RGNOTE; USES diff --git a/SOURCE/RGSCFG.PAS b/SOURCE/UNUSED/RGSCFG.PAS similarity index 99% rename from SOURCE/RGSCFG.PAS rename to SOURCE/UNUSED/RGSCFG.PAS index 10a1379..f0c47cc 100644 --- a/SOURCE/RGSCFG.PAS +++ b/SOURCE/UNUSED/RGSCFG.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + PROGRAM RGMAIN; USES From 4c2999d90b4fed9e56086e210912830db720fba2 Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 13:23:11 -0500 Subject: [PATCH 03/17] Make VP more like BP --- SOURCE/ARCHIVE1.PAS | 4 ++++ SOURCE/ARCHIVE2.PAS | 4 ++++ SOURCE/ARCHIVE3.PAS | 4 ++++ SOURCE/ARCVIEW.PAS | 4 ++++ SOURCE/AUTOMSG.PAS | 4 ++++ SOURCE/BBSLIST.PAS | 4 ++++ SOURCE/BOOT.PAS | 4 ++++ SOURCE/BULLETIN.PAS | 4 ++++ SOURCE/COMMON.PAS | 4 ++++ SOURCE/COMMON1.PAS | 4 ++++ SOURCE/COMMON2.PAS | 4 ++++ SOURCE/COMMON3.PAS | 4 ++++ SOURCE/COMMON4.PAS | 4 ++++ SOURCE/COMMON5.PAS | 4 ++++ SOURCE/CUSER.PAS | 4 ++++ SOURCE/DOORS.PAS | 4 ++++ SOURCE/EMAIL.PAS | 4 ++++ SOURCE/EVENTS.PAS | 4 ++++ SOURCE/EXECBAT.PAS | 4 ++++ SOURCE/FILE0.PAS | 4 ++++ SOURCE/FILE1.PAS | 4 ++++ SOURCE/FILE10.PAS | 4 ++++ SOURCE/FILE11.PAS | 4 ++++ SOURCE/FILE12.PAS | 4 ++++ SOURCE/FILE13.PAS | 4 ++++ SOURCE/FILE14.PAS | 4 ++++ SOURCE/FILE2.PAS | 4 ++++ SOURCE/FILE3.PAS | 4 ++++ SOURCE/FILE4.PAS | 4 ++++ SOURCE/FILE5.PAS | 4 ++++ SOURCE/FILE6.PAS | 4 ++++ SOURCE/FILE7.PAS | 4 ++++ SOURCE/FILE8.PAS | 4 ++++ SOURCE/FILE9.PAS | 4 ++++ SOURCE/LINECHAT.PAS | 4 ++++ SOURCE/LOGON.PAS | 4 ++++ SOURCE/MAIL0.PAS | 4 ++++ SOURCE/MAIL1.PAS | 4 ++++ SOURCE/MAIL2.PAS | 4 ++++ SOURCE/MAIL3.PAS | 4 ++++ SOURCE/MAIL4.PAS | 4 ++++ SOURCE/MAINT.PAS | 4 ++++ SOURCE/MENUS.PAS | 4 ++++ SOURCE/MENUS2.PAS | 4 ++++ SOURCE/MENUS3.PAS | 4 ++++ SOURCE/MISCUSER.PAS | 4 ++++ SOURCE/MSGPACK.PAS | 4 ++++ SOURCE/MULTNODE.PAS | 4 ++++ SOURCE/MYIO.PAS | 4 ++++ SOURCE/NEWUSERS.PAS | 4 ++++ SOURCE/NODELIST.PAS | 4 ++++ SOURCE/OFFLINE.PAS | 4 ++++ SOURCE/RENEGADE.PAS | 4 ++++ SOURCE/RENEMAIL.PAS | 4 ++++ SOURCE/RGLNG.PAS | 4 ++++ SOURCE/RGQUOTE.PAS | 4 ++++ SOURCE/SCRIPT.PAS | 4 ++++ SOURCE/SHORTMSG.PAS | 4 ++++ SOURCE/SPAWNO.PAS | 4 ++++ SOURCE/SPLITCHA.PAS | 4 ++++ SOURCE/STATS.PAS | 4 ++++ SOURCE/SYSOP1.PAS | 4 ++++ SOURCE/SYSOP10.PAS | 4 ++++ SOURCE/SYSOP11.PAS | 4 ++++ SOURCE/SYSOP12.PAS | 4 ++++ SOURCE/SYSOP2.PAS | 4 ++++ SOURCE/SYSOP2A.PAS | 4 ++++ SOURCE/SYSOP2B.PAS | 4 ++++ SOURCE/SYSOP2C.PAS | 4 ++++ SOURCE/SYSOP2D.PAS | 4 ++++ SOURCE/SYSOP2E.PAS | 4 ++++ SOURCE/SYSOP2F.PAS | 4 ++++ SOURCE/SYSOP2G.PAS | 4 ++++ SOURCE/SYSOP2H.PAS | 4 ++++ SOURCE/SYSOP2I.PAS | 4 ++++ SOURCE/SYSOP2J.PAS | 4 ++++ SOURCE/SYSOP2K.PAS | 4 ++++ SOURCE/SYSOP2L.PAS | 4 ++++ SOURCE/SYSOP2M.PAS | 4 ++++ SOURCE/SYSOP2O.PAS | 4 ++++ SOURCE/SYSOP3.PAS | 4 ++++ SOURCE/SYSOP4.PAS | 4 ++++ SOURCE/SYSOP5.PAS | 4 ++++ SOURCE/SYSOP6.PAS | 4 ++++ SOURCE/SYSOP7.PAS | 4 ++++ SOURCE/SYSOP7M.PAS | 4 ++++ SOURCE/SYSOP8.PAS | 4 ++++ SOURCE/SYSOP9.PAS | 4 ++++ SOURCE/TAGLINE.PAS | 4 ++++ SOURCE/TIMEBANK.PAS | 4 ++++ SOURCE/TIMEFUNC.PAS | 4 ++++ SOURCE/VOTE.PAS | 4 ++++ SOURCE/WFCMENU.PAS | 4 ++++ SOURCE/WIN32/defines.inc | 7 +++++++ VPC.CFG | 6 +++--- 95 files changed, 382 insertions(+), 3 deletions(-) create mode 100644 SOURCE/WIN32/defines.inc diff --git a/SOURCE/ARCHIVE1.PAS b/SOURCE/ARCHIVE1.PAS index 21e3579..c598fb7 100644 --- a/SOURCE/ARCHIVE1.PAS +++ b/SOURCE/ARCHIVE1.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Archive1; diff --git a/SOURCE/ARCHIVE2.PAS b/SOURCE/ARCHIVE2.PAS index d970d58..70b8d25 100644 --- a/SOURCE/ARCHIVE2.PAS +++ b/SOURCE/ARCHIVE2.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Archive2; diff --git a/SOURCE/ARCHIVE3.PAS b/SOURCE/ARCHIVE3.PAS index 3870001..725174e 100644 --- a/SOURCE/ARCHIVE3.PAS +++ b/SOURCE/ARCHIVE3.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT Archive3; diff --git a/SOURCE/ARCVIEW.PAS b/SOURCE/ARCVIEW.PAS index f2be025..7b50a7f 100644 --- a/SOURCE/ARCVIEW.PAS +++ b/SOURCE/ARCVIEW.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT ArcView; diff --git a/SOURCE/AUTOMSG.PAS b/SOURCE/AUTOMSG.PAS index f1a1eca..f53fe7c 100644 --- a/SOURCE/AUTOMSG.PAS +++ b/SOURCE/AUTOMSG.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT AutoMsg; diff --git a/SOURCE/BBSLIST.PAS b/SOURCE/BBSLIST.PAS index 296daf3..b7e3920 100644 --- a/SOURCE/BBSLIST.PAS +++ b/SOURCE/BBSLIST.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT BBSList; diff --git a/SOURCE/BOOT.PAS b/SOURCE/BOOT.PAS index 8d2984e..54a75d3 100644 --- a/SOURCE/BOOT.PAS +++ b/SOURCE/BOOT.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Boot; diff --git a/SOURCE/BULLETIN.PAS b/SOURCE/BULLETIN.PAS index 8f4e51d..7d91889 100644 --- a/SOURCE/BULLETIN.PAS +++ b/SOURCE/BULLETIN.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT Bulletin; diff --git a/SOURCE/COMMON.PAS b/SOURCE/COMMON.PAS index 8462601..05303ef 100644 --- a/SOURCE/COMMON.PAS +++ b/SOURCE/COMMON.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N+,O-,R-,S-,V-} UNIT Common; diff --git a/SOURCE/COMMON1.PAS b/SOURCE/COMMON1.PAS index 28a0f03..845c220 100644 --- a/SOURCE/COMMON1.PAS +++ b/SOURCE/COMMON1.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S-,V-} UNIT Common1; diff --git a/SOURCE/COMMON2.PAS b/SOURCE/COMMON2.PAS index 2403d17..d46370e 100644 --- a/SOURCE/COMMON2.PAS +++ b/SOURCE/COMMON2.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S-,V-} UNIT Common2; diff --git a/SOURCE/COMMON3.PAS b/SOURCE/COMMON3.PAS index d642d77..13cad50 100644 --- a/SOURCE/COMMON3.PAS +++ b/SOURCE/COMMON3.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S-,V-,X-} UNIT Common3; diff --git a/SOURCE/COMMON4.PAS b/SOURCE/COMMON4.PAS index d001bf9..1961b5c 100644 --- a/SOURCE/COMMON4.PAS +++ b/SOURCE/COMMON4.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S-,V-} (* diff --git a/SOURCE/COMMON5.PAS b/SOURCE/COMMON5.PAS index 43bb2a2..2126279 100644 --- a/SOURCE/COMMON5.PAS +++ b/SOURCE/COMMON5.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S-,V-} UNIT Common5; diff --git a/SOURCE/CUSER.PAS b/SOURCE/CUSER.PAS index 1054dda..fadaf77 100644 --- a/SOURCE/CUSER.PAS +++ b/SOURCE/CUSER.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT CUser; diff --git a/SOURCE/DOORS.PAS b/SOURCE/DOORS.PAS index 47bf516..cade80b 100644 --- a/SOURCE/DOORS.PAS +++ b/SOURCE/DOORS.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Doors; diff --git a/SOURCE/EMAIL.PAS b/SOURCE/EMAIL.PAS index 7abd34f..23477a5 100644 --- a/SOURCE/EMAIL.PAS +++ b/SOURCE/EMAIL.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT EMail; diff --git a/SOURCE/EVENTS.PAS b/SOURCE/EVENTS.PAS index 09c6223..d9512f5 100644 --- a/SOURCE/EVENTS.PAS +++ b/SOURCE/EVENTS.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Events; diff --git a/SOURCE/EXECBAT.PAS b/SOURCE/EXECBAT.PAS index 7579913..5a96386 100644 --- a/SOURCE/EXECBAT.PAS +++ b/SOURCE/EXECBAT.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT ExecBat; diff --git a/SOURCE/FILE0.PAS b/SOURCE/FILE0.PAS index bd2c6ee..965c0b9 100644 --- a/SOURCE/FILE0.PAS +++ b/SOURCE/FILE0.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File0; diff --git a/SOURCE/FILE1.PAS b/SOURCE/FILE1.PAS index 40fb151..473e66d 100644 --- a/SOURCE/FILE1.PAS +++ b/SOURCE/FILE1.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File1; diff --git a/SOURCE/FILE10.PAS b/SOURCE/FILE10.PAS index 7a1ec3f..916a0e0 100644 --- a/SOURCE/FILE10.PAS +++ b/SOURCE/FILE10.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File10; diff --git a/SOURCE/FILE11.PAS b/SOURCE/FILE11.PAS index fe87a7e..9140265 100644 --- a/SOURCE/FILE11.PAS +++ b/SOURCE/FILE11.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File11; diff --git a/SOURCE/FILE12.PAS b/SOURCE/FILE12.PAS index fbf6591..85009d5 100644 --- a/SOURCE/FILE12.PAS +++ b/SOURCE/FILE12.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File12; diff --git a/SOURCE/FILE13.PAS b/SOURCE/FILE13.PAS index 024e009..afb2f13 100644 --- a/SOURCE/FILE13.PAS +++ b/SOURCE/FILE13.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File13; diff --git a/SOURCE/FILE14.PAS b/SOURCE/FILE14.PAS index 1c6cfe7..4f383df 100644 --- a/SOURCE/FILE14.PAS +++ b/SOURCE/FILE14.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File14; diff --git a/SOURCE/FILE2.PAS b/SOURCE/FILE2.PAS index cf1adaa..3d2d1ef 100644 --- a/SOURCE/FILE2.PAS +++ b/SOURCE/FILE2.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File2; diff --git a/SOURCE/FILE3.PAS b/SOURCE/FILE3.PAS index ef6d126..b456986 100644 --- a/SOURCE/FILE3.PAS +++ b/SOURCE/FILE3.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File3; diff --git a/SOURCE/FILE4.PAS b/SOURCE/FILE4.PAS index e4991d1..7f84b2a 100644 --- a/SOURCE/FILE4.PAS +++ b/SOURCE/FILE4.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File4; diff --git a/SOURCE/FILE5.PAS b/SOURCE/FILE5.PAS index 9486d9a..6ded087 100644 --- a/SOURCE/FILE5.PAS +++ b/SOURCE/FILE5.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File5; diff --git a/SOURCE/FILE6.PAS b/SOURCE/FILE6.PAS index d674cf3..15ef0b2 100644 --- a/SOURCE/FILE6.PAS +++ b/SOURCE/FILE6.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File6; diff --git a/SOURCE/FILE7.PAS b/SOURCE/FILE7.PAS index 837c985..b2ea1b3 100644 --- a/SOURCE/FILE7.PAS +++ b/SOURCE/FILE7.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File7; diff --git a/SOURCE/FILE8.PAS b/SOURCE/FILE8.PAS index 8781760..818404b 100644 --- a/SOURCE/FILE8.PAS +++ b/SOURCE/FILE8.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File8; diff --git a/SOURCE/FILE9.PAS b/SOURCE/FILE9.PAS index fc45793..beeeac2 100644 --- a/SOURCE/FILE9.PAS +++ b/SOURCE/FILE9.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT File9; diff --git a/SOURCE/LINECHAT.PAS b/SOURCE/LINECHAT.PAS index 79b06ce..7942efc 100644 --- a/SOURCE/LINECHAT.PAS +++ b/SOURCE/LINECHAT.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT LineChat; diff --git a/SOURCE/LOGON.PAS b/SOURCE/LOGON.PAS index 4383c8f..907d1c0 100644 --- a/SOURCE/LOGON.PAS +++ b/SOURCE/LOGON.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Logon; diff --git a/SOURCE/MAIL0.PAS b/SOURCE/MAIL0.PAS index cb9fab0..788e826 100644 --- a/SOURCE/MAIL0.PAS +++ b/SOURCE/MAIL0.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Mail0; diff --git a/SOURCE/MAIL1.PAS b/SOURCE/MAIL1.PAS index 6c8a863..e8abea5 100644 --- a/SOURCE/MAIL1.PAS +++ b/SOURCE/MAIL1.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Mail1; diff --git a/SOURCE/MAIL2.PAS b/SOURCE/MAIL2.PAS index c4320ea..f45e300 100644 --- a/SOURCE/MAIL2.PAS +++ b/SOURCE/MAIL2.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Mail2; diff --git a/SOURCE/MAIL3.PAS b/SOURCE/MAIL3.PAS index cac107d..299c1bc 100644 --- a/SOURCE/MAIL3.PAS +++ b/SOURCE/MAIL3.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Mail3; diff --git a/SOURCE/MAIL4.PAS b/SOURCE/MAIL4.PAS index 74e325f..6203d12 100644 --- a/SOURCE/MAIL4.PAS +++ b/SOURCE/MAIL4.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Mail4; diff --git a/SOURCE/MAINT.PAS b/SOURCE/MAINT.PAS index dabb1e0..69cbd4c 100644 --- a/SOURCE/MAINT.PAS +++ b/SOURCE/MAINT.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Maint; diff --git a/SOURCE/MENUS.PAS b/SOURCE/MENUS.PAS index c5060b6..3ef36fd 100644 --- a/SOURCE/MENUS.PAS +++ b/SOURCE/MENUS.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O-,R-,S+,V-} UNIT Menus; diff --git a/SOURCE/MENUS2.PAS b/SOURCE/MENUS2.PAS index 299e4bf..4b483f4 100644 --- a/SOURCE/MENUS2.PAS +++ b/SOURCE/MENUS2.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Menus2; diff --git a/SOURCE/MENUS3.PAS b/SOURCE/MENUS3.PAS index a020430..e2f22c5 100644 --- a/SOURCE/MENUS3.PAS +++ b/SOURCE/MENUS3.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT Menus3; diff --git a/SOURCE/MISCUSER.PAS b/SOURCE/MISCUSER.PAS index e51592b..bc6ca04 100644 --- a/SOURCE/MISCUSER.PAS +++ b/SOURCE/MISCUSER.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT MiscUser; diff --git a/SOURCE/MSGPACK.PAS b/SOURCE/MSGPACK.PAS index bc8d019..8652eaf 100644 --- a/SOURCE/MSGPACK.PAS +++ b/SOURCE/MSGPACK.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT MsgPack; diff --git a/SOURCE/MULTNODE.PAS b/SOURCE/MULTNODE.PAS index 93187db..e64a6a4 100644 --- a/SOURCE/MULTNODE.PAS +++ b/SOURCE/MULTNODE.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT Multnode; diff --git a/SOURCE/MYIO.PAS b/SOURCE/MYIO.PAS index eb7b47b..5ebcf3e 100644 --- a/SOURCE/MYIO.PAS +++ b/SOURCE/MYIO.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R+,S-,V-} UNIT MyIO; diff --git a/SOURCE/NEWUSERS.PAS b/SOURCE/NEWUSERS.PAS index ed222f3..d9b0313 100644 --- a/SOURCE/NEWUSERS.PAS +++ b/SOURCE/NEWUSERS.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT NewUsers; diff --git a/SOURCE/NODELIST.PAS b/SOURCE/NODELIST.PAS index b9bbaad..6ef438d 100644 --- a/SOURCE/NODELIST.PAS +++ b/SOURCE/NODELIST.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT Nodelist; diff --git a/SOURCE/OFFLINE.PAS b/SOURCE/OFFLINE.PAS index 1848f53..70787fa 100644 --- a/SOURCE/OFFLINE.PAS +++ b/SOURCE/OFFLINE.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S-,V-} UNIT OffLine; diff --git a/SOURCE/RENEGADE.PAS b/SOURCE/RENEGADE.PAS index 9444673..717eae4 100644 --- a/SOURCE/RENEGADE.PAS +++ b/SOURCE/RENEGADE.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$M 35500,0,131072} { R E N E G A D E } diff --git a/SOURCE/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS index 92a6287..40d5373 100644 --- a/SOURCE/RENEMAIL.PAS +++ b/SOURCE/RENEMAIL.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$M 49152,0,65536} {$A+,I-,E-,F+} diff --git a/SOURCE/RGLNG.PAS b/SOURCE/RGLNG.PAS index 707a3d0..7145258 100644 --- a/SOURCE/RGLNG.PAS +++ b/SOURCE/RGLNG.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + PROGRAM RGLNG; USES diff --git a/SOURCE/RGQUOTE.PAS b/SOURCE/RGQUOTE.PAS index e007bad..768943b 100644 --- a/SOURCE/RGQUOTE.PAS +++ b/SOURCE/RGQUOTE.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + PROGRAM RGQUOTE; USES diff --git a/SOURCE/SCRIPT.PAS b/SOURCE/SCRIPT.PAS index ace124c..1952fde 100644 --- a/SOURCE/SCRIPT.PAS +++ b/SOURCE/SCRIPT.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT Script; diff --git a/SOURCE/SHORTMSG.PAS b/SOURCE/SHORTMSG.PAS index 33e2093..e03108b 100644 --- a/SOURCE/SHORTMSG.PAS +++ b/SOURCE/SHORTMSG.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT ShortMsg; diff --git a/SOURCE/SPAWNO.PAS b/SOURCE/SPAWNO.PAS index 1a35111..0325922 100644 --- a/SOURCE/SPAWNO.PAS +++ b/SOURCE/SPAWNO.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + UNIT SPAWNO; INTERFACE diff --git a/SOURCE/SPLITCHA.PAS b/SOURCE/SPLITCHA.PAS index 2b14470..52fa85d 100644 --- a/SOURCE/SPLITCHA.PAS +++ b/SOURCE/SPLITCHA.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT SplitCha; diff --git a/SOURCE/STATS.PAS b/SOURCE/STATS.PAS index 50c1510..7211504 100644 --- a/SOURCE/STATS.PAS +++ b/SOURCE/STATS.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT STATS; diff --git a/SOURCE/SYSOP1.PAS b/SOURCE/SYSOP1.PAS index 7d153bd..77ad48b 100644 --- a/SOURCE/SYSOP1.PAS +++ b/SOURCE/SYSOP1.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp1; diff --git a/SOURCE/SYSOP10.PAS b/SOURCE/SYSOP10.PAS index 85777aa..9fa37e3 100644 --- a/SOURCE/SYSOP10.PAS +++ b/SOURCE/SYSOP10.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp10; diff --git a/SOURCE/SYSOP11.PAS b/SOURCE/SYSOP11.PAS index e2bb4bc..932fa84 100644 --- a/SOURCE/SYSOP11.PAS +++ b/SOURCE/SYSOP11.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp11; diff --git a/SOURCE/SYSOP12.PAS b/SOURCE/SYSOP12.PAS index d7332bb..d6d88d4 100644 --- a/SOURCE/SYSOP12.PAS +++ b/SOURCE/SYSOP12.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp12; diff --git a/SOURCE/SYSOP2.PAS b/SOURCE/SYSOP2.PAS index 082abfd..75c1275 100644 --- a/SOURCE/SYSOP2.PAS +++ b/SOURCE/SYSOP2.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT SysOp2; diff --git a/SOURCE/SYSOP2A.PAS b/SOURCE/SYSOP2A.PAS index d5e50a7..169eb1d 100644 --- a/SOURCE/SYSOP2A.PAS +++ b/SOURCE/SYSOP2A.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp2A; diff --git a/SOURCE/SYSOP2B.PAS b/SOURCE/SYSOP2B.PAS index 61b2ca8..eeff6f1 100644 --- a/SOURCE/SYSOP2B.PAS +++ b/SOURCE/SYSOP2B.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,L+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp2B; diff --git a/SOURCE/SYSOP2C.PAS b/SOURCE/SYSOP2C.PAS index 0dcbd23..0081f3f 100644 --- a/SOURCE/SYSOP2C.PAS +++ b/SOURCE/SYSOP2C.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT SysOp2C; diff --git a/SOURCE/SYSOP2D.PAS b/SOURCE/SYSOP2D.PAS index 1cc5bec..33727d6 100644 --- a/SOURCE/SYSOP2D.PAS +++ b/SOURCE/SYSOP2D.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT SysOp2D; diff --git a/SOURCE/SYSOP2E.PAS b/SOURCE/SYSOP2E.PAS index f1f7044..48eac76 100644 --- a/SOURCE/SYSOP2E.PAS +++ b/SOURCE/SYSOP2E.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} { System Configuration - System Flagged Functions } diff --git a/SOURCE/SYSOP2F.PAS b/SOURCE/SYSOP2F.PAS index 6c78229..4e6acab 100644 --- a/SOURCE/SYSOP2F.PAS +++ b/SOURCE/SYSOP2F.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT SysOp2F; diff --git a/SOURCE/SYSOP2G.PAS b/SOURCE/SYSOP2G.PAS index 3ec2936..b98fa5d 100644 --- a/SOURCE/SYSOP2G.PAS +++ b/SOURCE/SYSOP2G.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp2G; diff --git a/SOURCE/SYSOP2H.PAS b/SOURCE/SYSOP2H.PAS index 45c03ab..4dd3acf 100644 --- a/SOURCE/SYSOP2H.PAS +++ b/SOURCE/SYSOP2H.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp2H; diff --git a/SOURCE/SYSOP2I.PAS b/SOURCE/SYSOP2I.PAS index df7d5aa..5366472 100644 --- a/SOURCE/SYSOP2I.PAS +++ b/SOURCE/SYSOP2I.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT SysOp2I; diff --git a/SOURCE/SYSOP2J.PAS b/SOURCE/SYSOP2J.PAS index aef628e..5b7e446 100644 --- a/SOURCE/SYSOP2J.PAS +++ b/SOURCE/SYSOP2J.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp2J; diff --git a/SOURCE/SYSOP2K.PAS b/SOURCE/SYSOP2K.PAS index 3e7ba0f..0339b04 100644 --- a/SOURCE/SYSOP2K.PAS +++ b/SOURCE/SYSOP2K.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp2K; diff --git a/SOURCE/SYSOP2L.PAS b/SOURCE/SYSOP2L.PAS index e22e606..9fae3ba 100644 --- a/SOURCE/SYSOP2L.PAS +++ b/SOURCE/SYSOP2L.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT SysOp2L; diff --git a/SOURCE/SYSOP2M.PAS b/SOURCE/SYSOP2M.PAS index e90f03d..7bdc7b4 100644 --- a/SOURCE/SYSOP2M.PAS +++ b/SOURCE/SYSOP2M.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT SysOp2M; diff --git a/SOURCE/SYSOP2O.PAS b/SOURCE/SYSOP2O.PAS index f1be26b..41896ff 100644 --- a/SOURCE/SYSOP2O.PAS +++ b/SOURCE/SYSOP2O.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT SysOp2O; diff --git a/SOURCE/SYSOP3.PAS b/SOURCE/SYSOP3.PAS index 067fe38..5fc4558 100644 --- a/SOURCE/SYSOP3.PAS +++ b/SOURCE/SYSOP3.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp3; diff --git a/SOURCE/SYSOP4.PAS b/SOURCE/SYSOP4.PAS index bf75a26..90b1a4b 100644 --- a/SOURCE/SYSOP4.PAS +++ b/SOURCE/SYSOP4.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S-,V-} UNIT SysOp4; diff --git a/SOURCE/SYSOP5.PAS b/SOURCE/SYSOP5.PAS index acc8b5d..b8e7538 100644 --- a/SOURCE/SYSOP5.PAS +++ b/SOURCE/SYSOP5.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp5; diff --git a/SOURCE/SYSOP6.PAS b/SOURCE/SYSOP6.PAS index ef1501d..87de7ad 100644 --- a/SOURCE/SYSOP6.PAS +++ b/SOURCE/SYSOP6.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp6; diff --git a/SOURCE/SYSOP7.PAS b/SOURCE/SYSOP7.PAS index 62e4efa..bc34bd4 100644 --- a/SOURCE/SYSOP7.PAS +++ b/SOURCE/SYSOP7.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B+,D+,E+,F+,I+,L+,N-,O+,R-,S+,V-} UNIT SysOp7; diff --git a/SOURCE/SYSOP7M.PAS b/SOURCE/SYSOP7M.PAS index bf12f71..e10cf9f 100644 --- a/SOURCE/SYSOP7M.PAS +++ b/SOURCE/SYSOP7M.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B+,D+,E+,F+,I+,L+,N-,O+,R-,S+,V-} UNIT SysOp7M; diff --git a/SOURCE/SYSOP8.PAS b/SOURCE/SYSOP8.PAS index 9236049..ca4eaf8 100644 --- a/SOURCE/SYSOP8.PAS +++ b/SOURCE/SYSOP8.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp8; diff --git a/SOURCE/SYSOP9.PAS b/SOURCE/SYSOP9.PAS index eb98404..4d62990 100644 --- a/SOURCE/SYSOP9.PAS +++ b/SOURCE/SYSOP9.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT SysOp9; diff --git a/SOURCE/TAGLINE.PAS b/SOURCE/TAGLINE.PAS index cce8de6..2672772 100644 --- a/SOURCE/TAGLINE.PAS +++ b/SOURCE/TAGLINE.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + PROGRAM TAGLINE; USES diff --git a/SOURCE/TIMEBANK.PAS b/SOURCE/TIMEBANK.PAS index 0529ccd..0ffd8be 100644 --- a/SOURCE/TIMEBANK.PAS +++ b/SOURCE/TIMEBANK.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT TimeBank; diff --git a/SOURCE/TIMEFUNC.PAS b/SOURCE/TIMEFUNC.PAS index b107fbb..cc6f551 100644 --- a/SOURCE/TIMEFUNC.PAS +++ b/SOURCE/TIMEFUNC.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} UNIT TimeFunc; diff --git a/SOURCE/VOTE.PAS b/SOURCE/VOTE.PAS index 94b1bf4..c2dac62 100644 --- a/SOURCE/VOTE.PAS +++ b/SOURCE/VOTE.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT Vote; diff --git a/SOURCE/WFCMENU.PAS b/SOURCE/WFCMENU.PAS index 6eb5910..764362b 100644 --- a/SOURCE/WFCMENU.PAS +++ b/SOURCE/WFCMENU.PAS @@ -1,3 +1,7 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + {$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} UNIT WFCMenu; diff --git a/SOURCE/WIN32/defines.inc b/SOURCE/WIN32/defines.inc new file mode 100644 index 0000000..397b28e --- /dev/null +++ b/SOURCE/WIN32/defines.inc @@ -0,0 +1,7 @@ +{$IFDEF VPASCAL} + {&AlignRec-} + {&Delphi-} + {&Use32+} + {$H-} + {$V-} +{$ENDIF} \ No newline at end of file diff --git a/VPC.CFG b/VPC.CFG index c9350a5..a759605 100644 --- a/VPC.CFG +++ b/VPC.CFG @@ -1,8 +1,8 @@ /OZ:\PROGRA~1\RG119SRC\EXE\VP -/I.\ELECOM;Z:\VP21\SOURCE\RTL;Z:\VP21\SOURCE\TV +/I.\ELECOM;.\WIN32;Z:\VP21\SOURCE\RTL;Z:\VP21\SOURCE\TV /U.\ELECOM;.\WIN32;Z:\VP21\UNITS.W32;Z:\VP21\SOURCE\RTL;Z:\VP21\SOURCE\W32;Z:\VP21\SOURCE\TV;Z:\VP21\EXAMPLES\W32\OPENGL\SHARED -/L.\ELECOM;Z:\VP21\LIB.W32;Z:\VP21\UNITS.W32 -/R.\ELECOM;Z:\VP21\RES.W32 +/L.\ELECOM;.\WIN32;Z:\VP21\LIB.W32;Z:\VP21\UNITS.W32 +/R.\ELECOM;.\WIN32;Z:\VP21\RES.W32 /$A+ /$B- /$D+ From 00cb4ec98556576ca068da93ef900217d023738a Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 13:52:38 -0500 Subject: [PATCH 04/17] RENEGADE now compiles with VP Of course it doesn't work yet, so don't try running it! --- SOURCE/BOOT.PAS | 32 ++++++++++++++++++ SOURCE/COMMON.PAS | 52 ++++++++++++++++++++++++++++- SOURCE/COMMON2.PAS | 30 +++++++++++++++++ SOURCE/COMMON4.PAS | 81 +++++++++++++++++++++++++++++++++++++++++++++ SOURCE/EVENTS.PAS | 14 +++++++- SOURCE/EXECBAT.PAS | 6 ++++ SOURCE/LINECHAT.PAS | 12 ++++++- SOURCE/MAIL1.PAS | 2 +- SOURCE/MYIO.PAS | 20 +++++++++++ SOURCE/RENEGADE.PAS | 6 ++++ SOURCE/SPAWNO.PAS | 13 ++++++++ SOURCE/SPLITCHA.PAS | 9 +++-- SOURCE/SYSOP4.PAS | 15 +++++++++ SOURCE/WFCMENU.PAS | 26 ++++++++++++++- 14 files changed, 311 insertions(+), 7 deletions(-) diff --git a/SOURCE/BOOT.PAS b/SOURCE/BOOT.PAS index 54a75d3..81b011f 100644 --- a/SOURCE/BOOT.PAS +++ b/SOURCE/BOOT.PAS @@ -837,6 +837,7 @@ VAR WinOk, WinNTOk: Boolean; +{$IFDEF MSDOS} FUNCTION TrueDosVer(VAR WinNTOk: Boolean): Word; VAR Regs: Registers; @@ -852,7 +853,15 @@ VAR TrueDosVer := Bl; END; END; +{$ENDIF} +{$IFDEF WIN32} + FUNCTION TrueDosVer(VAR WinNTOk: Boolean): Word; + BEGIN + WriteLn('REETODO BOOT TrueDosVer'); Halt; + END; +{$ENDIF} +{$IFDEF MSDOS} FUNCTION DosVer(VAR Minor,OS2Ver: Word): Word; VAR Regs: Registers; @@ -870,7 +879,15 @@ VAR OS2Ver := 2; END; END; +{$ENDIF} +{$IFDEF WIN32} + FUNCTION DosVer(VAR Minor,OS2Ver: Word): Word; + BEGIN + WriteLn('REETODO BOOT DosVer'); Halt; + END; +{$ENDIF} +{$IFDEF MSDOS} FUNCTION Win3_Check_On: Boolean; VAR Regs: Registers; @@ -885,7 +902,15 @@ VAR Win3_Check_On := TRUE; END; END; +{$ENDIF} +{$IFDEF WIN32} + FUNCTION Win3_Check_On: Boolean; + BEGIN + WriteLn('REETODO BOOT Win3_Check_On'); Halt; + END; +{$ENDIF} +{$IFDEF MSDOS} FUNCTION DV_Check_On: Boolean; VAR Regs: Registers; @@ -903,6 +928,13 @@ VAR ELSE DV_Check_On := TRUE; END; +{$ENDIF} +{$IFDEF WIN32} + FUNCTION DV_Check_On: Boolean; + BEGIN + WriteLn('REETODO BOOT DV_Check_On'); Halt; + END; +{$ENDIF} BEGIN D5 := 0; diff --git a/SOURCE/COMMON.PAS b/SOURCE/COMMON.PAS index 05303ef..f8cbaf3 100644 --- a/SOURCE/COMMON.PAS +++ b/SOURCE/COMMON.PAS @@ -276,7 +276,9 @@ VAR DatFilePath: STRING[40]; Interrupt14: Pointer; { far ptr TO interrupt 14 } +{$IFDEF MSDOS} Ticks: LongInt ABSOLUTE $0040:$006C; +{$ENDIF} IEMSIRec: IEMSIRecord; FossilPort: Word; SockHandle: STRING; { Telnet Handle } @@ -464,6 +466,9 @@ VAR MQArea, VQArea: Boolean; +{$IFDEF WIN32} +function Ticks: LongInt; +{$ENDIF} FUNCTION GetC(c: Byte): STRING; PROCEDURE ShowColors; FUNCTION CheckDriveSpace(S,Path: AStr; MinSpace: Integer): Boolean; @@ -664,10 +669,29 @@ USES MultNode, SpawnO, SysOp12, - Vote; + Vote +{$IFDEF WIN32} + ,VPUtils +{$ENDIF} + ; +{$IFDEF WIN32} +function Ticks: LongInt; +begin + Ticks := GetTimeMSec div 55; +end; +{$ENDIF} + +{$IFDEF MSDOS} FUNCTION UpdateCRC32(CRC: LongInt; VAR Buffer; Len: Word): LongInt; EXTERNAL; {$L CRC32.OBJ } +{$ENDIF} +{$IFDEF WIN32} +FUNCTION UpdateCRC32(CRC: LongInt; VAR Buffer; Len: Word): LongInt; +BEGIN + WriteLn('REETODO COMMON UpdateCRC32'); +END; +{$ENDIF} FUNCTION CheckPW: Boolean; BEGIN @@ -2692,16 +2716,23 @@ CONST LastTimeSlice: LongInt = 0; LastCheckTimeSlice: LongInt = 0; VAR +{$IFDEF MSDOS} Killme: Pointer ABSOLUTE $0040 :$F000; +{$ENDIF} Tf: Boolean; I: Integer; C: Word; TempTimer: LongInt; BEGIN IF (DieLater) THEN +{$IFDEF MSDOS} ASM Call Killme END; +{$ENDIF} +{$IFDEF WIN32} + Halt; +{$ENDIF} LIL := 1; IF (Buf <> '') THEN BEGIN @@ -2741,11 +2772,16 @@ BEGIN BEGIN FOR I := 1 TO 100 DO BEGIN +{$IFDEF MSDOS} Sound(500 + (I * 10)); Delay(2); Sound(100 + (I * 10)); Delay(2); NoSound; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON GetKey'); Halt; +{$ENDIF} END; LastBeep := TempTimer; END; @@ -4008,7 +4044,12 @@ BEGIN TempStr := ''; FOR XPos := 1 TO MaxDisplayCols DO BEGIN +{$IFDEF MSDOS} c := Chr(Mem[VidSeg:(160 * (YPos - 1) + 2 * (XPos - 1))]); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON ScreenDump'); Halt; +{$ENDIF} IF (c = #0) THEN c := #32; IF ((XPos = WhereX) AND (YPos = WhereY)) THEN @@ -4338,7 +4379,9 @@ BEGIN SaveCurCo := CurrentColor; SaveMCIAllowed := MCIAllowed; MCIAllowed := TRUE; +{$IFDEF MSDOS} NoSound; +{$ENDIF} IF (NOT AllowContinue) AND NOT (PrintingFile AND AllowAbort) THEN IsCont := FALSE; IF (IsCont) THEN @@ -4804,7 +4847,9 @@ END; FUNCTION DiskKBFree(DrivePath: AStr): LongInt; VAR F: TEXT; +{$IFDEF MSDOS} Regs: Registers; +{$ENDIF} S, S1: STRING; Counter: Integer; @@ -4843,6 +4888,7 @@ BEGIN END ELSE BEGIN +{$IFDEF MSDOS} FillChar(Regs,SizeOf(Regs),#0); Regs.Ah := $36; Regs.Dl := ExtractDriveNumber(DrivePath); @@ -4850,6 +4896,10 @@ BEGIN C := (1.0 * Regs.Ax); C1 := ((1.0 * Regs.Cx) * C); C2 := ((1.0 * Regs.Bx) * C1); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON DiskKBFree'); Halt; +{$ENDIF} END; DiskKBFree := Round(C2 / 1024.0); END; diff --git a/SOURCE/COMMON2.PAS b/SOURCE/COMMON2.PAS index d46370e..be40eff 100644 --- a/SOURCE/COMMON2.PAS +++ b/SOURCE/COMMON2.PAS @@ -280,7 +280,12 @@ BEGIN CASE WhichScreen OF 1 : WITH ThisUser DO BEGIN +{$IFDEF MSDOS} Update_Logo(Win1,ScreenAddr[(FirstRow - 1) * 160],WIN1_LENGTH); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON2 Update_Logo(Win1'); Halt; +{$ENDIF} GoToXY(02,FirstRow); Write(Caps(Name)); GoToXY(33,FirstRow); @@ -325,7 +330,12 @@ BEGIN END; 2 : WITH ThisUser DO BEGIN +{$IFDEF MSDOS} Update_Logo(Win2,ScreenAddr[(FirstRow - 1) * 160],WIN2_LENGTH); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON2 Update_Logo(Win2'); Halt; +{$ENDIF} GoToXY(02,FirstRow); Write(Street); GoToXY(33,FirstRow); @@ -358,7 +368,12 @@ BEGIN END; 3 : WITH ThisUser DO BEGIN +{$IFDEF MSDOS} Update_Logo(Win3,ScreenAddr[(FirstRow - 1) * 160],WIN3_LENGTH); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON2 Update_Logo(Win3'); Halt; +{$ENDIF} GoToXY(06,FirstRow); Write(Loggedon); GoToXY(16,FirstRow); @@ -407,7 +422,12 @@ BEGIN Close(HistoryFile); WITH History DO BEGIN +{$IFDEF MSDOS} Update_Logo(Win4,ScreenAddr[(FirstRow - 1) * 160],WIN4_LENGTH); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON2 Update_Logo(Win4'); Halt; +{$ENDIF} GoToXY(20,FirstRow); Write(Callers); GoToXY(34,FirstRow); @@ -430,7 +450,12 @@ BEGIN END; 5 : WITH History DO BEGIN +{$IFDEF MSDOS} Update_Logo(Win5,ScreenAddr[(FirstRow - 1) * 160],WIN5_LENGTH); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON2 Update_Logo(Win5'); Halt; +{$ENDIF} GoToXY(20,FirstRow); Write(General.CallerNum); GoToXY(31,FirstRow); @@ -555,7 +580,12 @@ BEGIN CASE Ord(C) OF 119 : BEGIN { CTRL-HOME } SaveScreen(Wind); +{$IFDEF MSDOS} Update_Logo(SYSKEY,ScreenAddr[0],SYSKEY_LENGTH); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON2 Update_Logo(SYSKEY'); Halt; +{$ENDIF} CursorOn(FALSE); C := ReadKey; IF (C = #0) THEN diff --git a/SOURCE/COMMON4.PAS b/SOURCE/COMMON4.PAS index 1961b5c..7072c8f 100644 --- a/SOURCE/COMMON4.PAS +++ b/SOURCE/COMMON4.PAS @@ -367,6 +367,7 @@ PROCEDURE Com_Flush_Recv; BEGIN IF (NOT LocalIOOnly) THEN BEGIN +{$IFDEF MSDOS} ASM Cmp InWfcMenu,1 Je @TheEnd @@ -375,6 +376,10 @@ BEGIN Int 14h @TheEnd: END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_Flush_Recv'); Halt; +{$ENDIF} END ELSE WHILE NOT (Com_IsRecv_Empty) DO WriteWFC(CInKey); @@ -399,6 +404,7 @@ the output buffer (not transmitted yet) is discarded. PROCEDURE Com_Purge_Send; BEGIN +{$IFDEF MSDOS} ASM Cmp LocalIOOnly,1 Je @TheEnd @@ -407,6 +413,10 @@ BEGIN Int 14h @TheEnd: END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_Purge_Send'); Halt; +{$ENDIF} END; (* @@ -436,6 +446,7 @@ VAR Dummy: Byte; BEGIN Dummy := 0; (* New *) +{$IFDEF MSDOS} ASM Cmp LocalIOOnly,1 Je @TheEnd @@ -445,6 +456,10 @@ BEGIN Mov Dummy,AL @TheEnd: END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_Carrier'); Halt; +{$ENDIF} Com_Carrier := (Dummy AND $80) = $80; END; @@ -478,6 +493,7 @@ VAR BEGIN Com_Recv := #0; T_RecvChar := FALSE; +{$IFDEF MSDOS} ASM Cmp LocalIOOnly,1 Je @TheEnd @@ -493,6 +509,10 @@ BEGIN Mov T_RecvChar,1 @TheEnd: END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_Recv'); Halt; +{$ENDIF} IF (T_RecvChar) THEN Com_Recv := Char(Dummy); END; @@ -524,6 +544,7 @@ VAR Dummy: Byte; BEGIN Dummy := 0; (* New *) +{$IFDEF MSDOS} ASM Cmp LocalIOOnly,1 Je @TheEnd @@ -533,6 +554,10 @@ BEGIN Mov Dummy,AH @TheEnd: END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_IsRecv_Empty'); Halt; +{$ENDIF} Com_IsRecv_Empty := NOT ((Dummy AND $01) = $01); END; @@ -563,6 +588,7 @@ VAR Dummy: Byte; BEGIN Dummy := 0; (* New *) +{$IFDEF MSDOS} ASM Cmp LocalIOOnly,1 Je @TheEnd @@ -572,6 +598,10 @@ BEGIN Mov Dummy,AH @TheEnd: END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_IsSend_Empty'); Halt; +{$ENDIF} Com_IsSend_Empty := ((Dummy AND $40) = $40); END; @@ -589,6 +619,7 @@ value of 0000h is returned in AX. If the driver accepts the character PROCEDURE Com_Send(C: Char); BEGIN +{$IFDEF MSDOS} ASM Cmp LocalIOOnly,1 Je @TheEnd @@ -598,6 +629,10 @@ BEGIN Int 14h @TheEnd: END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_Send'); Halt; +{$ENDIF} END; (* @@ -673,12 +708,17 @@ BEGIN T_AL := 32; END; Inc(T_AL,3); +{$IFDEF MSDOS} ASM Mov AH,00h Mov AL,T_AL Mov DX,FossilPort Int 14h END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_Set_Speed'); Halt; +{$ENDIF} END; END; @@ -696,16 +736,22 @@ PROCEDURE Com_DeInstall; BEGIN IF (NOT LocalIOOnly) THEN BEGIN +{$IFDEF MSDOS} ASM Mov AH,05h Mov DX,FossilPort Int 14h END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_DeInstall'); Halt; +{$ENDIF} END; END; PROCEDURE Com_Install; +{$IFDEF MSDOS} FUNCTION DriverInstalled: Word; ASSEMBLER; ASM Mov AH,5 @@ -716,6 +762,13 @@ PROCEDURE Com_Install; PushF Call Interrupt14 END; +{$ENDIF} +{$IFDEF WIN32} + FUNCTION DriverInstalled: Word; + BEGIN + DriverInstalled := $1954; // Seems to be what it wants + END; +{$ENDIF} BEGIN FossilPort := (Liner.Comport - 1); @@ -728,6 +781,7 @@ BEGIN Halt; END ELSE +{$IFDEF MSDOS} ASM Xor AL,AL Mov BL,Liner.MFlags @@ -744,9 +798,14 @@ BEGIN PushF Call Interrupt14 END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Com_Install'); Halt; +{$ENDIF} Com_Set_Speed(Liner.InitBaud); END; +{$IFDEF MSDOS} PROCEDURE CheckHangup; ASSEMBLER; ASM Cmp LocalIOOnly,1 @@ -762,6 +821,13 @@ ASM Mov HangUp,1 @GetOut: END; +{$ENDIF} +{$IFDEF WIN32} +PROCEDURE CheckHangup; +BEGIN + WriteLn('REETODO COMMON4 CheckHangup'); Halt; +END; +{$ENDIF} (* AH = 19h Write block (transfer from user buffer to FOSSIL) @@ -790,6 +856,7 @@ BEGIN T_DI := OFS(S[1]); T_CX := Length(S); T_ES := Seg(S[1]); +{$IFDEF MSDOS} ASM Mov AH,19h Mov DI,T_DI @@ -799,6 +866,10 @@ BEGIN Int 14h Mov T_AX,AX END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 SerialOut'); Halt; +{$ENDIF} Move(S[T_AX + 1],S[1],Length(S) - T_AX); Dec(S[0],T_AX); UNTIL (S = ''); @@ -834,12 +905,17 @@ BEGIN Empty := NOT KeyPressed; IF (InCom) AND (NOT KeyPressed) THEN BEGIN +{$IFDEF MSDOS} ASM Mov DX,FossilPort Mov AH,03h Int 14h Mov T_AH,AH END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 Empty'); Halt; +{$ENDIF} Empty := NOT (T_AH AND 1 = 1); END; END; @@ -862,12 +938,17 @@ BEGIN IF (NOT LocalIOOnly) THEN BEGIN T_AL := Byte(Status); +{$IFDEF MSDOS} ASM Mov AH,06h Mov DX,FossilPort Mov AL,T_AL Int 14h END; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO COMMON4 DTR'); Halt; +{$ENDIF} END; END; diff --git a/SOURCE/EVENTS.PAS b/SOURCE/EVENTS.PAS index d9512f5..24ed03e 100644 --- a/SOURCE/EVENTS.PAS +++ b/SOURCE/EVENTS.PAS @@ -19,7 +19,11 @@ IMPLEMENTATION USES Dos, Common, - TimeFunc; + TimeFunc +{$IFDEF WIN32} + ,Windows +{$ENDIF} + ; FUNCTION InTime(Tim,Tim1,Tim2: LongInt): Boolean; BEGIN @@ -226,11 +230,19 @@ END; FUNCTION SysOpAvailable: Boolean; VAR +{$IFDEF MSDOS} A: Byte ABSOLUTE $0000:$0417; +{$ENDIF} EventNum: Integer; ChatOk: Boolean; BEGIN +{$IFDEF MSDOS} ChatOk := ((A AND 16) = 0); +{$ENDIF} +{$IFDEF WIN32} + // Availability is togged with scroll lock key + ChatOk := (GetKeyState($91) and $ffff) <> 0; +{$ENDIF} IF (RChat IN ThisUser.Flags) THEN ChatOk := FALSE; diff --git a/SOURCE/EXECBAT.PAS b/SOURCE/EXECBAT.PAS index 5a96386..fa586db 100644 --- a/SOURCE/EXECBAT.PAS +++ b/SOURCE/EXECBAT.PAS @@ -43,10 +43,12 @@ VAR SaveY: Byte; SavCurWind: Integer; +{$IFDEF MSDOS} {$L EXECWIN} PROCEDURE SetCsInts; EXTERNAL; PROCEDURE NewInt21; EXTERNAL; +{$ENDIF} PROCEDURE ExecWindow(VAR Ok: Boolean; CONST Dir, @@ -83,6 +85,7 @@ BEGIN WindLo := WindMin; WindHi := WindMax; +{$IFDEF MSDOS} {Assure cursor is in Window} INLINE ( @@ -119,6 +122,7 @@ BEGIN GetIntVec($21,CurInt21); SetCsInts; SetIntVec($21,@NewInt21); +{$ENDIF} {$IFDEF Ver70} {Prevent SwapVectors from undoing our int21 change} @@ -136,8 +140,10 @@ BEGIN Window(1,1,MaxDisplayCols,MaxDisplayRows); RemoveWindow(Wind); +{$IFDEF MSDOS} {Restore interrupt} SetIntVec($21,CurInt21); +{$ENDIF} General.CurWindow := SaveCurWindow; General.WindowOn := SaveWindowOn; LastScreenSwap := (Timer - 5); diff --git a/SOURCE/LINECHAT.PAS b/SOURCE/LINECHAT.PAS index 7942efc..8ecb638 100644 --- a/SOURCE/LINECHAT.PAS +++ b/SOURCE/LINECHAT.PAS @@ -74,6 +74,7 @@ BEGIN Delay(600) ELSE BEGIN +{$IFDEF MSDOS} FOR Counter1 := 300 DOWNTO 2 DO BEGIN Delay(1); @@ -84,8 +85,12 @@ BEGIN Delay(1); Sound(Counter1 * 10); END; + NoSound; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO LINECHAT RequestSysOpChat'); Halt; +{$ENDIF} END; - NoSound; IF (KeyPressed) THEN BEGIN Cmd := ReadKey; @@ -364,6 +369,7 @@ BEGIN CLS ELSE IF (S = '/PAGE') THEN BEGIN +{$IFDEF MSDOS} FOR Counter := 650 TO 700 DO BEGIN Sound(Counter); @@ -376,6 +382,10 @@ BEGIN Delay(2); NoSound; UNTIL (Counter = 200); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO LINECHAT SysOpLineChat'); Halt; +{$ENDIF} Prompt(^G^G); END ELSE IF (S = '/BYE') THEN diff --git a/SOURCE/MAIL1.PAS b/SOURCE/MAIL1.PAS index e8abea5..92e4d24 100644 --- a/SOURCE/MAIL1.PAS +++ b/SOURCE/MAIL1.PAS @@ -1223,7 +1223,7 @@ VAR Insert_Char(Char(GKey)); 127 : Delete_Char; - 32..254 : + 32..46, 48..126, 128..254 : Insert_Char(Char(GKey)); 8 : BEGIN IF (CCol = 1) THEN diff --git a/SOURCE/MYIO.PAS b/SOURCE/MYIO.PAS index 5ebcf3e..49fdd75 100644 --- a/SOURCE/MYIO.PAS +++ b/SOURCE/MYIO.PAS @@ -28,8 +28,13 @@ CONST VAR Wind: WindowRec; +{$IFDEF MSDOS} MonitorType: Byte ABSOLUTE $0000:$0449; ScreenAddr: ScreenType ABSOLUTE $B800:$0000; +{$ENDIF} +{$IFDEF WIN32} + MonitorType: Byte = 3; // REENOTE 3=CO80, a safe assumption I think +{$ENDIF} ScreenSize: Integer; MaxDisplayRows, MaxDisplayCols, @@ -529,12 +534,22 @@ END; PROCEDURE SaveScreen(VAR Wind: WindowRec); BEGIN +{$IFDEF MSDOS} Move(ScreenAddr[0],Wind[0],ScreenSize); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO MYIO SaveScreen'); Halt; +{$ENDIF} END; PROCEDURE RemoveWindow(VAR Wind: WindowRec); BEGIN +{$IFDEF MSDOS} Move(Wind[0],ScreenAddr[0],ScreenSize); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO MYIO RemoveWindow'); Halt; +{$ENDIF} END; PROCEDURE SetWindow(VAR Wind: WindowRec; TLX,TLY,BRX,BRY,TColr,BColr,BoxType:Integer); @@ -549,6 +564,7 @@ END; PROCEDURE Update_Logo(VAR Addr1,Addr2; BlkLen: Integer); BEGIN +{$IFDEF MSDOS} INLINE ( $1E/ $C5/$B6/ADDR1/ @@ -603,6 +619,10 @@ BEGIN $49/ $E0/$AA/ $1F); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO MYIO Update_Logo'); Halt; +{$ENDIF} END; END. diff --git a/SOURCE/RENEGADE.PAS b/SOURCE/RENEGADE.PAS index 717eae4..83c93e7 100644 --- a/SOURCE/RENEGADE.PAS +++ b/SOURCE/RENEGADE.PAS @@ -2,7 +2,9 @@ {$I DEFINES.INC} {$ENDIF} +{$IFDEF MSDOS} {$M 35500,0,131072} +{$ENDIF} { R E N E G A D E } { =============== } @@ -230,7 +232,9 @@ END; BEGIN ClrScr; TextColor(Yellow); +{$IFDEF MSDOS} GetIntVec($14,Interrupt14); +{$ENDIF} FileMode := 66; ExitSave := ExitProc; ExitProc := @ErrorHandle; @@ -266,6 +270,7 @@ BEGIN ReadP; +{$IFDEF MSDOS} OvrFileMode := 0; Write('Initializing RENEGADE.OVR ... '); OvrInit('RENEGADE.OVR'); @@ -316,6 +321,7 @@ BEGIN END; END; WriteLn('Initial size of the overlay buffer is '+FormatNumber(OvrGetBuf)+' bytes.'); +{$ENDIF} Init; diff --git a/SOURCE/SPAWNO.PAS b/SOURCE/SPAWNO.PAS index 0325922..f6b74fa 100644 --- a/SOURCE/SPAWNO.PAS +++ b/SOURCE/SPAWNO.PAS @@ -36,11 +36,24 @@ FUNCTION Spawn(ProgName: STRING; Arguments: STRING; EnvSeg: Integer): Integer; IMPLEMENTATION +{$IFDEF MSDOS} {$L SPAWNTP.OBJ} PROCEDURE Init_Spawno(Swap_Dirs: STRING; Swap_Types: Integer; Min_Res: Integer; Res_Stack: Integer); EXTERNAL; FUNCTION Spawn(ProgName: STRING; Arguments: STRING; EnvSeg: Integer): Integer; EXTERNAL; +{$ENDIF} +{$IFDEF WIN32} +PROCEDURE Init_Spawno(Swap_Dirs: STRING; Swap_Types: Integer; Min_Res: Integer; Res_Stack: Integer); +BEGIN + WriteLn('REETODO SPAWNO Init_Spawno'); Halt; +END; + +FUNCTION Spawn(ProgName: STRING; Arguments: STRING; EnvSeg: Integer): Integer; +BEGIN + WriteLn('REETODO SPAWNO Spawn'); Halt; +END; +{$ENDIF} END. diff --git a/SOURCE/SPLITCHA.PAS b/SOURCE/SPLITCHA.PAS index 52fa85d..a3e6d20 100644 --- a/SOURCE/SPLITCHA.PAS +++ b/SOURCE/SPLITCHA.PAS @@ -82,10 +82,11 @@ BEGIN lRGLngStr(15,FALSE); IF (OutCom) THEN Com_Send(^G); - IF (ShutUpChatCall) THEN + IF (ShutUpChatCall) THEN Delay(600) ELSE BEGIN + {$IFDEF MSDOS} FOR Counter1 := 300 DOWNTO 2 DO BEGIN Delay(1); @@ -96,8 +97,12 @@ BEGIN Delay(1); Sound(Counter1 * 10); END; + NoSound; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO SPLITCHA RequestSysOpChat'); Halt; +{$ENDIF} END; - NoSound; IF (KeyPressed) THEN BEGIN Cmd := ReadKey; diff --git a/SOURCE/SYSOP4.PAS b/SOURCE/SYSOP4.PAS index 90b1a4b..80cfc35 100644 --- a/SOURCE/SYSOP4.PAS +++ b/SOURCE/SYSOP4.PAS @@ -223,7 +223,12 @@ VAR END; BEGIN +{$IFDEF MSDOS} Mark(TopHeap); +{$ENDIF} +{$IFDEF WIN32} + // REETODO Prepare to leak memory... +{$ENDIF} Used := NIL; Top := NIL; Bottom := NIL; @@ -396,7 +401,12 @@ BEGIN Cur := NIL; Top := NIL; Bottom := NIL; +{$IFDEF MSDOS} Release(TopHeap); +{$ENDIF} +{$IFDEF WIN32} + // REETODO Likely going to leak memory right about now +{$ENDIF} END; 'D' : BEGIN I := StrToInt(Copy(S,2,9)); @@ -540,7 +550,12 @@ BEGIN UNTIL ((Done) OR (HangUp)); END; END; +{$IFDEF MSDOS} Release(TopHeap); +{$ENDIF} +{$IFDEF WIN32} + // REETODO Likely going to leak memory right about now +{$ENDIF} PrintingFile := FALSE; LastError := IOResult; END; diff --git a/SOURCE/WFCMENU.PAS b/SOURCE/WFCMENU.PAS index 764362b..27d9aa6 100644 --- a/SOURCE/WFCMENU.PAS +++ b/SOURCE/WFCMENU.PAS @@ -309,7 +309,12 @@ BEGIN Com_Send_Str(Liner.Answer); IF (SysOpOn) THEN +{$IFDEF MSDOS} Update_Logo(ANSWER,ScreenAddr[(3*2)+(19*160)-162],ANSWER_LENGTH); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO WFCMENU GetConnection'); Halt; +{$ENDIF} rl := 0; SaveTimer := Timer; @@ -416,10 +421,19 @@ BEGIN IF (SysOpOn) THEN BEGIN +{$IFDEF MSDOS} Update_Logo(WFC,ScreenAddr[0],WFC_LENGTH); - +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO WFCMENU WFCDraw1'); Halt; +{$ENDIF} IF (General.NetworkMode) THEN +{$IFDEF MSDOS} Update_Logo(WFCNET,ScreenAddr[(3*2)+(19*160)-162],WFCNET_LENGTH); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO WFCMENU WFCDraw2'); Halt; +{$ENDIF} LoadURec(ThisUser,1); @@ -589,7 +603,12 @@ BEGIN END; END ELSE +{$IFDEF MSDOS} Update_Logo(WFC0,ScreenAddr[0],WFC0_LENGTH); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO WFCMENU WFCDraw3'); Halt; +{$ENDIF} END; END; @@ -714,6 +733,7 @@ VAR BeepEnd := FALSE; rl := Timer; REPEAT +{$IFDEF MSDOS} Sound(1500); Delay(20); Sound(1000); @@ -721,6 +741,10 @@ VAR Sound(800); Delay(20); NoSound; +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO WFCMENU BeepHim'); Halt; +{$ENDIF} rl1 := Timer; WHILE (ABS(rl1 - Timer) < 0.9) AND (NOT KeyPressed) DO; UNTIL (ABS(rl - Timer) > 30) OR (KeyPressed); From 88c971eb16cbde9d4b344963b90f1b4ed06ee1db Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 13:55:11 -0500 Subject: [PATCH 05/17] Now everything compiles --- README.md | 2 +- SOURCE/RENEMAIL.PAS | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c24703e..a9a71c6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ Ported to Win32 by Rick Parrish
TODO list:
    -
  • IFDEF out anything that doesn't compile and make a WIN32 placeholder that does a "WriteLn('REETODO UNIT FUNCTION'); Halt;" (then you can grep the executables for REETODO to see which REETODOs actually need to be implemented)
  • IFDEF out any ASM code blocks and handle the same as above
  • WORD in RECORD to SMALLWORD
  • INTEGER in RECORD to SMALLINT
  • @@ -27,4 +26,5 @@ TODO list:
    Completed list
      +
    • IFDEF out anything that doesn't compile and make a WIN32 placeholder that does a "WriteLn('REETODO UNIT FUNCTION'); Halt;" (then you can grep the executables for REETODO to see which REETODOs actually need to be implemented)
    diff --git a/SOURCE/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS index 40d5373..1efc988 100644 --- a/SOURCE/RENEMAIL.PAS +++ b/SOURCE/RENEMAIL.PAS @@ -2,7 +2,9 @@ {$I DEFINES.INC} {$ENDIF} +{$IFDEF MSDOS} {$M 49152,0,65536} +{$ENDIF} {$A+,I-,E-,F+} PROGRAM ReneMail; @@ -80,7 +82,9 @@ VAR FidoMsgHdr: FidoRecordType; +{$IFDEF MSDOS} Regs: Registers; +{$ENDIF} DirInfo: SearchRec; @@ -842,11 +846,16 @@ BEGIN FCB[1] := Chr(Ord(MemMsgPath[1]) - 64) ELSE FCB[1] := Chr(Ord(StartDir[1]) - 64); +{$IFDEF MSDOS} Regs.DS := Seg(FCB); Regs.DX := Ofs(FCB); Regs.AX := $1300; MSDOS(Regs); Purged := (Lo(Regs.AX) = 0); +{$ENDIF} +{$IFDEF WIN32} + WriteLn('REETODO RENEMAIL PurgeDir'); Halt; +{$ENDIF} END ELSE BEGIN @@ -1679,7 +1688,14 @@ BEGIN END; IF (IsNetMail) THEN +{$IFDEF MSDOS} FidoMsgHdr.Attribute := Word(RGMsgHdr.NetAttribute) +{$ENDIF} +{$IFDEF WIN32} +BEGIN + WriteLn('REETODO RENEMAIL Scan'); Halt; +END +{$ENDIF} ELSE IF (Prvt IN RGMsgHdr.Status) THEN FidoMsgHdr.Attribute := 257 ELSE From 37ffa5ebffb46b0565b4ca36c889f9af90db34ab Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 14:11:11 -0500 Subject: [PATCH 06/17] ASM blocks are now REETODOd --- README.md | 2 +- SOURCE/BOOT.PAS | 5 +++++ SOURCE/COMMON.PAS | 14 ++++++++++++++ SOURCE/COMMON2.PAS | 19 ++++++++++++++++++- SOURCE/COMMON3.PAS | 8 ++++++++ SOURCE/FILE0.PAS | 11 ++++++++++- SOURCE/MYIO.PAS | 8 ++++++++ SOURCE/RENEMAIL.PAS | 8 ++++++++ SOURCE/WFCMENU.PAS | 11 ++++++++++- 9 files changed, 82 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a9a71c6..0d1dd8d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ Ported to Win32 by Rick Parrish
    TODO list:
      -
    • IFDEF out any ASM code blocks and handle the same as above
    • WORD in RECORD to SMALLWORD
    • INTEGER in RECORD to SMALLINT
    • TYPEs of OF WORD to OF SMALLWORD (just in case they're used in a RECORD)
    • @@ -27,4 +26,5 @@ TODO list:
      Completed list
      • IFDEF out anything that doesn't compile and make a WIN32 placeholder that does a "WriteLn('REETODO UNIT FUNCTION'); Halt;" (then you can grep the executables for REETODO to see which REETODOs actually need to be implemented)
      • +
      • IFDEF out any ASM code blocks and handle the same as above
      diff --git a/SOURCE/BOOT.PAS b/SOURCE/BOOT.PAS index 81b011f..a14fa0d 100644 --- a/SOURCE/BOOT.PAS +++ b/SOURCE/BOOT.PAS @@ -817,12 +817,17 @@ FUNCTION SchareLoaded: Boolean; VAR T_Al: Byte; BEGIN +{$IFDEF MSDOS} ASM Mov Ah,10h Mov Al,0h Int 2fh Mov T_Al,Al END; +{$ENDIF} +{$IFDEF WIN32} + T_Al := $FF; +{$ENDIF} SchareLoaded := (T_Al = $FF); END; diff --git a/SOURCE/COMMON.PAS b/SOURCE/COMMON.PAS index f8cbaf3..cc07a9b 100644 --- a/SOURCE/COMMON.PAS +++ b/SOURCE/COMMON.PAS @@ -672,6 +672,7 @@ USES Vote {$IFDEF WIN32} ,VPUtils + ,Windows {$ENDIF} ; @@ -2810,6 +2811,7 @@ BEGIN BEGIN IF (ABS((Ticks - LastTimeSlice)) >= General.Slicetimer) THEN BEGIN +{$IFDEF MSDOS} CASE Tasker OF None : ASM int 28h @@ -2832,6 +2834,10 @@ BEGIN Pop dx END; END; +{$ENDIF} +{$IFDEF WIN32} + Sleep(1); +{$ENDIF} LastTimeSlice := Ticks; END ELSE IF (MultiNodeChat) AND (NOT InChat) AND (ABS(Ticks - LastCheckTimeSlice) > 9) THEN @@ -2996,6 +3002,7 @@ BEGIN END; END; +{$IFDEF MSDOS} FUNCTION AOnOff(b: Boolean; CONST s1,s2:AStr): STRING; ASSEMBLER; ASM PUSH ds @@ -3014,6 +3021,13 @@ ASM REP MOVSB POP ds END; +{$ENDIF} +{$IFDEF WIN32} +FUNCTION AOnOff(b: Boolean; CONST s1,s2:AStr): STRING; +BEGIN + WriteLn('REETODO COMMON AOnOff'); Halt; +END; +{$ENDIF} FUNCTION ShowOnOff(b: Boolean): STRING; BEGIN diff --git a/SOURCE/COMMON2.PAS b/SOURCE/COMMON2.PAS index be40eff..808fa13 100644 --- a/SOURCE/COMMON2.PAS +++ b/SOURCE/COMMON2.PAS @@ -29,7 +29,11 @@ USES LineChat, SysOp2G, SysOp3, - SplitCha; + SplitCha +{$IFDEF WIN32} + ,Windows +{$ENDIF} + ; CONST SYSKEY_LENGTH = 1269; @@ -155,6 +159,7 @@ CONST 'H','o','u','r','s',':',#25,#6 ,'M','a','i','l',' ',':',#25,#6 ,'O', 'v','e','r','l','a','y','s',':',#25,#7 ,#24); +{$IFDEF MSDOS} PROCEDURE BiosScroll(up: Boolean); ASSEMBLER; ASM Mov cx,0 @@ -171,6 +176,13 @@ ASM @Go: Int 10h END; +{$ENDIF} +{$IFDEF WIN32} +PROCEDURE BiosScroll(up: Boolean); +BEGIN + WriteLn('REETODO COMMON2 BiosScroll'); Halt; +END; +{$ENDIF} PROCEDURE CPR(c1,c2: Byte); VAR @@ -845,9 +857,14 @@ BEGIN REPEAT OutKey(^G); Delay(500); +{$IFDEF MSDOS} ASM Int 28h END; +{$ENDIF} +{$IFDEF WIN32} + Sleep(1); +{$ENDIF} CheckHangUp; UNTIL ((NOT Empty) OR (HangUp)); Update_Screen; diff --git a/SOURCE/COMMON3.PAS b/SOURCE/COMMON3.PAS index 13cad50..b07167c 100644 --- a/SOURCE/COMMON3.PAS +++ b/SOURCE/COMMON3.PAS @@ -340,6 +340,7 @@ VAR Inc(Cp); END; +{$IFDEF MSDOS} PROCEDURE SetCursor(InsertMode: Boolean); ASSEMBLER; ASM cmp InsertMode,0 @@ -354,6 +355,13 @@ VAR mov ah,1 int 10h END; +{$ENDIF} +{$IFDEF WIN32} + PROCEDURE SetCursor(InsertMode: Boolean); + BEGIN + WriteLn('REETODO COMMON3 SetCursor'); Halt; + END; +{$ENDIF} BEGIN FirstKey := FALSE; diff --git a/SOURCE/FILE0.PAS b/SOURCE/FILE0.PAS index 965c0b9..2487204 100644 --- a/SOURCE/FILE0.PAS +++ b/SOURCE/FILE0.PAS @@ -41,7 +41,11 @@ USES Dos, File1, ShortMsg, - TimeFunc; + TimeFunc +{$IFDEF WIN32} + ,Windows +{$ENDIF} + ; FUNCTION CompFileArea(FArea,ArrayNum: Integer): Integer; VAR @@ -585,9 +589,14 @@ BEGIN SaveTimer := Timer; END ELSE +{$IFDEF MSDOS} ASM Int 28h END; +{$ENDIF} +{$IFDEF WIN32} + Sleep(1); +{$ENDIF} END; IF (Cmd <> #27) THEN BEGIN diff --git a/SOURCE/MYIO.PAS b/SOURCE/MYIO.PAS index 49fdd75..598900b 100644 --- a/SOURCE/MYIO.PAS +++ b/SOURCE/MYIO.PAS @@ -71,6 +71,7 @@ IMPLEMENTATION USES Crt; +{$IFDEF MSDOS} PROCEDURE CursorOn(b: BOOLEAN); ASSEMBLER; ASM cmp b, 1 @@ -85,6 +86,13 @@ ASM mov ah,1 int 10h END; +{$ENDIF} +{$IFDEF WIN32} +PROCEDURE CursorOn(b: BOOLEAN); +BEGIN + WriteLn('REETODO MYIO CursorOn'); Halt; +END; +{$ENDIF} PROCEDURE infield1(x,y: Byte; VAR s: AStr; Len: Byte); VAR diff --git a/SOURCE/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS index 1efc988..fcce515 100644 --- a/SOURCE/RENEMAIL.PAS +++ b/SOURCE/RENEMAIL.PAS @@ -368,6 +368,7 @@ BEGIN END; *) +{$IFDEF MSDOS} FUNCTION AOnOff(B: Boolean; S1,S2: STRING): STRING; ASSEMBLER; ASM PUSH ds @@ -386,6 +387,13 @@ ASM REP MOVSB POP ds END; +{$ENDIF} +{$IFDEF WIN32} +FUNCTION AOnOff(B: Boolean; S1,S2: STRING): STRING; +BEGIN + WriteLn('REETODO RENEMAIL AOnOff'); Halt; +END; +{$ENDIF} FUNCTION StripName(S: STRING): STRING; VAR diff --git a/SOURCE/WFCMENU.PAS b/SOURCE/WFCMENU.PAS index 27d9aa6..88ecda5 100644 --- a/SOURCE/WFCMENU.PAS +++ b/SOURCE/WFCMENU.PAS @@ -47,7 +47,11 @@ USES SysOp11, SysOp12, TimeFunc, - MiscUser; + MiscUser +{$IFDEF WIN32} + ,Windows +{$ENDIF} + ; VAR LastKeyPress: LongInt; @@ -946,9 +950,14 @@ BEGIN DailyMaint; +{$IFDEF MSDOS} ASM Int 28h END; +{$ENDIF} +{$IFDEF WIN32} + Sleep(1); +{$ENDIF} IF (AnswerBaud = 0) THEN BEGIN From 19e2dcdab0c118d53540937b95faeda4ad510fc7 Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 14:17:50 -0500 Subject: [PATCH 07/17] OF WORD and OF INTEGER converted --- README.md | 5 +++-- SOURCE/COMMON.PAS | 2 +- SOURCE/EMAIL.PAS | 2 +- SOURCE/FILE11.PAS | 2 +- SOURCE/RECORDS.PAS | 4 ++++ SOURCE/RENEMAIL.PAS | 6 +++--- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0d1dd8d..135ffb8 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,17 @@ TODO list:
      • WORD in RECORD to SMALLWORD
      • INTEGER in RECORD to SMALLINT
      • -
      • TYPEs of OF WORD to OF SMALLWORD (just in case they're used in a RECORD)
      • -
      • TYPEs of OF INTEGER to OF SMALLINT (just in case they're used in a RECORD)
      • Implement any REETODOs that appear in compiled executables
      • Anything passing 0 for the Attr parameter to FindFirst should pass AnyFile instead (VP returns no files when 0 is passed for Attr)
      • Investigate FILEMODE usage to see if FILEMODEREADWRITE, TEXTMODEREAD or TEXTMODEREADWRITE should be used
      • Find/correct any usage of FOR loop variables after the loop (since they are 1 greater in VP than in BP
      • +
      • Find/correct any file i/o on untyped files where Words or LongInts are being read
      Completed list
      • IFDEF out anything that doesn't compile and make a WIN32 placeholder that does a "WriteLn('REETODO UNIT FUNCTION'); Halt;" (then you can grep the executables for REETODO to see which REETODOs actually need to be implemented)
      • IFDEF out any ASM code blocks and handle the same as above
      • +
      • TYPEs of OF WORD to OF SMALLWORD (just in case they're used in a RECORD)
      • +
      • TYPEs of OF INTEGER to OF SMALLINT (just in case they're used in a RECORD)
      diff --git a/SOURCE/COMMON.PAS b/SOURCE/COMMON.PAS index cc07a9b..14d0ce8 100644 --- a/SOURCE/COMMON.PAS +++ b/SOURCE/COMMON.PAS @@ -161,7 +161,7 @@ TYPE ConferenceKeyType = SET OF '@'..'Z'; - CompArrayType = ARRAY[0..1] OF INTEGER; + CompArrayType = ARRAY[0..1] OF SMALLINT; CONST MCIBuffer: MCIBufferPtr = NIL; diff --git a/SOURCE/EMAIL.PAS b/SOURCE/EMAIL.PAS index 23477a5..0d835ec 100644 --- a/SOURCE/EMAIL.PAS +++ b/SOURCE/EMAIL.PAS @@ -671,7 +671,7 @@ END; PROCEDURE ReadMail; TYPE - MessageArrayType = ARRAY [1..255] OF Word; + MessageArrayType = ARRAY [1..255] OF SmallWord; VAR MessageArray: MessageArrayType; User: UserRecordType; diff --git a/SOURCE/FILE11.PAS b/SOURCE/FILE11.PAS index 9140265..58edd95 100644 --- a/SOURCE/FILE11.PAS +++ b/SOURCE/FILE11.PAS @@ -50,7 +50,7 @@ USES TimeFunc; TYPE - DownLoadArrayType = ARRAY [0..99] OF Integer; + DownLoadArrayType = ARRAY [0..99] OF SmallInt; VAR DLArray: DownloadArrayType; diff --git a/SOURCE/RECORDS.PAS b/SOURCE/RECORDS.PAS index b7d8b79..613809d 100644 --- a/SOURCE/RECORDS.PAS +++ b/SOURCE/RECORDS.PAS @@ -46,6 +46,10 @@ CONST User_Phone_None = ''; {None for user phone fields} TYPE +{$IFDEF MSDOS} + SmallInt = Integer; + SmallWord = Word; +{$ENDIF} AStr = STRING[160]; Str1 = STRING[1]; Str2 = STRING[2]; diff --git a/SOURCE/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS index fcce515..2749895 100644 --- a/SOURCE/RENEMAIL.PAS +++ b/SOURCE/RENEMAIL.PAS @@ -68,7 +68,7 @@ VAR FidoFile: FILE; - HiWaterF: FILE OF Word; + HiWaterF: FILE OF SmallWord; General: GeneralRecordType; @@ -719,7 +719,7 @@ END; PROCEDURE GetMsgLst(MemMsgPath: STRING; VAR LowMsg,HighMsg: Word); VAR FidoMsgNum, - HiWater: Word; + HiWater: SmallWord; BEGIN HiWater := 1; IF (NOT IsNetMail) THEN @@ -797,7 +797,7 @@ BEGIN LowMsg := 2; END; -PROCEDURE UpdateHiWater(MemMsgPath: STRING; HighWater: Word); +PROCEDURE UpdateHiWater(MemMsgPath: STRING; HighWater: SmallWord); BEGIN Assign(HiWaterF,MemMsgPath+'HI_WATER.MRK'); {$I-} ReWrite(HiWaterF); {$I+} From 60e58f0b7e5181e9ba2ab3a61b1eccfc15b92197 Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 14:28:00 -0500 Subject: [PATCH 08/17] WORD and INTEGER in RECORDs converted --- README.md | 4 ++-- SOURCE/ARCHIVE1.PAS | 2 +- SOURCE/ARCHIVE3.PAS | 2 +- SOURCE/ARCVIEW.PAS | 54 ++++++++++++++++++++--------------------- SOURCE/COMMON.PAS | 8 +++---- SOURCE/FILE11.PAS | 2 +- SOURCE/NODELIST.PAS | 28 +++++++++++----------- SOURCE/OFFLINE.PAS | 2 +- SOURCE/RECORDS.PAS | 58 ++++++++++++++++++++++----------------------- SOURCE/RENEMAIL.PAS | 18 +++++++------- SOURCE/STATS.PAS | 4 ++-- SOURCE/SYSOP9.PAS | 2 +- 12 files changed, 92 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index 135ffb8..857fe88 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ Ported to Win32 by Rick Parrish
      TODO list:
        -
      • WORD in RECORD to SMALLWORD
      • -
      • INTEGER in RECORD to SMALLINT
      • Implement any REETODOs that appear in compiled executables
      • Anything passing 0 for the Attr parameter to FindFirst should pass AnyFile instead (VP returns no files when 0 is passed for Attr)
      • Investigate FILEMODE usage to see if FILEMODEREADWRITE, TEXTMODEREAD or TEXTMODEREADWRITE should be used
      • @@ -28,4 +26,6 @@ Completed list
      • IFDEF out any ASM code blocks and handle the same as above
      • TYPEs of OF WORD to OF SMALLWORD (just in case they're used in a RECORD)
      • TYPEs of OF INTEGER to OF SMALLINT (just in case they're used in a RECORD)
      • +
      • WORD in RECORD to SMALLWORD
      • +
      • INTEGER in RECORD to SMALLINT
      diff --git a/SOURCE/ARCHIVE1.PAS b/SOURCE/ARCHIVE1.PAS index c598fb7..94cf95d 100644 --- a/SOURCE/ARCHIVE1.PAS +++ b/SOURCE/ARCHIVE1.PAS @@ -190,7 +190,7 @@ END; PROCEDURE ExtractToTemp; TYPE TotalsRecordType = RECORD - TotalFiles: Integer; + TotalFiles: SmallInt; TotalSize: LongInt; END; VAR diff --git a/SOURCE/ARCHIVE3.PAS b/SOURCE/ARCHIVE3.PAS index 725174e..fae0c10 100644 --- a/SOURCE/ARCHIVE3.PAS +++ b/SOURCE/ARCHIVE3.PAS @@ -161,7 +161,7 @@ END; PROCEDURE ReZipStuff; TYPE TotalsRecordType = RECORD - TotalFiles: Integer; + TotalFiles: SmallInt; TotalOldSize, TotalNewSize: LongInt END; diff --git a/SOURCE/ARCVIEW.PAS b/SOURCE/ARCVIEW.PAS index 7b50a7f..d02c5c6 100644 --- a/SOURCE/ARCVIEW.PAS +++ b/SOURCE/ARCVIEW.PAS @@ -52,23 +52,23 @@ TYPE ArcRecordType = RECORD {* structure of ARC archive file header *} FileName: ARRAY [0..12] OF Char; {* FileName *} C_Size: LongInt; {* compressed size *} - Mod_Date: Integer; {* last mod file Date *} - Mod_Time: Integer; {* last mod file Time *} - CRC: Integer; {* CRC *} + Mod_Date: SmallInt; {* last mod file Date *} + Mod_Time: SmallInt; {* last mod file Time *} + CRC: SmallInt; {* CRC *} U_Size: LongInt; {* uncompressed size *} END; ZipRecordType = RECORD {* structure of ZIP archive file header *} - Version: Integer; {* Version needed to extract *} - Bit_Flag: Integer; {* General purpose bit flag *} - Method: Integer; {* compression Method *} - Mod_Time: Integer; {* last mod file Time *} - Mod_Date: Integer; {* last mod file Date *} + Version: SmallInt; {* Version needed to extract *} + Bit_Flag: SmallInt; {* General purpose bit flag *} + Method: SmallInt; {* compression Method *} + Mod_Time: SmallInt; {* last mod file Time *} + Mod_Date: SmallInt; {* last mod file Date *} CRC: LongInt; {* CRC-32 *} C_Size: LongInt; {* compressed size *} U_Size: LongInt; {* uncompressed size *} - F_Length: Integer; {* FileName Length *} - E_Length: Integer; {* extra field Length *} + F_Length: SmallInt; {* FileName Length *} + E_Length: SmallInt; {* extra field Length *} END; ZooRecordType = RECORD {* structure of ZOO archive file header *} @@ -77,9 +77,9 @@ TYPE Method: Byte; {* 0 = Stored, 1 = Crunched *} Next: LongInt; {* position of Next directory entry *} Offset: LongInt; {* position of this file *} - Mod_Date: Word; {* modification Date (DOS format) *} - Mod_Time: Word; {* modification Time (DOS format) *} - CRC: Word; {* CRC *} + Mod_Date: SmallWord; {* modification Date (DOS format) *} + Mod_Time: SmallWord; {* modification Time (DOS format) *} + CRC: SmallWord; {* CRC *} U_Size: LongInt; {* uncompressed size *} C_Size: LongInt; {* compressed size *} Major_V: Char; {* major Version number *} @@ -87,11 +87,11 @@ TYPE Deleted: Byte; {* 0 = active, 1 = Deleted *} Struc: Char; {* file structure if any *} Comment: LongInt; {* location of file Comment (0 = none) *} - Cmt_Size: Word; {* Length of Comment (0 = none) *} + Cmt_Size: SmallWord; {* Length of Comment (0 = none) *} FName: ARRAY [0..12] OF Char; {* FileName *} - Var_DirLen: Integer; {* Length of variable part of dir entry *} + Var_DirLen: SmallInt; {* Length of variable part of dir entry *} TZ: Char; {* timezone where file was archived *} - Dir_Crc: Word; {* CRC of directory entry *} + Dir_Crc: SmallWord; {* CRC of directory entry *} END; LZHRecordType = RECORD {* structure of LZH archive file header *} @@ -100,11 +100,11 @@ TYPE Method: ARRAY [1..5] OF Char; {* compression TYPE "-lh#-" *} C_Size: LongInt; {* compressed size *} U_Size: LongInt; {* uncompressed size *} - Mod_Time: Integer;{* last mod file Time *} - Mod_Date: Integer;{* last mod file Date *} - Attrib: Integer; {* file attributes *} + Mod_Time: SmallInt;{* last mod file Time *} + Mod_Date: SmallInt;{* last mod file Date *} + Attrib: SmallInt; {* file attributes *} F_Length: Byte; {* Length of FileName *} - CRC: Integer; {* CRC *} + CRC: SmallInt; {* CRC *} END; ARJRecordType = RECORD @@ -117,20 +117,20 @@ TYPE FileType: Byte; GarbleMod: Byte; Time, - Date: Integer; + Date: SmallInt; CompSize: LongInt; OrigSize: LongInt; OrigCRC: ARRAY[1..4] OF Byte; - EntryName: Word; - AccessMode: Word; - HostData: Word; + EntryName: SmallWord; + AccessMode: SmallWord; + HostData: SmallWord; END; OutRec = RECORD {* output information structure *} FileName: AStr; {* output file name *} Date, {* output Date *} Time, {* output Time *} - Method: Integer; {* output storage type *} + Method: SmallInt; {* output storage type *} CSize, {* output compressed size *} USize: LongInt; {* output uncompressed size *} END; @@ -316,8 +316,8 @@ PROCEDURE ARJ_Proc(VAR ArjFile: FILE; VAR Aborted: Boolean); TYPE ARJSignature = RECORD - MagicNumber: Word; - BasicHdrSiz: Word; + MagicNumber: SmallWord; + BasicHdrSiz: SmallWord; END; VAR Hdr: ARJRecordType; diff --git a/SOURCE/COMMON.PAS b/SOURCE/COMMON.PAS index 14d0ce8..e9ba19e 100644 --- a/SOURCE/COMMON.PAS +++ b/SOURCE/COMMON.PAS @@ -52,7 +52,7 @@ TYPE LightBarRecordType = RECORD XPos, YPos: Byte; - CmdToExec: Integer; + CmdToExec: SmallInt; CmdToShow: STRING[40]; END; @@ -99,7 +99,7 @@ TYPE BDLUserNum, BDLSection, BDLPoints, - BDLUploader: Integer; + BDLUploader: SmallInt; BDLFSize, BDLTime: LongInt; BDLFlags: TransferFlagSet; @@ -108,10 +108,10 @@ TYPE BatchULRecordType = RECORD BULFileName: Str12; BULUserNum, - BULSection: Integer; + BULSection: SmallInt; BULDescription: Str50; BULVPointer: LongInt; - BULVTextSize: Integer; + BULVTextSize: SmallInt; END; ExtendedDescriptionArray = ARRAY [1..99] OF Str50; diff --git a/SOURCE/FILE11.PAS b/SOURCE/FILE11.PAS index 58edd95..43e08b0 100644 --- a/SOURCE/FILE11.PAS +++ b/SOURCE/FILE11.PAS @@ -14,7 +14,7 @@ USES TYPE FileRecType = RECORD FArrayFileArea, - FArrayDirFileRecNum: Integer; + FArrayDirFileRecNum: SmallInt; END; FileArrayType = ARRAY [0..99] OF FileRecType; diff --git a/SOURCE/NODELIST.PAS b/SOURCE/NODELIST.PAS index 6ef438d..29fae8e 100644 --- a/SOURCE/NODELIST.PAS +++ b/SOURCE/NODELIST.PAS @@ -30,10 +30,10 @@ TYPE Zone, { Zone of board } Net, { Net Address of board } Node, { Node Address of board } - Point: Integer; { Either Point number OR 0 } + Point: SmallInt; { Either Point number OR 0 } CallCost, { Cost to sysop to send } MsgFee, { Cost to user to send } - NodeFlags: Word; { Node flags } + NodeFlags: SmallWord; { Node flags } ModemType, { Modem TYPE } PassWord: STRING[9]; Phone, @@ -46,34 +46,34 @@ TYPE IndxRefBlk = RECORD IndxOfs, { Offset of STRING into block } - IndxLen: Word; { Length of STRING } + IndxLen: SmallWord; { Length of STRING } IndxData, { RECORD number of STRING } IndxPtr: LongInt; { Block number of lower index } END; { IndxRef } LeafRefBlk = RECORD KeyOfs, { Offset of STRING into block } - KeyLen: Word; { Length of STRING } + KeyLen: SmallWord; { Length of STRING } KeyVal: LongInt; { Pointer to Data block } END; { LeafRef } CtlBlk = RECORD - CtlBlkSize: Word; { blocksize of Index blocks } + CtlBlkSize: SmallWord; { blocksize of Index blocks } CtlRoot, { Block number of Root } CtlHiBlk, { Block number of last block } CtlLoLeaf, { Block number of first leaf } CtlHiLeaf, { Block number of last leaf } CtlFree: LongInt; { Head of freelist } CtlLvls, { Number of index levels } - CtlParity: Word; { XOR of above fields } + CtlParity: SmallWord; { XOR of above fields } END; INodeBlk = RECORD IndxFirst, { Pointer to next lower level } IndxBLink, { Pointer to previous link } IndxFLink: LongInt; { Pointer to next link } - IndxCnt: Integer; { Count of Items IN block } - IndxStr: Word; { Offset IN block of 1st str } + IndxCnt: SmallInt; { Count of Items IN block } + IndxStr: SmallWord; { Offset IN block of 1st str } { IF IndxFirst is NOT -1, this is INode: } IndxRef: ARRAY [0..49] OF IndxRefBlk; END; @@ -82,8 +82,8 @@ TYPE IndxFirst, { Pointer to next lower level } IndxBLink, { Pointer to previous link } IndxFLink: LongInt; { Pointer to next link } - IndxCnt: Integer; { Count of Items IN block } - IndxStr: Word; { Offset IN block of 1st str } + IndxCnt: SmallInt; { Count of Items IN block } + IndxStr: SmallWord; { Offset IN block of 1st str } LeafRef: ARRAY [0..49] OF LeafRefBlk; END; @@ -184,7 +184,7 @@ TYPE Zone, Net, Node, - Point: Word; + Point: SmallWord; END; VAR Key: NodeType ABSOLUTE ALine; @@ -253,7 +253,7 @@ VAR Zone, Net, Node, - Point: Word; + Point: SmallWord; END; VAR Address: NodeType; @@ -329,10 +329,10 @@ VAR Zone, { Zone of board } Net, { Net Address of board } Node, { Node Address of board } - Point: Integer; { Either Point number OR 0 } + Point: SmallInt; { Either Point number OR 0 } CallCost, { Cost to sysop to send } MsgFee, { Cost to user to send } - NodeFlags: Word; { Node flags } + NodeFlags: SmallWord; { Node flags } ModemType, { Modem TYPE } PhoneLen, { Length of Phone Number } PassWordLen, { Length of Password } diff --git a/SOURCE/OFFLINE.PAS b/SOURCE/OFFLINE.PAS index 70787fa..a4c9003 100644 --- a/SOURCE/OFFLINE.PAS +++ b/SOURCE/OFFLINE.PAS @@ -52,7 +52,7 @@ TYPE RNum: STRING[7]; NumBlocks: ARRAY [1..6] OF Char; Status: Byte; - MBase: Word; + MBase: SmallWord; Crap: STRING[3]; END; diff --git a/SOURCE/RECORDS.PAS b/SOURCE/RECORDS.PAS index 613809d..95ae759 100644 --- a/SOURCE/RECORDS.PAS +++ b/SOURCE/RECORDS.PAS @@ -169,7 +169,7 @@ TYPE Name: STRING[36]; { the user's name } Number, { user number } Left, { Left node } - Right: Integer; { Right node } + Right: SmallInt; { Right node } RealName, { User's real name? } Deleted: Boolean; { deleted or not } END; @@ -233,11 +233,11 @@ TYPE LastMsgArea, { # last msg area } LastFileArea, { # last file area } UnUsedInteger1, - UnUsedInteger2: Integer; + UnUsedInteger2: SmallInt; PasswordChanged, { Numeric date pw changed - was UnixTime } UnUsedWord1, - UnUsedWord2: Word; + UnUsedWord2: SmallWord; lCredit, { Amount OF credit } Debit, { Amount OF debit } @@ -287,14 +287,14 @@ TYPE FromToInfo = { from/to information for mheaderrec } {$IFDEF WIN32} PACKED {$ENDIF} RECORD Anon: Byte; - UserNum: Word; { user number } + UserNum: SmallWord; { user number } A1S: STRING[36]; { posted as } Real: STRING[36]; { real name } Name: STRING[36]; { system name } Zone, Net, Node, - Point: Word; + Point: SmallWord; END; MHeaderRec = @@ -302,12 +302,12 @@ TYPE From, MTO: FromToInfo; { message from/to info } Pointer: LongInt; { starting record OF text } - TextSize: Word; { size OF text } - ReplyTo: Word; { ORIGINAL + REPLYTO = CURRENT } + TextSize: SmallWord; { size OF text } + ReplyTo: SmallWord; { ORIGINAL + REPLYTO = CURRENT } Date: UnixTime; { date/time PACKED STRING } DayOfWeek: Byte; { message day OF week } Status: SET OF MsgStatusR; { message status flags } - Replies: Word; { times replied to } + Replies: SmallWord; { times replied to } Subject: STRING[40]; { subject OF message } OriginDate: STRING[19]; { date OF echo/group msgs } FileAttached: Byte; { 0=No, 1=Yes&Del, 2=Yes&Save } @@ -341,7 +341,7 @@ TYPE UnArcLine, { de-compression cmdline } TestLine, { integrity test cmdline } CmtLine: STRING[25]; { comment cmdline } - SuccLevel: Integer; { success errorlevel, -1=ignore results } + SuccLevel: SmallInt; { success errorlevel, -1=ignore results } END; ModemFlagType = { MODEM.DAT status flags } @@ -395,7 +395,7 @@ TYPE NewSL, { new SL } NewDSL, { new DSL } NewMenu: Byte; { User start out menu } - Expiration: Word; { days until expiration } + Expiration: SmallWord; { days until expiration } NewFP, { nothing } NewCredit: LongInt; { new credit } SoftAR, { TRUE=AR added to current, else replaces } @@ -530,13 +530,13 @@ TYPE CreditInternetMail, { cost for Internet mail } BirthDateCheck, { check user's birthdate every xx logons } UnUsedInteger1, - UnUsedInteger2: Integer; + UnUsedInteger2: SmallInt; MaxQWKTotal, { max msgs in a packet, period } MaxQWKBase, { max msgs in a area } DaysOnline, { days online } UnUsedWord1, - UnUsedWord2: Word; + UnUsedWord2: SmallWord; MinimumBaud, { minimum baud rate to logon } MinimumDLBaud, { minimum baud rate to download } @@ -618,7 +618,7 @@ TYPE Zone, { 21st is for UUCP address } Net, Node, - Point: Word; + Point: SmallWord; END; NewUserToggles: ARRAY [1..20] OF Byte; @@ -639,7 +639,7 @@ TYPE ShortMessageRecordType = { SHORTMSG.DAT : One-line messages } {$IFDEF WIN32} PACKED {$ENDIF} RECORD Msg: AStr; - Destin: Integer; + Destin: SmallInt; END; VotingRecordType = { VOTING.DAT : Voting records } @@ -648,14 +648,14 @@ TYPE Question2: STRING[60]; { Voting Question 2 } ACS: ACString; { ACS required to vote on this } ChoiceNumber: Byte; { number OF choices } - NumVotedQuestion: Integer; { number OF votes on it } + NumVotedQuestion: SmallInt; { number OF votes on it } CreatedBy: STRING[36]; { who created it } AddAnswersACS: ACString; { ACS required to add choices } Answers: ARRAY [1..25] OF {$IFDEF WIN32} PACKED {$ENDIF} RECORD Answer1, { answer description } Answer2: STRING[65]; { answer description #2 } - NumVotedAnswer: Integer; { # user's who picked this answer } + NumVotedAnswer: SmallInt; { # user's who picked this answer } END; END; @@ -684,11 +684,11 @@ TYPE PostACS, { post access requirement } MCIACS, { MCI usage requirement } SysOpACS: ACString; { Message area sysop requirement } - MaxMsgs: Word; { max message count } + MaxMsgs: SmallWord; { max message count } Anonymous: AnonTyp; { anonymous type } Password: STRING[20]; { area password } MAFlags: MAFlagSet; { message area status vars } - MAType: Integer; { Area type (0=Local,1=Echo, 3=Qwk) } + MAType: SmallInt; { Area type (0=Local,1=Echo, 3=Qwk) } Origin: STRING[50]; { origin line } Text_Color, { color OF standard text } Quote_Color, { color OF quoted text } @@ -699,7 +699,7 @@ TYPE QuoteEnd: STRING[70]; PrePostFile: STRING[8]; AKA: Byte; { alternate address } - QWKIndex: Word; { QWK indexing number } + QWKIndex: SmallWord; { QWK indexing number } END; FileAreaFlagType = @@ -720,7 +720,7 @@ TYPE FileName: STRING[8]; { filename + ".DIR" } DLPath, { download path } ULPath: STRING[40]; { upload path } - MaxFiles: Integer; { max files allowed - VerbRec Limit would allow up to LongInt Value or Maximum 433835} + MaxFiles: SmallInt; { max files allowed - VerbRec Limit would allow up to LongInt Value or Maximum 433835} Password: STRING[20]; { password required } ArcType, { wanted archive type (1..max,0=inactive) } CmtType: Byte; { wanted comment type (1..3,0=inactive) } @@ -746,14 +746,14 @@ TYPE {$IFDEF WIN32} PACKED {$ENDIF} RECORD FileName: STRING[12]; { Filename } Description: STRING[50]; { File description } - FilePoints: Integer; { File points } + FilePoints: SmallInt; { File points } Downloaded: LongInt; { Number DLs } FileSize: LongInt; { File size in Bytes } - OwnerNum: Integer; { ULer OF file } + OwnerNum: SmallInt; { ULer OF file } OwnerName: STRING[36]; { ULer's name } FileDate: UnixTime; { Date ULed } VPointer: LongInt; { Pointer to verbose descr, -1 if none } - VTextSize: Integer; { Verbose descr textsize - 50 Bytes x 99 Lines = 4950 max } + VTextSize: SmallInt; { Verbose descr textsize - 50 Bytes x 99 Lines = 4950 max } FIFlags: FIFlagSet; { File status } END; @@ -774,7 +774,7 @@ TYPE MsgRead, { Messages Read } MsgPost, { Messages Posted } EmailSent, { Email sent } - FeedbackSent: Word; { Feedback sent } + FeedbackSent: SmallWord; { Feedback sent } UK, { Upload/Download kbytes during call } DK: LongInt; Reserved: ARRAY [1..17] OF Byte; { Reserved } @@ -813,7 +813,7 @@ TYPE EventDayOfMonth: BYTE; {If monthly, the Day of Month} EventDays: EventDaysType; {If Daily, the Days Active} EventStartTime, {Start Time in Min from Mid.} - EventFinishTime: WORD; {Finish Time} + EventFinishTime: SmallWord; {Finish Time} EventQualMsg, {Msg/Path if he qualifies} EventNotQualMsg: STRING[64]; {Msg/Path if he doesn't} EventPreTime: BYTE; {Min. B4 event to rest. Call} @@ -824,7 +824,7 @@ TYPE LoBaud, {Low baud rate limit} HiBaud: LongInt; {High baud rate limit} EventACS: ACString; {Event ACS} - MaxTimeAllowed: WORD; {Max Time per user this event} + MaxTimeAllowed: SmallWord; {Max Time per user this event} SetARflag, {AR Flag to Set} ClearARflag: CHAR; {AR Flag to Clear} EFlags: EFlagSet; {Kinds of Events Supported} { Changed } @@ -881,7 +881,7 @@ TYPE NodeRecordType = { MULTNODE.DAT } {$IFDEF WIN32} PACKED {$ENDIF} RECORD - User: Word; { What user number } + User: SmallWord; { What user number } UserName: STRING[36]; { User's name } CityState: STRING[30]; { User's location } Sex: Char; { User's sex } @@ -891,7 +891,7 @@ TYPE ActivityDesc: STRING[50]; { Activity STRING } Status: NodeFlagSet; Room: Byte; { What room are they in? } - Channel: Word; { What channel are they in? } + Channel: SmallWord; { What channel are they in? } Invited, { Have they been invited ? } Booted, { Have they been kicked off ? } Forget: ARRAY [0..31] OF SET OF 0..7; { Who are they forgetting? } @@ -903,7 +903,7 @@ TYPE Anonymous: Boolean; { Is Room anonymous ? } Private: Boolean; { Is Room private ? } Occupied: Boolean; { Is anyone in here? } - Moderator: Word; { Who's the moderator? } + Moderator: SmallWord; { Who's the moderator? } END; ScanRec = { *.SCN files / MESSAGES } diff --git a/SOURCE/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS index 2749895..3c0096e 100644 --- a/SOURCE/RENEMAIL.PAS +++ b/SOURCE/RENEMAIL.PAS @@ -35,16 +35,16 @@ TYPE ToUserName: STRING[35]; Subject: STRING[71]; DateTime: STRING[19]; - TimesRead: Word; - DestNode: Word; - OrigNode: Word; - Cost: Word; - OrigNet: Word; - DestNet: Word; + TimesRead: SmallWord; + DestNode: SmallWord; + OrigNode: SmallWord; + Cost: SmallWord; + OrigNet: SmallWord; + DestNet: SmallWord; Filler: ARRAY[1..8] OF Char; - ReplyTo: Word; - Attribute: Word; - NextReply: Word; + ReplyTo: SmallWord; + Attribute: SmallWord; + NextReply: SmallWord; END; BufferArrayType = ARRAY[1..32767] OF Char; diff --git a/SOURCE/STATS.PAS b/SOURCE/STATS.PAS index 7211504..acf8018 100644 --- a/SOURCE/STATS.PAS +++ b/SOURCE/STATS.PAS @@ -12,13 +12,13 @@ USES TYPE Top10UserRecordArray = RECORD - UNum: Integer; + UNum: SmallInt; Info: Real; END; Top20FileRecordArray = RECORD DirNum, - DirRecNum: Integer; + DirRecNum: SmallInt; Downloaded: LongInt; END; diff --git a/SOURCE/SYSOP9.PAS b/SOURCE/SYSOP9.PAS index 4d62990..5a70b6c 100644 --- a/SOURCE/SYSOP9.PAS +++ b/SOURCE/SYSOP9.PAS @@ -25,7 +25,7 @@ TYPE Drive: Char; FirstRecNum, LastRecNum, - RecNumToEdit: Integer; + RecNumToEdit: SmallInt; END; CONST From d6ff4957c292c52159f142c4bf12c126b17ee2d9 Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 14:30:29 -0500 Subject: [PATCH 09/17] FindFirst fixes --- README.md | 2 +- SOURCE/COMMON.PAS | 10 +++++----- SOURCE/RENEMAIL.PAS | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 857fe88..d6878ce 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ Ported to Win32 by Rick Parrish
      TODO list:
      • Implement any REETODOs that appear in compiled executables
      • -
      • Anything passing 0 for the Attr parameter to FindFirst should pass AnyFile instead (VP returns no files when 0 is passed for Attr)
      • Investigate FILEMODE usage to see if FILEMODEREADWRITE, TEXTMODEREAD or TEXTMODEREADWRITE should be used
      • Find/correct any usage of FOR loop variables after the loop (since they are 1 greater in VP than in BP
      • Find/correct any file i/o on untyped files where Words or LongInts are being read
      • @@ -28,4 +27,5 @@ Completed list
      • TYPEs of OF INTEGER to OF SMALLINT (just in case they're used in a RECORD)
      • WORD in RECORD to SMALLWORD
      • INTEGER in RECORD to SMALLINT
      • +
      • Anything passing 0 for the Attr parameter to FindFirst should pass AnyFile instead (VP returns no files when 0 is passed for Attr)
      diff --git a/SOURCE/COMMON.PAS b/SOURCE/COMMON.PAS index e9ba19e..33b9bfb 100644 --- a/SOURCE/COMMON.PAS +++ b/SOURCE/COMMON.PAS @@ -3857,7 +3857,7 @@ FUNCTION MaxChatRec: LongInt; VAR DirInfo1: SearchRec; BEGIN - FindFirst(General.TempPath+'MSG'+IntToStr(ThisNode)+'.TMP',0,DirInfo1); + FindFirst(General.TempPath+'MSG'+IntToStr(ThisNode)+'.TMP',AnyFile,DirInfo1); IF (DOSError = 0) THEN MaxChatRec := DirInfo1.Size ELSE @@ -3868,7 +3868,7 @@ FUNCTION MaxNodes: Byte; VAR DirInfo1: SearchRec; BEGIN - FindFirst(General.DataPath+'MULTNODE.DAT',0,DirInfo1); + FindFirst(General.DataPath+'MULTNODE.DAT',AnyFile,DirInfo1); IF (DOSError = 0) THEN MaxNodes := (DirInfo1.Size DIV SizeOf(NodeRecordType)) ELSE @@ -3963,7 +3963,7 @@ FUNCTION MaxUsers: Integer; VAR DirInfo1: SearchRec; BEGIN - FindFirst(General.DataPath+'USERS.DAT',0,DirInfo1); + FindFirst(General.DataPath+'USERS.DAT',AnyFile,DirInfo1); IF (DOSError = 0) THEN MaxUsers := (DirInfo1.Size DIV SizeOf(UserRecordType)) ELSE @@ -3974,7 +3974,7 @@ FUNCTION MaxIDXRec: Integer; VAR DirInfo1: SearchRec; BEGIN - FindFirst(General.DataPath+'USERS.IDX',0,DirInfo1); + FindFirst(General.DataPath+'USERS.IDX',AnyFile,DirInfo1); IF (DOSError = 0) THEN MaxIDXRec := (DirInfo1.Size DIV SizeOf(UserIDXRec)) ELSE @@ -3987,7 +3987,7 @@ FUNCTION HiMsg: Word; VAR DirInfo1: SearchRec; BEGIN - FindFirst(General.MsgPath+MemMsgArea.FileName+'.HDR',0,DirInfo1); + FindFirst(General.MsgPath+MemMsgArea.FileName+'.HDR',AnyFile,DirInfo1); IF (DOSError = 0) THEN HiMsg := (DirInfo1.Size DIV SizeOf(MHeaderRec)) ELSE diff --git a/SOURCE/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS index 3c0096e..508fb88 100644 --- a/SOURCE/RENEMAIL.PAS +++ b/SOURCE/RENEMAIL.PAS @@ -762,7 +762,7 @@ BEGIN LogError(MemMsgPath+'HI_WATER.MRK/Read Record 0 Error - '+IntToStr(LastError)+' (Proc: GetMsgList)'); Exit; END; - FindFirst(MemMsgPath+IntToStr(HiWater)+'.MSG',0,DirInfo); + FindFirst(MemMsgPath+IntToStr(HiWater)+'.MSG',AnyFile,DirInfo); IF (DOSError <> 0) THEN HiWater := 1; END; @@ -779,7 +779,7 @@ BEGIN END; HighMsg := 1; LowMsg := 65535; - FindFirst(MemMsgPath+'*.MSG',0,DirInfo); + FindFirst(MemMsgPath+'*.MSG',AnyFile,DirInfo); WHILE (DOSError = 0) DO BEGIN FidoMsgNum := StrToInt(DirInfo.Name); @@ -868,7 +868,7 @@ BEGIN ELSE BEGIN Purged := TRUE; - FindFirst(MemMsgPath+'*.MSG',0,DirInfo); + FindFirst(MemMsgPath+'*.MSG',AnyFile,DirInfo); IF (DOSError <> 0) THEN Purged := FALSE ELSE From 8c78673175ab185fbed86a5bec6535fa456add4e Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 15:07:11 -0500 Subject: [PATCH 10/17] WORD and INTEGER fixes Forgot to recompile before the "WORD and INTEGER in RECORDs converted" commit -- lots of errors related to that change needed to be taken care of --- SOURCE/ARCHIVE3.PAS | 2 +- SOURCE/COMMON.PAS | 21 ++++++++++++--------- SOURCE/COMMON3.PAS | 16 ++++++++-------- SOURCE/CUSER.PAS | 2 +- SOURCE/LOGON.PAS | 2 +- SOURCE/MAIL1.PAS | 2 +- SOURCE/NODELIST.PAS | 8 ++++---- SOURCE/RENEMAIL.PAS | 5 ++++- SOURCE/SYSOP1.PAS | 14 +++++++------- SOURCE/SYSOP12.PAS | 14 +++++++------- SOURCE/SYSOP2A.PAS | 2 +- SOURCE/SYSOP2D.PAS | 2 +- SOURCE/SYSOP2E.PAS | 2 +- SOURCE/SYSOP2G.PAS | 14 +++++++------- SOURCE/SYSOP2J.PAS | 12 ++++++------ SOURCE/SYSOP2O.PAS | 2 +- SOURCE/SYSOP5.PAS | 16 ++++++++-------- SOURCE/SYSOP6.PAS | 14 +++++++------- SOURCE/SYSOP7.PAS | 6 +++--- SOURCE/SYSOP7M.PAS | 8 ++++---- SOURCE/SYSOP8.PAS | 22 +++++++++++----------- SOURCE/SYSOP9.PAS | 6 +++--- 22 files changed, 99 insertions(+), 93 deletions(-) diff --git a/SOURCE/ARCHIVE3.PAS b/SOURCE/ARCHIVE3.PAS index fae0c10..7c9d304 100644 --- a/SOURCE/ARCHIVE3.PAS +++ b/SOURCE/ARCHIVE3.PAS @@ -21,7 +21,7 @@ USES File11, TimeFunc; -PROCEDURE CvtFiles(FArea: Integer; FileName,ReZipCmd: AStr; VAR TotalFiles: Integer; VAR TotalOldSize,TotalNewSize: LongInt); +PROCEDURE CvtFiles(FArea: Integer; FileName,ReZipCmd: AStr; VAR TotalFiles: SmallInt; VAR TotalOldSize,TotalNewSize: LongInt); VAR S: AStr; DS: DirStr; diff --git a/SOURCE/COMMON.PAS b/SOURCE/COMMON.PAS index 33b9bfb..33939a6 100644 --- a/SOURCE/COMMON.PAS +++ b/SOURCE/COMMON.PAS @@ -615,10 +615,10 @@ FUNCTION YN(Len: Byte; DYNY: Boolean): Boolean; FUNCTION PYNQ(CONST InString: AStr; MaxLen: Byte; DYNY: Boolean): Boolean; PROCEDURE InputLongIntWC(S: AStr; VAR L: LongInt; InputFlags: InputFlagSet; LowNum,HighNum: LongInt; VAR Changed: Boolean); PROCEDURE InputLongIntWOC(S: AStr; VAR L: LongInt; InputFlags: InputFlagSet; LowNum,HighNum: LongInt); -PROCEDURE InputWordWC(S: AStr; VAR W: Word; InputFlags: InputFlagSet; LowNum,HighNum: Word; VAR Changed: Boolean); -PROCEDURE InputWordWOC(S: AStr; VAR W: Word; InputFlags: InputFlagSet; LowNum,HighNum: Word); -PROCEDURE InputIntegerWC(S: AStr; VAR I: Integer; InputFlags: InputFlagSet; LowNum,HighNum: Integer; VAR Changed: Boolean); -PROCEDURE InputIntegerWOC(S: AStr; VAR I: Integer; InputFlags: InputFlagSet; LowNum,HighNum: Integer); +PROCEDURE InputWordWC(S: AStr; VAR W: SmallWord; InputFlags: InputFlagSet; LowNum,HighNum: Word; VAR Changed: Boolean); +PROCEDURE InputWordWOC(S: AStr; VAR W: SmallWord; InputFlags: InputFlagSet; LowNum,HighNum: Word); +PROCEDURE InputIntegerWC(S: AStr; VAR I: SmallInt; InputFlags: InputFlagSet; LowNum,HighNum: Integer; VAR Changed: Boolean); +PROCEDURE InputIntegerWOC(S: AStr; VAR I: SmallInt; InputFlags: InputFlagSet; LowNum,HighNum: Integer); PROCEDURE InputByteWC(S: AStr; VAR B: Byte; InputFlags: InputFlagSet; LowNum,HighNum: Byte; VAR Changed: Boolean); PROCEDURE InputByteWOC(S: AStr; VAR B: Byte; InputFlags: InputFlagSet; LowNum,HighNum: Byte); PROCEDURE InputDefault(VAR S: STRING; v: STRING; MaxLen: Byte; InputFlags: InputFlagSet; LineFeed: Boolean); @@ -779,22 +779,22 @@ BEGIN Common3.InputLongIntWOC(S,L,InputFlags,LowNum,HighNum); END; -PROCEDURE InputWordWC(S: AStr; VAR W: Word; InputFlags: InputFlagSet; LowNum,HighNum: Word; VAR Changed: Boolean); +PROCEDURE InputWordWC(S: AStr; VAR W: SmallWord; InputFlags: InputFlagSet; LowNum,HighNum: Word; VAR Changed: Boolean); BEGIN Common3.InputWordWC(S,W,InputFlags,LowNum,HighNum,Changed); END; -PROCEDURE InputWordWOC(S: AStr; VAR W: Word; InputFlags: InputFlagSet; LowNum,HighNum: Word); +PROCEDURE InputWordWOC(S: AStr; VAR W: SmallWord; InputFlags: InputFlagSet; LowNum,HighNum: Word); BEGIN Common3.InputWordWOC(S,W,InputFlags,LowNum,HighNum); END; -PROCEDURE InputIntegerWC(S: AStr; VAR I: Integer; InputFlags: InputFlagSet; LowNum,HighNum: Integer; VAR Changed: Boolean); +PROCEDURE InputIntegerWC(S: AStr; VAR I: SmallInt; InputFlags: InputFlagSet; LowNum,HighNum: Integer; VAR Changed: Boolean); BEGIN Common3.InputIntegerWC(S,I,InputFlags,LowNum,HighNum,Changed); END; -PROCEDURE InputIntegerWOC(S: AStr; VAR I: Integer; InputFlags: InputFlagSet; LowNum,HighNum: Integer); +PROCEDURE InputIntegerWOC(S: AStr; VAR I: SmallInt; InputFlags: InputFlagSet; LowNum,HighNum: Integer); BEGIN Common3.InputIntegerWOC(S,I,Inputflags,LowNum,HighNum); END; @@ -3025,7 +3025,10 @@ END; {$IFDEF WIN32} FUNCTION AOnOff(b: Boolean; CONST s1,s2:AStr): STRING; BEGIN - WriteLn('REETODO COMMON AOnOff'); Halt; + if (b) then + AOnOff := s1 + else + AOnOff := s2; END; {$ENDIF} diff --git a/SOURCE/COMMON3.PAS b/SOURCE/COMMON3.PAS index b07167c..e1bae37 100644 --- a/SOURCE/COMMON3.PAS +++ b/SOURCE/COMMON3.PAS @@ -15,10 +15,10 @@ PROCEDURE InputDefault(VAR S: STRING; v: STRING; MaxLen: Byte; InputFlags: Input PROCEDURE InputFormatted(DisplayStr: AStr; VAR InputStr: STRING; Format: STRING; Abortable: Boolean); PROCEDURE InputLongIntWC(S: AStr; VAR L: LongInt; InputFlags: InputFlagSet; LowNum,HighNum: LongInt; VAR Changed: Boolean); PROCEDURE InputLongIntWOC(S: AStr; VAR L: LongInt; InputFlags: InputFlagSet; LowNum,HighNum: LongInt); -PROCEDURE InputWordWC(S: AStr; VAR W: Word; InputFlags: InputFlagSet; LowNum,HighNum: Word; VAR Changed: Boolean); -PROCEDURE InputWordWOC(S: AStr; VAR W: Word; InputFlags: InputFlagSet; LowNum,HighNum: Word); -PROCEDURE InputIntegerWC(S: AStr; VAR I: Integer; InputFlags: InputFlagSet; LowNum,HighNum: Integer; VAR Changed: Boolean); -PROCEDURE InputIntegerWOC(S: AStr; VAR I: Integer; InputFlags: InputFlagSet; LowNum,HighNum: Integer); +PROCEDURE InputWordWC(S: AStr; VAR W: SmallWord; InputFlags: InputFlagSet; LowNum,HighNum: Word; VAR Changed: Boolean); +PROCEDURE InputWordWOC(S: AStr; VAR W: SmallWord; InputFlags: InputFlagSet; LowNum,HighNum: Word); +PROCEDURE InputIntegerWC(S: AStr; VAR I: SmallInt; InputFlags: InputFlagSet; LowNum,HighNum: Integer; VAR Changed: Boolean); +PROCEDURE InputIntegerWOC(S: AStr; VAR I: SmallInt; InputFlags: InputFlagSet; LowNum,HighNum: Integer); PROCEDURE InputByteWC(S: AStr; VAR B: Byte; InputFlags: InputFlagSet; LowNum,HighNum: Byte; VAR Changed: Boolean); PROCEDURE InputByteWOC(S: AStr; VAR B: Byte; InputFlags: InputFlagSet; LowNum,HighNum: Byte); PROCEDURE InputWN1(DisplayStr: AStr; VAR InputStr: AStr; MaxLen: Byte; InputFlags: InputFlagSet; VAR Changed: Boolean); @@ -165,7 +165,7 @@ BEGIN InputLongIntWC(S,L,InputFlags,LowNum,HighNum,Changed); END; -PROCEDURE InputWordWC(S: AStr; VAR W: Word; InputFlags: InputFlagSet; LowNum,HighNum: Word; VAR Changed: Boolean); +PROCEDURE InputWordWC(S: AStr; VAR W: SmallWord; InputFlags: InputFlagSet; LowNum,HighNum: Word; VAR Changed: Boolean); VAR TempStr: Str5; SaveW: Word; @@ -195,7 +195,7 @@ BEGIN Changed := TRUE; END; -PROCEDURE InputWordWOC(S: AStr; VAR W: Word; InputFlags: InputFlagSet; LowNum,HighNum: Word); +PROCEDURE InputWordWOC(S: AStr; VAR W: SmallWord; InputFlags: InputFlagSet; LowNum,HighNum: Word); VAR Changed: Boolean; BEGIN @@ -203,7 +203,7 @@ BEGIN InputWordWC(S,W,InputFlags,LowNum,HighNum,Changed); END; -PROCEDURE InputIntegerWC(S: AStr; VAR I: Integer; InputFlags: InputFlagSet; LowNum,HighNum: Integer; VAR Changed: Boolean); +PROCEDURE InputIntegerWC(S: AStr; VAR I: SmallInt; InputFlags: InputFlagSet; LowNum,HighNum: Integer; VAR Changed: Boolean); VAR TempStr: Str5; SaveI: Integer; @@ -233,7 +233,7 @@ BEGIN Changed := TRUE; END; -PROCEDURE InputIntegerWOC(S: AStr; VAR I: Integer; InputFlags: InputFlagSet; LowNum,HighNum: Integer); +PROCEDURE InputIntegerWOC(S: AStr; VAR I: SmallInt; InputFlags: InputFlagSet; LowNum,HighNum: Integer); VAR Changed: Boolean; BEGIN diff --git a/SOURCE/CUSER.PAS b/SOURCE/CUSER.PAS index fadaf77..a7f1ab4 100644 --- a/SOURCE/CUSER.PAS +++ b/SOURCE/CUSER.PAS @@ -896,7 +896,7 @@ VAR VAR AScheme: SchemeRec; i, - Onlin: Integer; + Onlin: SmallInt; BEGIN Reset(SchemeFile); CLS; diff --git a/SOURCE/LOGON.PAS b/SOURCE/LOGON.PAS index 907d1c0..ce529f7 100644 --- a/SOURCE/LOGON.PAS +++ b/SOURCE/LOGON.PAS @@ -744,7 +744,7 @@ VAR S, ACSReq: AStr; OverridePW: Str20; - Lng: Integer; + Lng: SmallInt; Tries, I, TTimes, diff --git a/SOURCE/MAIL1.PAS b/SOURCE/MAIL1.PAS index 92e4d24..0584a25 100644 --- a/SOURCE/MAIL1.PAS +++ b/SOURCE/MAIL1.PAS @@ -1338,7 +1338,7 @@ VAR HelpCounter: Byte; Counter, LineNum1, - LineNum2: Integer; + LineNum2: SmallInt; ShowCont, ExitMsg, SaveLine, diff --git a/SOURCE/NODELIST.PAS b/SOURCE/NODELIST.PAS index 29fae8e..684380e 100644 --- a/SOURCE/NODELIST.PAS +++ b/SOURCE/NODELIST.PAS @@ -13,8 +13,8 @@ USES PROCEDURE ToggleNetAttr(NetAttrT: NetAttr; VAR NetAttrS: NetAttribs); PROCEDURE ToggleNetAttrs(C: CHAR; VAR NetAttrS: NetAttribs); -FUNCTION GetNewAddr(DisplayStr: AStr; MaxLen: Byte; VAR Zone,Net,Node,Point: Word): Boolean; -PROCEDURE GetNetAddress(VAR SysOpName: AStr; VAR Zone,Net,Node,Point,Fee: Word; GetFee: Boolean); +FUNCTION GetNewAddr(DisplayStr: AStr; MaxLen: Byte; VAR Zone,Net,Node,Point: SmallWord): Boolean; +PROCEDURE GetNetAddress(VAR SysOpName: AStr; VAR Zone,Net,Node,Point: SmallWord; var Fee: Word; GetFee: Boolean); PROCEDURE ChangeFlags(VAR MsgHeader: MHeaderRec); FUNCTION NetMail_Attr(NetAttribute: NetAttribs): AStr; @@ -107,7 +107,7 @@ BEGIN END; END; -FUNCTION GetNewAddr(DisplayStr: AStr; MaxLen: Byte; VAR Zone,Net,Node,Point: Word): Boolean; +FUNCTION GetNewAddr(DisplayStr: AStr; MaxLen: Byte; VAR Zone,Net,Node,Point: SmallWord): Boolean; BEGIN GetNewAddr := FALSE; Prt(DisplayStr); @@ -209,7 +209,7 @@ BEGIN Compaddress := K; END; -PROCEDURE GetNetAddress(VAR SysOpName:AStr; VAR Zone,Net,Node,Point,Fee:Word; GetFee:Boolean); +PROCEDURE GetNetAddress(VAR SysOpName: AStr; VAR Zone,Net,Node,Point: SmallWord; var Fee: Word; GetFee: Boolean); VAR DataFile, NDXFile: FILE; diff --git a/SOURCE/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS index 508fb88..b37e871 100644 --- a/SOURCE/RENEMAIL.PAS +++ b/SOURCE/RENEMAIL.PAS @@ -391,7 +391,10 @@ END; {$IFDEF WIN32} FUNCTION AOnOff(B: Boolean; S1,S2: STRING): STRING; BEGIN - WriteLn('REETODO RENEMAIL AOnOff'); Halt; + if (B) then + AOnOff := S1 + else + AOnOff := S2; END; {$ENDIF} diff --git a/SOURCE/SYSOP1.PAS b/SOURCE/SYSOP1.PAS index 77ad48b..f6758a7 100644 --- a/SOURCE/SYSOP1.PAS +++ b/SOURCE/SYSOP1.PAS @@ -76,7 +76,7 @@ VAR END; END; - PROCEDURE DeleteProtocol(TempProtocol1: ProtocolRecordType; RecNumToDelete: Integer); + PROCEDURE DeleteProtocol(TempProtocol1: ProtocolRecordType; RecNumToDelete: SmallInt); VAR RecNum: Integer; BEGIN @@ -243,7 +243,7 @@ VAR END; PROCEDURE EditProtocol(TempProtocol1: ProtocolRecordType; VAR Protocol: ProtocolRecordType; VAR Cmd1: Char; - VAR RecNumToEdit: Integer; VAR Changed: Boolean; Editing: Boolean); + VAR RecNumToEdit: SmallInt; VAR Changed: Boolean; Editing: Boolean); VAR TempStr, CmdStr: AStr; @@ -600,11 +600,11 @@ VAR UNTIL (Pos(Cmd1,'Q[]FJL') <> 0) OR (HangUp); END; - PROCEDURE InsertProtocol(TempProtocol1: ProtocolRecordType; RecNumToInsertBefore: Integer); + PROCEDURE InsertProtocol(TempProtocol1: ProtocolRecordType; RecNumToInsertBefore: SmallInt); VAR Cmd1: Char; RecNum, - RecNumToEdit: Integer; + RecNumToEdit: SmallInt; Ok, Changed: Boolean; BEGIN @@ -659,7 +659,7 @@ VAR END; END; - PROCEDURE ModifyProtocol(TempProtocol1: ProtocolRecordType; Cmd1: Char; RecNumToEdit: Integer); + PROCEDURE ModifyProtocol(TempProtocol1: ProtocolRecordType; Cmd1: Char; RecNumToEdit: SmallInt); VAR SaveRecNumToEdit: Integer; Ok, @@ -710,11 +710,11 @@ VAR END; END; - PROCEDURE PositionProtocol(TempProtocol1: ProtocolRecordType; RecNumToPosition: Integer); + PROCEDURE PositionProtocol(TempProtocol1: ProtocolRecordType; RecNumToPosition: SmallInt); VAR RecNumToPositionBefore, RecNum1, - RecNum2: Integer; + RecNum2: SmallInt; BEGIN IF (NumProtocols = 0) THEN Messages(4,0,'protocols') diff --git a/SOURCE/SYSOP12.PAS b/SOURCE/SYSOP12.PAS index d6d88d4..46c9a31 100644 --- a/SOURCE/SYSOP12.PAS +++ b/SOURCE/SYSOP12.PAS @@ -199,7 +199,7 @@ VAR END; END; - PROCEDURE DeleteConference(TempConference1: ConferenceRecordType; RecNumToDelete: Integer); + PROCEDURE DeleteConference(TempConference1: ConferenceRecordType; RecNumToDelete: SmallInt); VAR User: UserRecordType; RecNum: Integer; @@ -273,7 +273,7 @@ VAR END; PROCEDURE EditConference(TempConference1: ConferenceRecordType; VAR Conference: ConferenceRecordType; VAR Cmd1: Char; - VAR RecNumToEdit: Integer; VAR Changed: Boolean; Editing: Boolean); + VAR RecNumToEdit: SmallInt; VAR Changed: Boolean; Editing: Boolean); VAR CmdStr: AStr; Ok: Boolean; @@ -362,11 +362,11 @@ VAR UNTIL (Pos(Cmd1,'Q[]FJL') <> 0) OR (HangUp); END; - PROCEDURE InsertConference(TempConference1: ConferenceRecordType; Cmd1: Char; RecNumToInsertBefore: Integer); + PROCEDURE InsertConference(TempConference1: ConferenceRecordType; Cmd1: Char; RecNumToInsertBefore: SmallInt); VAR OneKCmds: AStr; RecNum, - RecNumToEdit: Integer; + RecNumToEdit: SmallInt; Ok, Changed: Boolean; BEGIN @@ -431,7 +431,7 @@ VAR END; END; - PROCEDURE ModifyConference(TempConference1: ConferenceRecordType; Cmd1: Char; RecNumToEdit: Integer); + PROCEDURE ModifyConference(TempConference1: ConferenceRecordType; Cmd1: Char; RecNumToEdit: SmallInt); VAR SaveRecNumToEdit: Integer; Ok, @@ -482,11 +482,11 @@ VAR END; END; - PROCEDURE PositionConference(TempConference1: ConferenceRecordType; RecNumToPosition: Integer); + PROCEDURE PositionConference(TempConference1: ConferenceRecordType; RecNumToPosition: SmallInt); VAR RecNumToPositionBefore, RecNum1, - RecNum2: Integer; + RecNum2: SmallInt; BEGIN IF (NumConfKeys = 0) THEN Messages(4,0,'conference records') diff --git a/SOURCE/SYSOP2A.PAS b/SOURCE/SYSOP2A.PAS index 169eb1d..99c1a7f 100644 --- a/SOURCE/SYSOP2A.PAS +++ b/SOURCE/SYSOP2A.PAS @@ -284,7 +284,7 @@ USES } - PROCEDURE GetTimeRange(CONST RGStrNum: LongInt; VAR LoTime,HiTime: Integer); + PROCEDURE GetTimeRange(CONST RGStrNum: LongInt; VAR LoTime,HiTime: SmallInt); VAR TempStr: Str5; LowTime, diff --git a/SOURCE/SYSOP2D.PAS b/SOURCE/SYSOP2D.PAS index 33727d6..15fdb69 100644 --- a/SOURCE/SYSOP2D.PAS +++ b/SOURCE/SYSOP2D.PAS @@ -23,7 +23,7 @@ VAR MaxByte: Byte; TempI, MinInt, - MaxInt: Integer; + MaxInt: SmallInt; TempL, MinLongInt, MaxLongInt: LongInt; diff --git a/SOURCE/SYSOP2E.PAS b/SOURCE/SYSOP2E.PAS index 48eac76..9fd6ba7 100644 --- a/SOURCE/SYSOP2E.PAS +++ b/SOURCE/SYSOP2E.PAS @@ -26,7 +26,7 @@ VAR Cmd1: Char; LowNum, HiNum, - TempInt: Integer; + TempInt: SmallInt; BEGIN REPEAT WITH General DO diff --git a/SOURCE/SYSOP2G.PAS b/SOURCE/SYSOP2G.PAS index b98fa5d..ca2451b 100644 --- a/SOURCE/SYSOP2G.PAS +++ b/SOURCE/SYSOP2G.PAS @@ -401,7 +401,7 @@ VAR END; END; - PROCEDURE DeleteValidationLevel(TempValidation1: ValidationRecordType; RecNumToDelete: Integer); + PROCEDURE DeleteValidationLevel(TempValidation1: ValidationRecordType; RecNumToDelete: SmallInt); VAR User: UserRecordType; RecNum: Integer; @@ -478,7 +478,7 @@ VAR END; PROCEDURE EditValidationLevel(TempValidation1: ValidationRecordType; VAR Validation: ValidationRecordType; VAR Cmd1: Char; - VAR RecNumToEdit: Integer; VAR Changed: Boolean; Editing: Boolean); + VAR RecNumToEdit: SmallInt; VAR Changed: Boolean; Editing: Boolean); VAR User: UserRecordType; CmdStr, @@ -674,11 +674,11 @@ VAR UNTIL (Pos(Cmd1,'Q[]FJL') <> 0) OR (HangUp); END; - PROCEDURE InsertValidationLevel(TempValidation1: ValidationRecordType; Cmd1: Char; RecNumToInsertBefore: Integer); + PROCEDURE InsertValidationLevel(TempValidation1: ValidationRecordType; Cmd1: Char; RecNumToInsertBefore: SmallInt); VAR OneKCmds: AStr; RecNum, - RecNumToEdit: Integer; + RecNumToEdit: SmallInt; Ok, Changed: Boolean; BEGIN @@ -744,7 +744,7 @@ VAR END; END; - PROCEDURE ModifyValidationLevel(TempValidation1: ValidationRecordType; Cmd1: Char; RecNumToEdit: Integer); + PROCEDURE ModifyValidationLevel(TempValidation1: ValidationRecordType; Cmd1: Char; RecNumToEdit: SmallInt); VAR SaveRecNumToEdit: Integer; Ok, @@ -795,11 +795,11 @@ VAR END; END; - PROCEDURE PositionValidationLevel(TempValidation1: ValidationRecordType; RecNumToPosition: Integer); + PROCEDURE PositionValidationLevel(TempValidation1: ValidationRecordType; RecNumToPosition: SmallInt); VAR RecNumToPositionBefore, RecNum1, - RecNum2: Integer; + RecNum2: SmallInt; BEGIN IF (NumValKeys = 0) THEN Messages(4,0,'validation records') diff --git a/SOURCE/SYSOP2J.PAS b/SOURCE/SYSOP2J.PAS index 5b7e446..b4c18ef 100644 --- a/SOURCE/SYSOP2J.PAS +++ b/SOURCE/SYSOP2J.PAS @@ -371,7 +371,7 @@ VAR END; END; - PROCEDURE DeleteScheme(TempScheme1: SchemeRec; RecNumToDelete: Integer); + PROCEDURE DeleteScheme(TempScheme1: SchemeRec; RecNumToDelete: SmallInt); VAR User: UserRecordType; RecNum: Integer; @@ -450,7 +450,7 @@ VAR END; PROCEDURE EditScheme(TempScheme1: SchemeRec; VAR Scheme: SchemeRec; VAR Cmd1: Char; - VAR RecNumToEdit: Integer; VAR Changed: Boolean; Editing: Boolean); + VAR RecNumToEdit: SmallInt; VAR Changed: Boolean; Editing: Boolean); VAR CmdStr: AStr; Ok: Boolean; @@ -547,11 +547,11 @@ VAR UNTIL (Pos(Cmd1,'Q[]FJL') <> 0) OR (HangUp); END; - PROCEDURE InsertScheme(TempScheme1: SchemeRec; Cmd1: Char; RecNumToInsertBefore: Integer); + PROCEDURE InsertScheme(TempScheme1: SchemeRec; Cmd1: Char; RecNumToInsertBefore: SmallInt); VAR User: UserRecordType; RecNum, - RecNumToEdit: Integer; + RecNumToEdit: SmallInt; Ok, Changed: Boolean; BEGIN @@ -622,7 +622,7 @@ VAR END; END; - PROCEDURE ModifyScheme(TempScheme1: SchemeRec; Cmd1: Char; RecNumToEdit: Integer); + PROCEDURE ModifyScheme(TempScheme1: SchemeRec; Cmd1: Char; RecNumToEdit: SmallInt); VAR SaveRecNumToEdit: Integer; Ok, @@ -678,7 +678,7 @@ VAR RecNumToPosition, RecNumToPositionBefore, RecNum1, - RecNum2: Integer; + RecNum2: SmallInt; BEGIN IF (NumSchemes = 0) THEN Messages(4,0,'color schemes') diff --git a/SOURCE/SYSOP2O.PAS b/SOURCE/SYSOP2O.PAS index 41896ff..204250f 100644 --- a/SOURCE/SYSOP2O.PAS +++ b/SOURCE/SYSOP2O.PAS @@ -21,7 +21,7 @@ VAR Counter: Byte; DisplayValue, FromValue, - ToValue: Integer; + ToValue: SmallInt; NewValue: LongInt; PROCEDURE ShowSecRange(Start: Byte); diff --git a/SOURCE/SYSOP5.PAS b/SOURCE/SYSOP5.PAS index b8e7538..2c6241d 100644 --- a/SOURCE/SYSOP5.PAS +++ b/SOURCE/SYSOP5.PAS @@ -53,7 +53,7 @@ VAR END; PROCEDURE LocateHistoryDate(DisplayStr: AStr; TempHistory1: HistoryRecordType; VAR DateToLocate: Str10; - VAR RecNum1: Integer; ShowErr,Searching: Boolean); + VAR RecNum1: SmallInt; ShowErr,Searching: Boolean); VAR RecNum: Integer; BEGIN @@ -82,7 +82,7 @@ VAR END; END; - PROCEDURE DeleteHistoryRecord(TempHistory1: HistoryRecordType; RecNumToDelete: Integer); + PROCEDURE DeleteHistoryRecord(TempHistory1: HistoryRecordType; RecNumToDelete: SmallInt); VAR DateToDelete: Str10; RecNum: Integer; @@ -143,12 +143,12 @@ VAR END; PROCEDURE EditHistoryRecord(TempHistory1: HistoryRecordType; VAR History: HistoryRecordType; VAR Cmd1: Char; - VAR RecNumToEdit,SaveRecNumToEdit: Integer; VAR Changed: Boolean; Editing: Boolean); + VAR RecNumToEdit,SaveRecNumToEdit: SmallInt; VAR Changed: Boolean; Editing: Boolean); VAR CmdStr, TempStr1: AStr; DateToLocate: Str10; - RecNum: Integer; + RecNum: SmallInt; Ok: Boolean; BEGIN WITH History DO @@ -337,13 +337,13 @@ VAR UNTIL (Pos(Cmd1,'Q[]FJL') <> 0) OR (HangUp); END; - PROCEDURE InsertHistoryRecord(TempHistory1: HistoryRecordType; Cmd1: Char; RecNumToInsertBefore: Integer); + PROCEDURE InsertHistoryRecord(TempHistory1: HistoryRecordType; Cmd1: Char; RecNumToInsertBefore: SmallInt); VAR DateToInsert, DateToInsertBefore: Str10; RecNum, RecNum1, - SaveRecNumToEdit: Integer; + SaveRecNumToEdit: SmallInt; Ok, Changed: Boolean; BEGIN @@ -414,10 +414,10 @@ VAR END; END; - PROCEDURE ModifyHistoryRecord(TempHistory1: HistoryRecordType; Cmd1: Char; RecNumToEdit: Integer); + PROCEDURE ModifyHistoryRecord(TempHistory1: HistoryRecordType; Cmd1: Char; RecNumToEdit: SmallInt); VAR DateToEdit: Str10; - SaveRecNumToEdit: Integer; + SaveRecNumToEdit: SmallInt; Ok, Changed: Boolean; BEGIN diff --git a/SOURCE/SYSOP6.PAS b/SOURCE/SYSOP6.PAS index 87de7ad..0e93253 100644 --- a/SOURCE/SYSOP6.PAS +++ b/SOURCE/SYSOP6.PAS @@ -137,7 +137,7 @@ VAR END; END; - PROCEDURE DeleteEvent(TempEvent1: EventRecordType; RecNumToDelete: Integer); + PROCEDURE DeleteEvent(TempEvent1: EventRecordType; RecNumToDelete: SmallInt); VAR RecNum: Integer; BEGIN @@ -192,7 +192,7 @@ VAR PROCEDURE EditEvent(TempEvent1: EventRecordType; VAR Event: EventRecordType; VAR Cmd1: Char; - VAR RecNumToEdit: Integer; VAR Changed: Boolean; Editing: Boolean); + VAR RecNumToEdit: SmallInt; VAR Changed: Boolean; Editing: Boolean); CONST BaudRates: ARRAY [1..20] OF LongInt = (300,600,1200,2400,4800,7200,9600, 12000,14400,16800,19200,21600,24000, @@ -750,10 +750,10 @@ VAR UNTIL (Pos(Cmd1,'Q[]FJL') <> 0) OR (HangUp); END; - PROCEDURE InsertEvent(TempEvent1: EventRecordType; Cmd1: Char; RecNumToInsertBefore: Integer); + PROCEDURE InsertEvent(TempEvent1: EventRecordType; Cmd1: Char; RecNumToInsertBefore: SmallInt); VAR RecNum, - RecNumToEdit: Integer; + RecNumToEdit: SmallInt; Ok, Changed: Boolean; BEGIN @@ -808,7 +808,7 @@ VAR END; END; - PROCEDURE ModifyEvent(TempEvent1: EventRecordType; Cmd1: Char; RecNumToEdit: Integer); + PROCEDURE ModifyEvent(TempEvent1: EventRecordType; Cmd1: Char; RecNumToEdit: SmallInt); VAR SaveRecNumToEdit: Integer; Ok, @@ -859,11 +859,11 @@ VAR END; END; - PROCEDURE PositionEvent(TempEvent1: EventRecordType; RecNumToPosition: Integer); + PROCEDURE PositionEvent(TempEvent1: EventRecordType; RecNumToPosition: SmallInt); VAR RecNumToPositionBefore, RecNum1, - RecNum2: Integer; + RecNum2: SmallInt; BEGIN IF (NumEvents = 0) THEN Messages(4,0,'events') diff --git a/SOURCE/SYSOP7.PAS b/SOURCE/SYSOP7.PAS index bc34bd4..2c9cd55 100644 --- a/SOURCE/SYSOP7.PAS +++ b/SOURCE/SYSOP7.PAS @@ -231,7 +231,7 @@ VAR PROCEDURE DeleteMenu; VAR RecNumToDelete, - RecNum: Integer; + RecNum: SmallInt; DeleteOk: Boolean; BEGIN IF (NumMenus = 0) THEN @@ -307,7 +307,7 @@ VAR VAR RecNumToInsertBefore, NewMenuNum, - RecNum: Integer; + RecNum: SmallInt; BEGIN IF (NumMenus = MaxMenus) THEN Messages(5,MaxMenus,'menus') @@ -367,7 +367,7 @@ VAR RecNum, RecNum1, RecNumToModify, - SaveRecNumToModify: Integer; + SaveRecNumToModify: SmallInt; Changed: Boolean; BEGIN IF (NumMenus = 0) THEN diff --git a/SOURCE/SYSOP7M.PAS b/SOURCE/SYSOP7M.PAS index e10cf9f..3af822c 100644 --- a/SOURCE/SYSOP7M.PAS +++ b/SOURCE/SYSOP7M.PAS @@ -121,7 +121,7 @@ VAR PROCEDURE DeleteCommand; VAR RecNumToDelete, - RecNum: Integer; + RecNum: SmallInt; BEGIN IF (CmdNumArray[MenuToModify] = 0) THEN Messages(4,0,'commands') @@ -160,7 +160,7 @@ VAR VAR RecNumToInsertBefore, InsertNum, - RecNum: Integer; + RecNum: SmallInt; BEGIN IF (CmdNumArray[MenuToModify] = MaxCmds) THEN Messages(5,MaxCmds,'commands') @@ -208,7 +208,7 @@ VAR Cmd1: Char; TempB: Byte; RecNumToModify, - SaveRecNumToModify: Integer; + SaveRecNumToModify: SmallInt; Changed: Boolean; BEGIN IF (CmdNumArray[MenuToModify] = 0) THEN @@ -359,7 +359,7 @@ VAR RecNumToPosition, RecNumToPositionBefore, RecNum1, - RecNum2: Integer; + RecNum2: SmallInt; BEGIN IF (CmdNumArray[MenuToModify] = 0) THEN Messages(4,0,'commands') diff --git a/SOURCE/SYSOP8.PAS b/SOURCE/SYSOP8.PAS index ca4eaf8..5b7faa1 100644 --- a/SOURCE/SYSOP8.PAS +++ b/SOURCE/SYSOP8.PAS @@ -25,7 +25,7 @@ VAR MsgareaDefFile: FILE OF MessageAreaRecordType; TempMemMsgArea: MessageAreaRecordType; Cmd: Char; - RecNumToList: Integer; + RecNumToList: SmallInt; Ok, Changed, SaveTempPause: Boolean; @@ -163,10 +163,10 @@ VAR END; END; - PROCEDURE ChangeMsgAreaDrive(Drive: Char; FirstRecNum: Integer); + PROCEDURE ChangeMsgAreaDrive(Drive: Char; FirstRecNum: SmallInt); VAR LastRecNum, - RecNum: Integer; + RecNum: SmallInt; BEGIN IF (NumMsgAreas = 0) THEN Messages(4,0,'message areas') @@ -213,7 +213,7 @@ VAR END END; - PROCEDURE DeleteMsgArea(TempMemMsgArea1: MessageAreaRecordType; RecNumToDelete: Integer); + PROCEDURE DeleteMsgArea(TempMemMsgArea1: MessageAreaRecordType; RecNumToDelete: SmallInt); VAR RecNum: Integer; Ok, @@ -315,7 +315,7 @@ VAR END; PROCEDURE EditMessageArea(TempMemMsgArea1: MessageAreaRecordType; VAR MemMsgArea: MessageAreaRecordType; VAR Cmd1: Char; - VAR RecNumToEdit: Integer; VAR Changed: Boolean; Editing: Boolean); + VAR RecNumToEdit: SmallInt; VAR Changed: Boolean; Editing: Boolean); VAR TempFileName: Str8; Path1, @@ -687,12 +687,12 @@ VAR UNTIL (Pos(Cmd1,'Q[]FJL') <> 0) OR (HangUp); END; - PROCEDURE InsertMsgArea(TempMemMsgArea1: MessageAreaRecordType; Cmd1: Char; RecNumToInsertBefore: Integer); + PROCEDURE InsertMsgArea(TempMemMsgArea1: MessageAreaRecordType; Cmd1: Char; RecNumToInsertBefore: SmallInt); VAR MsgAreaScanFile: FILE OF ScanRec; RecNum, RecNum1, - RecNumToEdit: Integer; + RecNumToEdit: SmallInt; Ok, Changed: Boolean; BEGIN @@ -792,7 +792,7 @@ VAR END; END; - PROCEDURE ModifyMsgArea(TempMemMsgArea1: MessageAreaRecordType; Cmd1: Char; RecNumToEdit: Integer); + PROCEDURE ModifyMsgArea(TempMemMsgArea1: MessageAreaRecordType; Cmd1: Char; RecNumToEdit: SmallInt); VAR User: UserRecordType; MsgAreaScanFile: FILE OF ScanRec; @@ -916,11 +916,11 @@ VAR END; END; - PROCEDURE PositionMsgArea(TempMemMsgArea1: MessageAreaRecordType; RecNumToPosition: Integer); + PROCEDURE PositionMsgArea(TempMemMsgArea1: MessageAreaRecordType; RecNumToPosition: SmallInt); VAR RecNumToPositionBefore, RecNum1, - RecNum2: Integer; + RecNum2: SmallInt; BEGIN IF (NumMsgAreas = 0) THEN Messages(4,0,'message areas') @@ -1020,7 +1020,7 @@ VAR END; END; - PROCEDURE ListMsgAreas(VAR RecNumToList1: Integer); + PROCEDURE ListMsgAreas(VAR RecNumToList1: SmallInt); VAR NumDone: Integer; BEGIN diff --git a/SOURCE/SYSOP9.PAS b/SOURCE/SYSOP9.PAS index 5a70b6c..45f7ed8 100644 --- a/SOURCE/SYSOP9.PAS +++ b/SOURCE/SYSOP9.PAS @@ -351,7 +351,7 @@ VAR PROCEDURE DeleteFileArea(TempMemFileArea1: FileAreaRecordType; MCIVars1: MCIVarRecord); VAR RecNum, - RecNumToDelete: Integer; + RecNumToDelete: SmallInt; Ok, OK1, Ok2: Boolean; @@ -870,7 +870,7 @@ VAR Cmd1: Char; RecNum, RecNum1, - RecNumToInsertBefore: Integer; + RecNumToInsertBefore: SmallInt; Ok, Changed: Boolean; BEGIN @@ -1102,7 +1102,7 @@ VAR RecNumToPosition, RecNumToPositionBefore, RecNum1, - RecNum2: Integer; + RecNum2: SmallInt; BEGIN IF (NumFileAreas = 0) THEN FAELngStr(5,MemFileArea,MCIVars1,FALSE) From 11db959b87afc0395a731e9da5a9378d0ce8d713 Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 15:11:21 -0500 Subject: [PATCH 11/17] Add FileModeReadWrite on Win32 --- README.md | 2 +- SOURCE/RENEGADE.PAS | 3 +++ SOURCE/RENEMAIL.PAS | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d6878ce..f90534b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ Ported to Win32 by Rick Parrish
      TODO list:
      • Implement any REETODOs that appear in compiled executables
      • -
      • Investigate FILEMODE usage to see if FILEMODEREADWRITE, TEXTMODEREAD or TEXTMODEREADWRITE should be used
      • Find/correct any usage of FOR loop variables after the loop (since they are 1 greater in VP than in BP
      • Find/correct any file i/o on untyped files where Words or LongInts are being read
      @@ -28,4 +27,5 @@ Completed list
    • WORD in RECORD to SMALLWORD
    • INTEGER in RECORD to SMALLINT
    • Anything passing 0 for the Attr parameter to FindFirst should pass AnyFile instead (VP returns no files when 0 is passed for Attr)
    • +
    • Investigate FILEMODE usage to see if FILEMODEREADWRITE, TEXTMODEREAD or TEXTMODEREADWRITE should be used
    diff --git a/SOURCE/RENEGADE.PAS b/SOURCE/RENEGADE.PAS index 83c93e7..3a2391f 100644 --- a/SOURCE/RENEGADE.PAS +++ b/SOURCE/RENEGADE.PAS @@ -236,6 +236,9 @@ BEGIN GetIntVec($14,Interrupt14); {$ENDIF} FileMode := 66; +{$IFDEF WIN32} + FileModeReadWrite := FileMode; +{$ENDIF} ExitSave := ExitProc; ExitProc := @ErrorHandle; diff --git a/SOURCE/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS index b37e871..01f92b3 100644 --- a/SOURCE/RENEMAIL.PAS +++ b/SOURCE/RENEMAIL.PAS @@ -1998,6 +1998,9 @@ BEGIN GetDir(0,StartDir); FileMode := 66; +{$IFDEF WIN32} + FileModeReadWrite := FileMode; +{$ENDIF} GetGeneral(General); From 44c21027747df2efc81cd11e8a63acb9b6fba4fd Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Thu, 7 Feb 2013 15:11:45 -0500 Subject: [PATCH 12/17] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f90534b..e2a8748 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ TODO list:
    • Implement any REETODOs that appear in compiled executables
    • Find/correct any usage of FOR loop variables after the loop (since they are 1 greater in VP than in BP
    • -
    • Find/correct any file i/o on untyped files where Words or LongInts are being read
    • +
    • Find/correct any file i/o on untyped files where Words or Integers are being read
    Completed list
    From e2b2ead554e1a98dc17218335eeccadc0aa0732b Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Fri, 8 Feb 2013 12:52:49 -0500 Subject: [PATCH 13/17] RENEMAIL is now REETODO free --- SOURCE/RENEMAIL.PAS | 56 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/SOURCE/RENEMAIL.PAS b/SOURCE/RENEMAIL.PAS index 01f92b3..5e89a56 100644 --- a/SOURCE/RENEMAIL.PAS +++ b/SOURCE/RENEMAIL.PAS @@ -20,7 +20,12 @@ CONST Activity_Log: Boolean = FALSE; NetMailOnly: Boolean = FALSE; IsNetMail: Boolean = FALSE; +{$IFDEF MSDOS} FastPurge: Boolean = TRUE; +{$ENDIF} +{$IFDEF WIN32} + FastPurge: Boolean = FALSE; +{$ENDIF} Process_NetMail: Boolean = TRUE; Purge_NetMail: Boolean = TRUE; Absolute_Scan: Boolean = FALSE; @@ -97,6 +102,51 @@ VAR ParamFound: Boolean; +{$IFDEF WIN32} +(* REENOTE + In BP/TP you can do this: + + var + MySet: NetAttribs; + MyWord: Word; + begin + MySet := [Private, Crash]; + MyWord := Word(MySet); + { MyWord now contains the value 3 in BP/TP } + { but VP refuses to compile the code due to Word(MySet) } + end; + + In VP this typecast isn't allowed (maybe there's a compiler setting to allow it, didn't look actually) + so this function converts from a set to a word type. + + While this function should work for both BP/TP and for VP, I'm only using it for VP and using the + original cast for BP/TP, since there's no need to change what isn't broken +*) +function NetAttribsToWord(inSet: NetAttribs): Word; +var + Result: Word; +begin + Result := 0; + if (Private in inSet) then result := result + 1; + if (Crash in inSet) then result := result + 2; + if (Recd in inSet) then result := result + 4; + if (NSent in inSet) then result := result + 8; + if (FileAttach in inSet) then result := result + 16; + if (Intransit in inSet) then result := result + 32; + if (Orphan in inSet) then result := result + 64; + if (KillSent in inSet) then result := result + 128; + if (Local in inSet) then result := result + 256; + if (Hold in inSet) then result := result + 512; + if (Unused in inSet) then result := result + 1024; + if (FileRequest in inSet) then result := result + 2048; + if (ReturnReceiptRequest in inSet) then result := result + 4096; + if (IsReturnReceipt in inSet) then result := result + 8192; + if (AuditRequest in inSet) then result := result + 16384; + if (FileUpdateRequest in inSet) then result := result + 32768; + NetAttribsToWord := Result; +end; +{$ENDIF} + FUNCTION CenterStr(S: STRING): STRING; VAR Counter1: Byte; @@ -865,7 +915,7 @@ BEGIN Purged := (Lo(Regs.AX) = 0); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO RENEMAIL PurgeDir'); Halt; + // We ensure FastPurge is false in Win32, so this is never called {$ENDIF} END ELSE @@ -1703,9 +1753,7 @@ BEGIN FidoMsgHdr.Attribute := Word(RGMsgHdr.NetAttribute) {$ENDIF} {$IFDEF WIN32} -BEGIN - WriteLn('REETODO RENEMAIL Scan'); Halt; -END + FidoMsgHdr.Attribute := NetAttribsToWord(RGMsgHdr.NetAttribute) {$ENDIF} ELSE IF (Prvt IN RGMsgHdr.Status) THEN FidoMsgHdr.Attribute := 257 From 9642f6065536cf07a784abf8e0e9a10221961222 Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Fri, 8 Feb 2013 13:01:16 -0500 Subject: [PATCH 14/17] Implemented some REETODOs. 37 to go --- SOURCE/COMMON.PAS | 6 ++++ SOURCE/MYIO.PAS | 68 +++++++++++++++++++++++++++++++++++++++++++--- SOURCE/WFCMENU.PAS | 10 +++---- 3 files changed, 75 insertions(+), 9 deletions(-) diff --git a/SOURCE/COMMON.PAS b/SOURCE/COMMON.PAS index 33939a6..b95e1fd 100644 --- a/SOURCE/COMMON.PAS +++ b/SOURCE/COMMON.PAS @@ -467,6 +467,7 @@ VAR VQArea: Boolean; {$IFDEF WIN32} +procedure Sound(hz: Word; duration: Word); function Ticks: LongInt; {$ENDIF} FUNCTION GetC(c: Byte): STRING; @@ -677,6 +678,11 @@ USES ; {$IFDEF WIN32} +procedure Sound(hz: Word; duration: Word); +begin + Windows.Beep(hz, duration); +end; + function Ticks: LongInt; begin Ticks := GetTimeMSec div 55; diff --git a/SOURCE/MYIO.PAS b/SOURCE/MYIO.PAS index 598900b..037d465 100644 --- a/SOURCE/MYIO.PAS +++ b/SOURCE/MYIO.PAS @@ -50,7 +50,12 @@ VAR Infield_Arrow_Exit_Types, Infield_Normal_Exit_Keys: STRING; +{$IFDEF MSDOS} PROCEDURE Update_Logo(VAR Addr1,Addr2; BlkLen: Integer); +{$ENDIF} +{$IFDEF WIN32} +procedure Update_Logo(Data: Array of Char; OriginX, OriginY, DataLength: integer); +{$ENDIF} PROCEDURE CursorOn(b: BOOLEAN); PROCEDURE infield1(x,y: Byte; VAR s: AStr; Len: Byte); PROCEDURE Infielde(VAR s: AStr; Len: Byte); @@ -69,7 +74,11 @@ PROCEDURE SetWindow(VAR Wind: WindowRec; TLX,TLY,BRX,BRY,TColr,BColr,BoxType: In IMPLEMENTATION USES - Crt; + Crt +{$IFDEF WIN32} + ,VpSysLow +{$ENDIF} + ; {$IFDEF MSDOS} PROCEDURE CursorOn(b: BOOLEAN); ASSEMBLER; @@ -570,9 +579,9 @@ BEGIN Box(BoxType,TLX,TLY,BRX,BRY); { Set the border } END; +{$IFDEF MSDOS} PROCEDURE Update_Logo(VAR Addr1,Addr2; BlkLen: Integer); BEGIN -{$IFDEF MSDOS} INLINE ( $1E/ $C5/$B6/ADDR1/ @@ -627,10 +636,61 @@ BEGIN $49/ $E0/$AA/ $1F); +END; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO MYIO Update_Logo'); Halt; +procedure Update_Logo(Data: Array of Char; OriginX, OriginY, DataLength: integer); +var + i, x, y, count, counter: Integer; + character: Char; + spaces: String; +begin + i := 0; + x := OriginX; + y := OriginY; + spaces := ' '; // 80 spaces + + while (i < DataLength) do + begin + case Data[i] of + #0..#15: begin + TextColor(Ord(Data[i])); + end; + #16..#23: begin + TextBackground(Ord(Data[i]) - 16); + end; + #24: begin + x := OriginX; + Inc(y); + end; + #25: begin + Inc(i); + count := Ord(Data[i])+1; + SysWrtCharStrAtt(@spaces[1], count, x-1, y-1, TextAttr); + Inc(x, count); + end; + #26: begin + Inc(i); + count := Ord(Data[i])+1; + Inc(i); + character := Data[i]; + for counter := 1 to count do + begin + SysWrtCharStrAtt(@Data[i], 1, x-1, y-1, TextAttr); + Inc(x); + end; + end; + #27: begin + TextAttr := TextAttr XOR $80; // Invert blink flag + end; + #32..#255: begin + SysWrtCharStrAtt(@Data[i], 1, x-1, y-1, TextAttr); + Inc(x); + end; + end; + Inc(i); + end; +end; {$ENDIF} -END; END. diff --git a/SOURCE/WFCMENU.PAS b/SOURCE/WFCMENU.PAS index 88ecda5..1561d29 100644 --- a/SOURCE/WFCMENU.PAS +++ b/SOURCE/WFCMENU.PAS @@ -317,7 +317,7 @@ BEGIN Update_Logo(ANSWER,ScreenAddr[(3*2)+(19*160)-162],ANSWER_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO WFCMENU GetConnection'); Halt; + Update_logo(ANSWER, 3, 19, ANSWER_LENGTH); {$ENDIF} rl := 0; @@ -429,14 +429,14 @@ BEGIN Update_Logo(WFC,ScreenAddr[0],WFC_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO WFCMENU WFCDraw1'); Halt; + Update_logo(WFC, 1, 1, WFC_LENGTH); {$ENDIF} IF (General.NetworkMode) THEN {$IFDEF MSDOS} Update_Logo(WFCNET,ScreenAddr[(3*2)+(19*160)-162],WFCNET_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO WFCMENU WFCDraw2'); Halt; + Update_logo(WFCNET, 3, 19, WFCNET_LENGTH); {$ENDIF} LoadURec(ThisUser,1); @@ -611,7 +611,7 @@ BEGIN Update_Logo(WFC0,ScreenAddr[0],WFC0_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO WFCMENU WFCDraw3'); Halt; + Update_logo(WFC0, 1, 1, WFC0_LENGTH); {$ENDIF} END; END; @@ -747,7 +747,7 @@ VAR NoSound; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO WFCMENU BeepHim'); Halt; + Sound(1000, 60); {$ENDIF} rl1 := Timer; WHILE (ABS(rl1 - Timer) < 0.9) AND (NOT KeyPressed) DO; From 26d778c4ace3323ca129fdbc0aadb5690560bbe4 Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Fri, 8 Feb 2013 18:55:58 -0500 Subject: [PATCH 15/17] More REETODOs handled. Down to 14 in COMMON4 In theory Renegade should now work in local mode since the 14 items in COMMON4 are all comm related. I don't have v1.19 installed to test with though, so can't confirm. --- SOURCE/BOOT.PAS | 11 ++-- SOURCE/COMMON.PAS | 80 ++++++++++++++++++++-- SOURCE/COMMON2.PAS | 21 ++++-- SOURCE/COMMON3.PAS | 14 +++- SOURCE/LINECHAT.PAS | 11 +++- SOURCE/MYIO.PAS | 18 ++++- SOURCE/RPSCREEN.PAS | 157 ++++++++++++++++++++++++++++++++++++++++++++ SOURCE/WFCMENU.PAS | 8 +-- 8 files changed, 294 insertions(+), 26 deletions(-) create mode 100644 SOURCE/RPSCREEN.PAS diff --git a/SOURCE/BOOT.PAS b/SOURCE/BOOT.PAS index a14fa0d..2d6d3be 100644 --- a/SOURCE/BOOT.PAS +++ b/SOURCE/BOOT.PAS @@ -862,7 +862,8 @@ VAR {$IFDEF WIN32} FUNCTION TrueDosVer(VAR WinNTOk: Boolean): Word; BEGIN - WriteLn('REETODO BOOT TrueDosVer'); Halt; + WinNtOK := TRUE; + TrueDosVer := 5; END; {$ENDIF} @@ -888,7 +889,9 @@ VAR {$IFDEF WIN32} FUNCTION DosVer(VAR Minor,OS2Ver: Word): Word; BEGIN - WriteLn('REETODO BOOT DosVer'); Halt; + Minor := 0; + OS2Ver := 0; + DosVer := 5; END; {$ENDIF} @@ -911,7 +914,7 @@ VAR {$IFDEF WIN32} FUNCTION Win3_Check_On: Boolean; BEGIN - WriteLn('REETODO BOOT Win3_Check_On'); Halt; + Win3_Check_On := FALSE; END; {$ENDIF} @@ -937,7 +940,7 @@ VAR {$IFDEF WIN32} FUNCTION DV_Check_On: Boolean; BEGIN - WriteLn('REETODO BOOT DV_Check_On'); Halt; + DV_Check_On := FALSE; END; {$ENDIF} diff --git a/SOURCE/COMMON.PAS b/SOURCE/COMMON.PAS index b95e1fd..89966da 100644 --- a/SOURCE/COMMON.PAS +++ b/SOURCE/COMMON.PAS @@ -668,10 +668,13 @@ USES File11, Mail0, MultNode, +{$IFDEF MSDOS} SpawnO, +{$ENDIF} SysOp12, Vote {$IFDEF WIN32} + ,VPSysLow ,VPUtils ,Windows {$ENDIF} @@ -694,9 +697,72 @@ FUNCTION UpdateCRC32(CRC: LongInt; VAR Buffer; Len: Word): LongInt; EXTERNAL; {$L CRC32.OBJ } {$ENDIF} {$IFDEF WIN32} +CONST + CRC_32_TAB : array[0..255] of LongInt = ( + $00000000, $77073096, $ee0e612c, $990951ba, $076dc419, + $706af48f, $e963a535, $9e6495a3, $0edb8832, $79dcb8a4, + $e0d5e91e, $97d2d988, $09b64c2b, $7eb17cbd, $e7b82d07, + $90bf1d91, $1db71064, $6ab020f2, $f3b97148, $84be41de, + $1adad47d, $6ddde4eb, $f4d4b551, $83d385c7, $136c9856, + $646ba8c0, $fd62f97a, $8a65c9ec, $14015c4f, $63066cd9, + $fa0f3d63, $8d080df5, $3b6e20c8, $4c69105e, $d56041e4, + $a2677172, $3c03e4d1, $4b04d447, $d20d85fd, $a50ab56b, + $35b5a8fa, $42b2986c, $dbbbc9d6, $acbcf940, $32d86ce3, + $45df5c75, $dcd60dcf, $abd13d59, $26d930ac, $51de003a, + $c8d75180, $bfd06116, $21b4f4b5, $56b3c423, $cfba9599, + $b8bda50f, $2802b89e, $5f058808, $c60cd9b2, $b10be924, + $2f6f7c87, $58684c11, $c1611dab, $b6662d3d, $76dc4190, + $01db7106, $98d220bc, $efd5102a, $71b18589, $06b6b51f, + $9fbfe4a5, $e8b8d433, $7807c9a2, $0f00f934, $9609a88e, + $e10e9818, $7f6a0dbb, $086d3d2d, $91646c97, $e6635c01, + $6b6b51f4, $1c6c6162, $856530d8, $f262004e, $6c0695ed, + $1b01a57b, $8208f4c1, $f50fc457, $65b0d9c6, $12b7e950, + $8bbeb8ea, $fcb9887c, $62dd1ddf, $15da2d49, $8cd37cf3, + $fbd44c65, $4db26158, $3ab551ce, $a3bc0074, $d4bb30e2, + $4adfa541, $3dd895d7, $a4d1c46d, $d3d6f4fb, $4369e96a, + $346ed9fc, $ad678846, $da60b8d0, $44042d73, $33031de5, + $aa0a4c5f, $dd0d7cc9, $5005713c, $270241aa, $be0b1010, + $c90c2086, $5768b525, $206f85b3, $b966d409, $ce61e49f, + $5edef90e, $29d9c998, $b0d09822, $c7d7a8b4, $59b33d17, + $2eb40d81, $b7bd5c3b, $c0ba6cad, $edb88320, $9abfb3b6, + $03b6e20c, $74b1d29a, $ead54739, $9dd277af, $04db2615, + $73dc1683, $e3630b12, $94643b84, $0d6d6a3e, $7a6a5aa8, + $e40ecf0b, $9309ff9d, $0a00ae27, $7d079eb1, $f00f9344, + $8708a3d2, $1e01f268, $6906c2fe, $f762575d, $806567cb, + $196c3671, $6e6b06e7, $fed41b76, $89d32be0, $10da7a5a, + $67dd4acc, $f9b9df6f, $8ebeeff9, $17b7be43, $60b08ed5, + $d6d6a3e8, $a1d1937e, $38d8c2c4, $4fdff252, $d1bb67f1, + $a6bc5767, $3fb506dd, $48b2364b, $d80d2bda, $af0a1b4c, + $36034af6, $41047a60, $df60efc3, $a867df55, $316e8eef, + $4669be79, $cb61b38c, $bc66831a, $256fd2a0, $5268e236, + $cc0c7795, $bb0b4703, $220216b9, $5505262f, $c5ba3bbe, + $b2bd0b28, $2bb45a92, $5cb36a04, $c2d7ffa7, $b5d0cf31, + $2cd99e8b, $5bdeae1d, $9b64c2b0, $ec63f226, $756aa39c, + $026d930a, $9c0906a9, $eb0e363f, $72076785, $05005713, + $95bf4a82, $e2b87a14, $7bb12bae, $0cb61b38, $92d28e9b, + $e5d5be0d, $7cdcefb7, $0bdbdf21, $86d3d2d4, $f1d4e242, + $68ddb3f8, $1fda836e, $81be16cd, $f6b9265b, $6fb077e1, + $18b74777, $88085ae6, $ff0f6a70, $66063bca, $11010b5c, + $8f659eff, $f862ae69, $616bffd3, $166ccf45, $a00ae278, + $d70dd2ee, $4e048354, $3903b3c2, $a7672661, $d06016f7, + $4969474d, $3e6e77db, $aed16a4a, $d9d65adc, $40df0b66, + $37d83bf0, $a9bcae53, $debb9ec5, $47b2cf7f, $30b5ffe9, + $bdbdf21c, $cabac28a, $53b39330, $24b4a3a6, $bad03605, + $cdd70693, $54de5729, $23d967bf, $b3667a2e, $c4614ab8, + $5d681b02, $2a6f2b94, $b40bbe37, $c30c8ea1, $5a05df1b, + $2d02ef8d); FUNCTION UpdateCRC32(CRC: LongInt; VAR Buffer; Len: Word): LongInt; +VAR + i: Integer; + Octet: ^Byte; BEGIN - WriteLn('REETODO COMMON UpdateCRC32'); + Octet := @buffer; + for i := 1 to Len do + begin + CRC := CRC_32_TAB[Byte(Crc XOR LongInt(Octet^))] XOR ((Crc SHR 8) AND $00FFFFFF); + Inc(Octet); + end; + UpdateCRC32 := CRC; END; {$ENDIF} @@ -2043,6 +2109,7 @@ BEGIN SwapVectors; +{$IFDEF MSDOS} IF (General.SwapShell) THEN BEGIN s := GetEnv('TEMP'); @@ -2051,6 +2118,10 @@ BEGIN Init_SpawNo(s,General.SwapTo,20,10); ResultCode := Spawn(GetEnv('COMSPEC'),FName,0); END; +{$ENDIF} +{$IFDEF WIN32} + ResultCode := -1; +{$ENDIF} IF (NOT General.SwapShell) OR (ResultCode = -1) THEN BEGIN @@ -2787,7 +2858,8 @@ BEGIN NoSound; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON GetKey'); Halt; + Sound(500, 200); + Sound(1500, 200); {$ENDIF} END; LastBeep := TempTimer; @@ -4071,7 +4143,7 @@ BEGIN c := Chr(Mem[VidSeg:(160 * (YPos - 1) + 2 * (XPos - 1))]); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON ScreenDump'); Halt; + c := SysReadCharAt(XPos - 1, YPos - 1); {$ENDIF} IF (c = #0) THEN c := #32; @@ -4921,7 +4993,7 @@ BEGIN C2 := ((1.0 * Regs.Bx) * C1); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON DiskKBFree'); Halt; + C2 := DiskFree(ExtractDriveNumber(DrivePath)); {$ENDIF} END; DiskKBFree := Round(C2 / 1024.0); diff --git a/SOURCE/COMMON2.PAS b/SOURCE/COMMON2.PAS index 808fa13..76f78f6 100644 --- a/SOURCE/COMMON2.PAS +++ b/SOURCE/COMMON2.PAS @@ -31,6 +31,7 @@ USES SysOp3, SplitCha {$IFDEF WIN32} + ,VPSysLow ,Windows {$ENDIF} ; @@ -180,7 +181,13 @@ END; {$IFDEF WIN32} PROCEDURE BiosScroll(up: Boolean); BEGIN - WriteLn('REETODO COMMON2 BiosScroll'); Halt; + if (up) then + begin + SysScrollUp(0, 0, MaxDisplayCols-1, MaxDisplayRows-1, 2, 7); + end else + begin + SysScrollDn(0, 0, MaxDisplayCols-1, MaxDisplayRows-1, 2, 7); + end; END; {$ENDIF} @@ -296,7 +303,7 @@ BEGIN Update_Logo(Win1,ScreenAddr[(FirstRow - 1) * 160],WIN1_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON2 Update_Logo(Win1'); Halt; + Update_Logo(Win1, 1, FirstRow, WIN1_LENGTH); {$ENDIF} GoToXY(02,FirstRow); Write(Caps(Name)); @@ -346,7 +353,7 @@ BEGIN Update_Logo(Win2,ScreenAddr[(FirstRow - 1) * 160],WIN2_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON2 Update_Logo(Win2'); Halt; + Update_Logo(Win2, 1, FirstRow, WIN2_LENGTH); {$ENDIF} GoToXY(02,FirstRow); Write(Street); @@ -384,7 +391,7 @@ BEGIN Update_Logo(Win3,ScreenAddr[(FirstRow - 1) * 160],WIN3_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON2 Update_Logo(Win3'); Halt; + Update_Logo(Win3, 1, FirstRow, WIN3_LENGTH); {$ENDIF} GoToXY(06,FirstRow); Write(Loggedon); @@ -438,7 +445,7 @@ BEGIN Update_Logo(Win4,ScreenAddr[(FirstRow - 1) * 160],WIN4_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON2 Update_Logo(Win4'); Halt; + Update_Logo(Win4, 1, FirstRow, WIN4_LENGTH); {$ENDIF} GoToXY(20,FirstRow); Write(Callers); @@ -466,7 +473,7 @@ BEGIN Update_Logo(Win5,ScreenAddr[(FirstRow - 1) * 160],WIN5_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON2 Update_Logo(Win5'); Halt; + Update_Logo(Win5, 1, FirstRow, WIN5_LENGTH); {$ENDIF} GoToXY(20,FirstRow); Write(General.CallerNum); @@ -596,7 +603,7 @@ BEGIN Update_Logo(SYSKEY,ScreenAddr[0],SYSKEY_LENGTH); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON2 Update_Logo(SYSKEY'); Halt; + Update_Logo(SYSKEY, 1, 1, SYSKEY_LENGTH); {$ENDIF} CursorOn(FALSE); C := ReadKey; diff --git a/SOURCE/COMMON3.PAS b/SOURCE/COMMON3.PAS index e1bae37..538f76c 100644 --- a/SOURCE/COMMON3.PAS +++ b/SOURCE/COMMON3.PAS @@ -32,7 +32,11 @@ PROCEDURE InputCaps(VAR S: STRING; MaxLen: Byte); IMPLEMENTATION USES - Crt; + Crt +{$IFDEF WIN32} + ,RPScreen +{$ENDIF} + ; PROCEDURE InputDefault(VAR S: STRING; v: STRING; MaxLen: Byte; InputFlags: InputFlagSet; LineFeed: Boolean); VAR @@ -359,7 +363,13 @@ VAR {$IFDEF WIN32} PROCEDURE SetCursor(InsertMode: Boolean); BEGIN - WriteLn('REETODO COMMON3 SetCursor'); Halt; + if (InsertMode) then + begin + RPInsertCursor; + end else + begin + RPBlockCursor; + end; END; {$ENDIF} diff --git a/SOURCE/LINECHAT.PAS b/SOURCE/LINECHAT.PAS index 8ecb638..0a4e0a3 100644 --- a/SOURCE/LINECHAT.PAS +++ b/SOURCE/LINECHAT.PAS @@ -88,7 +88,9 @@ BEGIN NoSound; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO LINECHAT RequestSysOpChat'); Halt; + Sound(3000, 200); + Sound(1000, 200); + Sound(3000, 200); {$ENDIF} END; IF (KeyPressed) THEN @@ -384,7 +386,12 @@ BEGIN UNTIL (Counter = 200); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO LINECHAT SysOpLineChat'); Halt; + Sound(650, 200); + Sound(700, 200); + Sound(600, 200); + Sound(500, 200); + Sound(400, 200); + Sound(300, 200); {$ENDIF} Prompt(^G^G); END diff --git a/SOURCE/MYIO.PAS b/SOURCE/MYIO.PAS index 037d465..71e471b 100644 --- a/SOURCE/MYIO.PAS +++ b/SOURCE/MYIO.PAS @@ -76,10 +76,16 @@ IMPLEMENTATION USES Crt {$IFDEF WIN32} + ,RPScreen ,VpSysLow {$ENDIF} ; +{$IFDEF WIN32} +VAR + SavedScreen: TScreenBuf; +{$ENDIF} + {$IFDEF MSDOS} PROCEDURE CursorOn(b: BOOLEAN); ASSEMBLER; ASM @@ -99,7 +105,13 @@ END; {$IFDEF WIN32} PROCEDURE CursorOn(b: BOOLEAN); BEGIN - WriteLn('REETODO MYIO CursorOn'); Halt; + if (b) then + begin + RPShowCursor; + end else + begin + RPHideCursor; + end; END; {$ENDIF} @@ -555,7 +567,7 @@ BEGIN Move(ScreenAddr[0],Wind[0],ScreenSize); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO MYIO SaveScreen'); Halt; + RPSaveScreen(SavedScreen); {$ENDIF} END; @@ -565,7 +577,7 @@ BEGIN Move(Wind[0],ScreenAddr[0],ScreenSize); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO MYIO RemoveWindow'); Halt; + RPRestoreScreen(SavedScreen); {$ENDIF} END; diff --git a/SOURCE/RPSCREEN.PAS b/SOURCE/RPSCREEN.PAS new file mode 100644 index 0000000..16aab0d --- /dev/null +++ b/SOURCE/RPSCREEN.PAS @@ -0,0 +1,157 @@ +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} +unit RPScreen; + +interface + +{$IFDEF WIN32} +uses + Windows; + +type + TScreenBuf = Array[1..25, 1..80] of TCharInfo; // REETODO Don't hardcode to 80x25 +{$ENDIF} + +procedure RPBlockCursor; +procedure RPGotoXY(xy: SmallWord); +procedure RPHideCursor; +procedure RPInsertCursor; +procedure RPRestoreScreen(var screenBuf: TScreenBuf); +procedure RPSaveScreen(var screenBuf: TScreenBuf); +function RPScreenSizeX: Word; +function RPScreenSizeY: Word; +procedure RPSetAttrAt(x, y, attr: SmallWord); +procedure RPShowCursor; +function RPWhereXY: SmallWord; + +implementation + +{$IFDEF WIN32} +var + StdOut: THandle; +{$ENDIF} + +{$IFDEF WIN32} +procedure RPBlockCursor; +var + CCI: TConsoleCursorInfo; +begin + CCI.bVisible := true; + CCI.dwSize := 15; + SetConsoleCursorInfo(StdOut, CCI); +end; + +procedure RPGotoXY(xy: SmallWord); +var + Coord: TCoord; +begin + Coord.x := xy AND $00FF; + Coord.y := xy AND $FF00 SHR 8; + SetConsoleCursorPosition(StdOut, Coord); +end; + +procedure RPHideCursor; +var + CCI: TConsoleCursorInfo; +begin + GetConsoleCursorInfo(StdOut, CCI); + CCI.bVisible := false; + SetConsoleCursorInfo(StdOut, CCI); +end; + +procedure RPInsertCursor; +var + CCI: TConsoleCursorInfo; +begin + CCI.bVisible := true; + CCI.dwSize := 99; + SetConsoleCursorInfo(StdOut, CCI); +end; + +{ REETODO Should detect screen size } +procedure RPRestoreScreen(var screenBuf: TScreenBuf); +var + BufSize : TCoord; + WritePos : TCoord; + DestRect : TSmallRect; +begin + BufSize.X := 80; + BufSize.Y := 25; + WritePos.X := 0; + WritePos.Y := 0; + DestRect.Left := 0; + DestRect.Top := 0; + DestRect.Right := 79; + DestRect.Bottom := 24; + WriteConsoleOutput(StdOut, @screenBuf[1][1], BufSize, WritePos, DestRect); +end; + +{ REETODO Should detect screen size } +procedure RPSaveScreen(var screenBuf: TScreenBuf); +var + BufSize : TCoord; + ReadPos : TCoord; + SourceRect : TSmallRect; +begin + BufSize.X := 80; + BufSize.Y := 25; + ReadPos.X := 0; + ReadPos.Y := 0; + SourceRect.Left := 0; + SourceRect.Top := 0; + SourceRect.Right := 79; + SourceRect.Bottom := 24; + ReadConsoleOutput(StdOut, @screenBuf[1][1], BufSize, ReadPos, SourceRect); +end; + +function RPScreenSizeX: Word; +var + CSBI: TConsoleScreenBufferInfo; +begin + GetConsoleScreenBufferInfo(StdOut, CSBI); + RPScreenSizeX := CSBI.srWindow.Right - CSBI.srWindow.Left + 1; +end; + +function RPScreenSizeY: Word; +var + CSBI: TConsoleScreenBufferInfo; +begin + GetConsoleScreenBufferInfo(StdOut, CSBI); + RPScreenSizeY := CSBI.srWindow.Bottom - CSBI.srWindow.Top + 1; +end; + +procedure RPSetAttrAt(x, y, attr: SmallWord); +var + NumWritten: Longint; + WriteCoord: TCoord; +begin + WriteCoord.X := x; + WriteCoord.Y := y; + WriteConsoleOutputAttribute(StdOut, @attr, 1, WriteCoord, NumWritten); +end; + +procedure RPShowCursor; +var + CCI: TConsoleCursorInfo; +begin + GetConsoleCursorInfo(StdOut, CCI); + CCI.bVisible := true; + SetConsoleCursorInfo(StdOut, CCI); +end; + +function RPWhereXY: SmallWord; +var + CSBI: TConsoleScreenBufferInfo; +begin + GetConsoleScreenBufferInfo(StdOut, CSBI); + RPWhereXY := CSBI.dwCursorPosition.x + (CSBI.dwCursorPosition.y SHL 8); +end; +{$ENDIF} + + +{$IFDEF WIN32} +BEGIN + StdOut := GetStdHandle(STD_OUTPUT_HANDLE); +{$ENDIF} +END. \ No newline at end of file diff --git a/SOURCE/WFCMENU.PAS b/SOURCE/WFCMENU.PAS index 1561d29..cbbdc15 100644 --- a/SOURCE/WFCMENU.PAS +++ b/SOURCE/WFCMENU.PAS @@ -317,7 +317,7 @@ BEGIN Update_Logo(ANSWER,ScreenAddr[(3*2)+(19*160)-162],ANSWER_LENGTH); {$ENDIF} {$IFDEF WIN32} - Update_logo(ANSWER, 3, 19, ANSWER_LENGTH); + Update_Logo(ANSWER, 3, 19, ANSWER_LENGTH); {$ENDIF} rl := 0; @@ -429,14 +429,14 @@ BEGIN Update_Logo(WFC,ScreenAddr[0],WFC_LENGTH); {$ENDIF} {$IFDEF WIN32} - Update_logo(WFC, 1, 1, WFC_LENGTH); + Update_Logo(WFC, 1, 1, WFC_LENGTH); {$ENDIF} IF (General.NetworkMode) THEN {$IFDEF MSDOS} Update_Logo(WFCNET,ScreenAddr[(3*2)+(19*160)-162],WFCNET_LENGTH); {$ENDIF} {$IFDEF WIN32} - Update_logo(WFCNET, 3, 19, WFCNET_LENGTH); + Update_Logo(WFCNET, 3, 19, WFCNET_LENGTH); {$ENDIF} LoadURec(ThisUser,1); @@ -611,7 +611,7 @@ BEGIN Update_Logo(WFC0,ScreenAddr[0],WFC0_LENGTH); {$ENDIF} {$IFDEF WIN32} - Update_logo(WFC0, 1, 1, WFC0_LENGTH); + Update_Logo(WFC0, 1, 1, WFC0_LENGTH); {$ENDIF} END; END; From ef8852e0cda7ba93108725315f83593f3d83527f Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Fri, 8 Feb 2013 20:05:58 -0500 Subject: [PATCH 16/17] Everything is now REETODO free Next step is to actually test to see what might be broken --- README.md | 2 +- SOURCE/COMMON4.PAS | 149 ++++++++++++++++++++++++++++++++++++--------- 2 files changed, 122 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index e2a8748..b00c0df 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ Ported to Win32 by Rick Parrish
    TODO list:
      -
    • Implement any REETODOs that appear in compiled executables
    • Find/correct any usage of FOR loop variables after the loop (since they are 1 greater in VP than in BP
    • Find/correct any file i/o on untyped files where Words or Integers are being read
    @@ -28,4 +27,5 @@ Completed list
  • INTEGER in RECORD to SMALLINT
  • Anything passing 0 for the Attr parameter to FindFirst should pass AnyFile instead (VP returns no files when 0 is passed for Attr)
  • Investigate FILEMODE usage to see if FILEMODEREADWRITE, TEXTMODEREAD or TEXTMODEREADWRITE should be used
  • +
  • Implement any REETODOs that appear in compiled executables
diff --git a/SOURCE/COMMON4.PAS b/SOURCE/COMMON4.PAS index 7072c8f..4aba58a 100644 --- a/SOURCE/COMMON4.PAS +++ b/SOURCE/COMMON4.PAS @@ -352,7 +352,17 @@ IMPLEMENTATION USES Crt, - Common; + Common +{$IFDEF WIN32} + ,EleNorm +{$ENDIF} + ; + +{$IFDEF WIN32} +VAR + DidClose: Boolean = false; + DidInit: Boolean = false; +{$ENDIF} (* AH = 0Ah Purge input buffer @@ -378,7 +388,10 @@ BEGIN END; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_Flush_Recv'); Halt; + if Not(DidInit) then Exit; + if (DidClose) then Exit; + if Not(EleNorm.Com_Carrier) then Exit; + EleNorm.Com_PurgeInBuffer; // REENOTE Is this right? Function says flush not purge {$ENDIF} END ELSE WHILE NOT (Com_IsRecv_Empty) DO @@ -415,7 +428,11 @@ BEGIN END; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_Purge_Send'); Halt; + if (LocalIOOnly) then Exit; + if Not(DidInit) then Exit; + if (DidClose) then Exit; + if Not(EleNorm.Com_Carrier) then Exit; + EleNorm.Com_PurgeOutBuffer; {$ENDIF} END; @@ -456,11 +473,15 @@ BEGIN Mov Dummy,AL @TheEnd: END; + Com_Carrier := (Dummy AND $80) = $80; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_Carrier'); Halt; + Com_Carrier := Not(DidClose); + if (LocalIOOnly) then Exit; + if Not(DidInit) then Exit; + if (DidClose) then Exit; + Com_Carrier := EleNorm.Com_Carrier; {$ENDIF} - Com_Carrier := (Dummy AND $80) = $80; END; (* @@ -490,6 +511,9 @@ CONST VAR Dummy: Byte; T_RecvChar: Boolean; +{$IFDEF WIN32} + Ch: Char; +{$ENDIF} BEGIN Com_Recv := #0; T_RecvChar := FALSE; @@ -509,12 +533,34 @@ BEGIN Mov T_RecvChar,1 @TheEnd: END; -{$ENDIF} -{$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_Recv'); Halt; -{$ENDIF} IF (T_RecvChar) THEN Com_Recv := Char(Dummy); +{$ENDIF} +{$IFDEF WIN32} + if (LocalIOOnly) then Exit; + if Not(DidInit) then Exit; + if (DidClose) then Exit; + if Not(EleNorm.Com_Carrier) then Exit; + if Not(EleNorm.Com_CharAvail) then Exit; + + // Get character from buffer + Ch := EleNorm.Com_GetChar; + if (Ch = #10) then + begin + // Translate bare LF to CR + Com_Recv := #13; + end else + begin + Com_Recv := Ch; + end; + + // If this char is CR, check if the next char is LF (so we can discard it) + if (Ch = #13) and (EleNorm.Com_CharAvail) then + begin + Ch := EleNorm.Com_PeekChar; + if (Ch = #10) then EleNorm.Com_GetChar; // Discard that LF + end; +{$ENDIF} END; (* @@ -554,11 +600,15 @@ BEGIN Mov Dummy,AH @TheEnd: END; + Com_IsRecv_Empty := NOT ((Dummy AND $01) = $01); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_IsRecv_Empty'); Halt; + if (LocalIOOnly) then Exit; + if Not(DidInit) then Exit; + if (DidClose) then Exit; + if Not(EleNorm.Com_Carrier) then Exit; + Com_IsRecv_Empty := Not(EleNorm.Com_CharAvail); {$ENDIF} - Com_IsRecv_Empty := NOT ((Dummy AND $01) = $01); END; (* @@ -586,6 +636,9 @@ bit on hardwired (null modem) links. FUNCTION Com_IsSend_Empty: Boolean; VAR Dummy: Byte; +{$IFDEF WIN32} + InFree, OutFree, InUsed, OutUsed: LongInt; +{$ENDIF} BEGIN Dummy := 0; (* New *) {$IFDEF MSDOS} @@ -598,11 +651,16 @@ BEGIN Mov Dummy,AH @TheEnd: END; + Com_IsSend_Empty := ((Dummy AND $40) = $40); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_IsSend_Empty'); Halt; + if (LocalIOOnly) then Exit; + if Not(DidInit) then Exit; + if (DidClose) then Exit; + if Not(EleNorm.Com_Carrier) then Exit; + EleNorm.Com_GetBufferStatus(InFree, OutFree, InUsed, OutUsed); + Com_IsSend_Empty := (OutUsed = 0); {$ENDIF} - Com_IsSend_Empty := ((Dummy AND $40) = $40); END; (* @@ -631,7 +689,11 @@ BEGIN END; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_Send'); Halt; + if (LocalIOOnly) then Exit; + if Not(DidInit) then Exit; + if (DidClose) then Exit; + if Not(EleNorm.Com_Carrier) then Exit; + EleNorm.Com_SendChar(C); {$ENDIF} END; @@ -717,7 +779,7 @@ BEGIN END; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_Set_Speed'); Halt; + // REENOTE Telnet can't set speed {$ENDIF} END; END; @@ -744,7 +806,13 @@ BEGIN END; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_DeInstall'); Halt; + if Not(DidInit) then Exit; + if Not(DidClose) then + begin + EleNorm.Com_Close; + DidClose := true; + end; + EleNorm.Com_ShutDown; {$ENDIF} END; END; @@ -766,7 +834,7 @@ PROCEDURE Com_Install; {$IFDEF WIN32} FUNCTION DriverInstalled: Word; BEGIN - DriverInstalled := $1954; // Seems to be what it wants + // REENOTE Never gets called in Win32 END; {$ENDIF} @@ -774,6 +842,7 @@ BEGIN FossilPort := (Liner.Comport - 1); IF (LocalIOOnly) THEN Exit; +{$IFDEF MSDOS} IF (DriverInstalled <> $1954) THEN BEGIN ClrScr; @@ -781,7 +850,6 @@ BEGIN Halt; END ELSE -{$IFDEF MSDOS} ASM Xor AL,AL Mov BL,Liner.MFlags @@ -800,7 +868,12 @@ BEGIN END; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Com_Install'); Halt; + if (DidInit) then Exit; + if (DidClose) then Exit; + DidInit := true; + EleNorm.Com_StartUp(2); + EleNorm.Com_SetDontClose(false); + EleNorm.Com_OpenQuick(answerbaud); // REENOTE Should come up with a better solution, this works for now though {$ENDIF} Com_Set_Speed(Liner.InitBaud); END; @@ -825,7 +898,14 @@ END; {$IFDEF WIN32} PROCEDURE CheckHangup; BEGIN - WriteLn('REETODO COMMON4 CheckHangup'); Halt; + if (LocalIOOnly) then exit; + if Not(OutCom) then exit; + + if Not(Com_Carrier) then + begin + HangUp := true; + HungUp := true; + end; END; {$ENDIF} @@ -852,11 +932,11 @@ VAR BEGIN IF (OutCom) THEN BEGIN +{$IFDEF MSDOS} REPEAT T_DI := OFS(S[1]); T_CX := Length(S); T_ES := Seg(S[1]); -{$IFDEF MSDOS} ASM Mov AH,19h Mov DI,T_DI @@ -866,13 +946,16 @@ BEGIN Int 14h Mov T_AX,AX END; -{$ENDIF} -{$IFDEF WIN32} - WriteLn('REETODO COMMON4 SerialOut'); Halt; -{$ENDIF} Move(S[T_AX + 1],S[1],Length(S) - T_AX); Dec(S[0],T_AX); UNTIL (S = ''); +{$ENDIF} +{$IFDEF WIN32} + if Not(DidInit) then Exit; + if (DidClose) then Exit; + if Not(EleNorm.Com_Carrier) then Exit; + EleNorm.Com_SendString(S); +{$ENDIF} END; END; @@ -912,11 +995,14 @@ BEGIN Int 14h Mov T_AH,AH END; + Empty := NOT (T_AH AND 1 = 1); {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 Empty'); Halt; + if Not(DidInit) then Exit; + if (DidClose) then Exit; + if Not(EleNorm.Com_Carrier) then Exit; + Empty := Not(EleNorm.Com_CharAvail); {$ENDIF} - Empty := NOT (T_AH AND 1 = 1); END; END; @@ -947,7 +1033,14 @@ BEGIN END; {$ENDIF} {$IFDEF WIN32} - WriteLn('REETODO COMMON4 DTR'); Halt; + if Not(DidInit) then Exit; + if (DidClose) then Exit; + if Not(EleNorm.Com_Carrier) then Exit; + if Not(Status) then + begin + EleNorm.Com_Close; + DidClose := true; + end; {$ENDIF} END; END; From 860bf057e1896131e2931a3d371d3c3ce141cff5 Mon Sep 17 00:00:00 2001 From: Rick Parrish Date: Sun, 17 Feb 2013 22:02:01 -0500 Subject: [PATCH 17/17] Fixed keypresses not working in WFC --- SOURCE/COMMON4.PAS | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SOURCE/COMMON4.PAS b/SOURCE/COMMON4.PAS index 4aba58a..7abe0e2 100644 --- a/SOURCE/COMMON4.PAS +++ b/SOURCE/COMMON4.PAS @@ -388,6 +388,7 @@ BEGIN END; {$ENDIF} {$IFDEF WIN32} + if (InWfcMenu) then Exit; if Not(DidInit) then Exit; if (DidClose) then Exit; if Not(EleNorm.Com_Carrier) then Exit; @@ -476,7 +477,7 @@ BEGIN Com_Carrier := (Dummy AND $80) = $80; {$ENDIF} {$IFDEF WIN32} - Com_Carrier := Not(DidClose); + Com_Carrier := false; if (LocalIOOnly) then Exit; if Not(DidInit) then Exit; if (DidClose) then Exit; @@ -603,6 +604,7 @@ BEGIN Com_IsRecv_Empty := NOT ((Dummy AND $01) = $01); {$ENDIF} {$IFDEF WIN32} + Com_IsRecv_Empty := true; if (LocalIOOnly) then Exit; if Not(DidInit) then Exit; if (DidClose) then Exit; @@ -654,6 +656,7 @@ BEGIN Com_IsSend_Empty := ((Dummy AND $40) = $40); {$ENDIF} {$IFDEF WIN32} + Com_IsSend_Empty := false; if (LocalIOOnly) then Exit; if Not(DidInit) then Exit; if (DidClose) then Exit; @@ -898,8 +901,8 @@ END; {$IFDEF WIN32} PROCEDURE CheckHangup; BEGIN - if (LocalIOOnly) then exit; - if Not(OutCom) then exit; + if (LocalIOOnly) then Exit; + if Not(OutCom) then Exit; if Not(Com_Carrier) then begin