home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / GAPQBDR.ZIP / GAPQBDR.BI < prev    next >
Text File  |  1994-01-05  |  19KB  |  331 lines

  1. '
  2. '  Copyright (C) 1988-1993 The GAP Development Company
  3. '
  4. '  All Rights Reserved
  5. '
  6. '
  7. '  GAPQBDR.BI
  8. '
  9. '  Include file for all modules that use GAPQBDR
  10. '
  11. '
  12.  
  13. DECLARE FUNCTION keybrd% ()               ' checks if key was pressed locally
  14. DECLARE FUNCTION read.doorsys% ()         ' reads door.sys
  15. DECLARE FUNCTION getakey% ()              ' gets a single character
  16. DECLARE FUNCTION a.ccess% (a$)            ' checks for file existence
  17. DECLARE FUNCTION right.trim$ (a$)         ' trims C strings
  18. DECLARE FUNCTION read.gapdos% ()          ' reads GAPDOS.DAT
  19. DECLARE FUNCTION write.gapdos% ()         ' writes GAPDOS.DAT
  20. DECLARE FUNCTION read.gapuser% ()         ' reads USERS.DAT
  21. DECLARE FUNCTION write.gapuser% ()        ' writes USERS.DAT
  22. DECLARE FUNCTION read.pcbsys% ()          ' reads PCBOARD.SYS
  23. DECLARE FUNCTION write.pcbsys% ()         ' writes PCBOARD.SYS
  24. DECLARE FUNCTION read.pcbuser% ()         ' read pcb USERS
  25. DECLARE FUNCTION write.pcbuser% ()        ' write pcb USERS
  26. DECLARE FUNCTION getrand% (low%, high%)   ' get a random number
  27. DECLARE FUNCTION read.score% (datfile$, message$)  ' read high scores
  28.  
  29. DECLARE SUB at (r.ow%, c.ol%)             ' position cursor at row, column
  30. DECLARE SUB atsay (r.ow%, c.ol%, a$)      ' position cursor and print string
  31. DECLARE SUB eraeol ()                     ' erase from cursor to end of line
  32. DECLARE SUB show.mess (message$, bell%, newline%)  ' displays a string
  33. DECLARE SUB lostcd ()                     ' used by com routines
  34. DECLARE SUB no.carrier ()                 ' shows message and calls leave
  35. DECLARE SUB write.score (datfile$, score&) ' write high scores
  36. DECLARE SUB init.time ()                  ' inits get.time variables
  37. DECLARE SUB get.string (fld$)             ' main imput routine
  38. DECLARE SUB read.cnf (f.name$)            ' reads the configuration file
  39. DECLARE SUB init.door ()                  ' initializes the door
  40. DECLARE SUB leave ()                      ' normal exit
  41. DECLARE SUB nl (how%)                     ' sends CR/LF
  42. DECLARE SUB ansi (ansicolor$)             ' shows ansi colors
  43. DECLARE SUB more ()                       ' checks for full screen
  44. DECLARE SUB pause ()                      ' waits for a keypress
  45. DECLARE SUB elap.time ()                  ' computes elapsed time
  46. DECLARE SUB backspace (num.times%)        ' erases characters
  47. DECLARE SUB time.left ()                  ' computes time left
  48. DECLARE SUB waitasec (secs%)              ' waits for x number of seconds
  49. DECLARE SUB time.credit (how%)            ' computes time credits
  50. DECLARE SUB putachar (c%)                 ' sends a single character
  51. DECLARE SUB show.file (filename$)         ' displays a text file
  52. DECLARE SUB set.status (up.date%)         ' displays status line
  53. DECLARE SUB update.clock ()               ' updates status line clock
  54. DECLARE SUB putkey (c%)                   ' sends a single character
  55. DECLARE SUB do.chat ()                    ' chat with caller
  56. DECLARE SUB pagesysop ()                  ' page sysop for chat
  57. DECLARE SUB clear.scr ()                  ' clears local and remote screen
  58. DECLARE SUB setctrlc ()                   ' ctrl-c trapper
  59. DECLARE SUB reset.port ALIAS "RESET_PORT" ()   ' restores the comm port
  60.  
  61.  
  62. CONST MOREG = "MORE - [Y]es, [N]o, [C]ontinous "
  63. CONST MOREA = "MORE - [Y]es, [N]o, [C]ontinous "
  64.  
  65. CONST MORE1G = "MORE - [Y]es, [N]o, [C]ontinous, [R]edisplay "
  66. CONST MORE1A = "MORE - [Y]es, [N]o, [C]ontinous, [R]edisplay "
  67.  
  68. CONST PAUSEG = "Press [Any Key] To Continue "
  69. CONST PAUSEA = "Press [Any Key] To Continue "
  70.  
  71. CONST YES = 1
  72. CONST NO = 0
  73.  
  74.  
  75.   '***********************************************************************
  76.   '*                         ANSI colors                                 *
  77.   '***********************************************************************
  78.  
  79. ' dim colors
  80.  
  81. CONST BLACK = ""
  82. CONST RED = ""
  83. CONST GREEN = ""
  84. CONST BROWN = ""
  85. CONST BLUE = ""
  86. CONST MAGENTA = ""
  87. CONST CYAN = ""
  88. CONST WHITE = ""
  89.  
  90. ' bright colors
  91.  
  92. CONST BBLACK = ""
  93. CONST BRED = ""
  94. CONST BGREEN = ""
  95. CONST YELLOW = ""
  96. CONST BBLUE = ""
  97. CONST BMAGENTA = ""
  98. CONST BCYAN = ""
  99. CONST BWHITE = ""
  100.  
  101. CONST REVID = ""
  102.  
  103.  
  104. '$INCLUDE: 'qb.bi'
  105.  
  106.  
  107.    '***********************************************************************
  108.    '*  global variables                                                   *
  109.    '***********************************************************************
  110.  
  111.    COMMON SHARED interface  AS INTEGER     ' 0=Standard,1=Digi Direct,2=Int14/EBIOS
  112.    COMMON SHARED digiseg    AS INTEGER     ' DigiBoard Memory Window
  113.    COMMON SHARED digiport   AS INTEGER     ' DigiBoard I/O Port
  114.    COMMON SHARED digichnl   AS INTEGER     ' DigiBoard Channel
  115.    COMMON SHARED port       AS INTEGER     ' comm port being used
  116.    COMMON SHARED node       AS INTEGER     ' node number
  117.    COMMON SHARED s.creen    AS INTEGER     ' 0 = screen off, 1 = screen on
  118.    COMMON SHARED printer    AS INTEGER     ' 0 = printer off, 1 = printer on
  119.    COMMON SHARED bell       AS INTEGER     ' 0 = page bell off, 1 = on
  120.    COMMON SHARED alarm      AS INTEGER     ' 0 = caller alarm off, 1 = on
  121.    COMMON SHARED level      AS INTEGER     ' user's security level
  122.    COMMON SHARED minsleft   AS INTEGER     ' number of minutes left at start
  123.    COMMON SHARED c.olor     AS INTEGER     ' 0 = no color, 1 = color ok
  124.    COMMON SHARED page       AS INTEGER     ' user's page length
  125.    COMMON SHARED expert     AS INTEGER     ' 0 = novice, 1 = expert
  126.    COMMON SHARED l.ocal     AS INTEGER     ' l.ocal user flag
  127.    COMMON SHARED lines      AS INTEGER     ' # of lines currently displayed
  128.    COMMON SHARED v.iew      AS INTEGER     ' true if want a more prompt
  129.    COMMON SHARED noup       AS INTEGER     ' if 1, get.string wont upper case
  130.    COMMON SHARED timeleft   AS INTEGER     ' time user has left
  131.    COMMON SHARED timecredit AS INTEGER     ' time credits for user (in mins)
  132.    COMMON SHARED realcredit AS INTEGER     ' time credits from BBS
  133.    COMMON SHARED dflt.color AS INTEGER     ' BBS default color
  134.    COMMON SHARED maxfiles   AS INTEGER     ' Max files available
  135.    COMMON SHARED curfiles   AS INTEGER     ' Current files downloaded
  136.  
  137.    COMMON SHARED maindir    AS STRING      ' path to the main directory
  138.    COMMON SHARED gendir     AS STRING      ' path to the gen directory
  139.    COMMON SHARED sysname    AS STRING      ' sysop's name
  140.    COMMON SHARED birthday   AS STRING      ' caller's birth date
  141.    COMMON SHARED bbs.dir    AS STRING      ' path to BBS default dir
  142.    COMMON SHARED board.name AS STRING      ' name of the BBS
  143.    COMMON SHARED username   AS STRING      ' caller's full name
  144.    COMMON SHARED first      AS STRING      ' caller's first name
  145.    COMMON SHARED last       AS STRING      ' caller's last name
  146.    COMMON SHARED city       AS STRING      ' home state
  147.    COMMON SHARED hphone     AS STRING      ' home phone number
  148.    COMMON SHARED bphone     AS STRING      ' voice or data phone number
  149.    COMMON SHARED password   AS STRING      ' user's password
  150.    COMMON SHARED lastdate   AS STRING      ' last date user was on
  151.    COMMON SHARED subscrip   AS STRING      ' date user's subscription expires
  152.    COMMON SHARED CRLF       AS STRING      ' carriage return and line feed
  153.    COMMON SHARED handle     AS STRING      ' caller's Handle
  154.    COMMON SHARED event.time AS STRING      ' event run time
  155.    COMMON SHARED last.new   AS STRING      ' last new files scan
  156.  
  157.    COMMON SHARED userbaud   AS LONG        ' user's bps rate
  158.    COMMON SHARED baud       AS LONG        ' DTE bps rate
  159.    COMMON SHARED timeson    AS LONG        ' number of times on
  160.    COMMON SHARED uploads    AS LONG        ' total number of uploads
  161.    COMMON SHARED downloads  AS LONG        ' total number of downloads
  162.    COMMON SHARED upbytes    AS LONG        ' total bytes uploaded
  163.    COMMON SHARED curbytes   AS LONG        ' current bytes downloaded
  164.    COMMON SHARED maxbytes   AS LONG        ' max number of bytes available
  165.    COMMON SHARED timenow    AS LONG        ' time it is now  (in secs)
  166.    COMMON SHARED starttime  AS LONG        ' time the user started (in secs)
  167.    COMMON SHARED doors.open AS LONG        ' Total doors opened
  168.    COMMON SHARED mesleft    AS LONG        ' Total messages left
  169.    COMMON SHARED downbytes  AS LONG        ' total download bytes
  170.  
  171.  
  172.    '***********************************************************************
  173.    '*  USERS.DAT record structure.                                        *
  174.    '*  The index (fname and lname) must NOT be touched!                   *
  175.    '*  STRING fields are fully padded with spaces and the last position   *
  176.    '*  of the string MUST be a 0. This means that for a field such as     *
  177.    '*  handle, you may use 15 characters of the string. The 16th position *
  178.    '*  is reserved for the chr$(0).                                       *
  179.    '*  Phone number fields must be of the type "(999)999-999"+chr$(0).    *
  180.    '*  Date fields must be of the type "01/01/01"+chr$(0).                *
  181.    '*  Note that even if a phone number or date field has no data, they   *
  182.    '*  still contain the picture clauses (IE, "(   )  -" or "  /  /")     *
  183.    '***********************************************************************
  184.  
  185.    TYPE GAPUSER
  186.       fname       AS STRING * 16           ' first name
  187.       lname       AS STRING * 16           ' last name
  188.       handle      AS STRING * 16           ' handle for MPART!
  189.       passwd      AS STRING * 13           ' password
  190.       hphone      AS STRING * 16           ' homephone
  191.       bphone      AS STRING * 16           ' work/data phone
  192.       subscribe   AS STRING * 9            ' subscription date
  193.       level       AS INTEGER               ' security - up to 255
  194.       usernum     AS LONG                  ' user's sequence number
  195.       timeson     AS LONG                  ' times on - over 2 billion
  196.       lastdate    AS STRING * 9            ' last date on - mm/dd/yy
  197.       lasttime    AS STRING * 6            ' last time on - hh:mm
  198.       ttlmins     AS LONG                  ' total mins on - 2+ billion
  199.       minutes     AS INTEGER               ' # of minutes last call
  200.       uploads     AS LONG                  ' # of uploads - 2+ billion
  201.       downloads   AS LONG                  ' # of downloads - 2+ billion
  202.       ttlbytes    AS LONG                  ' total bytes downloaded
  203.       curbytes    AS LONG                  ' bytes downloaded this call
  204.       private     AS STRING * 1            ' allow on private nodes?
  205.       protocol    AS STRING * 3            ' transfer protocol
  206.       page        AS INTEGER               ' page length - to 23
  207.       lastdir     AS STRING * 9            ' date last looked at dir
  208.       lastmsg     AS LONG                  ' last message read - 99999 max
  209.       mesread     AS LONG                  ' total msgs read - 2+ billion
  210.       mesleft     AS LONG                  ' total messages left
  211.       joined      AS LONG                  ' total forums joined
  212.       blts        AS LONG                  ' total bulletins read
  213.       doors       AS LONG                  ' total doors opened
  214.       lastfrm     AS INTEGER               ' last forum in
  215.       expert      AS STRING * 1            ' novice = N, expert = Y
  216.       sysop       AS STRING * 1            ' sysop record, 1 = Y, 0 = N
  217.       upbytes     AS LONG                  ' total bytes uploaded
  218.       curdown     AS INTEGER               ' total files downed today
  219.       birthdate   AS STRING * 9            ' user's birthdate
  220.       comment     AS STRING * 51           ' comment about user
  221.       add1        AS STRING * 26           ' Company or address
  222.       add2        AS STRING * 26           ' Address
  223.       city        AS STRING * 26           ' City
  224.       state       AS STRING * 11           ' State
  225.       zip         AS STRING * 11           ' Zip
  226.       country     AS STRING * 16           ' Country
  227.       regisdate   AS STRING * 9            ' Date 1st signed on
  228.       enftime     AS STRING * 1            ' Y = enforce time limit
  229.       editor      AS STRING * 1            ' V = Visual, L = Line, A = Ask
  230.       chat        AS STRING * 1            ' Y/N if available for chat
  231.       msgclr      AS STRING * 1            ' Y/N to clear screen between msgs
  232.       newmsg      AS INTEGER               ' # of new messages
  233.       timecredit  AS INTEGER               ' time credits
  234.       expired     AS INTEGER               ' Expired Subscription level
  235.       pubforums   AS STRING * 1            ' put back to public Forums?
  236.       discons     AS INTEGER               ' # of dropped carriers
  237.       pertime     AS LONG                  ' time used during sub period
  238.       notused     AS LONG                  ' later additions
  239.       flags       AS STRING * 1            ' miscellaneous flags
  240.       notused1    AS STRING * 9            ' later additions
  241.    END TYPE                                ' 424 bytes
  242.  
  243.    COMMON SHARED user AS GAPUSER
  244.  
  245.  
  246.    '***********************************************************************
  247.    '*  PCBOARD.SYS record structure.                                      *
  248.    '*  GAPQBDR supports version 14.x ONLY!                                *
  249.    '*  Note - There is no consistency with this file. For instance, node  *
  250.    '*    number is stored as a short integer (1 byte integer), where as   *
  251.    '*    port number is stored as a 1 byte string.  Display, printer, etc *
  252.    '*    are stored as space 0 (if the function is off), where as event   *
  253.    '*    active and slide event are stored as 0 space.  Have fun!         *
  254.    '***********************************************************************
  255.  
  256.    TYPE PCBSYS14                           ' structure of PCBOARD.SYS
  257.       display     AS STRING * 2            ' display on/off -1=on,0=off
  258.       printer     AS STRING * 2            ' printer on/off -1=on,0=off
  259.       pagebell    AS STRING * 2            ' page bell      -1=on,0=off
  260.       calleralarm AS STRING * 2            ' caller alarm   -1=on,0=off
  261.       sysopnext   AS STRING * 1            ' sysop on next  N,X,space
  262.       errcorrect  AS STRING * 2            ' ecc modem      -1=yes,0=no
  263.       colorc      AS STRING * 1            ' color toggle   Y,N,7
  264.       nu          AS STRING * 1            ' node chat, not provided
  265.       baud        AS STRING * 5            ' com port bps rate
  266.       userbaud    AS STRING * 5            ' call bps rate
  267.       userrec     AS INTEGER               ' user record position
  268.       userfirst   AS STRING * 15           ' caller's first name
  269.       password    AS STRING * 12           ' users password
  270.       timeon      AS INTEGER               ' time user logged on (mins)
  271.       timeused    AS INTEGER               ' time user has used that day
  272.       ctime       AS STRING * 5            ' time user logged on hh:mm
  273.       timeallowed AS INTEGER               ' allowed time in minutes
  274.       ttlbytes    AS INTEGER               ' total bytes available /1024
  275.       forumnum    AS STRING * 1            ' forum user was in "0" = main
  276.       nu1         AS STRING * 10           ' areas been in, not provided
  277.       timegiven   AS INTEGER               ' highest forum time given
  278.       timecredit  AS INTEGER               ' time credit in minutes
  279.       nu2         AS STRING * 4            ' language being used
  280.       username    AS STRING * 25           ' name of caller
  281.       minsleft    AS INTEGER               ' minutes left for caller
  282.       node        AS STRING * 1            ' node number as short integer
  283.       event       AS STRING * 5            ' event time hh:mm
  284.       eactive     AS STRING * 2            ' event active -1=yes,0 = no
  285.       eslide      AS STRING * 2            ' slide event  -1=yes,0 = no
  286.       nu3         AS STRING * 4            ' memorized mess #, not prov
  287.       port        AS STRING * 1            ' com port, "0","1","2" in ascii
  288.       nu4         AS STRING * 2            ' not used
  289.    END TYPE
  290.  
  291.    COMMON SHARED pcbsys AS PCBSYS14
  292.  
  293.  
  294.    '***********************************************************************
  295.    '*  PCB USERS record structure.                                        *
  296.    '***********************************************************************
  297.  
  298.    TYPE PCBUSER14                          ' pcb 14 user file
  299.       username    AS STRING * 25           ' users name
  300.       city        AS STRING * 24           ' users city
  301.       passwd      AS STRING * 12           ' users password
  302.       bphone      AS STRING * 13           ' business or data phone number
  303.       hphone      AS STRING * 13           ' home phone number
  304.       lastdate    AS STRING * 6            ' Last date on as yymmdd
  305.       lasttime    AS STRING * 5            ' last time on hh:mm
  306.       expert      AS STRING * 1            ' expert mode - Y or N
  307.       protocol    AS STRING * 1            ' Protocol
  308.       nu          AS STRING * 1            ' not used
  309.       lastdir     AS STRING * 6            ' last date looked at DIR as yymmdd
  310.       level       AS STRING * 1            ' security level
  311.       timeson     AS INTEGER               ' number of times on
  312.       page        AS STRING * 1            ' page length
  313.       uploads     AS INTEGER               ' total number of uploads
  314.       downloads   AS INTEGER               ' total number of downloads
  315.       nu1         AS STRING * 70           ' cur down bytes,comments,elapsed time
  316.       regisdate   AS STRING * 6            ' registration date
  317.       nu2         AS STRING * 1            ' expired security level
  318.       lastconf    AS STRING * 1            ' last forum in
  319.       cnfregis    AS STRING * 5            ' forum registration
  320.       nu3         AS STRING * 10           ' not provided
  321.       downbytes   AS STRING * 8            ' total download bytes
  322.       upbytes     AS STRING * 8            ' total upload bytes
  323.       delete      AS STRING * 1            ' Deleted, Y = yes, N = no
  324.       lastmsg     AS STRING * 4            ' last message number read in main
  325.       lastmsg1    AS STRING * 156          ' last message read in forums
  326.       nu4         AS STRING * 15           ' not used
  327.    END TYPE
  328.  
  329.    COMMON SHARED pcbuser AS PCBUSER14
  330.  
  331.