home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / GAPCDR.ZIP / GAPCDR.TXT < prev    next >
Encoding:
Text File  |  1989-03-17  |  130.1 KB  |  3,367 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.           
  24.                                        GAPCDR
  25.                                           
  26.           
  27.                        Door Interface Module - March 15, 1989
  28.                                           
  29.            A Professional Development Kit For The Professional Programmer
  30.                                           
  31.           
  32.           
  33.                    (C) Copyright 1989 The GAP Development Company
  34.                                           
  35.                                  ALL RIGHTS RESERVED
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                                   TABLE OF CONTENTS
  74.           
  75.  
  76.  
  77.  
  78.  
  79.  
  80.                                                                   Page
  81.           
  82.                DESCRIPTION                                           2
  83.                GETTING STARTED                                       3
  84.                COMPILING AND LINKING                                 6
  85.                SYSOP SETUP AND FUNCTIONS                             8
  86.                GLOBAL VARIABLES                                     11
  87.                    DEFINES                                          11
  88.                    ANSI VARIABLES                                   11
  89.                    DOOR.SYS VARIABLES                               12
  90.                        INTEGERS                                     12
  91.                        LONGS                                        12
  92.                        STRINGS                                      13
  93.                    GAPCDR GLOBALS                                   13
  94.                        CHARS                                        13
  95.                        INTEGERS                                     13
  96.                        LONGS                                        13
  97.                        STRINGS                                      14
  98.                    GAPDOS.DAT VARIABLES                             14
  99.                    USERS.DAT VARIABLES                              15
  100.                    PCBOARD.SYS VARIABLES                            16
  101.                    PCB USERS VARIABLES                              17
  102.                GLOBAL VARIABLES - ALPHABETICALLY By Type            18
  103.                    DEFINES                                          18
  104.                    CHARS                                            18
  105.                    DOUBLES                                          18
  106.                    FLOATS                                           18
  107.                    INTEGERS                                         19
  108.                    LONGS                                            19
  109.                    STRINGS                                          20
  110.                FUNCTIONS - QUICK REFERENCE                          22
  111.                FUNCTIONS - REFERENCE                                23
  112.                REGISTRATION INFORMATION                             46
  113.                GAPCDR REGISTRATION                                  47
  114.                INDEX                                                48
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  137.  
  138.  
  139.                                      DESCRIPTION
  140.                                      -----------
  141.           
  142.           GAPCDR is  a professional development kit for Bulletin Board Door
  143.           programmers. Written  in Microsoft C version 5.1 and MASM version
  144.           5.1, it  is fast, reliable,  easy to use, and easy to incorporate
  145.           into the  serious programmer's source code.  It consists of a set
  146.           of C  and assembler  library routines  to  allow  for  easy  door
  147.           programming and  interfacing.   The communications  routines  are
  148.           moulded around  GAPCDR and,  as such,  will work  only within the
  149.           GAPCDR environment.
  150.           
  151.           
  152.           Features Include :
  153.           
  154.             o  Interfaces with GAP Communications and pcboard.
  155.             o  Full communications support.
  156.             o  Supports CTS/RTS, automatically.
  157.             o  Does not require watchdog or CTTY.
  158.             o  Uses ANSI colors so the sysop sees what the caller sees.
  159.             o  High speed text file display.
  160.             o  Supports ANSI color and ASCII text files with no programming
  161.                effort other than to make a single function call.
  162.             o  Easy to use Random Number Generator.
  163.             o  Informative Status Line display.
  164.             o  Monitors keyboard activity and caller time remaining.
  165.             o  Easy interfacing to BBS system and user files.
  166.             o  Sysop chat with full word wrapping.
  167.             o  Allows the sysop to shell to DOS.
  168.             o  "Remembers" the default drive and directory which prevents
  169.                file access errors.
  170.             o  Credits caller with time spent chatting or while sysop is in
  171.                a DOS shell.
  172.             o  Sysop can twit caller without caller ever knowing the sysop
  173.                is watching.
  174.             o  Caller time can be increased or decreased.
  175.             o  Full programmer control of whether or not to update the BBS
  176.                system files.
  177.             o  Time calculations are not dependent on the "seconds since
  178.                midnight" and are thus unsusceptible to the midnight roll
  179.                over.
  180.             o  Timer routines are hardware independent.
  181.             o  Allows the sysop to override the "more" prompt during file
  182.                shows.
  183.             o  Allows the sysop to "force" a file display.
  184.             o  Automatic detection of multi-user system.
  185.             o  Input routines are consistent throughout the program.
  186.             o  Uses the latest in Microsoft C features.
  187.             o  Extremely easy interfacing to door programs.
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                        Page 2
  197.  
  198.  
  199.  
  200.  
  201.  
  202.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  203.  
  204.  
  205.                                    GETTING STARTED
  206.                                    ---------------
  207.           
  208.           GAPCDR is distributed in archived format.  The contents of the
  209.           archive should be as follows:
  210.           
  211.                GAPCDR.TXT     -    This documentation.
  212.                GAPCDRS.LIB    -    Small model Library routines.
  213.                GAPCDRL.LIB    -    Large model Library routines.
  214.                GAPCDR.H       -    Door Interface include file.
  215.                GAPSTRUC.H     -    Door Interface include file.
  216.                CDOOR.ZIP      -    Sample program illustrating many of
  217.                                    the features of GAPCDR.
  218.                READ.ME        -    Any pertinent information which you
  219.                                    should read.
  220.           
  221.           
  222.           If you purchased the source code to GAPCDR, the following files
  223.           are included in an archive called GAPCSRC:
  224.           
  225.                GAPCDR.C       -    C source.
  226.                ANSI.H         -    Initialized ANSI strings.
  227.                MAKECDR.BAT    -    Batch file for compiling the source
  228.                                    modules and creating libraries.
  229.           
  230.           In addition,  you will  of course  need a C environment set up on
  231.           your hard  disk.   The following  environment  was  used  in  the
  232.           creation of GAPCDR:
  233.           
  234.                DIRECTORIES
  235.                -----------
  236.                C:\MSC              Parent Directory for Microsoft C.
  237.                C:\MSC\BIN          Holds all Microsoft Executable files.
  238.                C:\MSC\INCLUDE      Holds all header files for C.
  239.                C:\MSC\LIB          All completed libraries are placed here.
  240.                C:\MSC\TMP          For use by the compiler.
  241.                C:\GAPCDR           Work directory for compiling GAPCDR.
  242.                C:\DOORS            Directory for testing door programs.
  243.           
  244.                DOS ENVIRONMENT
  245.                ---------------
  246.                TMP=C:\MSC\TMP
  247.                INCLUDE=C:\MSC\INCLUDE
  248.                LIB=C:\MSC\LIB
  249.                LINK=/E /F /PACKCODE
  250.           
  251.                DOS PATH
  252.                ---------
  253.                PATH=C:\;C:\DOS;C:\MSC\BIN
  254.           
  255.           
  256.           The C  compiler used  is MSC  5.1.   The Linker  used is LINK.EXE
  257.           version 4.06.  (It comes with QC 2.0).  Note that this linker has
  258.           a bug  in that  you must  spell out  PACKCODE (previous  versions
  259.  
  260.  
  261.  
  262.                                        Page 3
  263.  
  264.  
  265.  
  266.  
  267.  
  268.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  269.  
  270.  
  271.           allowed PACK,  as per  the manual).  The linker supplied with MSC
  272.           5.x will do just fine.
  273.           
  274.           The C runtime libraries were set up to use the alternate floating
  275.           point library,  and the  C modules  in GAPCDRx.LIB  were compiled
  276.           with the /FPa switch.
  277.           
  278.           
  279.           Place the GAPCDR files in your work directory.  You may place the
  280.           LIB files in the MSC\LIB directory.
  281.           
  282.           The text  editor you  use must  allow control  characters  to  be
  283.           entered and  displayed. The  GAPCDR.C source  module contains the
  284.           declarations  for  the ANSI  strings which  are  initialized with
  285.           literal characters  and if  your editor removes the ESC character
  286.           from the strings, your ANSI displays will be quite messy.
  287.           
  288.           At the  very beginning  of your  program, you  must  include  the
  289.           GAPCDR.H file.   Without  this file,  nothing will  work.   It is
  290.           normally included  after the C header files that your program may
  291.           need.   To  include  the  file,  you  type  the  following  after
  292.           including the regular C header files:
  293.           
  294.                #include "gapcdr.h"
  295.           
  296.           GAPCDR.H  contains  the  declarations  for  the  external  global
  297.           variables.   In addition,  it includes  GAPSTRUC.H which contains
  298.           the structure declarations and the function prototypes.
  299.           
  300.           NOTE: any of your source modules that include GAPCDR.H, MUST have
  301.           an include  declaration for  STDIO.H prior to including GAPCDR.H.
  302.           It should  be standard practice to include stdio.h in your source
  303.           modules anyway, so this shouldn't present any problems.
  304.           
  305.           The first  thing that must be done prior to using any of the door
  306.           functions, is  to initialize  GAPCDR itself.   This  is  done  by
  307.           making a call to read_cnf.  Read_cnf opens the configuration file
  308.           (the name  of which  you pass as a parameter) and reads the first
  309.           two lines  of the  file.   If the  configuration file  cannot  be
  310.           found, the  program will  end.   The format  of the configuration
  311.           file is as follows:
  312.           
  313.           -----------------------------------------
  314.           c:\gap
  315.           The Crow's Nest
  316.           
  317.           The first  line of  the file  is the  path  to  the  BBS  default
  318.           directory.   The second  line is  the  name  of  the  BBS.    The
  319.           configuration file is usually given a name similar to the name of
  320.           your door  program, with  a CNF  extension.   Read_cnf will leave
  321.           this file  open for  your use.   If  you have  any  configuration
  322.           options of  your own,  you may  place them in this file beginning
  323.           with line  3.  Do not read your configuration options until after
  324.           making a  call to  init_door (which should be the second function
  325.  
  326.  
  327.  
  328.                                        Page 4
  329.  
  330.  
  331.  
  332.  
  333.  
  334.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  335.  
  336.  
  337.           call in  your program).  Upon return from init_door, you are free
  338.           to read  your configuration  options (if any).  At this time, you
  339.           should close the configuration file. Its file pointer is returned
  340.           by read_cnf.
  341.           
  342.           Normally, your  program is  invoked with a command line parameter
  343.           giving the name of the configuration file to use:
  344.           
  345.                DOOR DOOR.CNF
  346.           
  347.           You would use the argv parameter to your main function to extract
  348.           the configuration  parameter and  then pass  this parameter on to
  349.           read_cnf.   This allows  the end  user to  use a  single  program
  350.           (your program)  with  multiple  configuration  files.    This  is
  351.           especially important  under  multi-user  systems  where  separate
  352.           configuration files are needed.
  353.           
  354.           The configuration  file is  opened as a stream, so using fgets or
  355.           any of  the stream  input  functions  would  be  appropriate  for
  356.           reading the  data.  Remember that the file pointer is passed back
  357.           to you  after the  call to read_cnf.  An example of the first few
  358.           "door" statements that might appear in a source file would be:
  359.           
  360.             FILE *cnf_file;                    // pointer to config file
  361.           
  362.             cnf_file = read_cnf(argv[1]);      // read the cnf file
  363.             init_door();                       // init the door
  364.             fclose(cnf_file);                  // close the cnf file
  365.           
  366.           
  367.           If there were no errors, read_cnf will return.  You must now make
  368.           a call to init_door.  Init_door uses the information derived from
  369.           line 1  of the configuration file to open and read DOOR.SYS (GAP)
  370.           or PCBOARD.SYS (PCB)  as well  as the BBS configuration file.  In
  371.           addition, init_door  opens the  communications port (if  a remote
  372.           user is  on), initializes  some global variables, and initializes
  373.           the random  number generator.   If  there is  an error, init_door
  374.           will not return.  Instead it will end the program.
  375.           
  376.           That is  basically all  you have  to do  to initialize the GAPCDR
  377.           module.   When your  program ends,  you  should  clean  house  if
  378.           necessary and  call leave.   Leave closes the communications port
  379.           and any  open files,  restores the ISR routines to their original
  380.           state, sends  a sign off message to the caller, and then exits to
  381.           DOS.  It is of vital importance to exit the door by making a call
  382.           to leave.   Failure  to do so will leave communication interrupts
  383.           active, the  ctrl-break intercept  active, and the BIOS intercept
  384.           active.  The vectors to these routines will be left in the vector
  385.           table and your computer will surely lock up.
  386.           
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                                        Page 5
  395.  
  396.  
  397.  
  398.  
  399.  
  400.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  401.  
  402.  
  403.           Things to remember:
  404.           
  405.             To get  the ball  rolling, include  GAPCDR.H after the C header
  406.             files.
  407.             
  408.             To initialize  the door,  call read_cnf  with the  name of your
  409.             programs configuration file.  Call init_door.
  410.             
  411.             Call leave when your program is finished.
  412.             
  413.             All input  and output  should be  performed through  the GAPCDR
  414.             functions.   The sample  program gives  good examples on how to
  415.             accomplish this.
  416.             
  417.             To determine if the BBS is a single or multi user system, check
  418.             the variable called node.  If it is anything other than 0, then
  419.             the BBS is multi-user and you should read/write your data files
  420.             with sharing attributes.
  421.             
  422.             The default mode of operation is GAP mode.  This means that you
  423.             should not  use those  functions which  access PCB  files.   To
  424.             determine if the BBS is a PCB system, check the variable dopcb.
  425.             If this  is set  to 1,  then the  BBS is PCB and you should not
  426.             access GAP  files.   The variable  dopcb is  set to  1  if  the
  427.             environment variable GAPCDR is set equal to PCB.
  428.           
  429.           
  430.           To test  your program,  you  will  need  a  DOOR.SYS (GAP)  or  a
  431.           PCBOARD.SYS (PCB) file  that was  written for  local  exit.    Of
  432.           course, you  can always  modify any  DOOR.SYS file and change the
  433.           first line  so that  it reads COM0:.  In addition, for a GAP BBS,
  434.           the  GAPBBS.CNF   file  must   be   accessible   (PCBOARD.DAT and
  435.           USERS for PCB).   A complete set of sample files are provided for
  436.           testing your program under local mode.
  437.           
  438.           
  439.                                 COMPILING AND LINKING
  440.                                 ---------------------
  441.           
  442.           GAPCDR has  already been compiled with the necessary compile time
  443.           switches.
  444.           
  445.           To compile your programs, use whatever switches are required with
  446.           the following commands:
  447.           
  448.                cl /c doorname
  449.                link doorname,,NUL.MAP,+GAPCDRx
  450.           
  451.           Where doorname is the name of your program and 'x' is 'S' for the
  452.           small model library or 'L' for the large model library.
  453.           
  454.           As was  mentioned previously,  GAPCDR was  compiled with the /FPa
  455.           option.   However, the door code uses no floating point functions
  456.           so you  are free to compile your modules with the emulator option
  457.  
  458.  
  459.  
  460.                                        Page 6
  461.  
  462.  
  463.  
  464.  
  465.  
  466.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  467.  
  468.  
  469.           (the default)  if you  prefer.   The /FPa option produces smaller
  470.           executable files.
  471.           
  472.           If  you   purchased  the   source  code   to  GAPCDR,  there  are
  473.           suplementary files  to aid  in re-compiling  and  librarying  the
  474.           source modules.
  475.           
  476.           GAPCDR has  not been  tested with  Quick C,  although there is no
  477.           reason why it should not work with the QC 2.0 environment.
  478.           
  479.           GAPCDR uses  the PASCAL  function calling convention.  If you are
  480.           unfamiliar with  this calling  convention, in short it means that
  481.           the parameters  to a function are pushed onto the stack from left
  482.           to right  instead of  right to  left.   In addition, the function
  483.           being called  is responsible  for  removing  arguments  from  the
  484.           stack.  In the C calling convention, the function making the call
  485.           is responsible  for restoring  the stack.   What this means is if
  486.           you make  10 calls to show_mess, there will be 10 instances where
  487.           the stack  must be  restored upon  return from show_mess.  In the
  488.           PASCAL convention,  there will  be only  one instance  where this
  489.           will occur  and it  will be in show_mess just prior to the actual
  490.           return from  the function.   The  end result  of using the PASCAL
  491.           calling convention is smaller code size.
  492.           
  493.           It should be noted that the PASCAL convention cannot be used with
  494.           functions that take a variable number of arguments.
  495.           
  496.           Using  the   PASCAL  convention   absolutely  requires  that  ALL
  497.           functions be  prototyped.   Otherwise the  compiler will generate
  498.           redeclaration errors  and the  linker  will  generate  unresolved
  499.           external reference errors.
  500.           
  501.           A word  about using  GOTO -  If you  purchased the source code to
  502.           GAPCDR, you will find that we use the goto in several places.  It
  503.           should be  pointed out  that speed and compactness, combined with
  504.           readability, are  our number  one concerns.   Prior  to  actually
  505.           using our  first goto in GAP Communications, we performed several
  506.           experiments.   We took a very simple function that consisted of a
  507.           while loop  and a  few statements embodied within the while loop.
  508.           We took the same function and rewrote it using a counter variable
  509.           and a  goto and removed the while loop.  The assembler output and
  510.           resultant object  code was  1/2 the  size as that of the function
  511.           that used the while loop.
  512.           
  513.           We are  not proposing that anyone give up the fine structure of C
  514.           and use  gotos as  a beginning  programmer in  Basic might do. In
  515.           fact, if  you are  a beginning  programmer in C, you should avoid
  516.           using gotos altogether until you become more proficient. When GAP
  517.           communications began  to outgrow  its  britches  we  looked  into
  518.           alternative ways of coding.  We found through careful analyses of
  519.           the assembly  output that  the goto  was a natural choice in many
  520.           instances.  Lest anyone shudder at the thought of using a goto in
  521.           C, be  reminded that  a break  or continue in a loop is the exact
  522.           equivalent of using a goto.
  523.  
  524.  
  525.  
  526.                                        Page 7
  527.  
  528.  
  529.  
  530.  
  531.  
  532.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  533.  
  534.  
  535.                               SYSOP SETUP AND FUNCTIONS
  536.                               -------------------------
  537.           
  538.           These sysop  setup and  function descriptions should be placed in
  539.           the documentation  of your  door program.   You should, of course
  540.           change the setup information to fit your particular needs.
  541.           
  542.           
  543.           
  544.           Door programs  written with the GAPCDR Door Interface Module will
  545.           run on  GAP Communications  version 3  and  greater  and  on  PCB
  546.           version 14 and greater.
  547.           
  548.           To configure the door for a particular BBS setup, a configuration
  549.           file must  be used.   At the very minimum, this file will contain
  550.           two lines.   It  may contain  more than  two,  depending  upon  a
  551.           particular doors  configuration requirements.   The  name of  the
  552.           file is  usually the  same as that of the door program but with a
  553.           CNF extension.   The  minimum requirements  for the  file are  as
  554.           follows:
  555.           
  556.                c:\gap
  557.                The Crow's Nest
  558.           
  559.                The first  line  is  the  full  path  to  your  BBS  default
  560.                directory.   For GAP, this is usually C:\GAP.  For PCB, this
  561.                is usually C:\PCB.  The second line is the name of your BBS.
  562.           
  563.           GAPCDR will  obtain the  sysop's name  from the BBS configuration
  564.           file.
  565.           
  566.           You must  now create a batch file to invoke the door.  This batch
  567.           file is  placed in your BBS default directory.  Such a batch file
  568.           might look like this:
  569.           
  570.                echo off
  571.                cd \gap\doors\tourist
  572.                tourist tourist.cnf
  573.                cd \gap
  574.                gap
  575.           
  576.           As you  can see, the door is invoked by passing the configuration
  577.           file name as a parameter.
  578.           
  579.           You will  also need  to modify your doors menu files and the data
  580.           file that  tells the  BBS what  your doors  are and  the security
  581.           level needed to access them.  For GAP, these are respectively:
  582.           
  583.                DOORM
  584.                DOORMG
  585.                DOORS.DAT
  586.           
  587.           Please refer  to your  BBS documentation  for details on  setting
  588.           these files up.
  589.  
  590.  
  591.  
  592.                                        Page 8
  593.  
  594.  
  595.  
  596.  
  597.  
  598.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  599.  
  600.  
  601.           If you  are running  multi-nodes, simply  create a  separate door
  602.           configuration file for each node, and number them.  For instance,
  603.           for a  3 node  system, you might have the following configuration
  604.           files:
  605.           
  606.                TOURIST1.CNF
  607.                TOURIST2.CNF
  608.                TOURIST.CNF
  609.           
  610.           The only difference between the three would be the 1st line which
  611.           points to the default directory for the particular node.
  612.           
  613.           Multi-user operation  is automatic.   For  GAP, the  presence  of
  614.           DUMMYLOK.DAT in the MAIN directory triggers multi-user operation.
  615.           For PCB, this information is derived from the PCBOARD.DAT file.
  616.           
  617.           The following  files are  read during  door initialization.  They
  618.           must be present or the door will not operate.
  619.           
  620.                GAP                      PCB
  621.                ----------------         ----------------
  622.                DOOR.SYS                 PCBOARD.SYS
  623.                GAPBBS.CNF               PCBOARD.DAT
  624.                                         USERS
  625.           
  626.           In addition,  a particular  door may access the GAP USERS.DAT and
  627.           GAPDOS.DAT files.
  628.           
  629.           The default mode of operation for any door that is developed with
  630.           GAPCDR is  the GAP  mode.   To run  the door under a PCB BBS, you
  631.           must set the following environment variable (in UPPERCASE):
  632.           
  633.                GAPCDR=PCB
  634.           
  635.           
  636.           
  637.           The following sysop functions are available while awaiting
  638.           keyboard input :
  639.           
  640.                    F5     -  Shell to DOS.
  641.                    F8     -  Twit user and return to BBS.
  642.                   F10     -  Initiate chat with user.
  643.                   CF10    -  Answer user page bell.
  644.                   Home    -  Main user stats.
  645.                   End     -  Displays sysop keys available.
  646.                   PgDn    -  Secondary user stats.
  647.                 Up Arrow  -  Increase user's time remaining.
  648.                 Dn Arrow  -  Decrease user's time remaining.
  649.           
  650.           
  651.           One of  the nicer  features about using the TWIT key, is the user
  652.           is not  told that  "the sysop  wants them  to return to the BBS".
  653.           Instead, a very plain and simple message of "returning you to the
  654.  
  655.  
  656.  
  657.  
  658.                                        Page 9
  659.  
  660.  
  661.  
  662.  
  663.  
  664.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  665.  
  666.  
  667.           BBS" is  displayed.   This way,  the user  is given no indication
  668.           that the sysop is hovering about.
  669.           
  670.           When using  the F5  shell to  DOS key,  to  return  to  the  door
  671.           program, simply  type EXIT  at the DOS command prompt.  It is not
  672.           necessary to  change directories  back  to  the  door  directory.
  673.           GAPCDR is smart enough to know which drive and directory the door
  674.           program is  in and  will reset the defaults upon return from DOS.
  675.           In addition, the status line will remain "glued" to the screen.
  676.           
  677.           It should  be noted  that the  GAPCDR status line is protected by
  678.           intercepting BIOS  video calls.  If you use ANSI.SYS replacements
  679.           which write  directly to  the  video,  you  will  not  have  this
  680.           protection and your status line will scroll off the screen.
  681.           
  682.           The Up  and Down Arrow keys increase and decrease the user's time
  683.           respectively by  5 minutes for each press of the key. There is no
  684.           indication of  what is  occurring (except  by the fact the user's
  685.           time remaining  will change), so the sysop should try not to have
  686.           a lead  finger.  The increase or decrease is effective only while
  687.           the user  is in  the door.   Since we are firm believers that the
  688.           BBS system  files belong  to the BBS and should not be altered by
  689.           any door  program, updating the BBS system file is NOT automatic.
  690.           If you  wish that  any decrease or increase in the user's time be
  691.           made permanent,  you may,  after initializing  the door, call the
  692.           function that  opens the  system file.   Keep  track of  any time
  693.           credits  during  the  door  programs  operation,  then  call  the
  694.           function that updates the BBS system file.  Examples of how to do
  695.           this are included in the sample program.
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.                                        Page 10
  725.  
  726.  
  727.  
  728.  
  729.  
  730.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  731.  
  732.  
  733.                                   GLOBAL VARIABLES
  734.                                   ----------------
  735.           
  736.           
  737.           DEFINES
  738.           -------
  739.           
  740.           The following defines are used when calling show_mess.
  741.           
  742.           NO                  Defined as 0
  743.           YES                 Defined as 1
  744.           
  745.           ANSI VARIABLES
  746.           --------------
  747.           
  748.           ANSI strings contain the actual ANSI color sequences.
  749.           
  750.           BLACK               ANSI codes for Black
  751.           BLUE                ANSI codes for Blue
  752.           BROWN               ANSI codes for Brown
  753.           CYAN                ANSI codes for Cyan
  754.           GREEN               ANSI codes for Green
  755.           MAGENTA             ANSI codes for Magenta
  756.           RED                 ANSI codes for Red
  757.           WHITE               ANSI codes for White
  758.           
  759.           BBLACK              ANSI codes for Grey
  760.           BBLUE               ANSI codes for bright Blue
  761.           BCYAN               ANSI codes for bright Cyan
  762.           BGREEN              ANSI codes for bright Green
  763.           BMAGENTA            ANSI codes for bright Magenta
  764.           BRED                ANSI codes for bright Red
  765.           BWHITE              ANSI codes for bright White
  766.           YELLOW              ANSI codes for Yellow
  767.           
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                                        Page 11
  791.  
  792.  
  793.  
  794.  
  795.  
  796.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  797.  
  798.  
  799.           DOOR.SYS VARIABLES
  800.           ------------------
  801.           
  802.           DOOR.SYS  variables   are  initialized  while  reading  the  Door
  803.           Interface Module,  DOOR.SYS. (For PCB, PCBOARD.DAT and USERS must
  804.           be read  to initialize  these  variables).  These  variables  are
  805.           available from door start up to door end.  The DOOR.SYS variables
  806.           are the door programmer's connection to the BBS.
  807.           
  808.           Note that any PCB variables that are declared as SINGLE or DOUBLE
  809.           are set  to 0.   This  is because  any attempt  to convert  these
  810.           variables (which  are in the long outdated MSB format) would drag
  811.           in the  floating point  library (minimum  of 10k  memory will  be
  812.           taken up by the floating point functions).
  813.           
  814.           
  815.           INTEGERS
  816.           --------
  817.           
  818.           alarm               Caller Alarm. 0 = off, 1 = on
  819.           baud                DTE rate to open COMM port at
  820.           bell                Page Bell. 0 = off, 1 = on
  821.           color               Color toggle. 0 = no color, 1 = color ok
  822.           expert              Expert mode. 0 = non-expert, 1 = expert
  823.           local               0 = remote user, 1 = local
  824.           level               User's security level
  825.           minsleft            Number of minutes user has left at door start
  826.           node                Node number. 0 = single user
  827.           page                User's page length
  828.           parity              Should actually be data bits and is not used
  829.           port                Communications port in use
  830.           printer             Printer Toggle. 0 = off, 1 = on
  831.           screen              Screen display. 0 = off, 1 = on
  832.           userbaud            BPS rate of the remote user
  833.           
  834.           LONGS
  835.           -----
  836.           
  837.           downbytes           Total bytes downloaded
  838.           downloads           Number of downloads
  839.           maxbytes            Maximum number of bytes allowed to download
  840.           recnum              User's record number in USER file
  841.           timeson             Number of times user has been on
  842.           upbytes             Total bytes uploaded
  843.           uploads             Number of uploads
  844.           
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.                                        Page 12
  857.  
  858.  
  859.  
  860.  
  861.  
  862.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  863.  
  864.  
  865.           STRINGS
  866.           -------
  867.           
  868.           bphone              User's business or data phone number
  869.           city                User's home town
  870.           fname               User's first name
  871.           hphone              User's home phone number
  872.           lastdate            Last date user was on
  873.           lname               User's last name
  874.           password            User's password. PASSWORD if sysop is on
  875.           subscrip            Date user's subscription expires
  876.           username            User's full name
  877.           
  878.           
  879.           GAPCDR GLOBALS
  880.           --------------
  881.           
  882.           These variables are the documented, global variables (initialized
  883.           and used  by GAPCDR).   They  may be  modified and/or used at the
  884.           programmer's discretion.
  885.           
  886.           
  887.           CHARS
  888.           -----
  889.           
  890.           chat                True if chatting with caller
  891.           clockon             If 0, don't display status line clock
  892.           dopcb               If set to 1, the BBS is a PCB system
  893.           endview             True if caller doesn't want to view any more
  894.           fileshow            1 if showing a file, 0 if not
  895.           instatus            Used by BIOS interceptor
  896.           noup                If set to 1, get_string will not uppercase
  897.           NS                  True if in Continuous mode
  898.           redisplay           True if wants to see file from beginning
  899.           view                True if viewing a file
  900.           
  901.           INTEGERS
  902.           ---------
  903.           
  904.           lines               Number of lines currently displayed
  905.           timecredit          Time credits for user (in minutes)
  906.           timeleft            Time user has left (in minutes)
  907.           
  908.           LONGS
  909.           -----
  910.           
  911.           starttime           Time the user logged on (in seconds)
  912.           temptime            For calculating keyboard time out
  913.           timenow             Time it is now  (in seconds)
  914.           
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                                        Page 13
  923.  
  924.  
  925.  
  926.  
  927.  
  928.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  929.  
  930.  
  931.           STRINGS
  932.           -------
  933.           
  934.           anystring           Global garbage collector
  935.           bbs_dir             Path to BBS default dir
  936.           board_name          Name of the BBS
  937.           curtime             Holds the current time as a string
  938.           gendir              Path to the gen directory
  939.           maindir             Path to the main directory
  940.           strtime             Holds the time as a string
  941.           sysname             Sysop's name
  942.           
  943.           
  944.           GAPDOS.DAT VARIABLES
  945.           --------------------
  946.           
  947.           These variables  are initialized  by the  programmer by  making a
  948.           call to  read_gapdos.   String variables  should not be modified.
  949.           Please see  the GAPSTRUC.H  header file for the actual definition
  950.           of these variables.
  951.           
  952.           
  953.           gapdos.baud         DTE bps rate
  954.           gapdos.callbytes    Ttl bytes available for download
  955.           gapdos.didnew       1 = did a new files scan
  956.           gapdos.exitdos      1 = exit to DOS after call
  957.           gapdos.forumnum     Forum the user is in
  958.           gapdos.givetime     1 = event pending, else extra time received
  959.           gapdos.joined       Bit flags of forums joined
  960.           gapdos.local        0 = user, 1 = sysop, 2 = local user
  961.           gapdos.minavail     Total minutes available to user
  962.           gapdos.port         Port being used
  963.           gapdos.starttime    Time (in seconds) user logged on
  964.           gapdos.timecredit   Any time credits user may have
  965.           gapdos.userbaud     User's bps rate
  966.           gapdos.userfirst    User's first name
  967.           gapdos.userindex    User's index into user file
  968.           gapdos.username     User's full name
  969.           
  970.           
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.                                        Page 14
  989.  
  990.  
  991.  
  992.  
  993.  
  994.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  995.  
  996.  
  997.           USERS.DAT VARIABLES
  998.           -------------------
  999.           
  1000.           These variables  are initialized  by the  programmer by  making a
  1001.           call to  read.gapuser.  Please see the GAPSTRUC.H header file for
  1002.           the actual definition of these variables.
  1003.           
  1004.           WARNING : STRING fields are fully padded with spaces and the last
  1005.           position of the string is and MUST be a 0!
  1006.           
  1007.           
  1008.           user.blts           Total bulletins read
  1009.           user.bphone         User's work or data phone number
  1010.           user.city           City, state, and zip (padded)
  1011.           user.curbytes       Total bytes downloaded this call
  1012.           user.curdown        Total files dowloaded today
  1013.           user.doors          Total doors opened
  1014.           user.downloads      Total downloads
  1015.           user.expert         Novice = N, expert = Y
  1016.           user.fname          User's first name (padded)
  1017.           user.handle         User's handle (padded)
  1018.           user.hphone         User's home phone number
  1019.           user.joined         Total forums joined
  1020.           user.lastdate       Last date on - mm/dd/yy
  1021.           user.lastdir        Date last looked at a directory listing
  1022.           user.lastfrm        Last forum in
  1023.           user.lastmsg        Last message read
  1024.           user.lasttime       Last time on - hh:mm
  1025.           user.level          Security Level
  1026.           user.lname          User's last name (padded)
  1027.           user.mesleft        Total messages left
  1028.           user.mesread        Total messages read
  1029.           user.minutes        Total minutes last call
  1030.           user.page           Page length
  1031.           user.passwd         User's password (padded)
  1032.           user.private        Allow on private nodes?
  1033.           user.protocol       Transfer protocol (padded)
  1034.           user.subscribe      Date user's subscription expires
  1035.           user.sysop          Sysop record, 1 = Y, 0 = N
  1036.           user.timeson        Number of times on
  1037.           user.ttlbytes       Total bytes downloaded
  1038.           user.ttlmins        Total mins on
  1039.           user.upbytes        Total bytes uploaded
  1040.           user.uploads        Total uploads
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.                                        Page 15
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1061.  
  1062.  
  1063.           PCBOARD.SYS VARIABLES
  1064.           ---------------------
  1065.           
  1066.           These variables are initialized automatically by init_door if the
  1067.           BBS system is PCB (set by environment variable GAPCDR=PCB).
  1068.           
  1069.           
  1070.           pcbsys.baud         Com port bps rate
  1071.           pcbsys.calleralarm  Caller alarm   -1=on,0=off
  1072.           pcbsys.color        Color toggle   Y,N,7
  1073.           pcbsys.ctime        Time user logged on as HH:MM
  1074.           pcbsys.display      Display on/off -1=on,0=off
  1075.           pcbsys.event_active Event active   -1=yes,0=no
  1076.           pcbsys.errcorrect   ECC modem      -1=yes,0=no
  1077.           pcbsys.event        Event time as HH:MM
  1078.           pcbsys.forumnum     Forum user was in  "0" = main
  1079.           pcbsys.minsleft     Minutes left for caller
  1080.           pcbsys.node         Node number as short integer
  1081.           pcbsys.pagebell     Page bell      -1=on,0=off
  1082.           pcbsys.password     User's password
  1083.           pcbsys.port         Com port as "0","1", or "2"
  1084.           pcbsys.printer      Printer on/off -1=on,0=off
  1085.           pcbsys.slide_event  Slide event    -1=yes,0=no
  1086.           pcbsys.sysopnext    Sysop on next  N,X,space
  1087.           pcbsys.timeallowed  Allowed time in minutes
  1088.           pcbsys.timecredit   Any time credits in minutes
  1089.           pcbsys.timegiven    Highest forum time given
  1090.           pcbsys.timeon       Time user logged on in minutes
  1091.           pcbsys.timeused     Time user has used that day
  1092.           pcbsys.ttlbytes     Total K bytes available
  1093.           pcbsys.userbaud     Caller bps rate (Local if local mode)
  1094.           pcbsys.userfirst    User's first name
  1095.           pcbsys.username     Name of caller
  1096.           pcbsys.userrec      User's record number
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.                                        Page 16
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1127.  
  1128.  
  1129.           PCB USERS VARIABLES
  1130.           -------------------
  1131.           
  1132.           These variables are initialized automatically by init_door if the
  1133.           BBS system is PCB (set by environment variable GAPCDR=PCB).
  1134.           
  1135.           
  1136.           pcbuser.bphone      User's work or data phone number
  1137.           pcbuser.city        City, state, and zip (padded)
  1138.           pcbuser.forum_regis Forum registration
  1139.           pcbuser.delete      Delete, Y=yes,N=no
  1140.           pcbuser.curdown     Total download bytes.
  1141.           pcbuser.downbytes   Total download bytes.
  1142.           pcbuser.downloads   Number of downloads
  1143.           pcbuser.expert      Expert mode Y=yes,N=no
  1144.           pcbuser.hphone      User's home phone
  1145.           pcbuser.lastconf    Last forum in
  1146.           pcbuser.lastdate    Last date user was on
  1147.           pcbuser.lastdir     Last New files scan
  1148.           pcbuser.lastime     Last time user was on
  1149.           pcbuser.lastmsg     Last message read in main.
  1150.           pcbuser.lastmsg1    Last message read in each forum
  1151.           pcbuser.level       User's level as short integer
  1152.           pcbuser.name        User's name
  1153.           pcbuser.page        Page length
  1154.           pcbuser.passwd      User's password
  1155.           pcbuser.protocol    Protocol type
  1156.           pcbuser.regisdate   Registration date
  1157.           pcbuser.timeson     Number of times on
  1158.           pcbuser.upbytes     Total upload bytes.
  1159.           pcbuser.uploads     Number of uploads
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.                                        Page 17
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1193.  
  1194.  
  1195.                       GLOBAL VARIABLES - ALPHABETICALLY By Type
  1196.                       -----------------------------------------
  1197.           
  1198.           
  1199.           DEFINES
  1200.           -------
  1201.           
  1202.           NO                  Defined as 0
  1203.           YES                 Defined as 1
  1204.           
  1205.           CHARS
  1206.           -----
  1207.           
  1208.           chat                True if chatting with caller
  1209.           clockon             If 0, don't display status line clock
  1210.           dopcb               If set to 1, the BBS is a PCB system
  1211.           endview             True if caller doesn't want to view any more
  1212.           fileshow            1 if showing a file, 0 if not
  1213.           gapdos.didnew       1 = did a new files scan
  1214.           gapdos.exitdos      1 = exit to DOS after call
  1215.           instatus            Used by BIOS interceptor
  1216.           noup                If set to 1, get_string will not uppercase
  1217.           NS                  True if in Continuous mode
  1218.           pcbsys.forumnum     Forum user was in  "0" = main
  1219.           pcbsys.node         Node number as short integer
  1220.           pcbsys.port         Com port as "0","1", or "2"
  1221.           pcbsys.sysopnext    Sysop on next  N,X,space
  1222.           pcbuser.delete      Delete, Y=yes,N=no
  1223.           pcbuser.expert      Expert mode Y=yes,N=no
  1224.           pcbuser.lastconf    Last forum in
  1225.           pcbuser.level       User's level as short integer
  1226.           pcbuser.page        Page length
  1227.           pcbuser.protocol    Protocol type
  1228.           redisplay           True if wants to see file from beginning
  1229.           user.expert         Novice = N, expert = Y
  1230.           user.sysop          Sysop record, 1 = Y, 0 = N
  1231.           view                True if viewing a file
  1232.           
  1233.           DOUBLES
  1234.           -------
  1235.           
  1236.           pcbuser.curdown     Total download bytes.
  1237.           pcbuser.downbytes   Total download bytes.
  1238.           pcbuser.upbytes     Total upload bytes.
  1239.           
  1240.           FLOATS
  1241.           ------
  1242.           
  1243.           pcbuser.lastmsg1    Last message read in each forum
  1244.           pcbuser.lastmsg     Last message read in main.
  1245.           
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                                        Page 18
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1259.  
  1260.  
  1261.           INTEGERS
  1262.           --------
  1263.           
  1264.           alarm               Caller Alarm. 0 = off, 1 = on
  1265.           baud                DTE rate to open COMM port at
  1266.           bell                Page Bell. 0 = off, 1 = on
  1267.           color               Color toggle. 0 = no color, 1 = color ok
  1268.           expert              Expert mode. 0 = non-expert, 1 = expert
  1269.           gapdos.baud         DTE bps rate
  1270.           gapdos.forumnum     Forum the user is in
  1271.           gapdos.givetime     1 = event pending, else extra time received
  1272.           gapdos.local        0 = user, 1 = sysop, 2 = local user
  1273.           gapdos.minavail     Total minutes available to user
  1274.           gapdos.port         Port being used
  1275.           gapdos.timecredit   Any time credits user may have
  1276.           gapdos.userbaud     User's bps rate
  1277.           level               User's security level
  1278.           lines               Number of lines currently displayed
  1279.           local               0 = remote user, 1 = local
  1280.           minsleft            Number of minutes user has left at door start
  1281.           node                Node number. 0 = single user
  1282.           page                User's page length
  1283.           parity              Should actually be data bits and is not used
  1284.           pcbsys.minsleft     Minutes left for caller
  1285.           pcbsys.timeallowed  Allowed time in minutes
  1286.           pcbsys.timecredit   Any time credits in minutes
  1287.           pcbsys.timegiven    Highest forum time given
  1288.           pcbsys.timeon       Time user logged on in minutes
  1289.           pcbsys.timeused     Time user has used that day
  1290.           pcbsys.ttlbytes     Total K bytes available
  1291.           pcbsys.userrec      User's record number
  1292.           pcbuser.downloads   Number of downloads
  1293.           pcbuser.timeson     Number of times on
  1294.           pcbuser.uploads     Number of uploads
  1295.           port                Communications port in use
  1296.           printer             Printer Toggle. 0 = off, 1 = on
  1297.           screen              Screen display. 0 = off, 1 = on
  1298.           timecredit          Time credits for user (in minutes)
  1299.           timeleft            Time user has left (in minutes)
  1300.           user.curdown        Total files dowloaded today
  1301.           user.lastfrm        Last forum in
  1302.           user.level          Security Level
  1303.           user.minutes        Total minutes last call
  1304.           user.page           Page length
  1305.           userbaud            BPS rate of the remote user
  1306.           
  1307.           LONGS
  1308.           -----
  1309.           
  1310.           downbytes           Total bytes downloaded
  1311.           downloads           Number of downloads
  1312.           gapdos.callbytes    Ttl bytes available for download
  1313.           gapdos.joined       Bit flags of forums joined
  1314.           gapdos.starttime    Time (in seconds) user logged on
  1315.  
  1316.  
  1317.  
  1318.                                        Page 19
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1325.  
  1326.  
  1327.           maxbytes            Maximum number of bytes allowed to download
  1328.           recnum              User's record number in USER file
  1329.           starttime           Time the user logged on (in seconds)
  1330.           temptime            For calculating keyboard time out
  1331.           timenow             Time it is now  (in seconds)
  1332.           timeson             Number of times user has been on
  1333.           upbytes             Total bytes uploaded
  1334.           uploads             Number of uploads
  1335.           user.blts           Total bulletins read
  1336.           user.curbytes       Total bytes downloaded this call
  1337.           user.doors          Total doors opened
  1338.           user.downloads      Total downloads
  1339.           user.joined         Total forums joined
  1340.           user.lastmsg        Last message read
  1341.           user.mesleft        Total messages left
  1342.           user.mesread        Total messages read
  1343.           user.timeson        Number of times on
  1344.           user.ttlbytes       Total bytes downloaded
  1345.           user.ttlmins        Total mins on
  1346.           user.upbytes        Total bytes uploaded
  1347.           user.uploads        Total uploads
  1348.           
  1349.           STRINGS
  1350.           -------
  1351.           
  1352.           anystring           Global garbage collector
  1353.           BBLACK              ANSI codes for Grey
  1354.           BBLUE               ANSI codes for bright Blue
  1355.           bbs_dir             Path to BBS default dir
  1356.           BCYAN               ANSI codes for bright Cyan
  1357.           BGREEN              ANSI codes for bright Green
  1358.           BLACK               ANSI codes for Black
  1359.           BLUE                ANSI codes for Blue
  1360.           BMAGENTA            ANSI codes for bright Magenta
  1361.           board_name          Name of the BBS
  1362.           bphone              User's business or data phone number
  1363.           BRED                ANSI codes for bright Red
  1364.           BROWN               ANSI codes for Brown
  1365.           BWHITE              ANSI codes for bright White
  1366.           city                User's home town
  1367.           curtime             Holds the current time as a string
  1368.           CYAN                ANSI codes for Cyan
  1369.           fname               User's first name
  1370.           gapdos.userfirst    User's first name
  1371.           gapdos.userindex    User's index into user file
  1372.           gapdos.username     User's full name
  1373.           gendir              Path to the gen directory
  1374.           GREEN               ANSI codes for Green
  1375.           hphone              User's home phone number
  1376.           lastdate            Last date user was on
  1377.           lname               User's last name
  1378.           MAGENTA             ANSI codes for Magenta
  1379.           maindir             Path to the main directory
  1380.           password            User's password. PASSWORD if sysop is on
  1381.  
  1382.  
  1383.  
  1384.                                        Page 20
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1391.  
  1392.  
  1393.           pcbsys.baud         Com port bps rate
  1394.           pcbsys.calleralarm  Caller alarm   -1=on,0=off
  1395.           pcbsys.color        Color toggle   Y,N,7
  1396.           pcbsys.ctime        Time user logged on as HH:MM
  1397.           pcbsys.display      Display on/off -1=on,0=off
  1398.           pcbsys.errcorrect   ECC modem      -1=yes,0=no
  1399.           pcbsys.event        Event time as HH:MM
  1400.           pcbsys.event_active Event active   -1=yes,0=no
  1401.           pcbsys.pagebell     Page bell      -1=on,0=off
  1402.           pcbsys.password     User's password
  1403.           pcbsys.printer      Printer on/off -1=on,0=off
  1404.           pcbsys.slide_event  Slide event    -1=yes,0=no
  1405.           pcbsys.userbaud     Caller bps rate (Local if local mode)
  1406.           pcbsys.userfirst    User's first name
  1407.           pcbsys.username     Name of caller
  1408.           pcbuser.bphone      User's work or data phone number
  1409.           pcbuser.city        City, state, and zip (padded)
  1410.           pcbuser.forum_regis Forum registration
  1411.           pcbuser.hphone      User's home phone
  1412.           pcbuser.lastdate    Last date user was on
  1413.           pcbuser.lastdir     Last New files scan
  1414.           pcbuser.lastime     Last time user was on
  1415.           pcbuser.name        User's name
  1416.           pcbuser.passwd      User's password
  1417.           pcbuser.regisdate   Registration date
  1418.           RED                 ANSI codes for Red
  1419.           strtime             Holds the time as a string
  1420.           subscrip            Date user's subscription expires
  1421.           sysname             Sysop's name
  1422.           user.bphone         User's work or data phone number
  1423.           user.city           City, state, and zip (padded)
  1424.           user.fname          User's first name (padded)
  1425.           user.handle         User's handle (padded)
  1426.           user.hphone         User's home phone number
  1427.           user.lastdate       Last date on - mm/dd/yy
  1428.           user.lastdir        Date last looked at a directory listing
  1429.           user.lasttime       Last time on - hh:mm
  1430.           user.lname          User's last name (padded)
  1431.           user.passwd         User's password (padded)
  1432.           user.private        Allow on private nodes?
  1433.           user.protocol       Transfer protocol (padded)
  1434.           user.subscribe      Date user's subscription expires
  1435.           username            User's full name
  1436.           WHITE               ANSI codes for White
  1437.           YELLOW              ANSI codes for Yellow
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                                        Page 21
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1457.  
  1458.  
  1459.                              FUNCTIONS - QUICK REFERENCE
  1460.                              ---------------------------
  1461.           
  1462.           ansi                Displays ANSI escape sequences.
  1463.           backspace           Sends one or more backspaces.
  1464.           ckeypress           Checks for a remote or local key press.
  1465.           clear_scrn          Clears the local and remote screens
  1466.           do_chat             To allow sysop to chat with remote user.
  1467.           elap_time           Computes elapsed time.
  1468.           get_string          Gets a string of characters.
  1469.           getakey             Gets one key responses.
  1470.           get_random          Returns a random number.
  1471.           init_door           Initializes the Door.
  1472.           leave               Shuts down door and returns to the BBS.
  1473.           more                Checks for a full screen.
  1474.           nl                  Sends a CR/LF to local and remote.
  1475.           no_carrier          Called by the Comm Routines if Carrier lost.
  1476.           open_gap            Opens and reads GAPBBS.CNF.
  1477.           pagesysop           Alerts sysop that the user wants to chat.
  1478.           pause               Sends a "Press [Any Key] To Continue" prompt.
  1479.           putachar            Sends a single character.
  1480.           putkey              Used by chat for word wrapping.
  1481.           read_cnf            Reads the door configuration file.
  1482.           read_doorsys        Reads DOOR.SYS.
  1483.           read_gapdos         Reads GAPDOS.DAT.
  1484.           read_gapuser        Reads USERS.DAT.
  1485.           read_pcbsys         Reads PCBOARD.SYS.
  1486.           read_pcbuser        Reads PCB USERS file.
  1487.           read_score          Reads and displays top 10 scores.
  1488.           trim                Trims spaces from string.
  1489.           set_status          Displays status line.
  1490.           show_file           Displays text files.
  1491.           show_mess           Displays a message.
  1492.           time_credit         Gives credits for time used.
  1493.           time_left           Computes time remaining.
  1494.           update_clock        Updates status line clock.
  1495.           wait                Pauses for x number of seconds.
  1496.           wrap_word           Wraps a word.
  1497.           write_gapdos        Writes GAPDOS.DAT.
  1498.           write_gapuser       Writes USERS.DAT.
  1499.           write_pcbsys        Writes PCBOARD.SYS.
  1500.           write_pcbuser       Writes PCB USERS.
  1501.           write_score         Creates and maintains top 10 scores file.
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.                                        Page 22
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1523.  
  1524.  
  1525.                                 FUNCTIONS - REFERENCE
  1526.                                 ---------------------
  1527.           
  1528.           Functions will  return either a void (nothing), an integer value,
  1529.           or a  character pointer.   To  retrieve the  return value, either
  1530.           assign it  to a  variable of  the same  type, or use the function
  1531.           call in a test expression such as :
  1532.           
  1533.                intvar = getakey();
  1534.           
  1535.                        or
  1536.           
  1537.                if (ckeypress())
  1538.                     key = getakey();
  1539.           
  1540.           
  1541.           
  1542.           
  1543.           
  1544.           
  1545.                   Name :  ansi
  1546.                Purpose :  Displays ANSI escape sequences
  1547.             Parameters :  ANSI color to display
  1548.           Return Value :  None
  1549.             Convention :  void ansi(color);
  1550.                           char *color;
  1551.           
  1552.            Description :  This function will send a string of ANSI escape
  1553.                           sequences to the remote user and to the local
  1554.                           console.  The ANSI codes for the various colors
  1555.                           are defined as global variables.  If the remote
  1556.                           or local user is in non graphics mode, the
  1557.                           function returns immediately.
  1558.           
  1559.                Example :  ansi(BWHITE)
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.                                        Page 23
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1589.  
  1590.  
  1591.                   Name :  backspace
  1592.                Purpose :  Sends one or more backspaces
  1593.             Parameters :  Number of backspaces to send
  1594.           Return Value :  None
  1595.             Convention :  void backspace(num);
  1596.                           int num;
  1597.           
  1598.            Description :  In order to actually erase a character on the
  1599.                           screen, you must send a 3 character sequence
  1600.                           which consists of backspace, space, backspace.
  1601.                           This function will send as many of these 3 char-
  1602.                           acter sequences as you specify in the parameter
  1603.                           list.
  1604.           
  1605.                Example :  backspace(1)
  1606.                           
  1607.                           strcpy(anystring,"Press Any Key ");
  1608.                           show_mess(anystring,NO,NO)     // show string
  1609.                           while (!ckeypress())           // wait for key
  1610.                              ;
  1611.                           getakey();                     // get the key
  1612.                           backspace(strlen(anystring));  // erase string
  1613.           
  1614.           
  1615.                   Name :  ckeypress
  1616.                Purpose :  Checks for a remote or local key press
  1617.             Parameters :  None
  1618.           Return Value :  0 = no key is waiting, 1 = a key is waiting
  1619.             Convention :  int ckeypress(void);
  1620.           
  1621.            Description :  This function will check the local keyboard as
  1622.                           well as the communications receive buffer to see
  1623.                           if a key is waiting to be read.  It is most often
  1624.                           used in loops that need to receive a 1 character
  1625.                           keystroke.
  1626.           
  1627.                Example :  c = ckeypress();               // key pressed?
  1628.                           
  1629.                           while(!ckeypress())            // do something
  1630.                              {
  1631.                              |                           // until a key
  1632.                              |                           // is pressed
  1633.                              }
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.                                        Page 24
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1655.  
  1656.  
  1657.                   Name :  clear_scrn
  1658.                Purpose :  Clears local and remote screens.
  1659.             Parameters :  None
  1660.           Return Value :  None
  1661.             Convention :  void clear_scrn(void);
  1662.           
  1663.            Description :  This routine will use the assembler routine cls
  1664.                           to clear the first 23 lines of the local screen.
  1665.                           If the remote caller is in non-color mode, it
  1666.                           sends a CTRL-L to the remote screen, otherwise it
  1667.                           sends the ANSI clear screen sequence.
  1668.           
  1669.                Example :  clear_scrn();                  // clear screen
  1670.           
  1671.           
  1672.                   Name :  do_chat
  1673.                Purpose :  To allow sysop to chat with remote user
  1674.             Parameters :  None
  1675.           Return Value :  None
  1676.             Convention :  void do_chat(void);
  1677.           
  1678.            Description :  This function allows a one on one chat with a re-
  1679.                           mote user.  If the caller is in graphics mode,
  1680.                           the sysop's key presses will be displayed in
  1681.                           green and the remote user's key presses will be
  1682.                           displayed in white. Text will automatically wrap
  1683.                           at column 76.  To exit chat, press either the ESC
  1684.                           key or type a CTRL-X.  Note that the user may
  1685.                           also send these characters to end chat. The user
  1686.                           will receive full credit for the time spent chat-
  1687.                           ting with the sysop.  However, this function will
  1688.                           not update the BBS system file so it is possible
  1689.                           that the user may be logged off (with an out of
  1690.                           time message) when he/she returns to the BBS.
  1691.           
  1692.                Example :  do_chat();
  1693.                           
  1694.                           empty(response,2);             // initialize
  1695.                           get_string(response);          // get a string
  1696.                           if (response[0] == 'P')        // paging sysop
  1697.                              do_chat();                  // chat with sysop
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.                                        Page 25
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1721.  
  1722.  
  1723.                   Name :  elap_time
  1724.                Purpose :  Computes elapsed time while waiting for keyboard
  1725.                           input
  1726.             Parameters :  None
  1727.           Return Value :  None
  1728.             Convention :  void elap_time(void);
  1729.           
  1730.            Description :  This function is used in loops that await a key-
  1731.                           board response.  Prior to entering the loop, the
  1732.                           variable called temptime should be initialized
  1733.                           with the current time. Once inside the loop, this
  1734.                           function should be called to keep track of the
  1735.                           elapsed time. If there is no keyboard response
  1736.                           within 4 minutes, the user will be logged off.
  1737.           
  1738.                Example :  elap_time();
  1739.                           
  1740.                           time (&temptime);              // start timer
  1741.                                                          // check activity
  1742.                           while (!getakey())             // until a key is
  1743.                              elap_time();                // pressed
  1744.           
  1745.           
  1746.                   Name :  get_string
  1747.                Purpose :  Gets a string of characters
  1748.             Parameters :  String to fill
  1749.           Return Value :  None
  1750.             Convention :  void get_string(string);
  1751.                           char *string;
  1752.           
  1753.            Description :  This is the main input routine.  It will get a
  1754.                           string from either the remote user or the local
  1755.                           keyboard.  The string passed will be set to the
  1756.                           characters received. The length of the input
  1757.                           string is determined by the length of the string
  1758.                           passed.
  1759.                           
  1760.                           Before calling, you must initialize the passed
  1761.                           string with spaces.  The number of spaces in the
  1762.                           string determines the number of characters al-
  1763.                           lowed to be input. If a user attempts to type
  1764.                           more characters than allowed, the cursor will not
  1765.                           move pass the end of the string.  Input ends when
  1766.                           the Enter key is pressed.
  1767.                           
  1768.                           To initialize the string, use the empty function.
  1769.                           
  1770.                           WARNING : It is extremely important that the
  1771.                           passed string be initialized.  Failure to set the
  1772.                           string to spaces, will cause unpredictable
  1773.                           results!
  1774.                           
  1775.                           This function does not return a new string con-
  1776.                           taining the keyboard input.  Instead, it modifies
  1777.  
  1778.  
  1779.  
  1780.                                        Page 26
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1787.  
  1788.  
  1789.                           the string you pass to it in the parameter list.
  1790.                           The string will be stripped of any trailing
  1791.                           spaces.
  1792.                           
  1793.                           get_string automatically uppercases the string.
  1794.                           If you wish to disable this feature, set the
  1795.                           variable noup to 1.
  1796.                           
  1797.                           get_string will automatically check for keyboard
  1798.                           activity so it is not necessary for you to do so.
  1799.           
  1800.                Example :  empty(instr,10);               // initialize
  1801.                           get_string(instr);             // get string
  1802.           
  1803.           
  1804.                   Name :  getakey
  1805.                Purpose :  Gets one key responses
  1806.             Parameters :  None
  1807.           Return Value :  ASCII code for the key pressed or 0
  1808.             Convention :  int getakey(void);
  1809.           
  1810.            Description :  This is the main keyboard input routine
  1811.                           (internal). It is called by get_string as well as
  1812.                           any keyboard polling loops.  It checks the re-
  1813.                           ceive buffer as well as the local keyboard for a
  1814.                           key press.  If one is not found it returns 0.
  1815.                           The character input is not echoed. Since 99% of
  1816.                           all keyboard input comes from this routine, it
  1817.                           checks for time remaining, keyboard time-out, as
  1818.                           well as special sysop function keys.  The
  1819.                           "timeleft" variable is updated via this routine.
  1820.                           This is the variable you would normally use in a
  1821.                           prompt such as,
  1822.                           
  1823.                               [20 mins left] Main Command :
  1824.           
  1825.                Example :  c = getakey();
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.                                        Page 27
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1853.  
  1854.  
  1855.                   Name :  get_random
  1856.                Purpose :  Gets a random number
  1857.             Parameters :  Low number, high number
  1858.           Return Value :  A random number
  1859.             Convention :  int get_random(low,high);
  1860.                           int low;
  1861.                           int high;
  1862.           
  1863.            Description :  This routine is provided because it is much
  1864.                           easier to use and understand than the C library
  1865.                           routine (which drags in the floating point
  1866.                           library).  Provide as parameters, two integers.
  1867.                           The first parameter is the lowest number you will
  1868.                           accept as a random number, and the second
  1869.                           parameter is the highest random number you will
  1870.                           accept.  The function will return a random
  1871.                           integer between the range specified (low and high
  1872.                           are included in the range of numbers).  It is not
  1873.                           necessary to seed the random number generator as
  1874.                           this is done automatically for you during program
  1875.                           initialization.
  1876.           
  1877.                Example :  rndnum = get_random(1,10);     // get a random
  1878.                                                          // number between
  1879.                                                          // 1 and 10
  1880.           
  1881.           
  1882.                   Name :  init_door
  1883.                Purpose :  Initializes the GAPCDR functions
  1884.             Parameters :  None
  1885.           Return Value :  None
  1886.             Convention :  void init_door(void);
  1887.           
  1888.            Description :  This routine must be called immediately after
  1889.                           calling read_cnf.  It initializes the door, opens
  1890.                           and reads system files, initializes the comm
  1891.                           port, initializes global variables and in
  1892.                           general, makes sure that all of the files
  1893.                           required for operation are present. There is no
  1894.                           return value.  If an error occurs while trying to
  1895.                           initialize, the function will display an error
  1896.                           message and end the program.
  1897.           
  1898.                Example :  read_cnf("DOOR.CFG");          // read cnf file
  1899.                           init_door();                   // init the door
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.                                        Page 28
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1919.  
  1920.  
  1921.                   Name :  leave
  1922.                Purpose :  Exits the program
  1923.             Parameters :  The exit code you wish to terminate with
  1924.           Return Value :  None
  1925.             Convention :  void leave(code);
  1926.                           int code;
  1927.           
  1928.            Description :  When the program terminates, it must call this
  1929.                           function to end.  This is the ONLY proper exit
  1930.                           from the door.  It is of vital importance to end
  1931.                           your program thru this function so that the
  1932.                           interrupt service routines that are installed at
  1933.                           door beginning can be removed.
  1934.           
  1935.                Example :  leave(0);
  1936.           
  1937.           
  1938.                   Name :  more
  1939.                Purpose :  Checks for a full screen and issues a More Prompt
  1940.             Parameters :  None
  1941.           Return Value :  None
  1942.             Convention :  void more(void);
  1943.           
  1944.            Description :  This is an internal routine that is called by the
  1945.                           character output functions.
  1946.           
  1947.                Example :
  1948.           
  1949.           
  1950.                   Name :  nl
  1951.                Purpose :  To send a Carriage Return and Line Feed to local
  1952.                           and remote
  1953.             Parameters :  Number of New Line's to send
  1954.           Return Value :  None
  1955.             Convention :  void nl(lines);
  1956.                           int lines;
  1957.           
  1958.            Description :  To send a blank line, call this routine with the
  1959.                           number of blank lines you wish to send.
  1960.           
  1961.                Example :  nl(2);                         // send two blank
  1962.                                                          // lines
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.                                        Page 29
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  1985.  
  1986.  
  1987.                   Name :  no_carrier
  1988.                Purpose :  Used by the Comm functions.
  1989.             Parameters :  None
  1990.           Return Value :  None
  1991.             Convention :  void no_carrier(void);
  1992.           
  1993.            Description :  Internal routine that is called when there is a
  1994.                           loss of carrier.  Displays a message to the local
  1995.                           screen and then calls leave to terminate the
  1996.                           program.
  1997.           
  1998.                Example :
  1999.           
  2000.           
  2001.                   Name :  open_gap
  2002.                Purpose :  Opens and reads the GAPBBS.CNF file
  2003.             Parameters :  None
  2004.           Return Value :  0 = no error, 1 = error
  2005.             Convention :  int open_gap(void);
  2006.           
  2007.            Description :  This function is called by init_door.  It opens
  2008.                           and reads the configuration file for GAP.  Note
  2009.                           that only part of the CNF file is read.  The main
  2010.                           purpose for reading the file is to obtain the
  2011.                           path to the BBS's main directory and get the
  2012.                           sysop' name.
  2013.           
  2014.                Example :  c = open_gap();
  2015.           
  2016.           
  2017.                   Name :  pagesysop
  2018.                Purpose :  Alerts sysop that user wants to chat
  2019.             Parameters :  None
  2020.           Return Value :  None
  2021.             Convention :  void pagesysop(void);
  2022.           
  2023.             Description : Allows the programer to provide the user with a
  2024.                           Page Sysop command.  The page lasts for 30
  2025.                           seconds and can be aborted by typing CTRL K. If
  2026.                           the sysop's page bell is on, the sysop's speaker
  2027.                           will also sound.  To answer the page, the sysop
  2028.                           should press CTRL F10.
  2029.           
  2030.                Example :  empty(response,2);             // initialize var
  2031.                           get_string(response);          // get a response
  2032.                           if (response[0] = 'P')         // wants to chat
  2033.                              pagesysop();                // tell sysop
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.                                        Page 30
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2051.  
  2052.  
  2053.                   Name :  pause
  2054.                Purpose :  Sends a "Press [Any Key] To Continue" prompt
  2055.             Parameters :  None
  2056.           Return Value :  None
  2057.             Convention :  void pause(void);
  2058.           
  2059.             Description : This function sends a pause prompt and waits for
  2060.                           a key press.
  2061.           
  2062.                Example :  nl(1);                         // send blank line
  2063.                           pause();                       // wait for a key
  2064.           
  2065.           
  2066.                   Name :  putachar
  2067.                Purpose :  Send a single character to local and remote
  2068.             Parameters :  Integer value of ASCII character to send
  2069.           Return Value :  None
  2070.             Convention :  void putachar(ch);
  2071.                           int ch;
  2072.           
  2073.            Description :  This routine is called a "semi-unfiltered" char-
  2074.                           acter output routine because it allows for most
  2075.                           ASCII characters to be output.
  2076.           
  2077.                Example :  c  = 65;                       // send an 'A'
  2078.                           putachar(c);                   // to local and
  2079.                                                          // remote screen
  2080.                           
  2081.                           c = getakey();                 // get a keypress
  2082.                           if (c != 0)                    // if we got a key
  2083.                              putachar(c)                 // display the
  2084.                                                          // character
  2085.           
  2086.           
  2087.                   Name :  putkey
  2088.                Purpose :  Used by chat routines to keep track of word
  2089.                           wrapping
  2090.             Parameters :  Integer representing character to send
  2091.           Return Value :  None
  2092.             Convention :  void putkey(ch);
  2093.                           int ch;
  2094.           
  2095.            Description :  This is the main output routine for the chat
  2096.                           functions. It keeps track of the current column,
  2097.                           and decides when it is time to wrap a word.  It
  2098.                           should not be called by the programmer's routines
  2099.                           since putachar is faster and more efficient.
  2100.           
  2101.                Example :
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.                                        Page 31
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2117.  
  2118.  
  2119.                   Name :  read_cnf
  2120.                Purpose :  To read the door configuration file
  2121.             Parameters :  Full path and file name to the configuration
  2122.                           file.
  2123.           Return Value :  FILE pointer
  2124.             Convention :  FILE *read_cnf(path);
  2125.                           char *path;
  2126.           
  2127.            Description :  Opens the configuration file for the current
  2128.                           door. Normally the passed parameter is the name
  2129.                           of the door with a .CNF extension (it is assumed
  2130.                           that the file is in the same directory as the
  2131.                           door program). If an error occurs, the program
  2132.                           ends immediately.
  2133.                           
  2134.                           WARNING : The first two lines of this configura-
  2135.                           tion file belong to the GAPCDR interface module.
  2136.                           You are free to use the information, but the in-
  2137.                           formation contained in the first two lines must
  2138.                           conform exactly to the following specifications.
  2139.                           
  2140.                           The first line of this file is the full drive and
  2141.                           path to the BBS default directory.  This is the
  2142.                           directory where the BBS system files can be found
  2143.                           (IE, GAPDOS.DAT, DOOR.SYS, GAPBBS.CNF).  The en-
  2144.                           try on line 1 is not checked until init_door is
  2145.                           called.
  2146.                           
  2147.                           The second line of this file is the name of the
  2148.                           BBS.
  2149.                           
  2150.                           It is the responsibility of the door author to
  2151.                           describe the format of these two lines to the end
  2152.                           user.  It is also the responsibility of the door
  2153.                           author to insure that the end user have these two
  2154.                           lines in the door configuration file.  If your
  2155.                           door program requires no configuration parameters
  2156.                           of its own, you can simply distribute a sample
  2157.                           "door".cnf file with these two lines already in
  2158.                           it.
  2159.                           
  2160.                           GAPCDR will NOT close this file (a FILE pointer
  2161.                           to the file will be returned) after reading the
  2162.                           first two lines.  It leaves the file open for the
  2163.                           programmer's use.  If your door does require
  2164.                           certain configuration parameters, have your users
  2165.                           place the parameters in the file starting with
  2166.                           line 3.  If you use a set up program, be sure
  2167.                           that your set up program writes the first two
  2168.                           lines as specified.
  2169.                           
  2170.                           After you have called read_cnf and init_door, if
  2171.                           you have any configuration options in the
  2172.                           "door".cnf file, you should use the stream input
  2173.  
  2174.  
  2175.  
  2176.                                        Page 32
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2183.  
  2184.  
  2185.                           routines to read those options. Then fclose the
  2186.                           file using the FILE pointer returned.  Even if
  2187.                           you have no options to read, close the file.
  2188.                           
  2189.                           WARNING : You MUST call this routine before using
  2190.                           any of the GAPCDR functions.  After calling this
  2191.                           routine, you MUST call init_door.
  2192.           
  2193.                Example :  FILE *fp;                      // File pointer
  2194.                           fp = read_cnf("TOURIST.CNF");  // read cnf file
  2195.                           fclose(fp);                    // close the file
  2196.                           init_door();                   // init the door
  2197.           
  2198.           
  2199.                   Name :  read_doorsys
  2200.                Purpose :  Reads the DOOR.SYS universal door interface file
  2201.             Parameters :  None
  2202.           Return Value :  0 = no error, 1 = error
  2203.             Convention :  int read_doorsys(void);
  2204.           
  2205.            Description :  Internal routine called by init_door.  Reads the
  2206.                           DOOR.SYS file and initializes any global
  2207.                           variables that depend on the information in that
  2208.                           file.
  2209.           
  2210.                Example :  c = read_doorsys();
  2211.           
  2212.           
  2213.                   Name :  read_gapdos
  2214.                Purpose :  Reads the GAP Communications DOS file.
  2215.             Parameters :  None
  2216.           Return Value :  0 = no error, 1 = error
  2217.             Convention :  int read_gapdos(void);
  2218.           
  2219.            Description :  GAPDOS.DATReads the GAPDOS.DAT remote exit to DOS
  2220.                           file.  If you have a need for the information in
  2221.                           this file, or if you need to modify the record
  2222.                           variables, this function will read the file for
  2223.                           you.  The record variables are contained in a
  2224.                           variable called gapdos.
  2225.                           
  2226.                           WARNING : Do NOT modify the string fields in
  2227.                           GAPDOS.DAT. If the gapdos.userindex field is
  2228.                           changed, GAP will be unable to find the user in
  2229.                           the userfile upon return from the door.
  2230.                           
  2231.                           The only proper way to update this file is to
  2232.                           first read it.  Make any changes to the variables
  2233.                           themselves or use your own temporary variables.
  2234.                           Then call write_gapdos to update the record.
  2235.           
  2236.                Example :  c = read_gapdos()
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.                                        Page 33
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2249.  
  2250.  
  2251.                   Name :  read_gapuser
  2252.                Purpose :  Reads the GAP Communications USERS.DAT file
  2253.             Parameters :  None
  2254.           Return Value :  0 = no error, 1 = error
  2255.             Convention :  int read_gapuser(void);
  2256.           
  2257.            Description :  Reads the user record of the current user in the
  2258.                           GAP USERS.DAT file.  The record variables are
  2259.                           contained in a variable called user.
  2260.           
  2261.                Example :  c = read_gapuser();
  2262.           
  2263.           
  2264.                   Name :  read_pcbsys
  2265.                Purpose :  Reads the PCBOARD.SYS file.
  2266.             Parameters :  None
  2267.           Return Value :  0 = no error, 1 = error
  2268.             Convention :  int read_pcbsys(void);
  2269.           
  2270.            Description :  For a PCB setup, this function is automatically
  2271.                           called by init_door.  Do not use unless dopcb is
  2272.                           set to 1.
  2273.           
  2274.                Example :  c = read_pcbsys();
  2275.           
  2276.           
  2277.                   Name :  read_pcbuser
  2278.                Purpose :  Reads the PCB USERS file.
  2279.             Parameters :  None
  2280.           Return Value :  0 = no error, 1 = error
  2281.             Convention :  int read_pcbuser(void);
  2282.           
  2283.            Description :  For a PCB setup, this function is automatically
  2284.                           called by init_door.  Do not use unless dopcb is
  2285.                           set to 1.  Note that to change the fields
  2286.                           downbytes, upbytes, or lastmsg, you will need to
  2287.                           use the C library routines designed specifically
  2288.                           for converting MSB formatted numbers.
  2289.           
  2290.                Example :  c = read_pcbuser();
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.                                        Page 34
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2315.  
  2316.  
  2317.                   Name :  read_score
  2318.                Purpose :  Reads the score file and displays the results.
  2319.             Parameters :  data file to read, message to display
  2320.           Return Value :  0 = scores read, 1 = no scores to read
  2321.             Convention :  int read_score(datfile,message);
  2322.                           char *datfile;
  2323.                           char *message;
  2324.           
  2325.            Description :  This function will read the scoreboard data file
  2326.                           for your door (if any) and display the results.
  2327.                           You pass as parameters the name of the data file
  2328.                           to read, and a message to display at the top of
  2329.                           the scoreboard.  The message could be something
  2330.                           like "Top 10 Players".
  2331.           
  2332.                Example :  if (read_score("TOURIST.DAT","Top 10 Tourists"))
  2333.                              {
  2334.                              nl(1);
  2335.                              ansi(BWHITE);
  2336.                              show_mess("No one's made it Yet!",NO,YES);
  2337.                              }
  2338.           
  2339.           
  2340.                   Name :  set_status
  2341.                Purpose :  To display and update the sysop status line
  2342.             Parameters :  0 = set the status line, 1 = update the status
  2343.                           line, 4 = show other user stats
  2344.           Return Value :  None
  2345.             Convention :  void set_status(how);
  2346.                           int how;
  2347.           
  2348.            Description :  This routine is used internally.  There should be
  2349.                           no reason to call it unless you have modified a
  2350.                           user's stats and you need to update those stats
  2351.                           on the status line.  In this case, you should use
  2352.                           option 0.
  2353.           
  2354.                Example :  set_status(0);
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.                                        Page 35
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2381.  
  2382.  
  2383.                   Name :  show_file
  2384.                Purpose :  To display a text file
  2385.             Parameters :  The full path and file name to the file to be
  2386.                           shown
  2387.           Return Value :  None
  2388.             Convention :  void show_file(filename);
  2389.                           char *filename;
  2390.           
  2391.            Description :  Many door programs have welcome, news, exit, help
  2392.                           and other files to show to the user at various
  2393.                           points in the program.  This is the function that
  2394.                           allows you to do that.  This function tries to be
  2395.                           as intelligent as it possibly can in determining
  2396.                           the sysop's wishes. To display a file to the
  2397.                           user, call the function with the full
  2398.                           drive\path\filename of the file to display.
  2399.                           
  2400.                           If you have color and non-color versions of files
  2401.                           pass the name of the non-color version as this
  2402.                           function will automatically append a "G" to the
  2403.                           filename if the user is in color mode.  In fact,
  2404.                           this function will ALWAYS try to find a file with
  2405.                           a "G" appended to the end of the name (if the
  2406.                           user is in color mode) before it looks for the
  2407.                           actual file by the name you specified.  If you
  2408.                           pass "WELCOMEG" to this function and the user is
  2409.                           in color mode, it will first try to find a file
  2410.                           with the name of "WELCOMEGG".
  2411.                           
  2412.                           As with GAP Communications, your text files can
  2413.                           have certain control characters as the first
  2414.                           character in the file.  A "{" signals that the
  2415.                           more prompt should never display.  In other
  2416.                           words, GAPCDR will not keep track of the number
  2417.                           of lines displayed and will never issue a more
  2418.                           prompt.  This is useful for very long ANSI files.
  2419.                           A "@" signals that the pause prompt should be
  2420.                           displayed when the screen is full instead of a
  2421.                           more prompt.  This is very handy when you want
  2422.                           the user to see the file in its entirety.  The
  2423.                           user will not be allowed to break out of the file
  2424.                           read.
  2425.                           
  2426.                           WARNING : The "{" or "@" MUST appear as the VERY
  2427.                           first character in the file.  If you use an ANSI
  2428.                           editor, be aware that the first few characters in
  2429.                           a file will usually be an ANSI color sequence.
  2430.                           You normally have to edit the file with a text
  2431.                           editor to insert the control character.
  2432.                           
  2433.                           Pressing CTRL K or CTRL X will abort any file
  2434.                           display if the file does not begin with a "@".
  2435.                           
  2436.                           REMEMBER : If you have both color and non-color
  2437.  
  2438.  
  2439.  
  2440.                                        Page 36
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2447.  
  2448.  
  2449.                           versions of the same files, pass the name of the
  2450.                           non-color version.  Also, the actual disk files
  2451.                           must be named in such a way that they have no
  2452.                           file extension and the color version ends with a
  2453.                           "G".
  2454.           
  2455.                Example :  show_file("WELCOME");
  2456.                           show_file("C:\GAP\GEN\WELCOME");
  2457.           
  2458.           
  2459.                   Name :  show_mess
  2460.                Purpose :  Displays a message
  2461.             Parameters :  Message, ring the bell, issue a New Line
  2462.           Return Value :  None
  2463.             Convention :  void show_mess(message,bell,newline);
  2464.                           char *message;
  2465.                           int bell;
  2466.                           int newline;
  2467.           
  2468.            Description :  Finally!  After all of this, just how do you
  2469.                           display a message to the user?  Well, here it is.
  2470.                           This is the string output function for GAPCDR.
  2471.                           Under most circumstances, this is the one func-
  2472.                           tion that you would call to display output to the
  2473.                           user. There should be no reason to ever call
  2474.                           putkey or putachar, as they are basically inter-
  2475.                           nal routines.
  2476.                           
  2477.                           The three parameters are :
  2478.            
  2479.                             1 - the string to display
  2480.                             2 - YES or NO if you want to sound the remote
  2481.                                 user's bell.
  2482.                             3 - YES or NO if you want to issue a CR/LF
  2483.                                 after displaying the string.
  2484.           
  2485.                Example :  // the first show_mess displays the string and
  2486.                           // leaves the cursor on the same line.  The
  2487.                           // second displays the string, rings the remote
  2488.                           // user's bell, and drops the cursor to the next
  2489.                           // line.
  2490.                           
  2491.                           nl(1);
  2492.                           show_mess("Are you ready? (Y/N) : ",NO,NO);
  2493.                           
  2494.                           empty(response,4);
  2495.                           get_string(response);
  2496.                           
  2497.                           if (response[0] == 'Y')
  2498.                              // begin whatever it is you want to begin
  2499.                           else
  2500.                              show_mess("Too Bad!",YES,YES);
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.                                        Page 37
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2513.  
  2514.  
  2515.                   Name :  time_credit
  2516.                Purpose :  Keeps track of time and credits the user with
  2517.                           time elapsed
  2518.             Parameters :  1 = start timer, 0 = end timer
  2519.           Return Value :  None
  2520.             Convention :  void time_credit(flag);
  2521.                           int flag;
  2522.           
  2523.            Description :  This is basically an internal routine called by
  2524.                           chat and sysop shell to DOS so that the user is
  2525.                           not penalized for time used.  It updates a global
  2526.                           variable called timecredit.  Timecredit is used
  2527.                           in the calculations that determine the user's
  2528.                           time remaining.
  2529.                           
  2530.                           If you wish to use this feature in your own rou-
  2531.                           tines, prior to entering your routine, call
  2532.                           time_credit with a 1 and it will start the timer.
  2533.                           When your routine is finished, call time_credit
  2534.                           with a 0 and the timer will stop.  The variable
  2535.                           timecredit will be updated with the elapsed time.
  2536.           
  2537.                Example :  time_credit(1);                // start the timer
  2538.                           do_chat();                     // chat with user
  2539.                           time_credit(0);                // stop the timer
  2540.                           
  2541.                           Note that this is simply an example.  do_chat
  2542.                           calls time_credit on its own. In the above
  2543.                           example, if the sysop chat with the user took
  2544.                           10  minutes, the user will be credited with
  2545.                           that 10 minutes as will be reflected in the
  2546.                           timecredit variable.
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.                                        Page 38
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2579.  
  2580.  
  2581.                   Name :  time_left
  2582.                Purpose :  To compute the user's time remaining
  2583.             Parameters :  None
  2584.           Return Value :  None
  2585.             Convention :  void time_left(void);
  2586.           
  2587.            Description :  This is the routine that is called by the input
  2588.                           and output routines to compute the user's time
  2589.                           remaining. It is not necessary for the programmer
  2590.                           to call this routine directly.
  2591.                           
  2592.                           A global variable called timeleft will be updated
  2593.                           with each call.  This variable may be used in
  2594.                           prompts that display the user's remaining time.
  2595.                           
  2596.                           As long as all input/output is performed thru
  2597.                           calls to the GAPCDR library, the timeleft vari-
  2598.                           able will always be current.
  2599.           
  2600.                Example :  time_left();
  2601.           
  2602.           
  2603.                   Name :  trim
  2604.                Purpose :  Trims spaces from the end of NULL terminated
  2605.                           strings
  2606.             Parameters :  String containing the spaces.
  2607.           Return Value :  Pointer to the string without the spaces.
  2608.             Convention :  char *trim(string);
  2609.                           char *string;
  2610.           
  2611.            Description :  This function will remove any spaces from the end
  2612.                           of a string.
  2613.           
  2614.                Example :  trim(gapdos.username);
  2615.           
  2616.           
  2617.                   Name :  update_clock
  2618.                Purpose :  Updates the status line clock
  2619.             Parameters :  None
  2620.           Return Value :  None
  2621.             Convention :  void update_clock(void);
  2622.           
  2623.            Description :  Internal routine to update the status line clock.
  2624.           
  2625.                Example :
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.                                        Page 39
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2645.  
  2646.  
  2647.                   Name :  wait
  2648.                Purpose :  Pauses for the number of "ticks" specified.
  2649.             Parameters :  Number of timer ticks to pause
  2650.           Return Value :  None
  2651.             Convention :  void wait(ticks);
  2652.                           int ticks;
  2653.           
  2654.            Description :  This function allows you to pause all processing
  2655.                           for the specified number of ticks.  It is in-
  2656.                           sensitive to processor speed.
  2657.                           
  2658.                           The function simply delays the number of "ticks"
  2659.                           indicated by the passed parameter.  Each tick is
  2660.                           1/18 of a second.
  2661.           
  2662.                Example :  wait(18);                      // pause for 1 sec
  2663.           
  2664.           
  2665.                   Name :  wrap_word
  2666.                Purpose :  To wrap a word during sysop chats
  2667.             Parameters :  None
  2668.           Return Value :  None
  2669.             Convention :  void wrap_word(void);
  2670.           
  2671.            Description :  Internal function called by putkey to wrap words.
  2672.           
  2673.                Example :
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.                                        Page 40
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2711.  
  2712.  
  2713.                   Name :  write_gapdos
  2714.                Purpose :  Updates the GAPDOS.DAT file
  2715.             Parameters :  None
  2716.           Return Value :  0 = no error, 1 = error
  2717.             Convention :  int write_gapdos(void);
  2718.           
  2719.            Description :  This function allows the programmer to update the
  2720.                           GAP Communications remote exit to DOS system
  2721.                           file.  If the GAPDOS.DAT file is read at door be-
  2722.                           ginning,  the timecredit variable assigned to
  2723.                           gapdos.timecredit, and the GAPDOS.DAT file writ-
  2724.                           ten out at doors end, the user will be credited
  2725.                           with any time spent during a sysop chat or shell
  2726.                           to DOS.
  2727.           
  2728.                Example :  c = read_gapdos();             // read the file
  2729.                           
  2730.                           if (c == 0)                    // if no error...
  2731.                              {
  2732.                              timecredit = gapdos.timecredit;
  2733.                           
  2734.                              // do some processing
  2735.                           
  2736.                              // give the user 20 more minutes
  2737.                           
  2738.                              timecredit += 20;
  2739.                              gapdos.timecredit = timecredit
  2740.                              c = write_gapdos();         // update the file
  2741.                              }
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.                                        Page 41
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2777.  
  2778.  
  2779.                   Name :  write_gapuser
  2780.                Purpose :  Updates the user record in GAP's USERS.DAT file
  2781.             Parameters :  None
  2782.           Return Value :  0 = no error, 1 = error
  2783.             Convention :  int write_gapuser(void);
  2784.           
  2785.            Description :  This function allows you to update any variables
  2786.                           in the GAP USERS.DAT file for the current user.
  2787.                           
  2788.                           WARNING : The GAP USERS.DAT file contains strings
  2789.                           that are fully padded with spaces. If you modify
  2790.                           any of these strings, you MUST make sure that the
  2791.                           string is fully padded with  spaces and that the
  2792.                           NULL character is placed in the last string posi-
  2793.                           tion.
  2794.                           
  2795.                           WARNING : The index for the user file consists of
  2796.                           the user's last name and first name.  Do not un-
  2797.                           der any circumstances modify either of these two
  2798.                           fields. Doing so will cause corruption of the
  2799.                           Index file.
  2800.           
  2801.                Example :  // give the user a level of 50
  2802.                           
  2803.                           c = read_gapuser();            // 1st read record
  2804.                           user.level = 50;
  2805.                           c = write_gapuser();           // update the rec
  2806.                           
  2807.                           // allow user to change handle
  2808.                           
  2809.                           c = read_gapuser();
  2810.                           if (c == 0)
  2811.                              {
  2812.                              show_mess("Enter New Handle : ",NO,NO)
  2813.                              empty(handle,16);
  2814.                              get_string(handle)
  2815.                              if (handle[0] != 0)
  2816.                                 {
  2817.                                 strcpy(user.handle,handle);
  2818.                                 pad(user.handle,16);     // pad with spaces
  2819.                                 c = write_gapuser();
  2820.                                 if (c == 0)
  2821.                                    show_mess("Saved new Handle",NO,YES);
  2822.                                 }
  2823.                              }
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.                                        Page 42
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2843.  
  2844.  
  2845.                   Name :  write_pcbsys
  2846.                Purpose :  Updates the PCBOARD.SYS file
  2847.             Parameters :  None
  2848.           Return Value :  0 = no error, 1 = error
  2849.             Convention :  int write_pcbsys(void);
  2850.           
  2851.            Description :  This function allows the programmer to update the
  2852.                           PCBOARD.SYS File.  Do not use unless dopcb is set
  2853.                           to 1.
  2854.           
  2855.                Example :  c = write_pcbsys()             // write the file
  2856.           
  2857.           
  2858.                   Name :  write_pcbuser
  2859.                Purpose :  Updates the PCB USERS file
  2860.             Parameters :  None
  2861.           Return Value :  0 = no error, 1 = error
  2862.             Convention :  int write_pcbuser(void);
  2863.           
  2864.            Description :  This function allows the programmer to update the
  2865.                           PCB USERS File.  Do not use unless dopcb is set
  2866.                           to 1.  Note that you will need to use the C
  2867.                           library routines to convert IEEE formatted
  2868.                           numbers to the MSB format that pcb uses if you
  2869.                           change any of the DOUBLE or SINGLE fields in the
  2870.                           user file.
  2871.           
  2872.                Example :  c = write_pcbuser();           // write the file
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.                                        Page 43
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.           GAPCDR             (C) Copyright 1989 The GAP Development Company
  2909.  
  2910.  
  2911.                   Name :  write_score
  2912.                Purpose :  Creates and maintains a scoreboard
  2913.             Parameters :  data file to write, score to write
  2914.           Return Value :  None
  2915.             Convention :  void write_score(filename,score);
  2916.                           char *filename;
  2917.                           unsigned long score;
  2918.           
  2919.            Description :  This function will create and maintain a
  2920.                           scoreboard of the top ten players. You pass it
  2921.                           two parameters.  The first is a string containing
  2922.                           the name of the data file to create/maintain.
  2923.                           The second is a long unsigned integer containing
  2924.                           the score to write.  The user's name and the
  2925.                           current date are already known.  If the sysop is
  2926.                           in the door at the time, the function will simply
  2927.                           return and not write a score.  The scores will
  2928.                           automatically be sorted in decreasing order by
  2929.                           the highest score.  If you wish to use this
  2930.                           routine but your points are kept as integers
  2931.                           instead of longs, simply cast the second
  2932.                           parameter to a long unsigned integer.
  2933.           
  2934.                Example :  int points;
  2935.                           
  2936.                           points = 1000;
  2937.                           write_score("TOURIST.DAT,(unsigned long) points);
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.                                        Page 44
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.                               GAPCDR LICENSE AGREEMENT
  2975.                               -------------------------
  2976.  
  2977.         This legal document is an agree-                                             GAP Development Company consents
  2978.         ment between  you, the end user,                                             in writing, in advance.
  2979.         and GAP Development Company.  By                                             
  2980.         using   the    GAPCDR   software                                             Registration of  the SOFTWARE is
  2981.         (the "SOFTWARE") provided by GAP                                             REQUIRED as a condition of use.
  2982.         Development Company,  you  agree                                             
  2983.         to become  bound by the terms of                                             You are  granted a  royalty-free
  2984.         this agreement,  which  includes                                             right to  distribute  executable
  2985.         the  software  license  and  the                                             files created  using  the  SOFT-
  2986.         disclaimer of warranty.                                             WARE.   You may  not, under  any
  2987.                                                      circumstances   distribute   any
  2988.         This agreement  constitutes  the                                             part of  the SOFTWARE  with your
  2989.         complete agreement  between  you                                             executable files.
  2990.         and GAP Development Company.  If                                             
  2991.         you do not agree to the terms of                                             If you  purchased  the  SOFTWARE
  2992.         this agreement,  promptly return                                             SOURCE CODE,  you are  granted a
  2993.         the disks  and other  items that                                             nonexclusive,   personal,   non-
  2994.         are part of this product.                                             transferable, nonassignable  li-
  2995.                                                      cense  to  use  and  modify  the
  2996.         The SOFTWARE  may not be copied,                                             SOURCE CODE  and  to  distribute
  2997.         reproduced,  disclosed,   trans-                                             your programs.  You may  not re-
  2998.         ferred, or  reduced to any form,                                             produce or distribute the SOURCE
  2999.         including electronic  medium  or                                             CODE except  in executable  form
  3000.         machine readable form, or trans-                                             as part of your executable file.
  3001.         mitted or  publicly performed by                                             If you  distribute  your  source
  3002.         any means,  electronic or other-                                             code, you  may not  include  the
  3003.         wise,  unless   GAP  Development                                             SOFTWARE SOURCE  CODE as part of
  3004.         Company consents  in writing, in                                             your product.
  3005.         advance.                                             
  3006.                                                      This License  is effective until
  3007.         The SOFTWARE  contains  valuable                                             terminated.   This License  will
  3008.         trade  secrets  and  proprietary                                             terminate automatically  if  you
  3009.         information and  is protected by                                             fail to  comply with  any provi-
  3010.         federal copyright laws. Unautho-                                             sion of this License.
  3011.         rized use  of the  software  can                                             
  3012.         result  in   civil  damages  and                                             SUMMARY OF LIMITED WARRANTY:
  3013.         criminal prosecution.                                             
  3014.                                                      In summary,  the SOFTWARE is li-
  3015.         You may  use the  SOFTWARE on  a                                             censed AS  IS.    THERE  ARE  NO
  3016.         single computer  only.  You  may                                             WARRANTEES, EXPRESS  OR IMPLIED,
  3017.         not network the SOFTWARE or oth-                                             INCLUDING BUT NOT LIMITED TO THE
  3018.         erwise use  it on  more than one                                             IMPLIED   WARRANTIES   OF   MER-
  3019.         computer or terminal at the same                                             CHANTABILITY AND  FITNESS FOR  A
  3020.         time.                                             PARTICULAR PURPOSE, AND ALL SUCH
  3021.                                                      WARRANTIES  ARE   EXPRESSLY  AND
  3022.         YOU MAY  NOT COPY  the  SOFTWARE                                             SPECIFICALLY DISCLAIMED.   IN NO
  3023.         except  to  place  the  programs                                             EVENT SHALL GAP DEVELOPMENT COM-
  3024.         onto your  hard disk and to make                                             PANY BE  RESPONSIBLE FOR ANY IN-
  3025.         archival  backup   copies   onto                                             DIRECT, SPECIAL,  INCIDENTAL  OR
  3026.         floppy disks  for your  personal                                             CONSEQUENTIAL  DAMAGES  OR  LOST
  3027.         use as  permitted  by  this  Li-                                             PROFITS TO YOU OR ANY OTHER PER-
  3028.         cense.  You  may  not  copy  the                                             SON OR  ENTITY REGARDLESS OF THE
  3029.         written  materials  accompanying                                             LEGAL THEORY,  EVEN IF  WE  HAVE
  3030.         the software.  You may not grant                                             BEEN ADVISED  OF THE POSSIBILITY
  3031.         sublicenses  nor   transfer  the                                             OF SUCH DAMAGE.
  3032.         SOFTWARE or related materials in
  3033.         any form  to any  person  unless
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.                               REGISTRATION INFORMATION
  3044.                               ------------------------
  3045.             
  3046.             
  3047.             GAPCDR  is   a  user-supported   program,  also   known   as
  3048.             'shareware'.  Shareware is a means by which users may 'test-
  3049.             drive' software before purchasing.  Generally, it allows the
  3050.             user to  evaluate the  software for  a period  of  30  days.
  3051.             After the  evaluation period  the user  must either register
  3052.             the product or cease using it.
  3053.             
  3054.             You are  permitted under  the terms  of  the  above  License
  3055.             Agreement to  use GAPCDR  for a  period of  30 days  without
  3056.             payment.  If you continue to use the product past the 30 day
  3057.             evaluation period,  you must register your copy as described
  3058.             below.
  3059.             
  3060.             Commercial  use  of  this  software  absolutely  requires  a
  3061.             registration within  the 30  day  period.    Commercial  use
  3062.             includes any  software written  by you which utilizes GAPCDR
  3063.             and which  you charge  any sum  of money for the use of your
  3064.             software.   This includes shareware registration, donations,
  3065.             registration fees,  or any  method  you  use  or  devise  to
  3066.             solicit funds from the users of your software.
  3067.             
  3068.             Commercial use  also includes  bundling  GAPCDR  with  other
  3069.             software even if that other software does not utilize any of
  3070.             the GAPCDR  functions.   This  type  of  commercial  use  is
  3071.             strictly prohibited.
  3072.             
  3073.             
  3074.             A great  deal of  time, money, and effort went into creating
  3075.             GAPCDR.   In order  for us  to continue  to provide  quality
  3076.             software at reasonable prices, we need your support.
  3077.             
  3078.             Registration of GAPCDR is a one time fee of $25.00.  Payment
  3079.             of this  fee entitles  you to  one year  of  free  upgrades,
  3080.             product support,  the right  to use GAPCDR in any executable
  3081.             program you sell or distribute, and a good conscience.
  3082.             
  3083.             
  3084.             Source code  is available to registered users for a one time
  3085.             license fee  of $25.00.   The source code is fully commented
  3086.             and well structured.
  3087.             
  3088.             
  3089.                                GAPCDR Support Board :
  3090.             
  3091.               The Crow's Nest BBS         (714)493-3819  Node 1
  3092.                                           (714)493-9851  Node 2
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.                                 GAPCDR REGISTRATION
  3110.                                 --------------------
  3111.             
  3112.             
  3113.             Please fill in and detach the following sheet and mail it to
  3114.             GAP Development Company.
  3115.             ------------------------------------------------------------
  3116.             
  3117.             
  3118.             I understand and accept the GAPCDR License Agreement.
  3119.             
  3120.             
  3121.                  Accepted By : ____________________________________
  3122.                                (signature)
  3123.                  
  3124.                  Accepted By : ____________________________________
  3125.                                (printed name)
  3126.                  
  3127.                         Date : ____________
  3128.                  
  3129.                  
  3130.                      Product : GAPCDR
  3131.             
  3132.             
  3133.             Licensee Information :
  3134.             
  3135.                       Name : ___________________________________________
  3136.             
  3137.                    Address : ___________________________________________
  3138.             
  3139.                    Address : ___________________________________________
  3140.             
  3141.             City,State,Zip : ___________________________________________
  3142.             
  3143.                Voice Phone : ________________________
  3144.             
  3145.             
  3146.             ------------------------------------------------------------
  3147.                 #   Description                              Price
  3148.             ------------------------------------------------------------
  3149.               3001  GAPCDR Run Time Library         25.00     __________
  3150.               3002  GAPCDR Source Code License      25.00     __________
  3151.             
  3152.                     Total Due                                 __________
  3153.                     Less Credit(s)                            __________
  3154.                     Total Amount Enclosed                     __________
  3155.             
  3156.             ------------------------------------------------------------
  3157.                     Payment may be made by check or money order
  3158.             ------------------------------------------------------------
  3159.             
  3160.                               GAP Development Company
  3161.                              24242 Porto Fino  RT 7715
  3162.                            Laguna Niguel, CA  92677-3844
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.                                         INDEX
  3173.                                         -----
  3174.  
  3175.           @  36                                                 GREEN  11
  3176.           ANSI  2, 4, 11, 20, 23, 36                                                 MAGENTA  11
  3177.           argv  5                                                 RED  11
  3178.           backspace  24                                                 WHITE  11
  3179.           bell  37                                                 YELLOW  11
  3180.           chat  2, 25, 30, 31, 38, 40,                                               Chars
  3181.                41                                                 GAPDOS
  3182.           ckeypress  24                                                   gapdos.didnew  14
  3183.           clear_scrn  25                                                   gapdos.exitdos  14
  3184.           communications port  5                                                 General
  3185.           configuration file  5                                                   chat  13
  3186.           CTS  2                                                   clockon  13
  3187.           DEFINES  11                                                   dopcb  13
  3188.           do_chat  25                                                   endview  13
  3189.           DOOR.SYS  5, 6, 9, 12, 22, 32,                                                   fileshow  13
  3190.                33                                                   instatus  13
  3191.           dopcb  6, 34, 43                                                   noup  13
  3192.           elap_time  26                                                   NS  13
  3193.           empty  26                                                   redisplay  13
  3194.           error  5, 28, 32                                                   view  13
  3195.           exit code  29                                                 PCBSYS
  3196.           Files                                                   pcbsys.forumnum  16
  3197.             Aborting  36                                                   pcbsys.node  16
  3198.             Color  36                                                   pcbsys.port  16
  3199.             Configuration  30, 32                                                   pcbsys.sysopnext  16
  3200.             DOOR.SYS  33                                                 PCBUSERS
  3201.             GAPDOS.DAT  33, 41                                                   pcbuser.delete  17
  3202.             Header  4, 6                                                   pcbuser.expert  17
  3203.             PCB USERS  34, 43                                                   pcbuser.lastconf  17
  3204.             PCBOARD.SYS  34, 43                                                   pcbuser.level  17
  3205.             Showing  36                                                   pcbuser.page  17
  3206.             System  25, 28                                                   pcbuser.protocol  17
  3207.             USERS.DAT  34, 42                                                 USERS
  3208.           Functions  23                                                   user.expert  15
  3209.           GAPBBS.CNF  32                                                   user.sysop  15
  3210.           GAPDOS.DAT  9, 14, 22, 32, 33,                                               Defines
  3211.                41                                                 General
  3212.           get_random  28                                                   NO  11
  3213.           get_string  13, 25, 26, 27,                                                   YES  11
  3214.                30, 37, 42                                               Doubles
  3215.           getakey  27                                                 PCBUSERS
  3216.           Global Variables                                                   pcbuser.curdown  17
  3217.             ANSI                                                   pcbuser.downbytes  17
  3218.               BBLACK  11                                                   pcbuser.upbytes  17
  3219.               BBLUE  11                                               Floats
  3220.               BCYAN  11                                                 PCBUSERS
  3221.               BGREEN  11                                                   pcbuser.lastmsg  17
  3222.               BLACK  11                                                   pcbuser.lastmsg1  17
  3223.               BLUE  11                                               Integers
  3224.               BMAGENTA  11                                                 DOOR.SYS
  3225.               BRED  11                                                   alarm  12
  3226.               BROWN  11                                                   baud  12
  3227.               BWHITE  11                                                   bell  12
  3228.               CYAN  11                                                   color  12
  3229.  
  3230.  
  3231.  
  3232.                                        Page 48
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.                                         INDEX
  3239.                                         -----
  3240.  
  3241.                 expert  12                                                   gapdos.joined  14
  3242.                 level  12                                                   gapdos.starttime  14
  3243.                 local  12                                                 General
  3244.                 minsleft  12                                                   starttime  13
  3245.                 node  12                                                   temptime  13
  3246.                 page  12                                                   timenow  13
  3247.                 parity  12                                                 USERS
  3248.                 port  12                                                   user.blts  15
  3249.                 printer  12                                                   user.curbytes  15
  3250.                 screen  12                                                   user.doors  15
  3251.                 userbaud  12                                                   user.downloads  15
  3252.               GAPDOS                                                   user.joined  15
  3253.                 gapdos.baud  14                                                   user.lastmsg  15
  3254.                 gapdos.forumnum  14                                                   user.mesleft  15
  3255.                 gapdos.givetime  14                                                   user.mesread  15
  3256.                 gapdos.local  14                                                   user.timeson  15
  3257.                 gapdos.minavail  14                                                   user.ttlbytes  15
  3258.                 gapdos.port  14                                                   user.ttlmins  15
  3259.                 gapdos.timecredit  14                                                   user.upbytes  15
  3260.                 gapdos.userbaud  14                                                   user.uploads  15
  3261.               General                                               Strings
  3262.                 lines  13                                                 DOOR.SYS
  3263.                 timecredit  13                                                   bphone  13
  3264.                 timeleft  13                                                   city  13
  3265.               PCBSYS                                                   fname  13
  3266.                 pcbsys.minsleft  16                                                   hphone  13
  3267.                 pcbsys.timeallowed  16                                                   lastdate  13
  3268.                 pcbsys.timecredit  16                                                   lname  13
  3269.                 pcbsys.timegiven  16                                                   password  13
  3270.                 pcbsys.timeon  16                                                   subscrip  13
  3271.                 pcbsys.timeused  16                                                   username  13
  3272.                 pcbsys.ttlbytes  16                                                 GAPDOS
  3273.                 pcbsys.userrec  16                                                   gapdos.userfirst  14
  3274.               PCBUSERS                                                   gapdos.userindex  14
  3275.                 pcbuser.downloads  17                                                   gapdos.username  14
  3276.                 pcbuser.timeson  17                                                 General
  3277.                 pcbuser.uploads  17                                                   anystring  14
  3278.               USERS                                                   bbs_dir  14
  3279.                 user.curdown  15                                                   board_name  14
  3280.                 user.lastfrm  15                                                   curtime  14
  3281.                 user.level  15                                                   gendir  14
  3282.                 user.minutes  15                                                   maindir  14
  3283.                 user.page  15                                                   strtime  14
  3284.             Longs                                                   sysname  14
  3285.               DOOR.SYS                                                 PCBSYS
  3286.                 downbytes  12                                                   pcbsys.baud  16
  3287.                 downloads  12                                                   pcbsys.calleralarm  16
  3288.                 maxbytes  12                                                   pcbsys.color  16
  3289.                 recnum  12                                                   pcbsys.ctime  16
  3290.                 timeson  12                                                   pcbsys.display  16
  3291.                 upbytes  12                                                   pcbsys.errcorrect  16
  3292.                 uploads  12                                                   pcbsys.event  16
  3293.               GAPDOS                                                   pcbsys.event_active  16
  3294.                 gapdos.callbytes  14                                                   pcbsys.pagebell  16
  3295.  
  3296.  
  3297.  
  3298.                                        Page 49
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.                                         INDEX
  3305.                                         -----
  3306.  
  3307.                 pcbsys.password  16                                             read_pcbuser  34
  3308.                 pcbsys.printer  16                                             read_score  35
  3309.                 pcbsys.slide_event  16                                             RTS  2
  3310.                 pcbsys.userbaud  16                                             set_status  35
  3311.                 pcbsys.userfirst  16                                             show_file  36
  3312.                 pcbsys.username  16                                             show_mess  11, 24, 37, 42
  3313.               PCBUSERS                                             Spaces
  3314.                 pcbuser.bphone  17                                               Trimming  39
  3315.                 pcbuser.city  17                                               USERS.DAT  42
  3316.                 pcbuser.forum_regis  17                                             Status Line  2, 35, 39
  3317.                 pcbuser.hphone  17                                             string output  37
  3318.                 pcbuser.lastdate  17                                             time_credit  38
  3319.                 pcbuser.lastdir  17                                             time_left  39
  3320.                 pcbuser.lastime  17                                             timecredit  38, 41
  3321.                 pcbuser.name  17                                             timeleft  27, 39
  3322.                 pcbuser.passwd  17                                             trim  39
  3323.                 pcbuser.regisdate  17                                             Trimming Spaces  39
  3324.               USERS                                             update_clock  39
  3325.                 user.bphone  15                                             USERS.DAT  9, 15, 22
  3326.                 user.city  15                                             wait  40
  3327.                 user.fname  15                                             wrap_word  40
  3328.                 user.handle  15                                             write_gapdos  33, 41
  3329.                 user.hphone  15                                             write_gapuser  42
  3330.                 user.lastdate  15                                             write_pcbsys  43
  3331.                 user.lastdir  15                                             write_pcbuser  43
  3332.                 user.lasttime  15                                             write_score  44
  3333.                 user.lname  15                                             {  36
  3334.                 user.passwd  15
  3335.                 user.private  15
  3336.                 user.protocol  15
  3337.                 user.subscribe  15
  3338.           IEEE  43
  3339.           init_door  4, 5, 6, 16, 17,
  3340.                28, 30, 32, 33, 34
  3341.           leave  5, 6, 29
  3342.           more  29
  3343.           MSB  12, 34, 43
  3344.           New Line  29, 37
  3345.           nl  29
  3346.           no_carrier  30
  3347.           node  6
  3348.           noup  27
  3349.           open_gap  30
  3350.           pagesysop  30
  3351.           pause  31, 40
  3352.           PCB USERS  17, 22
  3353.           PCBOARD.SYS  5, 6, 16, 22
  3354.           putachar  31, 37
  3355.           putkey  31, 37
  3356.           read_cnf  4, 5, 6, 32
  3357.           read_doorsys  33
  3358.           read_gapdos  33
  3359.           read_gapuser  34
  3360.           read_pcbsys  34
  3361.  
  3362.  
  3363.  
  3364.                                        Page 50
  3365.  
  3366.  
  3367.