home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
cddk9605.zip
/
HEADERS.ARJ
/
CONCERTO.INT
next >
Wrap
Text File
|
1996-05-17
|
11KB
|
323 lines
{ ───────────────────────────────────────────────────────────────────────── }
{ Name : CONCERTO.PAS }
{ Description : Concerto Door Development Kit }
{ ───────────────────────────────────────────────────────────────────────── }
UNIT Concerto;
{$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
{$F+} { . . . . . . . . . . . . . . . . . . . . Force far calls for safety }
{$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
{$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
{$Q-} { . . . . . . . . . . . . . . Do not generate overflow-checking code }
{$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
{$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
{$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
INTERFACE
USES
IO, Objects, Scripts, xStrings;
TYPE
tChatColor = ARRAY[0..1] OF tColorScheme;
pChatColor = ^tChatColor;
{ tChatColor[0] = Color set for characters typed by the sysop. }
{ tChatColor[1] = Color set for characters typed by the caller. }
tFOSSIL = OBJECT(tIODriverRemote)
CONSTRUCTOR Init(p:pChar; c:Word; b,l:LongInt);
FUNCTION CarrierDetect:Boolean; VIRTUAL;
PROCEDURE LowerDTR; VIRTUAL;
PROCEDURE PurgeInbound; VIRTUAL;
PROCEDURE PurgeOutbound; VIRTUAL;
PROCEDURE RaiseDTR; VIRTUAL;
PROCEDURE ReadChar(VAR c:Char); VIRTUAL;
PROCEDURE SendChar(c:Char); VIRTUAL;
FUNCTION Waiting:Boolean; VIRTUAL;
DESTRUCTOR Done; VIRTUAL;
END;
pFOSSIL = ^tFOSSIL;
tSysKey = OBJECT(tObject)
ScanCode : Word;
Script : pChar;
CONSTRUCTOR Init(Code:Word; Source:pChar);
DESTRUCTOR Done; VIRTUAL;
END;
pSysKey = ^tSysKey;
tLocalIO = OBJECT(tIODriver)
SysKeySet : pCollection;
CONSTRUCTOR Init(p:pChar);
PROCEDURE ClrEOL; VIRTUAL;
PROCEDURE ClrScr; VIRTUAL;
PROCEDURE Color(C:Byte); VIRTUAL;
PROCEDURE CursorDown(N:Byte); VIRTUAL;
PROCEDURE CursorLeft(N:Byte); VIRTUAL;
PROCEDURE CursorRight(N:Byte); VIRTUAL;
PROCEDURE CursorUp(N:Byte); VIRTUAL;
PROCEDURE GotoXY(X,Y:Byte); VIRTUAL;
PROCEDURE ReadChar(VAR C:Char); VIRTUAL;
PROCEDURE SendChar(C:Char); VIRTUAL;
PROCEDURE SendString(CONST S:OpenString); VIRTUAL;
FUNCTION Waiting:Boolean; VIRTUAL;
DESTRUCTOR Done; VIRTUAL;
END;
pLocalIO = ^tLocalIO;
tStatusLine = OBJECT(tID)
Size : ShortInt; {. . . . . . . . Size of the status line in rows }
Text : pChar; { Text on the status line (color codes are valid) }
CONSTRUCTOR Init(Name:pChar; Sz:ShortInt; Txt:pChar);
DESTRUCTOR Done; VIRTUAL;
END;
pStatusLine = ^tStatusLine;
CONST
{ Constants for use with the ChatFlags word }
ChatActive = $01; { .......1 } { . . . . . Chat-mode is currently active }
ChatExit = $02; { ......1. } { . . . . . . . . . . . Force termination }
CONST
Application : pChar = NIL; { . . . . . . . Name of the door }
Author : pChar = NIL; { . . . . . . Author of the door }
Baud : LongInt = 0; { . . . . . . . . Connection rate }
BBSName : pChar = NIL; { . . . . . . . . Name of the BBS }
Build : STRING[6] = '960517'; { . . . . . . . Concerto version }
CarrierDropped : Boolean = False; { . . . TRUE if the user hung up }
ChatExecPrompt : pChar = NIL; { . . . . . Slash-command prompt }
ChatFlags : Word = 0; { . . . . Chat-mode status flags }
ChatGreeting : pChar = NIL; { . . . . . Displayed upon entry }
ChatGoodbye : pChar = NIL; { . . . . . . Displayed upon exit }
ChatText : pChar90 = ''; { . . . . . Chat-mode text buffer }
CheckCD : Boolean = True; { . . Check for dropped carrier? }
Color1 : Boolean = True; { . . . DORINFOx.DEF color kludge }
ComPort : Word = 0; { . . . . . . Communications port }
Copyright : pChar = NIL; { . . . Author's copyright notice }
DropFile : pChar = NIL; { . . . . Path/Name of drop file }
FOSSILPtr : pFOSSIL = NIL; { . . FOSSIL interface I/O driver }
FOSSILPort : Word = 0; { . . . . . . . . . . FOSSIL port }
LocalIOPtr : pLocalIO = NIL; { . . . . . . . Local I/O driver }
Locked : LongInt = 0; { . . . . . . . Locked baud rate }
MacroFiller : Char = ' '; { . . . . Fills expanding macros }
Node : LongInt = 0; { . . . . . . . Node/line number }
NoTimeCode : Byte = 0; { . Returned to DOS when no time }
Security : LongInt = 0; { . . . . Security level of user }
StatusShown : Integer = -1; { . . Index of status line shown }
SysopFirst : pChar = NIL; { . . . . . . Sysop's first name }
SysopLast : pChar = NIL; { . . . . . . . Sysop's last name }
TimeOutCode : Byte = 0; { . . . . . Errorlevel if timeout }
UserFirst : pChar = NIL; { . . . . . . . User's first name }
UserLast : pChar = NIL; { . . . . . . . User's last name }
UserLocation : pChar = NIL; { . . . . . . . . User's location }
Version : pChar = NIL; { . . . . . . Version of the door }
ChatColor : tChatColor =
(( Lower:03; Upper:03; Digit:03; HiBit:03; Punct:03 ),
( Lower:07; Upper:07; Digit:07; HiBit:07; Punct:07 ));
FUNCTION AddSysKey(Code:Word; Source:pChar):Boolean;
{
PURPOSE : Associates a scan code with a string of commands. The commands
are executed whenever the scan code is pressed by the sysop.
}
PROCEDURE DefaultNoTimeProcedure;
{
PURPOSE : Convenience. Use this procedure if you do not wish to
write your own no-time-left procedure.
NOTES : The file EXCEEDED is displayed before terminating the call.
Add the following to your main program:
SetNoTimeProcedure(@DefaultNoTimeProcedure);
SEE ALSO : SetNoTimeProcedure
}
PROCEDURE DefaultTimeOutProcedure;
{
PURPOSE : Convenience. Use this procedure if you do not wish to
write your own time-out procedure.
NOTES : The file TIMEOUT.ANS is displayed before terminating the
call. Add the following to your main program:
SetTimeOutProcedure(@DefaultTimeOutProcedure)
SEE ALSO : SetTimeOutProcedure
}
PROCEDURE ExitChatMode;
{
PURPOSE : Terminates the chat-mode, if active.
NOTES : It is more efficient to directly modify the ChatFlags variable:
ChatFlags := (ChatFlags OR ChatExit);
SEE ALSO : LineChat
}
PROCEDURE ExitDoor(ErrorLevel:Byte);
{
PURPOSE : Exits the door with the specified error level.
NOTES : The connection is not terminated. Use the HangUp function
if you wish to drop carrier on the user.
SEE ALSO : HangUp
}
FUNCTION HangUp:Boolean;
{
PURPOSE : Hangs up on the caller.
NOTES : The door is not terminated. Use ExitDoor if you wish to
return to the BBS.
SEE ALSO : ExitDoor
}
PROCEDURE HideStatusLine;
{
PURPOSE : Hides the current status line, if visible.
NOTES : Each status line is an identifier stored in the IDs collection.
The ShowStatus variable contains the index of the visible
status line's object in IDs, or -1 is no status line is
visible.
SEE ALSO : ShowStatusLine
}
PROCEDURE InitFOSSIL;
{
PURPOSE : Initializes the FOSSIL I/O driver for remote operation.
NOTES : Intended for INIT.SCR usage only.
}
PROCEDURE LineChat;
{
PURPOSE : Acticates the line-by-line scrolling chat-mode.
NOTES : The sysop can press the forward slash key to activate
a special command-mode. The cursor must be at the left-most
column of the screen to activate the command-mode. The
remote caller cannot see this, but will see the results
of any executed commands.
SEE ALSO : ExitChat
}
FUNCTION LoadDropFile(p:pChar):Boolean;
{
PURPOSE : Loads the specified drop file. If p is NIL, then the
procedure uses the path specified in the DropFile variable.
NOTES : DORINFOx.DEF and DOOR.SYS are supported. The current version
of Concerto provides limited support for drop files. The next
version will implement a template-system that allows any
text-based drop-file to be used with Concerto.
}
PROCEDURE ProtectSourceVars;
{
PURPOSE : Makes the following variables read-only:
Application
Author
Build
Copyright
Version
SEE ALSO : MakeReadOnly (Scripts)
}
PROCEDURE RegisterConcerto;
{
PURPOSE : Registers the Concerto door enviroment. This includes the
run-time library, the color-code systems, the control-code
system and the descriptive-macro system.
NOTES : This procedure is mandatory.
}
PROCEDURE RegisterFCodeSystem;
{
PURPOSE : Registers the formatting-code/control-code system with Concerto.
SEE ALSO : RegisterMacroSystem
}
PROCEDURE RegisterMacroSystem;
{
PURPOSE : Registers the macro system with Concerto.
SEE ALSO : RegisterFCodeSystem
}
PROCEDURE ShowStatusLine(p:pChar);
{
PURPOSE : Shows the specified status line, where p is the name of
the identifier saved in the IDs collection.
EXAMPLE : BEGIN
CASE Random(3) OF
0 : ShowStatusLine('Help');
1 : ShowStatusLine('Quote');
2 : ShowStatusLine('Peter');
END;
END;
SEE ALSO : HideStatusLine
}