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 >
Text File  |  1996-05-17  |  11KB  |  323 lines

  1.  
  2. { ───────────────────────────────────────────────────────────────────────── }
  3. {  Name        : CONCERTO.PAS                                               }
  4. {  Description : Concerto Door Development Kit                              }
  5. { ───────────────────────────────────────────────────────────────────────── }
  6.  
  7. UNIT Concerto;
  8.  
  9. {$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
  10. {$F+} { . . . . . . . . . . . . . . . . . . . .  Force far calls for safety }
  11. {$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
  12. {$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
  13. {$Q-} { . . . . . . . . . . . . . .  Do not generate overflow-checking code }
  14. {$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
  15. {$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
  16. {$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
  17.  
  18.  
  19. INTERFACE
  20.  
  21. USES
  22.   IO, Objects, Scripts, xStrings;
  23.  
  24. TYPE
  25.  
  26.   tChatColor = ARRAY[0..1] OF tColorScheme;
  27.  
  28.   pChatColor = ^tChatColor;
  29.  
  30.   { tChatColor[0] = Color set for characters typed by the sysop.            }
  31.   { tChatColor[1] = Color set for characters typed by the caller.           }
  32.  
  33.  
  34.   tFOSSIL = OBJECT(tIODriverRemote)
  35.  
  36.     CONSTRUCTOR Init(p:pChar; c:Word; b,l:LongInt);
  37.  
  38.     FUNCTION  CarrierDetect:Boolean;  VIRTUAL;
  39.     PROCEDURE LowerDTR;               VIRTUAL;
  40.     PROCEDURE PurgeInbound;           VIRTUAL;
  41.     PROCEDURE PurgeOutbound;          VIRTUAL;
  42.     PROCEDURE RaiseDTR;               VIRTUAL;
  43.     PROCEDURE ReadChar(VAR c:Char);   VIRTUAL;
  44.     PROCEDURE SendChar(c:Char);       VIRTUAL;
  45.     FUNCTION  Waiting:Boolean;        VIRTUAL;
  46.  
  47.     DESTRUCTOR Done;                  VIRTUAL;
  48.  
  49.     END;
  50.  
  51.   pFOSSIL = ^tFOSSIL;
  52.  
  53.  
  54.   tSysKey = OBJECT(tObject)
  55.     ScanCode : Word;
  56.     Script   : pChar;
  57.     CONSTRUCTOR Init(Code:Word; Source:pChar);
  58.     DESTRUCTOR Done; VIRTUAL;
  59.     END;
  60.  
  61.   pSysKey = ^tSysKey;
  62.  
  63.  
  64.   tLocalIO = OBJECT(tIODriver)
  65.  
  66.     SysKeySet : pCollection;
  67.  
  68.     CONSTRUCTOR Init(p:pChar);
  69.  
  70.     PROCEDURE ClrEOL;                         VIRTUAL;
  71.     PROCEDURE ClrScr;                         VIRTUAL;
  72.     PROCEDURE Color(C:Byte);                  VIRTUAL;
  73.     PROCEDURE CursorDown(N:Byte);             VIRTUAL;
  74.     PROCEDURE CursorLeft(N:Byte);             VIRTUAL;
  75.     PROCEDURE CursorRight(N:Byte);            VIRTUAL;
  76.     PROCEDURE CursorUp(N:Byte);               VIRTUAL;
  77.     PROCEDURE GotoXY(X,Y:Byte);               VIRTUAL;
  78.     PROCEDURE ReadChar(VAR C:Char);           VIRTUAL;
  79.     PROCEDURE SendChar(C:Char);               VIRTUAL;
  80.     PROCEDURE SendString(CONST S:OpenString); VIRTUAL;
  81.     FUNCTION  Waiting:Boolean;                VIRTUAL;
  82.  
  83.     DESTRUCTOR Done; VIRTUAL;
  84.     END;
  85.  
  86.   pLocalIO = ^tLocalIO;
  87.  
  88.  
  89.   tStatusLine = OBJECT(tID)
  90.  
  91.     Size : ShortInt;      {. . . . . . . .  Size of the status line in rows }
  92.     Text : pChar;         { Text on the status line (color codes are valid) }
  93.  
  94.     CONSTRUCTOR Init(Name:pChar; Sz:ShortInt; Txt:pChar);
  95.     DESTRUCTOR Done; VIRTUAL;
  96.     END;
  97.  
  98.   pStatusLine = ^tStatusLine;
  99.  
  100.  
  101. CONST
  102.  
  103.   { Constants for use with the ChatFlags word }
  104.  
  105.   ChatActive = $01; { .......1 } { . . . . .  Chat-mode is currently active }
  106.   ChatExit   = $02; { ......1. } { . . . . . . . . . . .  Force termination }
  107.  
  108.  
  109. CONST
  110.   Application    : pChar      = NIL;      { . . . . . . .  Name of the door }
  111.   Author         : pChar      = NIL;      { . . . . . .  Author of the door }
  112.   Baud           : LongInt    = 0;        { . . . . . . . . Connection rate }
  113.   BBSName        : pChar      = NIL;      { . . . . . . . . Name of the BBS }
  114.   Build          : STRING[6]  = '960517'; { . . . . . . .  Concerto version }
  115.   CarrierDropped : Boolean    = False;    { . . .  TRUE if the user hung up }
  116.   ChatExecPrompt : pChar      = NIL;      { . . . . .  Slash-command prompt }
  117.   ChatFlags      : Word       = 0;        { . . . .  Chat-mode status flags }
  118.   ChatGreeting   : pChar      = NIL;      { . . . . .  Displayed upon entry }
  119.   ChatGoodbye    : pChar      = NIL;      { . . . . . . Displayed upon exit }
  120.   ChatText       : pChar90    = '';       { . . . . . Chat-mode text buffer }
  121.   CheckCD        : Boolean    = True;     { . .  Check for dropped carrier? }
  122.   Color1         : Boolean    = True;     { . . . DORINFOx.DEF color kludge }
  123.   ComPort        : Word       = 0;        { . . . . . . Communications port }
  124.   Copyright      : pChar      = NIL;      { . . . Author's copyright notice }
  125.   DropFile       : pChar      = NIL;      { . . . .  Path/Name of drop file }
  126.   FOSSILPtr      : pFOSSIL    = NIL;      { . . FOSSIL interface I/O driver }
  127.   FOSSILPort     : Word       = 0;        { . . . . . . . . . . FOSSIL port }
  128.   LocalIOPtr     : pLocalIO   = NIL;      { . . . . . . .  Local I/O driver }
  129.   Locked         : LongInt    = 0;        { . . . . . . .  Locked baud rate }
  130.   MacroFiller    : Char       = ' ';      { . . . .  Fills expanding macros }
  131.   Node           : LongInt    = 0;        { . . . . . . .  Node/line number }
  132.   NoTimeCode     : Byte       = 0;        { .  Returned to DOS when no time }
  133.   Security       : LongInt    = 0;        { . . . .  Security level of user }
  134.   StatusShown    : Integer    = -1;       { . .  Index of status line shown }
  135.   SysopFirst     : pChar      = NIL;      { . . . . . .  Sysop's first name }
  136.   SysopLast      : pChar      = NIL;      { . . . . . . . Sysop's last name }
  137.   TimeOutCode    : Byte       = 0;        { . . . . . Errorlevel if timeout }
  138.   UserFirst      : pChar      = NIL;      { . . . . . . . User's first name }
  139.   UserLast       : pChar      = NIL;      { . . . . . . .  User's last name }
  140.   UserLocation   : pChar      = NIL;      { . . . . . . . . User's location }
  141.   Version        : pChar      = NIL;      { . . . . . . Version of the door }
  142.  
  143.   ChatColor : tChatColor =
  144.     (( Lower:03;  Upper:03; Digit:03;  HiBit:03;  Punct:03 ),
  145.      ( Lower:07;  Upper:07; Digit:07;  HiBit:07;  Punct:07 ));
  146.  
  147.  
  148. FUNCTION AddSysKey(Code:Word; Source:pChar):Boolean;
  149.   {
  150.   PURPOSE  : Associates a scan code with a string of commands.  The commands
  151.              are executed whenever the scan code is pressed by the sysop.
  152.   }
  153.  
  154.  
  155. PROCEDURE DefaultNoTimeProcedure;
  156.   {
  157.   PURPOSE  : Convenience.  Use this procedure if you do not wish to
  158.              write your own no-time-left procedure.
  159.  
  160.   NOTES    : The file EXCEEDED is displayed before terminating the call.
  161.              Add the following to your main program:
  162.  
  163.              SetNoTimeProcedure(@DefaultNoTimeProcedure);
  164.  
  165.   SEE ALSO : SetNoTimeProcedure
  166.   }
  167.  
  168.  
  169. PROCEDURE DefaultTimeOutProcedure;
  170.   {
  171.   PURPOSE  : Convenience.  Use this procedure if you do not wish to
  172.              write your own time-out procedure.
  173.  
  174.   NOTES    : The file TIMEOUT.ANS is displayed before terminating the
  175.              call.  Add the following to your main program:
  176.  
  177.              SetTimeOutProcedure(@DefaultTimeOutProcedure)
  178.  
  179.   SEE ALSO : SetTimeOutProcedure
  180.   }
  181.  
  182.  
  183. PROCEDURE ExitChatMode;
  184.   {
  185.   PURPOSE  : Terminates the chat-mode, if active.
  186.  
  187.   NOTES    : It is more efficient to directly modify the ChatFlags variable:
  188.  
  189.              ChatFlags := (ChatFlags OR ChatExit);
  190.  
  191.   SEE ALSO : LineChat
  192.   }
  193.  
  194.  
  195. PROCEDURE ExitDoor(ErrorLevel:Byte);
  196.   {
  197.   PURPOSE  : Exits the door with the specified error level.
  198.  
  199.   NOTES    : The connection is not terminated.  Use the HangUp function
  200.              if you wish to drop carrier on the user.
  201.  
  202.   SEE ALSO : HangUp
  203.   }
  204.  
  205.  
  206. FUNCTION HangUp:Boolean;
  207.   {
  208.   PURPOSE  : Hangs up on the caller.
  209.  
  210.   NOTES    : The door is not terminated.  Use ExitDoor if you wish to
  211.              return to the BBS.
  212.  
  213.   SEE ALSO : ExitDoor
  214.   }
  215.  
  216.  
  217. PROCEDURE HideStatusLine;
  218.   {
  219.   PURPOSE  : Hides the current status line, if visible.
  220.  
  221.   NOTES    : Each status line is an identifier stored in the IDs collection.
  222.              The ShowStatus variable contains the index of the visible
  223.              status line's object in IDs, or -1 is no status line is
  224.              visible.
  225.  
  226.   SEE ALSO : ShowStatusLine
  227.   }
  228.  
  229.  
  230. PROCEDURE InitFOSSIL;
  231.   {
  232.   PURPOSE  : Initializes the FOSSIL I/O driver for remote operation.
  233.  
  234.   NOTES    : Intended for INIT.SCR usage only.
  235.   }
  236.  
  237.  
  238. PROCEDURE LineChat;
  239.   {
  240.   PURPOSE  : Acticates the line-by-line scrolling chat-mode.
  241.  
  242.   NOTES    : The sysop can press the forward slash key to activate
  243.              a special command-mode.  The cursor must be at the left-most
  244.              column of the screen to activate the command-mode.  The
  245.              remote caller cannot see this, but will see the results
  246.              of any executed commands.
  247.  
  248.   SEE ALSO : ExitChat
  249.   }
  250.  
  251.  
  252. FUNCTION LoadDropFile(p:pChar):Boolean;
  253.   {
  254.   PURPOSE  : Loads the specified drop file.  If p is NIL, then the
  255.              procedure uses the path specified in the DropFile variable.
  256.  
  257.   NOTES    : DORINFOx.DEF and DOOR.SYS are supported.  The current version
  258.              of Concerto provides limited support for drop files.  The next
  259.              version will implement a template-system that allows any
  260.              text-based drop-file to be used with Concerto.
  261.   }
  262.  
  263.  
  264.  
  265. PROCEDURE ProtectSourceVars;
  266.   {
  267.   PURPOSE  : Makes the following variables read-only:
  268.  
  269.              Application
  270.              Author
  271.              Build
  272.              Copyright
  273.              Version
  274.  
  275.   SEE ALSO : MakeReadOnly (Scripts)
  276.   }
  277.  
  278.  
  279. PROCEDURE RegisterConcerto;
  280.   {
  281.   PURPOSE  : Registers the Concerto door enviroment.  This includes the
  282.              run-time library, the color-code systems, the control-code
  283.              system and the descriptive-macro system.
  284.  
  285.   NOTES    : This procedure is mandatory.
  286.  
  287.   }
  288.  
  289.  
  290. PROCEDURE RegisterFCodeSystem;
  291.   {
  292.   PURPOSE  : Registers the formatting-code/control-code system with Concerto.
  293.  
  294.   SEE ALSO : RegisterMacroSystem
  295.   }
  296.  
  297.  
  298. PROCEDURE RegisterMacroSystem;
  299.   {
  300.   PURPOSE  : Registers the macro system with Concerto.
  301.  
  302.   SEE ALSO : RegisterFCodeSystem
  303.   }
  304.  
  305.  
  306. PROCEDURE ShowStatusLine(p:pChar);
  307.   {
  308.   PURPOSE  : Shows the specified status line, where p is the name of
  309.              the identifier saved in the IDs collection.
  310.  
  311.   EXAMPLE  : BEGIN
  312.              CASE Random(3) OF
  313.                0 : ShowStatusLine('Help');
  314.                1 : ShowStatusLine('Quote');
  315.                2 : ShowStatusLine('Peter');
  316.                END;
  317.              END;
  318.  
  319.   SEE ALSO : HideStatusLine
  320.   }
  321.  
  322.  
  323.