home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
bbs_ra
/
radu_110.arj
/
RADU.INT
< prev
next >
Wrap
Text File
|
1991-11-21
|
12KB
|
234 lines
(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*-
▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄ ▄▄▄▄▄
Remote Access Door Unit v1.10
(c) 1990,91 by In Fase Productions, The Netherlands
Written and compiled using
Turbo pascal v5.5 and v6.0 by
Richard Faasen,
Sysop of In Fase BBS +31-1840-10261 [2:285/311]
Release date: 21 november 1991
-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*)
{$A+,B-,D-,E-,F-,I+,L-,N-,O-,R-,S-,V-}
Unit RADU;
(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*)
Interface
(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*)
{$I RaStruct}
{$I RAL}
Type
CharSet = Set of Char; { Used by LineEdit }
UOnString = String[70]; { Used by UOn routines }
Var
ChatStr : String; { Displayed at chat-startup }
ChatEndStr : String; { Displayed at chat-termination }
CrtInput : Text; { Use to read local only }
CrtOutput : Text; { Use to write local only }
DorAnsi : Boolean; { True if user has ANSI turned on }
DorAvatar : Boolean; { True if user has AVATAR turned on }
DorCheckIdle: Boolean; { Check keyboard inactivity on/off }
DorCommPort : Byte; { COM port connected to }
DorExtCheck : Boolean; { True if ext keys must be checked }
DorExtKeys : Array[0..150] of Procedure; { Procedures for extended keys }
DorFrozen : Boolean; { True if time should be frozen }
DorIsLocal : Boolean; { True if locally logged on }
DorMinute : Procedure (TimeLeft : Word); { Points to your own proc }
DorNullProc : Procedure; { Dummy to clear DorExtKeys }
DorPath : String; { Full path to door .EXE file }
DorSysopKey : Boolean; { True if last key returned was pressed locally }
DorTimeOut : Function (KeyIdle : Word) : Boolean; { Points to own proc }
DvActive : Boolean; { True if DESQview was detected }
DvVer : Word; { Version of DESQview }
DvVidSeg : Word; { Screen segment to use }
ExitInfo : ExitInfoRecord; { Holds EXITINFO.BBS contents }
Language : LanguageRecord; { Holds info for requested language }
RaNodeNr : Byte; { Line number }
RaConfig : ConfigRecord; { Where CONFIG.RA is stored in }
RaSystem : String; { Path to RA system directory }
ShareInstalled: Boolean; { TRUE if SHARE.EXE is installed }
TextAttr : Byte; { Current attribute. Please DON'T modify }
Const
Black = 0; { Constants for CRT compatibility }
Blue = 1;
Green = 2;
Cyan = 3;
Red = 4;
Magenta = 5;
Brown = 6;
LightGray = 7;
DarkGray = 8;
LightBlue = 9;
LightGreen = 10;
LightCyan = 11;
LightRed = 12;
LightMagenta= 13;
Yellow = 14;
White = 15;
Blink = 128;
{ Constant to create your own status line }
DorStatLn : Array[8..9,1..2] of String[80] =
(('',''),
('ALT: [C]hat [G]arbage [H]angup [L]ockOut [N]extOn [Q]uit to BBS',
' [S]ecurity [O]verride Paging '+#24+'-Inc Time '+#25+
'-Dec Time [F1]-[F7]=Extra Stats'));
PagingHours = 1; { Constants for RaPageStat and RaSetPageStat }
PagingOff = 2;
PagingOn = 3;
ReadMode = 0; { Constants for System.FileMode }
WriteMode = 1;
ReadWriteMode = 2;
DenyAll = $10;
DenyWrite = $20;
DenyRead = $30;
DenyNone = $40;
Inheritance = $80;
ChatSysopStr : String = '`a12:';
ChatUserStr : String = '`a3:';
{ Radu procedures/functions }
Procedure DorInit; { Initialize RADU, must be run to activate RADU }
{ CRT compatible routines }
Procedure ClrEol; { Local/remote clear to end of line }
Procedure ClrScr; { Local/remote clear screen }
Procedure Delay (MS: Word); { DV-Aware Delay procedure }
Procedure DelLine; { Local/remote delete line. }
Procedure GotoXY (X,Y : Byte); { Local/remote gotoxy }
Procedure HighVideo; { Local/remote HighVideo }
Procedure InsLine; { Local/remote insert line }
Function KeyPressed : Boolean; { True if key in buffer }
Procedure LowVideo; { Local/remote LowVideo }
Procedure NormVideo; { Local/remote NormVideo }
Procedure NoSound; { Same as CRT.NoSound }
Function ReadKey : Char; { Returns key from local/remote keyboard }
Procedure Sound (Hz: Word); { Same as CRT.Sound when PRA.RaYell=True }
Procedure TextBackground(Color: Byte); { Local/remote BackGroundColor change }
Procedure TextColor(Color: Byte); { Local/Remote TextColor change }
Function WhereX : Byte; { Same as CRT.WhereX }
Function WhereY : Byte; { Same as CRT.WhereY }
Procedure Window (X1,Y1,X2,Y2 : Byte); { Does nothing }
{ Some specific door routines }
Function CtlRead (Var Fil : Text;Var Line : Word;Var Ident,Value : String)
: Boolean; { CTL reading routine }
Procedure DorChangeTime (Delta : Integer); { Increase/Decrease time }
Procedure DorChat; { Invoke chatmode }
Function DorDisplay (Name,Abort : String;More : Boolean) : Char; { Disp txt }
Function DorLineEdit (Var S :String;Len : Byte;Legal,Abort : CharSet;
Pad : Char) : Char; { Editable line input routine }
Procedure DorRefresh; { Refresh the screen }
Procedure DorStatus (Nr : Byte); { Select which statusline must be displayed }
Procedure DupWrite (Ch : Char;Times : Byte); { Write char multiple times }
Procedure Exec(Path, CmdLine: string); { Execute sub-door in a shell }
{ Routines specific to Remote Access }
Function Byte2Flags (B : Byte) : String; { Convert byte to flag-style }
Function DorPage (SysAbort,UsrAbort,PageFile : String) : Char; { Page sysop }
Function RaCheckFlags (Fl : FlagType;Witch : String) : Boolean; { Chk flags }
Function RaCmpFlags (FlUser,Fl : FlagType) : Boolean; { Compare flags }
Function RaFormatDate (D : Date;Format : Byte) : String; { Format Date var }
Function RalGet (Nr : Word) : String; { Get entry from .RAL file }
Procedure RaLog (S : String); { make an RA.LOG entry }
Function RaPageStat : Byte; { Get page status }
Procedure RaResetFlags (Var Fl : FlagType;Witch : String); { Reset flags }
Procedure RaSetFlags (Var Fl : FlagType;Witch : String); { Set flags }
Procedure RaSetPageStat (Status : Byte); { Set pageStatus }
Procedure RaSetSecurity (NewSec : Word); { Change security level }
Function RaYell : Boolean; { Returns true when sound is allowed }
{ Hotkey routines }
Procedure DorCleanKeys; { Clean all keyboard buffers }
Procedure DorSetHotKeys (Hot : String); { Set hotkeys to use }
Function GetKey (Legal : String) : Char; { Wait for certain key }
Function GetYesNo (Default : Boolean) : Boolean; { Wait for Y/N in used lng }
Function HotKeyPressed : Boolean; { As "KeyPressed", but checks for hotkey }
Function HotReadKey : Char; { As "ReadKey", but reads only hotkeys }
{ Non-door routines }
Function ASCIIZToStr (Var NullStr) : String; { Conv Null terminated to str }
Function DateStr : Date; { Date to string }
Function Dup (C : Char;T : Byte) : String; { Duplicate char C T times }
Procedure FastWrite (X,Y : Byte;S : String80); { Direct screen write }
Function ForceBack (Path : String) : String; { Force backslash if needed }
Function FStr (N : LongInt) : String; { The same as Str procedure }
Function FVal (S : String) : LongInt; { Same as Val procedure }
Function LastChar (S : String) : Char; { Returns last char of String }
Function LeftJust (S : String;Len : Byte) : String; { LJustify with spaces }
Function LeftJustChar (S : String;Len : Byte;C : Char) : String; { LJustify }
Function LowCase (C : Char) : Char; { Change char to lower case }
Function RightJust (S : String;Len : Byte) : String; { RJustify with spaces }
Function RightJustChar (S : String;Len : Byte;C : Char) : String;{ RJustify }
Function SLowCase (S : String) : String; { Change string to lower case }
Function SUpCase (S : String) : String; { UpCase for strings }
Function TimeStr (WithSec,WithHS : Boolean) : String15; { Time to string }
Function ToDec (Hex : String) : Byte; { Conv hex string to dec byte }
Function ToHex (Dec : Byte) : String; { Conv decimal byte to 2 digit hex }
Function Trim (S : String) : String; { Same for both sides }
Function TrimLeft (S : String) : String; { Removes whitespaces on left }
Function TrimRight (S : String) : String; { Same for trailing spaces }
{ Direct access to the FOSSIL }
Function FosCarrier : Boolean; { Is CARRIER detected? }
Procedure FosFlushOutput; { Wait until all data is send }
Function FosInReady : Boolean; { Is char available? }
Procedure FosPurgeInput; { Delete input buffer }
Procedure FosPurgeOutput; { Delete output buffer }
Function FosRead : Char; { Receive/wait character }
Procedure FosSend (C : Char); { Send a character }
Procedure FosSendStr (S : String); { Send a string to the fossil }
Procedure FosSetDTR (State : Boolean); { Raise/lower DTR state }
{ DESQview support }
Procedure DvPause; { Give time to other process }
Procedure DvStartCritical; { Start critical section }
Procedure DvStopCritical; { Stop critical section }
{ Multi-line routines }
Procedure DorSendMessage (LineNr : Byte); { Send message to other node }
Procedure LockRecords (Var F;StartRec,NumRec : LongInt); { Lock }
Function LockResult : Byte; { Returns the status of (un)lock action }
Procedure UnLockRecords (Var F;StartRec,NumRec : LongInt); { UnLock }
Procedure UOnClear; { Clear UserDoes file }
Function UOnGet (Line : Byte) : UOnString; { Get what someone is doing }
Procedure UOnSet (What : UOnString); { Set what user is doing }
(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*)
Implementation
(*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-*)