home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / GENUTIL / FKFOS102.ZIP / FKFOSSIL.DOC < prev    next >
Text File  |  1994-12-27  |  81KB  |  1,606 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.             |  FKFOSSIL v1.02
  12.             |  Turbo Pascal Fossil Communication/Door Driver Routines
  13.             |
  14.             |  Copyright 1993-1994 by Tim Strike
  15.             |      and Forbidden Knights Systems.
  16.             |  Released on December 27th, 1994.
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                                  ____________
  26.  
  27.                                  INTRODUCTION
  28.                                  ____________
  29.  
  30.              I've been programming for the fossil driver for 2 years. It
  31.         originally started with portions of a simple program, all built-in
  32.         code.  Whenever I needed the routines, I would copy them from program
  33.         to program.  About a year ago I optimized all the code and it became
  34.         a .TPU unit.  I've been using those routines since then, until I
  35.         recently decided I would optimize the code even MORE with what I had
  36.         learned since (it's forever an experience).
  37.  
  38.              At any rate, some of the biggest complaints of some programmers
  39.         is the lack of decent fossil routines, and even that fossil routines
  40.         that exist are far too costly.  If you're in need of a small program
  41.         then you also don't want to pay for the routines.  Since I rewrote my
  42.         routines, I decided that they would make a very good, powerful .TPU
  43.         unit for programmers -- and I decided that I would surpass as many
  44.         products as I could in price and quality.  I think I've managed to do
  45.         both.
  46.  
  47.              The Forbidden Knights Fossil Routines are absolutely free except
  48.         for one condition; If you use these routines in ANY of your programs,
  49.         you must give credit for their use.  Forbidden Knights Systems
  50.         maintains copyright on the fossil routines contained in this unit,
  51.         which should also be stated upon program execution or clearly in your
  52.         documentation.  Please understand this clause -- if you do not agree
  53.         with this then you must delete the unit from your harddrives.  If
  54.         people begin to abuse this right, future versions will not be made
  55.         available to the public.  While the copyright is maintained by
  56.         Forbidden Knights Systems, we are not responsible for damage due to
  57.         use or misuse of these routines.
  58.  
  59.              FKFOSSIL is to be used with Turbo Pascal 6.0 or 7.0.  To use
  60.         with TP6.0, copy the FK6.TPU to FKFOSSIL.TPU and place into your TPU
  61.         directory.  To use with TP7.0, copy the FK7.TPU to FKFOSSIL.TPU and
  62.         place into your TPU directory.
  63.  
  64.              FKFOSSIL is a tool for all programmers who wish quick, reliable
  65.         fossil communication routines.  FKFOSSIL will provide the novice user
  66.         with a insert-and-run level that can be easily understood, and the
  67.         expert user with many advanced configuration and control units.  Some
  68.         of the highlights include;
  69.  
  70.              o Insert and run -- all variables are pre-defined so that even
  71.                   the novice programmer can quickly get things started.  The
  72.                   more advanced users will like the configurability of
  73.                   most of the internal options.
  74.  
  75.              o It's free to use!  A note saying that the FKFOSSIL routines
  76.                   are being used, and that they are copyright Forbidden
  77.                   Knights Systems must be displayed, and that's all that is
  78.                   required.  (however donations are always welcomed by anyone
  79.                   who would like to send anything in).
  80.  
  81.              o Full support for TTY, ANSI and Avatar/0 commands.  From
  82.                   clearing the screen to setting the text colour, all the
  83.                   ANSI commands and Avatar/0 commands are supported.
  84.  
  85.              o Internal ANSI and Avatar drivers -- ANSI.SYS is not required
  86.                   to view/display ANSI lines.  Because of this built-in code,
  87.                   ANSI keyboard remapping isn't possible which provides a
  88.                   safeguard for ANSI displayed in the door against "trojans"
  89.                   and other pranks (ever had YOUR terminal turned into a
  90.                   300x200 mode by an ansi file...?)
  91.  
  92.              o OS/2, DESQview and Windows detection - FKFOSSIL releases all
  93.                   unused timeslices to improve CPU usage.  This is done
  94.                   whenever keyboard polling occurs automatically by FKFOSSIL.
  95.  
  96.              o Configured to read from DOOR.SYS or DORINFO1.DEF drop files,
  97.                   or the information can be manually set/read from other
  98.                   places so that the FKFOSSIL unit is completely portable. If
  99.                   drop files need to be created, FKFOSSIL will create drop
  100.                   files DOOR.SYS and DORINFO1.DEF.
  101.  
  102.              o Automatically keeps track of time (including time rolling over
  103.                   midnight), and the last time user pressed a key.  These
  104.                   counters can be disabled or changed quickly, and are
  105.                   displayed on the status line.  Keyboard inactivity timeouts
  106.                   warn the user and then automatically shut down when
  107.                   violated.
  108.  
  109.              o ANSI Music Interface -- Will send ANSI Music string to remote
  110.                   side, and disassemble and play on the local side.
  111.  
  112.              o Definable functions -- Local and Remote Input Processing,
  113.                   Carrier loss, Inactivity Timeout, No Time Left, Open and
  114.                   Close.  These are used if you want to have the standard
  115.                   routines replaced, for example; the carrier loss routine
  116.                   currently sends a string to the screen saying the carrier
  117.                   was lost, then it deinitializes the fossil driver.  If you
  118.                   want to have it write to the log, then close a few files,
  119.                   then say the carrier was lost and exit -- the definable
  120.                   function makes it easy to do without having to trap all of
  121.                   the stuff yourself.
  122.  
  123.         And those are just SOME of the highlights of the routines.  There are
  124.         big plans to improve these routines and add even more -- I've already
  125.         started with the coding and some of them are even at the testing
  126.         stage right now.  I get the full use out of the routines that I
  127.         expect, so I hope that you enjoy using the routines and get some good
  128.         use out of them as well.
  129.  
  130.  
  131.                               _________________
  132.  
  133.                               UNIT INSTALLATION
  134.                               _________________
  135.  
  136.              We have tried to make the installation of FKFOSSIL as simple as
  137.         possible.  If you are using TP6.0, rename FK6.TPU -> FKFOSSIL.TPU
  138.         and copy it into your main TPU directory (where the other .TPU's are
  139.         stored).  If you are using TP7.0, rename FK7.TPU -> FKFOSSIL.TPU
  140.         and copy into your main TPU directory. That's the simple part... ;)
  141.  
  142.              To setup your program to use the routines, you will need to let
  143.         Turbo Pascal know that you are using the library.  You may or may not
  144.         already have a "USES <library>[,<library>]" clause in your program.
  145.         If you do, then simply add FKFOSSIL to that list.  If you do not,
  146.         then right after the "PROGRAM name" clause add "USES FKFOSSIL;".
  147.  
  148.              Program Example1_1;
  149.              USES CRT,DOS,FKFOSSIL;     { If using more then one unit }
  150.  
  151.              Program Example1_2;
  152.              USES FKFOSSIL;             { If only using FKFOSSIL unit }
  153.  
  154.              At this point when compiled, your program will include the
  155.         FKFOSSIL routines in your program.  In order to make these the
  156.         simplest routines to use, when your program is first run, FKFOSSIL
  157.         will auto-initialize.  You won't even know it's happening, and by
  158.         that point all the variables will be predefined and FKFOSSIL will
  159.         have already determined your operating system and it's capabilities.
  160.  
  161.              Why are the variables predefined?  Because if the "standard
  162.         setup" was actually a procedure, then some programmers might fail to
  163.         run the "setup" procedure, and that could cause unpredictable results
  164.         (sometimes it might work, other times it might not).  To save you
  165.         time and sanity, the variables are initialized automatically -- this
  166.         means that if you want to change any of the variables, you don't need
  167.         to worry about the order or what procedures come before or afterward.
  168.  
  169.              NOTE; This means that this unit may _not_ be overlayed. There
  170.         are a couple of good reasons to do this, but the main one is that
  171.         overlaying this unit will cause extreme slowdowns in communications
  172.         and it is never recommended to overlay any type of unit which will
  173.         be used throughout a program (especially if you have a larger
  174.         overlay file, like a BBS for example).
  175.  
  176.              Now that takes care of getting the routines recognized -- but
  177.         what about starting the fossil driver and getting the actual
  178.         communications started?  Easy enough -- your program should start
  179.         with FK_INITFOSSIL and end with FK_DEINITFOSSIL.
  180.  
  181.              o The fk_InitFossil routine should be called before you start
  182.                  using any of the other routines.  This starts the fossil
  183.                  driver and get's the ball rolling.  If you want to setup
  184.                  variables or call NON-FKFOSSIL routines beforehand, that's
  185.                  fine.  For instance, if you have a "Command Line Help", you
  186.                  may wish to process that before starting the fossil driver.
  187.  
  188.                  NOTE; If you plan on reading in the DOOR.SYS or DORINFO1.DEF
  189.                  files, then I suggest you read the section for those two
  190.                  drop files -- it's important that you read in the
  191.                  information before the fk_InitFossil routine so that the
  192.                  initialization can use the information that is read in.
  193.                  Also, if you do plan on reading in the DOOR.SYS and
  194.                  DORINFO1.DEF files, there is a special initialization
  195.                  procedure which saves you time.
  196.  
  197.              o The fk_DeInitFossil should be the very LAST line your program
  198.                  will run -- this will take care of releasing the fossil
  199.                  driver and exiting your program.
  200.  
  201.              Program Example1_3;
  202.              USES FKFOSSIL;
  203.  
  204.              BEGIN
  205.              if Paramstr(1) = '/?' then BEGIN
  206.                                         ...
  207.                                         END;
  208.              fk_InitFossil(1,2400,19200,'Tim Strike','Riim',600,1);
  209.              if fk_Host.Error = 2 then
  210.                 BEGIN
  211.                 Writeln('Unable to open Fossil Driver.');
  212.                 Halt(1);
  213.                 END;
  214.              ...
  215.              fk_DeInitFossil;
  216.              END. { main }
  217.  
  218.  
  219.                                    _______
  220.  
  221.                                    SAMPLES
  222.                                    _______
  223.  
  224.              To allow you to get a full idea of the operation of the FKFOSSIL
  225.         routines, a sample program demonstrating every aspect of the routines
  226.         has been enclosed in the SAMPLES.ZIP file in the archive.  Full
  227.         source to the samples have also been provided.
  228.  
  229.  
  230.                                _______________
  231.  
  232.                                EMULATION MODES
  233.                                _______________
  234.  
  235.              FKFOSSIL supports several different types of emulations modes,
  236.         all internally.  These emulation modes and brief descriptions are
  237.         listed below.  Before setting a users screen mode to one of these
  238.         emulations, first make sure that the user can handle it.  TTY is the
  239.         most common, and most (if not all) users should be able to handle
  240.         this mode.
  241.  
  242.              TTY is just straight ascii -- in this mode, all characters will
  243.         be sent to the remote side, but no colours will be sent even if the
  244.         colour routines are called.  Also in TTY mode the functions such as
  245.         cursor placement, clreol, etc will be disabled (and return an error
  246.         in FK_HOST.ERROR if there are problems).  The only special function
  247.         in TTY mode is that of CHR(12), which clears the screen.
  248.  
  249.              ANSI is another emulation standard supported in FKFOSSIL.  ANSI
  250.         starts off with ESC[ and is followed by a few characters of
  251.         information, and finally, a character code indicating the function to
  252.         perform.  ANSI has the ability to set foreground and background
  253.         colours, move the cursor up/down/left/right or to specific locations,
  254.         clear the line, clear the screen, and the list goes on.  All the ANSI
  255.         routines in FKFOSSIL have been optimized to send the fewest codes to
  256.         the modem.  If you set the colour to 15/0 and the colour is already
  257.         15/0, the codes won't be sent.  Unlike many other programming units,
  258.         ANSI is _built_ into this unit.  That means ansi displayed with the
  259.         functions FK_DISPLAY[file] or FK_WRITELN_ANSI will be processed
  260.         internally.  The internal ANSI has everything that most other drivers
  261.         support except the keyboard remapping, and the screen modes -- both
  262.         of which are unnecessary in the communications world.  Since the
  263.         routines are internal, the chance of someone using ANSI "bombs" or
  264.         "trojans" with FKFOSSIL is impossible.  This also means that an
  265.         ANSI.SYS (or compatible driver) need not be loaded into memory.
  266.  
  267.              Avatar is a third emulation which is gaining popular acceptance
  268.         in many programs.  Avatar is like ANSI -- except that the codes are
  269.         smaller and more compact, while providing the same level of control.
  270.         The Avatar drivers are built into FKFOSSIL, and as a result no
  271.         external .SYS driver is necessary.  The avatar mode in FKFOSSIL is
  272.         fully compatible with the AVT/0 standard.  The AVT/0+ and AVT/1
  273.         standards have not been added to this version but will receive
  274.         treatment in following versions.  This is likely not a problem since
  275.         the AVT/1 series adds windows and scrolling among other things, items
  276.         which are not usually standard (and that some terminal programs don't
  277.         even accept).
  278.  
  279.              There are probably many other terminal modes that I have avoided
  280.         adding to this release.  If people send me specs on those emulations
  281.         I'll consider adding them to later releases of FKFOSSIL.
  282.  
  283.  
  284.                                _______________
  285.  
  286.                                DOOR DROP FILES
  287.                                _______________
  288.  
  289.              One of the powerful features of FKFOSSIL is the ability to read
  290.         and write door drop files.  The files currently supported are
  291.         DORINFO1.DEF and DOOR.SYS.
  292.  
  293.              If you wish to load the user information from the door drop
  294.         files, you will need to call one of two commands.  Your door should
  295.         know WHICH doorfile it's going to read; if you want the ability to
  296.         read both, you'd best have a configuration or command line switch to
  297.         distinguish between the two.  The information should be loaded BEFORE
  298.         you start communications -- this is sort of obvious, because you need
  299.         the information from those files to start communications. ;)
  300.  
  301.              FK_READDOORSYS will read the DOOR.SYS file, and FK_READDORINFO
  302.         will read the DORINFO1.DEF file.  Both are easy to use, and both
  303.         provide different information.
  304.  
  305.              For the DOOR.SYS file, call the command fk_ReadDOORSYS(dir)
  306.         where dir is the directory that the DOOR.SYS file is to be found in.
  307.         If you want the current directory, put '' as the value of dir.
  308.  
  309.              For the DORINFO1.DEF file, call the command fk_ReadDORINFO(dir)
  310.         where dir is the directory that the DORINFO1.DEF file is to be found.
  311.  
  312.              REMEMBER TO CALL THE DOOR INFO FILE READING _BEFORE_ YOU CALL
  313.         THE INITIALIZE COMMUNICATIONS COMMAND.
  314.  
  315.              To make things easier on you, you do not need to call the
  316.         FK_INITFOSSIL command.  Instead, call FK_INITFOSSIL_DF which only
  317.         requires 1 parameter instead of the 7 that the FK_INITFOSSIL
  318.         requires.  Please note that the FK_INITFOSSIL_DF should _only_ be run
  319.         if the doorfile read was done, and is successful.
  320.  
  321.             Program Example4_1;
  322.             fk_ReadDORINFO('');
  323.             if fk_Host.Error <> 9 then
  324.                BEGIN
  325.                fk_Initfossil_DF(25);
  326.                {...}
  327.                fk_DeInitfossil;
  328.                END;
  329.  
  330.              By checking the fk_Host.Error parameter, which handles errors in
  331.         the FKFOSSIL functions, you can determine whether the doorfile was
  332.         found and read okay.
  333.  
  334.              Writing door files is another matter; it requires that you have
  335.         loaded the correct information into the fk_Client variables so that
  336.         when the door drop files are written, they are complete.  If you read
  337.         in one door file, and write another -- the information may not be
  338.         entirely complete, but it will allow another program to pickup on
  339.         some of the necessary information.
  340.  
  341.              THe procedures for writing door files are fk_WriteDOORSYS(dir)
  342.         where "dir" is the path where the DOOR.SYS file is to be written, and
  343.         fk_WriteDORINFO(dir) where "dir" is path to write DORINFO1.DEF to.
  344.         The node fields in each of the files is controlled with the
  345.         fk_Host.Node variable -- so if you are on node two, make sure to set
  346.         fk_Host.Node to 2, so that if you choose to write a door file, the
  347.         internal changes are made to the data files (notably DOOR.SYS).
  348.  
  349.  
  350.                                  ____________
  351.  
  352.                                  FILE SHARING
  353.                                  ____________
  354.  
  355.              File sharing is sometimes required by door programs that load in
  356.         multinode environments.  This has been made a little easier by
  357.         FKFOSSIL, in the sense that it automatically detects upon loadup the
  358.         existance of SHARE.EXE.  You can use the variable FK_TASK.SHARE to
  359.         determine whether to set FILEMODE to share files or not.
  360.  
  361.              Please note that you should not set the FILEMODE variable if
  362.         SHARE.EXE is not loaded.  If you do, your program will only work in a
  363.         shared environment, and if it runs in an environment where SHARE.EXE
  364.         is not loaded, will give run-time errors.  This is why you must check
  365.         the FK_TASK.SHARE boolean variable before playing with the FILEMODE
  366.         variable.
  367.  
  368.              So if you check FK_TASK.SHARE and find it's true, you can then
  369.         set the FILEMODE variable to the value that you want.  These values
  370.         are listed in the table below:
  371.  
  372.                                           SHARING METHOD
  373.         ACCESS         Compat.  Deny All  Deny Write  Deny Read  Deny None
  374.         ------------------------------------------------------------------
  375.         Read Only         0        16         32          48         64
  376.         Write Only        1        17         33          49         65
  377.         Read/Write        2        18         34          50         66
  378.         ------------------------------------------------------------------
  379.  
  380.  
  381.              EXAMPLE 5_1;
  382.              VAR f:file;
  383.  
  384.              BEGIN
  385.              { Open in Read/Write mode, Deny Write }
  386.              Assign(f,'EXAMPLE.DAT');
  387.              if fk_task.Share then Filemode := 34;
  388.              Reset(f);
  389.              ...
  390.              Close(f);
  391.              END.
  392.  
  393.              Just be careful with what you do and how you set this up.  This
  394.         is just a brief summary to help you get started.  I suggest that if
  395.         you want to write multinode compatible programs that you also look
  396.         into record locking.
  397.  
  398.                            ________________________
  399.  
  400.                            PROCEDURES AND FUNCTIONS
  401.                            ________________________
  402.  
  403.              The following guide is a quick reference chart to all procedures
  404.         and functions that FKFOSSIL provides.  There are several modifier
  405.         variables that affect the operation of these subroutines, and are
  406.         listed in the section "VARIABLES AND CONSTANTS" in the main
  407.         FKFOSSIL.DOC file.
  408.  
  409.  
  410.         FK_ANSIMUSIC
  411.         ---------------------------------------------------------------------
  412.         Procedure fk_AnsiMusic( s : string );
  413.  
  414.         fk_AnsiMusic will play the music string locally and then send it
  415.         to the remote side. NOTE; Ansi Music is not an ANSI standard -- it
  416.         only uses the term ansi because the string starts with the escape
  417.         sequence #27[.  Not all terminal programs will support Ansi Music
  418.         if they support Ansi - check with user before sending anything
  419.         with fk_AnsiMusic.
  420.  
  421.         The format of the music string "s" is like any BASIC PLAY statement,
  422.         with a few minor exceptions.  The commands are noted below;
  423.  
  424.             A..G    Play musical note
  425.                        If followed by a number, that will be the note length
  426.                           (ignoring the preset length) -- ie, A4 will play "A"
  427.                           as a quarter note
  428.                        If followed by a # or + the note will be played sharp.
  429.                        If followed by a - the note will be played flat.
  430.                        If followed by any number of . (periods), the note
  431.                           length will be multiplied by 3/2 for each period
  432.                           (making the note last a little longer).
  433.             L n     Set the length of the note to n (1..64)
  434.             MN      Music Normal -- each note plays 7/8 length
  435.             ML      Music legato -- each note plays full length
  436.             MS      Music Staccato -- each note plays 3/4 length
  437.             O n     Set the octave number to n (0..6)
  438.             P       Pause (rest)
  439.                        If followed by a number, the pause will ignore the
  440.                           preset length and use the number as the length.
  441.             T n     Set the tempo of the music to n (32..255)
  442.             >       Increase octave one step
  443.             <       Decrease octave one step
  444.  
  445.  
  446.         FK_BS
  447.         ---------------------------------------------------------------------
  448.         Procedure fk_BS( n : integer );
  449.  
  450.         fk_BS will send backspace characters "n" times to effectively back the
  451.         cursor up over already typed information.  The cursor however will
  452.         not backup past column 1 on any given line.
  453.  
  454.  
  455.         FK_CLOCK
  456.         ---------------------------------------------------------------------
  457.         Procedure fk_Clock( b : boolean );
  458.  
  459.         fk_Clock will turn off/on the timer clock.  If B is set to false,
  460.         the timer will be turned off.  If B is set to true, the timer will
  461.         be turned back on again.
  462.  
  463.  
  464.         FK_CLREOL
  465.         ---------------------------------------------------------------------
  466.         Procedure fk_ClrEol;
  467.  
  468.         fk_ClrEol will clear to the end of the line in ANSI or Avatar mode.
  469.         If the user is in TTY mode, fk_ClrEol will do nothing.
  470.  
  471.  
  472.         FK_CLRSCR
  473.         ---------------------------------------------------------------------
  474.         Procedure fk_ClrScr;
  475.  
  476.         fk_ClrScr will clear the screen (local and remote) in any emulation
  477.         mode.  For ASCII/Avatar, CHR(12) is sent, and in ANSI mode #27[2J is
  478.         sent.
  479.  
  480.  
  481.         FK_DEINITFOSSIL
  482.         ---------------------------------------------------------------------
  483.         Procedure fk_DeInitFossil;
  484.  
  485.         fk_DeInitFossil will release the fossil driver (if running remotely)
  486.         and remove the status line if active, and then exit the program.
  487.  
  488.         NOTE; this should be the LAST line in your source code.  All files,
  489.         and any clean up routines should be called before this procedure is
  490.         run (or see the section "DEFINABLE FUNCTIONS").
  491.  
  492.  
  493.         FK_DETECTANSI
  494.         ---------------------------------------------------------------------
  495.         Function fk_DetectAnsi : Boolean;
  496.  
  497.         fk_DetectAnsi sends out the cursor placement query to the user, and
  498.         checks for any response.  If a response comes, then ANSI is present
  499.         and fk_DetectAnsi returns TRUE, otherwise if no response if
  500.         forthcoming and the timer reaches 0, fk_DetectAnsi returns FALSE.
  501.  
  502.         This function does not set the users screen type.  If you want it to,
  503.         you will need to do it yourself -- the procedure is only provided to
  504.         allow you to check for Ansi.
  505.  
  506.  
  507.         FK_DETECTAVATAR
  508.         ---------------------------------------------------------------------
  509.         Function fk_DetectAvatar : boolean;
  510.  
  511.         fk_DetectAvatar sends out the ANSI cursor placement query, and 
  512.         stores the X screen co-ordinates.  If no response comes and the 
  513.         timer reaches 0, fk_DetectAvatar returns FALSE.  If the response 
  514.         does come, an avatar repetition sequence is sent to the modem, and 
  515.         the cursor placement query is sent again.  If the X co-ordinates 
  516.         move by more then 5 characters, fk_DetectAvatar returns TRUE, 
  517.         otherwise it returns FALSE (because the other terminal did not 
  518.         process the avatar sequence correctly).
  519.  
  520.         This function does not set the users screen type.  If you want it to,
  521.         you will need to do it yourself -- the procedure is only provided to
  522.         allow you to check for Avatar.
  523.  
  524.  
  525.         FK_DISPLAY
  526.         ---------------------------------------------------------------------
  527.         Procedure fk_Display( s : string );
  528.  
  529.         fk_Display will send a file "s" to the local and remote screens.  The
  530.         "s" variable should be a full path, filename and extension to a valid
  531.         file.  If the user is in ANSI mode, ansi codes will be accepted.  If
  532.         the user is in Avatar mode, Avatar codes will be accepted.  If the
  533.         user is in TTY mode, straight text is expected.
  534.  
  535.         The better alternative to this procedure is FK_DISPLAYFILE; the
  536.         alternate procedure requires no extension and automatically selects
  537.         the most appropriate file (and if it doesn't exist, a fallback is
  538.         chosen).  If you need to access files with odd extensions, then this
  539.         procedure will prove useful.
  540.  
  541.  
  542.         FK_DISPLAYFILE
  543.         ---------------------------------------------------------------------
  544.         Procedure fk_Displayfile( s : string );
  545.  
  546.         fk_Displayfile will send a file "s" to the local and remote screens.
  547.         Any extension passed in "s" will automatically be stripped, and an
  548.         appropriate extension (based on the users screen setting) will be
  549.         selected.
  550.  
  551.                 TTY             ->  .ASC
  552.                 Ansi            ->  .ANS
  553.                 Avatar          ->  .AVT
  554.  
  555.         If in Avatar/Ansi mode the file isn't found with .ANS or .AVT
  556.         extensions, the fallback will be to .ASC extensions.  So if any file
  557.         needs to exist, it should always be the .ASC file as it will always
  558.         be the fallback file if none of the others are found.
  559.  
  560.  
  561.         FK_FLUSHINPUTBUFFER
  562.         ---------------------------------------------------------------------
  563.         Procedure fk_FlushInputBuffer;
  564.  
  565.         fk_FlushInputBuffer will clear the inbound keyboard buffers and
  566.         fossil buffers so that no keystrokes are left pending.  It's a good
  567.         idea to call this before any important queries.
  568.  
  569.  
  570.         FK_FLUSHOUTPUTBUFFER
  571.         ---------------------------------------------------------------------
  572.         Procedure fk_FlushOutputBuffer;
  573.  
  574.         fk_FlushOutputBuffer will clear the outbound modem buffer if there is
  575.         anything still in the buffer.  It is a good idea to call this before
  576.         hanging up or dropping the DTR, etc...
  577.  
  578.  
  579.         FK_GOTOXY
  580.         ---------------------------------------------------------------------
  581.         Procedure fk_GotoXY( X,Y : Byte );
  582.  
  583.         fk_GotoXY will position the cursor at the (X,Y) coordinates on the
  584.         screen.  This function will only work with ANSI or Avatar modes
  585.         selected.
  586.  
  587.  
  588.         FK_INITFOSSIL
  589.         ---------------------------------------------------------------------
  590.         Procedure fk_InitFossil( Port,
  591.                                  BPSrate,
  592.                                  Lockedrate    : Longint;
  593.                                  Name,
  594.                                  Handle        : String;
  595.                                  Timeleft      : Longint;
  596.                                  Screentype,
  597.                                  StatuslinePos : Byte );
  598.  
  599.         fk_InitFossil should be called BEFORE any other FKFOSSIL modem
  600.         related routines are called.  This will initialize the fossil driver
  601.         and setup the minimal variables that FKFOSSIL requires to run (such
  602.         as user timeleft, screen mode, etc...).
  603.  
  604.         Setting the BPSrate to 0 will cause FKFOSSIL to assume a local
  605.         orientation.
  606.  
  607.         Setting the StatuslinePos to 0 will cause the statusline to not be
  608.         shown until it is set to something other then 0.
  609.  
  610.  
  611.         FK_INITFOSSIL_DF
  612.         ---------------------------------------------------------------------
  613.         fk_InitFossil_DF( StatuslinePos : Byte);
  614.  
  615.         fk_InitFossil_DF is an alternative to fk_InitFossil when you are
  616.         using the DOOR DROP FILES.  Since the DOOR DROP FILE routines
  617.         automatically read the information into the necessary variables, it
  618.         is not required to set them again via fk_InitFossil.
  619.  
  620.  
  621.         FK_IDLETICK
  622.         ---------------------------------------------------------------------
  623.         Procedure fk_Idletick;
  624.  
  625.         fk_Idletick gives up timeslices to various multitasking programs --
  626.         OS/2, DESQview, DOS and Windows are all supported.  This procedure is
  627.         automatically called when an FKFOSSIL routine is polling the
  628.         keyboard, but just in case you need it for something, here it is.
  629.  
  630.  
  631.         FK_KEYPRESSED
  632.         ---------------------------------------------------------------------
  633.         Function fk_Keypressed : Boolean;
  634.  
  635.         fk_Keypressed returns TRUE if there are keys in the keyboard buffer
  636.         or fossil buffer that are waiting to be read.
  637.  
  638.  
  639.         FK_LOCALBUFFER
  640.         ---------------------------------------------------------------------
  641.         Procedure fk_LocalBuffer( s : string );
  642.  
  643.         fk_LocalBuffer will add the string of characters "s" to the inbound 
  644.         local keyboard buffer.  This can be used to add characters as if 
  645.         the local keyboard actually typed in those keys.  (For remote
  646.         buffer, see FK_REMOTEBUFFER)
  647.  
  648.  
  649.         FK_LOCALBUFFERCLEAR
  650.         ---------------------------------------------------------------------
  651.         Procedure fk_LocalBufferClear;
  652.  
  653.         fk_LocalBufferClear will empty the buffer of stored characters.  
  654.         This function does not empty the systems keyboard buffer.  
  655.         fk_FlushInputBuffer will also empty the stored buffer.
  656.  
  657.  
  658.         FK_MOVECURSOR
  659.         ---------------------------------------------------------------------
  660.         Procedure fk_MoveCursor( n : byte;
  661.                                  dir : char );
  662.  
  663.         fk_MoveCursor will move the cursor n times in the direction of "dir".
  664.         Dir should be any of the following;
  665.  
  666.                        U    Up              L    Left
  667.                        D    Down            R    Right
  668.  
  669.         This function will only work in ANSI or Avatar modes.
  670.  
  671.  
  672.         FK_NOWAITREAD
  673.         ---------------------------------------------------------------------
  674.         function fk_NoWaitRead : Char;
  675.  
  676.         fk_NoWaitRead will poll the keyboard if there are any characters
  677.         waiting.  If characters are found in the local or remote buffers,
  678.         then the character will be returned by fk_NoWaitRead.
  679.  
  680.  
  681.         FK_READ
  682.         ---------------------------------------------------------------------
  683.         Function fk_Read : Char;
  684.  
  685.         fk_Read will poll the keyboard for any waiting characters.  If none
  686.         are found, fk_Read will wait until there are some (or the last
  687.         keypress timer runs out).  When a character is found, it will be
  688.         returned by fk_Read.
  689.  
  690.  
  691.         FK_READLN
  692.         ---------------------------------------------------------------------
  693.         Function fk_Readln( n : byte;
  694.                             up : boolean ):String;
  695.  
  696.         fk_Readln will read in a string of n characters long (max).  If UP
  697.         then the string will be returned in uppercase.  fk_Readln will end
  698.         when the user presses CR or runs out of time.  To control the input
  699.         of strings, see the VARIABLES AND CONSTANTS section.
  700.  
  701.  
  702.         FK_REMOTEBUFFER
  703.         ---------------------------------------------------------------------
  704.         Procedure fk_RemoteBuffer( s : string );
  705.  
  706.         fk_RemoteBuffer will add the string of characters "s" to the 
  707.         inbound user keyboard buffer.  This can be used to add characters 
  708.         as if the user actually typed in those keys.  (For local buffer, see 
  709.         FK_LOCALBUFFER)
  710.  
  711.  
  712.         FK_REMOTEBUFFERCLEAR
  713.         ---------------------------------------------------------------------
  714.         Procedure fk_RemoteBufferClear;
  715.  
  716.         fk_RemoteBufferClear will empty the buffer of stored characters.  
  717.         This function does not empty to fossil buffer.  fk_FlushInputBuffer
  718.         will also empty the stored buffer.
  719.  
  720.  
  721.         FK_REMOTEKEYPRESSED
  722.         ---------------------------------------------------------------------
  723.         Function fk_RemoteKeypressed : boolean;
  724.  
  725.         fk_RemoteKeypressed will return TRUE if there are characters waiting
  726.         in the inbound remote buffer, and FALSE if there are no characters
  727.         waiting.  This only works for the REMOTE keyboard, like the Turbo
  728.         Pascal function KEYPRESSED works for the local keyboard.  To combine
  729.         the two tests (to see if there are any waiting characters anywhere),
  730.         see FK_KEYPRESSED.
  731.  
  732.  
  733.         FK_REMOTEWRITE
  734.         ---------------------------------------------------------------------
  735.         Procedure fk_RemoteWrite( s : string );
  736.  
  737.         fk_RemoteWrite will send the string "s" to the comport.  If it is a
  738.         local connection, this routine will do nothing.  If the remote screen
  739.         has been turned off (see FK_HOST.REMOTESCREEN variable) then the
  740.         output won't go to the remote side either.
  741.  
  742.  
  743.         FK_REMOTEWRITELN
  744.         ---------------------------------------------------------------------
  745.         Procedure fk_RemoteWriteln( s : string;
  746.                                     n : integer );
  747.  
  748.         fk_RemoteWriteln operates exactly like fk_RemoteWrite except will it
  749.         follow by outputting "n" occurrences of CR/LF (next line).  If "n" is
  750.         0, then there will be no CR/LF's appended, and fk_RemoteWriteln will
  751.         operate like exactly fk_RemoteWrite.  ie fk_RemoteWriteln('Tim',0) is
  752.         the same as fk_RemoteWrite('Tim');
  753.  
  754.  
  755.         FK_TEXTBACKGROUND
  756.         ---------------------------------------------------------------------
  757.         Procedure fk_TextBackground( n : byte );
  758.  
  759.         fk_TextBackground will change the background colour attribute, and
  760.         retain the last foreground attribute.
  761.  
  762.  
  763.         FK_TEXTCOLOR / FK_TEXTCOLOUR
  764.         ---------------------------------------------------------------------
  765.         Procedure fk_TextColour( n : byte );
  766.  
  767.         fk_TextColour will set the remote screen attribute and local screen
  768.         attributes.  The n byte is a combined foreground/background/blink
  769.         number which will be used to set all the colour attributes at once
  770.         and operates like the TextAttr:= variable in Turbo Pascal.
  771.  
  772.         To get the combined number, say for yellow (14) on red (4) do
  773.         something like fk_TextColour(14+(4*16));  For each background number,
  774.         the actual n byte will increase by 16.  To add a blink to the yellow
  775.         on red, 128 will be added to the value of n
  776.         fk_TextColour(14+(4*16)+128);
  777.  
  778.         If you are familiar with the TextAttr variable in Turbo Pascal this
  779.         will be an easy to follow function.  If however you wish to set the
  780.         foreground and background attributes separately there are the
  781.         FK_TEXTFOREGROUND and FK_TEXTBACKGROUND functions to use.
  782.  
  783.         ANSI and Avatar codes will be sent when the user has either of the
  784.         respective screen emulations.  If the user is in TTY mode, the colour
  785.         will not change.  The local screen colour will be changed if the user
  786.         is in ANSI or Avatar mode, and in TTY mode if strict colour is off
  787.         (see VARIABLES AND CONSTANTS section).
  788.  
  789.  
  790.         FK_TEXTFOREGROUND
  791.         ---------------------------------------------------------------------
  792.         Procedure fk_TextForeground( n : byte );
  793.  
  794.         fk_TextForeground will change the foreground attribute only, leaving
  795.         the background attribute as is.  If you wish the foreground to blink,
  796.         add 128 to the n byte.
  797.  
  798.  
  799.         FK_TIMELEFT
  800.         ---------------------------------------------------------------------
  801.         Function fk_Timeleft : String;
  802.  
  803.         fk_Timeleft will return the users timeleft in the string variable in
  804.         the format of [-]HH:MM:SS.  The string will be padded with 0's in
  805.         empty spaces, so it will always have a length of 8 characters (unless
  806.         the user has negative time left when the length will be 9).
  807.  
  808.  
  809.         FK_TOGGLEDTR
  810.         ---------------------------------------------------------------------
  811.         Procedure fk_ToggleDTR( Up : Boolean );
  812.  
  813.         fk_ToggleDTR will raise or lower the DTR of the modem.  If UP is TRUE
  814.         then the DTR will be raised, if UP is FALSE the DTR will be lowered.
  815.         Lowering the DTR while there is a carrier will cause the modem to
  816.         hangup on the user (if the modem has been setup to do so).  This is
  817.         the fastest method of logging off a user.  If you drop the DTR for a
  818.         second or two, and then raise it again, the user should be off.
  819.  
  820.  
  821.         FK_WRITE
  822.         ---------------------------------------------------------------------
  823.         Procedure fk_Write( s : string );
  824.  
  825.         fk_Write will send the string "s" to the comport and the local
  826.         screen.  There are several modifier variables that can be used to
  827.         change the output of this procedure; see FK_HOST.REMOTESCREEN and
  828.         FK_HOST.HOSTSCREEN in the variables section for more information.
  829.  
  830.  
  831.         FK_WRITELN
  832.         ---------------------------------------------------------------------
  833.         Procedure fk_Writeln( s : string;
  834.                               n : integer );
  835.  
  836.         fk_Writeln operates exactly like fk_Write except will it follow by
  837.         outputting "n" occurrences of CR/LF (next line).  If "n" is 0, then
  838.         there will be no CR/LF's appended, and fk_Writeln will operate like
  839.         exactly fk_Write.
  840.  
  841.  
  842.         FK_WRITELN_ANSI
  843.         ---------------------------------------------------------------------
  844.         Procedure fk_Writeln_Ansi( s : string;
  845.                                    n : integer );
  846.  
  847.         fk_Writeln_Ansi operates exactly like fk_Writeln except that the
  848.         string "s" can contain ansi sequences.  FKFOSSIL uses it's own built
  849.         in ANSI interpreter to handle the sequences -- this disables most of
  850.         the redundant and dangerous sequences such as Keyboard remapping,
  851.         etc.  If the string is going to have ANSI sequences in it, use this
  852.         procedure.
  853.  
  854.  
  855.         FK_WRITELN_AVATAR
  856.         ---------------------------------------------------------------------
  857.         Procedure fk_Writeln_Avatar( s : string;
  858.                                      n : integer );
  859.  
  860.         fk_Writeln_Avatar operates exactly like fk_Writeln except that the
  861.         string "s" can contain Avatar/0 sequences.  FKFOSSIL uses it's own
  862.         built in avatar interpreter to handle the sequences.
  863.  
  864.  
  865.                            _______________________
  866.  
  867.                            VARIABLES AND CONSTANTS
  868.                            _______________________
  869.  
  870.              The following guide is a quick reference chart to all variables
  871.         and constants the FKFOSSIL provides.
  872.  
  873.         CONSTANTS
  874.         --------------------------------------------------------------------
  875.         fk_StandardInput = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV'
  876.                           +'WXYZ1234567890~!@#$%^&*()-+\[]{};:`''".,/<> =_?|'
  877.         fk_highBitInput  = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV'
  878.                           +'WXYZ1234567890~!@#$%^&*()-+\[]{};:`''".,/<> =_?|'
  879.                           +'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«'
  880.                           +'»░▒▓│┤╡╢║╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐'
  881.                           +'▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■';
  882.         fk_FilenameInput = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV'
  883.                           +'WXYZ1234567890~!@#$%^&()-_{}.';
  884.         fk_FilespecInput = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV'
  885.                           +'WXYZ1234567890~!@#$%^&()-_{}.?*';
  886.         fk_FilepathInput = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV'
  887.                           +'WXYZ1234567890~!@#$%^&()-_{}.?*:\';
  888.         fk_NumberInput   = '123456790.-+';
  889.  
  890.         The "input" constants can be used to defined the input that is
  891.         allowed by the fk_Readln function.  There are probably other users
  892.         for these constants, but the primary purpose was for the input
  893.         definition.  See the variable FK_HOST.VALIDINPUT.
  894.         
  895.         fk_DriverVersion = '1.02';
  896.         fk_DriverName    = 'Forbidden Knights Fossil/Door Driver Unit';
  897.         fk_DriverAuthor  = 'Tim Strike';
  898.         On               = True;
  899.         Off              = False;
  900.  
  901.         All define other constants that can be used.  If you want to include
  902.         a notice of the routines that are being used but don't wish to change
  903.         the information for changes in FKFOSSIL versions, the info constants
  904.         fk_DriverVersion, fk_DriverName and fk_DriverAuthor might help you
  905.         out.
  906.  
  907.         For any BOOLEAN function, the ON and OFF constants have been defined.
  908.         For instance, if you want the boolean variable BOB to be true, you
  909.         could use BOB:=TRUE or BOB:=ON.  This is just for simplicity sake, it
  910.         really holds no advantage.
  911.  
  912.  
  913.         FOSSIL INFORMATION
  914.         ---------------------------------------------------------------------
  915.         The Fossil Information Variables contain information on the fossil
  916.         driver version and the connection information.  Do *NOT* set any of
  917.         these variables yourself unless you know what you are doing.
  918.  
  919.         fk_Fossil.Started      Boolean  True if fk_InitFossil has been
  920.                                         called. If false, the other fossil
  921.                                         dependant routines will not run.
  922.  
  923.         fk_Fossil.Port         Longint  Current port
  924.         fk_Fossil.Baud         Longint  Current connection BPS rate
  925.         fk_Fossil.Locked       Longint  Current locked BPS rate
  926.         fk_Fossil.Carrier      Boolean  True if there is a modem carrier
  927.  
  928.         fk_Fossil.Driver       Str(80)  Fossil Driver Name
  929.         fk_Fossil.Version      Byte     Fossil Driver Major Version No.
  930.         fk_Fossil.Revision     Byte     Fossil Driver Minor Revision No.
  931.  
  932.  
  933.         PROGRAM INFORMATION
  934.         ---------------------------------------------------------------------
  935.         The Program information variables contain information about your
  936.         program.  This information is displayed if the title line is in use.
  937.         These variables need not be set if you are not using the title line.
  938.  
  939.         fk_ProgramInfo.Title   Str(25)  Your Program Title
  940.         fk_ProgramInfo.Version Str(8)   Program Version
  941.         fk_ProgramInfo.Author  Str(20)  Author Information
  942.         fk_ProgramInfo.Other   Str(20)  Other Information
  943.  
  944.  
  945.         TASK INFORMATION
  946.         ---------------------------------------------------------------------
  947.         The Task Information variables contain all the information on the
  948.         current task type.  These variables are automatically tested for when
  949.         your program is run, and should *NOT* be changed at all.
  950.  
  951.         fk_Task.System         Str(15)  Contains name and version of OS;
  952.                                         Supports DOS, Windows, DESQview and
  953.                                         OS/2.  All OS's compatible with DOS
  954.                                         will be listed as "DOS".
  955.  
  956.         fk_Task.Tasktype       Byte     Contains the task type;  0  DOS
  957.                                                                  1  DESQview
  958.                                                                  2  OS/2
  959.                                                                  3  Windows
  960.  
  961.         fk_Task.Window         Integer  Active window number (DESQview Only)
  962.         fk_Task.Share          Boolean  If SHARE is active (use for file
  963.                                         sharing test -- see the section on
  964.                                         FILE SHARING)
  965.  
  966.  
  967.         CLIENT INFORMATION
  968.         ---------------------------------------------------------------------
  969.         The Client Information variables hold information on the user who is
  970.         currently online.  Some of the variables require settings -- however
  971.         if you are not using the door drop file routines to read in the user
  972.         information, not all of the variables will be available.
  973.  
  974.         DS   indicates this variable can be retrieved via DOOR.SYS.
  975.         DI   indicates this variable can be retrieved via DORINFO#.DEF.
  976.         MI   indicates this is required information and is set through the
  977.              fk_InitFossil routine if the doorfiles aren't read.
  978.  
  979.         fk_Client.BBSName      Str(35)  BBS System Name             DI
  980.         fk_Client.Calls        Longint  # of Calls                  DS
  981.         fk_Client.Citystate    Str(30)  User's City/State           DS,DI
  982.         fk_Client.Downloads    Longint  # of Downloads              DS
  983.         fk_Client.Firstdate    Str(8)   First Calling Date
  984.         fk_Client.Handle       Str(35)  User's Handle               MI,DS,DI
  985.         fk_Client.HomePhone    Str(15)  Home/Voice Phone Number     DS
  986.         fk_Client.Lastdate     Str(8)   Last Calling Date           DS
  987.         fk_Client.Lasttime     Str(5)   Last Calling Time
  988.         fk_Client.Name         Str(35)  User's Real Name            MI,DS,DI
  989.         fk_Client.Pagelength   Byte     Pagelength                  DS
  990.         fk_Client.Password     Str(30)  User's Password             DS
  991.         fk_Client.RecordPos    Longint  Record Position (file)      DS
  992.         fk_Client.Screentype   Byte     Screen Mode;  0  TTY        MI,DS,DI
  993.                                                       1  ANSI
  994.                                                       2  AVATAR
  995.         fk_Client.Security     Longint  Security Level              DS,DI
  996.         fk_Client.SysOpName    Str(35)  BBS SysOp Name              DI
  997.         fk_Client.Timeleft     Longint  Time Remaining (seconds)    MI,DS,DI
  998.         fk_Client.Uploads      Longint  # of Uploads                DS
  999.         fk_Client.WorkPhone    Str(15)  Work/Data Phone             DS
  1000.  
  1001.         If the information isn't gathered, default (empty/nul) values will be
  1002.         given for each of the fields.
  1003.  
  1004.  
  1005.         MUSIC INFORMATION
  1006.         ---------------------------------------------------------------------
  1007.         The Music Information variables contain the information that is used
  1008.         by the ANSI Music function; such as default Octave, Tempo, etc.
  1009.  
  1010.         fk_Music.Musictype     Byte     Current Music Type;  6  Staccato
  1011.                                                              7  Normal
  1012.                                                              8  Legato
  1013.  
  1014.         fk_Music.Notelength    Byte     Note Length (default  = 4, Quarter)
  1015.         fk_Music.Octave        Byte     Current Octave (default = 4)
  1016.         fk_Music.Tempo         Byte     Current Tempo (default = 120)
  1017.  
  1018.  
  1019.         HOST INFORMATION
  1020.         ---------------------------------------------------------------------
  1021.         The Host Information variables contain all the toggles, switches etc
  1022.         that can be configured by you for your program.  The defaults for
  1023.         most general purposes will not need to be changed.
  1024.  
  1025.         fk_Host.AnsiTimer      Word     Countdown for Ansi Detection.  If
  1026.                                         this count down reaches 0 before the
  1027.                                         codes are received, the fk_AnsiDetect
  1028.                                         routine will return false.
  1029.                                         (default = 2500)
  1030.  
  1031.         fk_Host.Blink          Boolean  Blinking Attribute.  Used by the
  1032.                                         colour routines; it is not suggested
  1033.                                         that you reset the value of this
  1034.                                         variable.
  1035.  
  1036.  
  1037.         fk_Host.Clock          Boolean  Decrease Time and Increase Lastkey.
  1038.                                         If FALSE, then time will not be
  1039.                                         counted (could be used for intensive
  1040.                                         procedures -- or during chat or
  1041.                                         something similar).  It is a lot
  1042.                                         better to use fk_Clock to turn the
  1043.                                         time on and off, since the fk_Clock
  1044.                                         routine will take care of all the
  1045.                                         variables that fk_Host.Clock affects.
  1046.                                         (default = TRUE)
  1047.  
  1048.         fk_Host.CurrentInput   Str(80)  The default output for fk_Readln.
  1049.                                         Sets up the string for fk_Readln with
  1050.                                         this value -- this value is NOT
  1051.                                         written to the screen (you should do
  1052.                                         this) but will be used as if the user
  1053.                                         had already typed this in.
  1054.  
  1055.         fk_Host.Error          Byte     Contains information on the last
  1056.                                         run procedure;
  1057.  
  1058.                                         0   No Errors
  1059.                                         1   Fossil Driver Not Initialized
  1060.                                         2   Error Initializing Fossil Driver
  1061.                                         9   File Not Found
  1062.                                         10  Function Not Compatible with
  1063.                                                Users Screen Mode
  1064.                                         11  Invalid Call to Function
  1065.  
  1066.         fk_Host.ExitCode       Byte     Contains exit code that
  1067.                                         fk_DeInitFossil will exit with.  If
  1068.                                         your program encounters an error (and
  1069.                                         you wish to exit with a different
  1070.                                         errorlevel) set this variable and
  1071.                                         then call fk_DeInitFossil.
  1072.                                         (default = 0)
  1073.  
  1074.         fk_Host.High           Boolean  High-Bit (bright foreground).  Used
  1075.                                         by the colour routines; it is not
  1076.                                         suggested that you reset the value of
  1077.                                         this variable.
  1078.  
  1079.         fk_Host.HostScreen     Boolean  Send information to local screen -
  1080.                                         If FALSE, no information from any of
  1081.                                         the fk_Write[ln] functions will be
  1082.                                         sent to the local screen (although
  1083.                                         the status bar will still be active)
  1084.                                         (default = TRUE)
  1085.  
  1086.         fk_Host.Hostkey        Boolean  Get information from local keyboard -
  1087.                                         If FALSE, no keys pressed on the
  1088.                                         local side will be processed during
  1089.                                         any of the fk_Read[ln] functions.
  1090.                                         (default = TRUE)
  1091.  
  1092.         fk_Host.Inactivity     Word     Count down in seconds for user
  1093.                                         Inactivity.  If the user does not hit
  1094.                                         a key for this number of seconds,
  1095.                                         the program will automatically end.
  1096.                                         (default = 180 seconds, 3 minutes)
  1097.  
  1098.         fk_Host.Lastbg         Byte     Last background attribute
  1099.         fk_Host.Lastfg         Byte     Last foreground attribute
  1100.         fk_Host.Mono           Boolean  Monochrome Monitor (local)
  1101.  
  1102.                                         ** All three variables are used by
  1103.                                         the colour/write routines.  It is not
  1104.                                         suggested that they be changed and
  1105.                                         should be used for reference only
  1106.                                         (otherwise you create the risk of
  1107.                                         messing up your program).
  1108.  
  1109.         fk_Host.Multinode      Boolean  Stores whether the system is running
  1110.                                         in a multinode environment.  If TRUE,
  1111.                                         the value of fk_Host.Node will be
  1112.                                         displayed on the status line.
  1113.  
  1114.         fk_Host.Node           Byte     Stores the node number value.  This
  1115.                                         will be used when reading/writing door
  1116.                                         drop files, and also displayed on the
  1117.                                         status line if the fk_Host.Multinode
  1118.                                         is TRUE.
  1119.                                         (default = 1)
  1120.  
  1121.  
  1122.         fk_Host.OutputChar     Char     Send this character in the fk_Readln
  1123.                                         function.  Since the fk_Readln reads
  1124.                                         in characters and displays them, this
  1125.                                         function can be used to override the
  1126.                                         character returned.  If it's set to
  1127.                                         CHR(0) then whatever the user types
  1128.                                         will be returned.  However, if it's
  1129.                                         set to say, CHR(178) then the ▓
  1130.                                         character will be sent, regardless of
  1131.                                         what the user typed.  This is a good
  1132.                                         function for password input or other
  1133.                                         sensitive items.  ALWAYS MAKE SURE
  1134.                                         THAT YOU RESET THE VALUE TO CHR(0)!
  1135.  
  1136.         fk_Host.Outputlines    Word     The number of output lines sent to
  1137.                                         the user.  This is handy if you want
  1138.                                         to have screen pauses -- Just check
  1139.                                         this value, if it's greater then the
  1140.                                         screen length, pause for a key and
  1141.                                         reset this variable.  In some areas,
  1142.                                         after you clear a screen or any other
  1143.                                         sort of "pause", you may wish to
  1144.                                         reset the value.
  1145.  
  1146.         fk_Host.RemoteScreen   Boolean  Send information to remote screen -
  1147.                                         If FALSE, no information from any of
  1148.                                         the fk_Write[ln] functions will be
  1149.                                         sent to the remote screen (although
  1150.                                         the status bar will still be active)
  1151.                                         (default = TRUE)
  1152.  
  1153.         fk_Host.Remotekey      Boolean  Get information from remote buffer -
  1154.                                         If FALSE, no keys pressed on the
  1155.                                         remote side will be processed during
  1156.                                         any of the fk_Read[ln] functions.
  1157.                                         (default = TRUE)
  1158.  
  1159.         fk_Host.Sound          Boolean  Local Sound Toggle - if in Local mode
  1160.                                         the default is TRUE, otherwise the
  1161.                                         default is FALSE.  To hear any Ansi
  1162.                                         Music or CHR(7) Beeps locally, this
  1163.                                         variable needs to be TRUE.
  1164.  
  1165.         fk_Host.StatuslineBuf  Byte     The number of blank lines setup
  1166.                                         before the actual status line.
  1167.                                         (default = 1)
  1168.  
  1169.         fk_Host.StatuslinePos  Byte     The position of the status line.
  1170.                                         (default = 25)
  1171.  
  1172.                                         0     will disable the status line
  1173.  
  1174.                                         1-10  will place the active window
  1175.                                               below the status line position.
  1176.  
  1177.                                         11-25 will place the active window
  1178.                                               above the status line position.
  1179.  
  1180.         fk_Host.StrictColour   Boolean  If TRUE, then if the user is in TTY
  1181.                                         mode any colour changes will be
  1182.                                         ignored.  If FALSE and the user is in
  1183.                                         TTY mode, all changes of colour will
  1184.                                         be displayed as normal locally.
  1185.                                         (default = TRUE)
  1186.  
  1187.         fk_Host.Timeslice      Boolean  If TRUE, FKFOSSIL will attempt to
  1188.                                         give up unused timeslices to the
  1189.                                         OS/Multitasker. (default = TRUE)
  1190.  
  1191.         fk_Host.Titleline      Boolean  If TRUE and the status line position
  1192.                                         is 25, then a second title line will
  1193.                                         be added at line 24.  On this line,
  1194.                                         the information in the fk_ProgramInfo
  1195.                                         variables will be displayed.
  1196.                                         (default = FALSE)
  1197.  
  1198.         fk_Host.ValidInput     String   Determines the allowable characters
  1199.                                         for the fk_Readln function.  If you
  1200.                                         set this string to 'ABC' then the
  1201.                                         fk_Readln function will only accept
  1202.                                         an A, B or C.  Several constants have
  1203.                                         been provided so that you don't need
  1204.                                         to type in all the characters all the
  1205.                                         time. (default = fk_StandardInput)
  1206.  
  1207.                                         For example;
  1208.  
  1209.                                         number input;
  1210.                                         fk_Host.ValidInput:=fk_NumberInput;
  1211.                                         fk_Readln(nums,false);
  1212.                                         fk_Host.ValidInput:=fk_StandardInput;
  1213.  
  1214.                                         filename input;
  1215.                                         fk_Host.ValidInput:=fk_FilenameInput;
  1216.                                         fk_Readln(fname,true);
  1217.                                         fk_Host.ValudInput:=fk_StandardInput;
  1218.  
  1219.                                         defined input;
  1220.                                         fk_Host.ValidInput:='TIM_STRIKE'
  1221.                                         fk_Readln(fname,true);
  1222.                                         fk_Host.ValidInput:=fk_StandardInput;
  1223.  
  1224.                                         Never set the fk_Host.ValidInput
  1225.                                         variable to a null string ('') as the
  1226.                                         fk_Readln function will cease to
  1227.                                         work.
  1228.  
  1229.                                         Just remember to ALWAYS turn the
  1230.                                         input type back so that you don't
  1231.                                         forget to do it later (unless you
  1232.                                         need one input type for the whole
  1233.                                         program, etc...)
  1234.  
  1235.         fk_Host.WaitforChar    Boolean  If TRUE, the fk_Read function will
  1236.                                         wait for a character, otherwise it
  1237.                                         won't.  The MUCH better alternative
  1238.                                         to this variable is the function
  1239.                                         fk_NoWaitRead since you won't need to
  1240.                                         remember to reset the variable.
  1241.                                         (default = TRUE)
  1242.  
  1243.         fk_Host.WarningBell    Boolean  TRUE if warning bell (inactivity
  1244.                                         timeout) has been sent to the user.
  1245.         fk_Host.WarningTime    Boolean  TRUE if timeleft warning has been
  1246.                                         sent to the user.
  1247.  
  1248.                                         ** It is not suggested that the
  1249.                                         warning variables be reset, unless
  1250.                                         there is a specific need.  FKFOSSIL
  1251.                                         will automatically handle the warning
  1252.                                         variables itself.
  1253.  
  1254.  
  1255.         COLOUR INFORMATION
  1256.         ---------------------------------------------------------------------
  1257.         The Colour Information variables define the status line display
  1258.         colours.  These should be set BEFORE you call the fk_InitFossil
  1259.         procedure.
  1260.  
  1261.         fk_Host.Colour.Baud             Baud Rate         (default =  9,1)
  1262.         fk_Host.Colour.Handle           Handle            (default = 11,1)
  1263.         fk_Host.Colour.InfoDesc         Descriptors       (default =  9,1)
  1264.         fk_Host.Colour.Lastkey          Lastkey Timer     (default = 11,1)
  1265.         fk_Host.Colour.Multitasker      Multitasker Type  (default =  9,1)
  1266.         fk_Host.Colour.Name             Real Name         (default = 14,1)
  1267.         fk_Host.Colour.Node             Node Marker       (default =  9,1)
  1268.         fk_Host.Colour.NoTimeleft       No User Time Left (default = 12,1)
  1269.         fk_Host.Colour.Screentype       Emulation Mode    (default =  9,1)
  1270.         fk_Host.Colour.Statusline       Empty Space       (default =  1,1)
  1271.         fk_Host.Colour.Timeleft         User Time Left    (default = 11,1)
  1272.         fk_Host.Colour.Titleline        Program Info      (default = 11,1)
  1273.         fk_Host.Colour.Warning          Warning Sent      (default = 12,1,B)
  1274.  
  1275.         For monochrome monitors the attributes are all set to black on white
  1276.         (reverse video) and should easily be seen.  Let me know, I don't have
  1277.         a mono monitor. ;)  For colour monitors, the default is listed in the
  1278.         righthand column (foreground, background, blink).
  1279.  
  1280.         The colour attribute is a combination foreground, background & blink.
  1281.         To set it to Cyan on Black the value would be 11.  To set it to
  1282.         Yellow on Red, the value would be 14+(4*16).  To set the value to
  1283.         blinking Red on Blue, it would be 12+(1*16)+128. This is the same
  1284.         format used for the TextAttr command in TP.
  1285.  
  1286.         There is only one colour scheme setup.  You can't switch from Mono to
  1287.         Colour without resetting the variables.  When your program is run,
  1288.         FKFOSSIL will predefine the colour set based on whether a mono or
  1289.         colour monitor is detected.  This will not work if the user has a
  1290.         black-white VGA system.  If you plan on changing the status line
  1291.         colours, you may wish to check the FK_HOST.MONO variable to see if a
  1292.         mono or colour system is in use.  Be careful!
  1293.  
  1294.  
  1295.                              ___________________
  1296.  
  1297.                              DEFINABLE FUNCTIONS
  1298.                              ___________________
  1299.  
  1300.              What are definable functions?  Good question.  They are
  1301.         functions and procedures that FKFOSSIL runs internally that you can
  1302.         define externally.  Each of these functions has a default "value"
  1303.         which you can override.
  1304.  
  1305.              It's relatively hard to explain how these types of functions
  1306.         work, but let's consider an example.  If we have a function called
  1307.         KEY_SPECIAL which is run when a key is pressed -- let's say it resets
  1308.         a timer from the last keypress.  Let's say we now create a function
  1309.         variable called "KEY_IN".  KEY_IN will be set to equal KEY_SPECIAL,
  1310.         like KEY_IN := KEY_SPECIAL.  Now, we only need to call KEY_IN and
  1311.         KEY_IN will notice that it's a pointer to another function, and run
  1312.         KEY_SPECIAL instead.  Now, if you had a function called KEY_NORMAL,
  1313.         you could set KEY_IN := KEY_NORMAL and the next time the KEY_IN
  1314.         function was called, it would point to KEY_NORMAL and run that
  1315.         function instead.
  1316.  
  1317.              What is essentially boils down to are functions that are called
  1318.         in a program/part of a program can be given a "tag", and whenever
  1319.         that "tag" is found, it will run the function that tag points to.
  1320.  
  1321.              FKFOSSIL has these routines so that you can replace some of the
  1322.         defaults with other defaults.  For instance, if you were writing a
  1323.         callback program, you would quickly find that once you hungup on the
  1324.         user, FKFOSSIL would detect the hangup and bail out.  This is
  1325.         obviously undesirable because you wouldn't be able to call the user
  1326.         back.  Consider now that we have a function called fk_NoCarrier;
  1327.         fk_NoCarrier has been set to a function which will exit the program.
  1328.         If you set fk_NoCarrier to another (perhaps empty) function, it will
  1329.         no longer exit the program but rather return to whatever it was
  1330.         doing.
  1331.  
  1332.              To setup your "override" functions, you must set them up to
  1333.         match exactly the type of function you are replacing.  So if the
  1334.         function are you replacing is Function 8_1(ch:Char):Char then your
  1335.         function must also be (ch:Char):Char.  The function must also be
  1336.         setup as a FAR call.  To do this, you put {$F+} before the function.
  1337.         Make sure that you put {$F-} after the function so that it saves you
  1338.         memory/space when compiling (no need to setup your entire code to be
  1339.         a FAR call).
  1340.  
  1341.              The replaceable functions are as follows -- the defaults are the
  1342.         values that you should return the variable to after you are done with
  1343.         your "override".  All of those functions have the same name as the
  1344.         initial variable, except read fkp_ instead of fk_ (note the one
  1345.         exception to this rule; the input routines).
  1346.  
  1347.  
  1348.         VARIABLE        FUNCTION/PROCEDURE TYPE      INFORMATION / DEFAULT
  1349.         --------------------------------------------------------------------
  1350.         fk_LocalInput   Function(Ch:Char):Char       Processed when local
  1351.                                                      input is received. Char
  1352.                                                      is the return character
  1353.                                                      -- if you are not doing
  1354.                                                      anything with the actual
  1355.                                                      character, make sure
  1356.                                                      that your function
  1357.                                                      returns CH variable.
  1358.                                                      (default = fkp_input)
  1359.  
  1360.         fk_RemoteInput  Function(Ch:Char):Char       Same as fk_LocalInput
  1361.                                                      except for remote input.
  1362.                                                      (default = fkp_input)
  1363.  
  1364.         fk_CarrierLoss  Procedure                    Run during any input
  1365.                                                      session if the carrier
  1366.                                                      is not online. (default
  1367.                                                      = fkp_Carrierloss)
  1368.  
  1369.         fk_Timeout      Procedure                    Run when the user times
  1370.                                                      out in any input session
  1371.                                                      (doesn't press a key for
  1372.                                                      the specified period).
  1373.                                                      (default = fkp_Timeout)
  1374.  
  1375.         fk_NoTimeLeft   Procedure                    Run when the user's time
  1376.                                                      run's out in any input
  1377.                                                      session. (default =
  1378.                                                      fkp_notimeleft)
  1379.  
  1380.         fk_Close        Procedure                    Run when the fossil
  1381.                                                      driver is shut down via
  1382.                                                      fk_Deinitfossil.
  1383.                                                      (default = fkp_Close)
  1384.  
  1385.         fk_Open         Procedure                    Run when the fossil
  1386.                                                      driver is first started
  1387.                                                      via fk_InitFossil[_DF].
  1388.                                                      (default = fkp_Open)
  1389.  
  1390.         fk_MCI          Function(s:string):string    Run when the fk_Display
  1391.                                                      functions are displaying
  1392.                                                      the files.  Every line
  1393.                                                      is passed through and a
  1394.                                                      return line is received.
  1395.                                                      (default = fkp_MCI)
  1396.  
  1397.              EXAMPLE 8_1;
  1398.  
  1399.              {$F+}
  1400.              Procedure Replace_NoCarrier;
  1401.              BEGIN
  1402.              END;
  1403.              {$F-}
  1404.  
  1405.              BEGIN
  1406.              fk_Writeln('We are about to drop carrier to call you back.',1);
  1407.              (* Replace fk_Carrierloss so that the program doesn't exit
  1408.                 when the carrier is dropped (we want to drop it... ;)  *)
  1409.              fk_Carrierloss:= Replace_NoCarrier;
  1410.              fk_DropDTR(false);
  1411.              Delay(1000);
  1412.              fk_DropDTR(true);
  1413.              Delay(1000);
  1414.              fk_Writeln('ATDT416-820-7273',1);
  1415.              ...
  1416.              fk_Writeln('Callback successful!',1);
  1417.              (* Return the fk_Carrierloss function back to normal so that
  1418.                 if the user hangs up at this point, it will exit!  *)
  1419.              fk_Carrierloss := fkp_NoCarrier;
  1420.              END.
  1421.  
  1422.              If you have never used definable functions and variables, then I
  1423.         highly suggest that you learn how to use them before attempting to
  1424.         set them up with FKFOSSIL.  The defaults do everything that you need
  1425.         to them to do in regular release programs, except some items, like
  1426.         callback doors, timebanks, etc... may require specialized versions of
  1427.         those routines.
  1428.  
  1429.  
  1430.                                    ________
  1431.  
  1432.                                    VERSIONS
  1433.                                    ________
  1434.  
  1435.              This section will always contain the history/update information
  1436.         on this program.  It will list a general summary of bug fixes and new
  1437.         features.  Please read this section on every upgrade, even if you
  1438.         don't plan on reading any other section.
  1439.  
  1440.            +:New Feature   *:Updated (Fixed) Feature   !!:Important to Note
  1441.  
  1442.                                     v1.00
  1443.  
  1444.            + Compiled in Turbo Pascal 6.0 and 7.0
  1445.            + First release to the general public.
  1446.  
  1447.                                     v1.01
  1448.  
  1449.            * Internal FKFOSSIL version.
  1450.  
  1451.                                     v1.02
  1452.  
  1453.            + Added fk_Clock routine so the clock can be started and
  1454.                 stopped without having to worry about the many different
  1455.                 variables.  fk_Clock(false) turns the timer clock off
  1456.                 (users time and last keypress won't be updated), and
  1457.                 fk_Clock(true) turns the timer clock on (users time and
  1458.                 last keypress will be updated).
  1459.  
  1460.            + Added fk_DetectAvatar routine to determine the presence of
  1461.                 avatar on the remote system.
  1462.  
  1463.            + Added keyboard buffers - the buffer can be added to with
  1464.                 fk_localbuffer(s) or fk_remotebuffer(s).  The buffers
  1465.                 can be cleared with fk_localbufferclear and 
  1466.                 fk_remotebufferclear.  Buffers will be processed before
  1467.                 the internal keyboard bufferor the fossil buffer if
  1468.                 they contain any characters.  The buffers can contain
  1469.                 key sequences up to 255 characters long.
  1470.  
  1471.            + Added fk_notimeleft definable function so that customized 
  1472.                 warnings can be sent to the user, or a timebank function
  1473.                 can be run, etc.
  1474.         
  1475.            * Fixed fk_Writeln_Ansi so that a variable need NOT be passed;
  1476.                 it's just a string now S:STRING instead of VAR S:STRING.                
  1477.  
  1478.            * Fixed problems with a routine which would inadvertently wipe
  1479.                 out some memory during the initialization of the status 
  1480.                 line.  In most cases, this memory was at the top end and
  1481.                 held nothing important.  However, in secondary windows on 
  1482.                 multitasking machines and sometimes on non-multitasking 
  1483.                 machines, this wiped out memory would cause intermitent 
  1484.                 problems (incl. system hangs).  Thanks to John Zielinksi 
  1485.                 for tracking this one down - otherwise it likely would have 
  1486.                 been left unnoticed.
  1487.  
  1488.            * Fixed display(file) routines so that the filemode is returned
  1489.                 to it's original value.
  1490.  
  1491.            * Fixed time checking so there are no more midnight timeout's.
  1492.  
  1493.            * Fixed music frequencies so they are a little more correct on
  1494.                 the local side.
  1495.  
  1496.            * fk_AnsiMusic routine no longer requires a second parameter.
  1497.                 The parameter "Force" turned out to be useless and
  1498.                 cumbersome.  If you want to send ansi music to the user,
  1499.                 check to see if they support it first.  Then you can do
  1500.                 something like "If userrec.ansimusic then
  1501.                 fk_AnsiMusic(music);".
  1502.  
  1503.            * Ansi music strings sent to the modem now start with sequence
  1504.                "ESC[M " instead of "ESC[MN", and now end with " CHR(14)"
  1505.                as the ansi music standard specified.
  1506.  
  1507.  
  1508.                                   __________
  1509.  
  1510.                                   LEGALITIES
  1511.                                   __________
  1512.  
  1513.          WARRANTY
  1514.  
  1515.                 FKFOSSIL is provided as-is, without a warranty of any kind,
  1516.            either expressed or implied.  It is only guaranteed to occupy disk
  1517.            space, nothing more.  Under no circumstances shall the author be
  1518.            liable to you or anyone else for any damages, including (but not
  1519.            limited to) any lost profits, lost savings or other incidental or
  1520.            consequential damages arising out of the use or misuse of these
  1521.            programming routines.
  1522.  
  1523.                 In other words; USE THESE ROUTINES AT YOUR OWN RISK.  You
  1524.            yourself, and nobody else is responsible for the outcome of
  1525.            choosing to use these routines.
  1526.  
  1527.  
  1528.          COPYRIGHT
  1529.  
  1530.                 The program, and all documents and files included in the
  1531.            original FKFOSSIL release package are copyrighted by Tim Strike
  1532.            and Forbidden Knights Systems.  They are not to be modified in any
  1533.            way, shape or form;  The distribution archive may be changed from
  1534.            ARJ/ZIP to another archive form, as long as no files are added or
  1535.            removed from the release archive.
  1536.  
  1537.                 When you use FKFOSSIL in your programs, our copyright on the
  1538.            routines is still held and you should acknowledge the fact that
  1539.            portions of your program are copyright by Forbidden Knights
  1540.            Systems.
  1541.  
  1542.                 FKFOSSIL may be packaged on a distribution diskette or in a
  1543.            compilation archive, but under no circumstances may any charge be
  1544.            incurred beyond the physical cost of the hardware (disks, CD...)
  1545.            or transfer medium (phone, mail...).  To include FKFOSSIL in any
  1546.            type of "compilation archive", you must first have the express
  1547.            written consent of Tim Strike and Forbidden Knights Systems.
  1548.  
  1549.  
  1550.          CREDITS
  1551.  
  1552.                 All brand and product names referenced in this document are
  1553.            trademarks, registered trademarks, or  copyrighted works of their
  1554.            respective holders.
  1555.  
  1556.  
  1557.                             _____________________
  1558.  
  1559.                             CONTACTING THE AUTHOR
  1560.                             _____________________
  1561.  
  1562.  
  1563.              I can be contacted in a number of different methods.  When
  1564.         sending netmail or posting in one of the conferences, direct mail to
  1565.         "Tim Strike".  Replies will be forthcoming as soon as I can get to
  1566.         them.
  1567.  
  1568.         NETMAIL:
  1569.  
  1570.             Telenet Canada       Fidonet         Xnet
  1571.             20:22/101            1:259/423       40:41/108
  1572.  
  1573.         ECHOMAIL CONFERENCES:
  1574.  
  1575.             PASCAL          Pascal Help                            (FIDO)
  1576.             TNC_FKNIGHTS    Forbidden Knights Support               (TNC)
  1577.             TNC_PROGRAM     Programming Help                        (TNC)
  1578.             XNET_PROGRAM    Programming Help                       (XNET)
  1579.  
  1580.         POSTAL MAIL:
  1581.  
  1582.             Forbidden Knights Systems
  1583.                 Attn: Tim Strike
  1584.             3360 Council Ring Rd, Unit 11
  1585.             Mississauga, ON
  1586.             L5L 2E4
  1587.  
  1588.         BULLETIN BOARD:
  1589.  
  1590.              Forbidden Knights Systems
  1591.              (905)820-7273
  1592.              2400-16,800 HST/v.32bis
  1593.              Access denied between 4:00am and 5:00am
  1594.              Restricted access between 9:00pm and 10:00pm
  1595.  
  1596.              Guest account available.
  1597.  
  1598.  
  1599.  
  1600.              Any changes or upgrades that need to be made to FKFOSSIL v1.02
  1601.         will be made as time permits.  Further suggestions, comments and/or
  1602.         bug reports can be directed through one of the above methods.
  1603.  
  1604.                                                                 Enjoy.
  1605.  
  1606.