home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RADOOR30.ZIP / BBSTYPES.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-04-10  |  3.0 KB  |  95 lines

  1. {╔═════════════════════════════════════════════════════════════════════════╗
  2.  ║                                                                         ║
  3.  ║                   (c) CopyRight LiveSystems 1990, 1994                  ║
  4.  ║                                                                         ║
  5.  ║ Author    : Gerhard Hoogterp                                            ║
  6.  ║ FidoNet   : 2:282/100.5   2:283/7.33                                    ║
  7.  ║ BitNet    : GERHARD@LOIPON.WLINK.NL                                     ║
  8.  ║                                                                         ║
  9.  ║ SnailMail : Kremersmaten 108                                            ║
  10.  ║             7511 LC Enschede                                            ║
  11.  ║             The Netherlands                                             ║
  12.  ║                                                                         ║
  13.  ║        This module is part of the RADoor BBS doorwriters toolbox.       ║
  14.  ║                                                                         ║
  15.  ╚═════════════════════════════════════════════════════════════════════════╝}
  16. {
  17. Detects the BBS under which the door is running. At this time RA, QBBS and
  18. SBBS are supported.
  19.  
  20. The way of working is simple. First look for the BBS= environment variable.
  21. If it's set, use it's value. If it is not set, look for the QUICKBBS=
  22. environment variable. If it's found, report QBBS, if not report RA.
  23. RA is the default sinds I'm an RA sysop myself..;-)
  24.  
  25. - 12 feb 92: Release
  26.  
  27. }
  28.  
  29. Unit BBSTypes;
  30. Interface
  31. Uses Dos;
  32.  
  33. Type BBSTypeList    = (
  34.                        NO_BBS,    { No BBS could be detected }
  35.  
  36.                        RA_BBS,    { RemoteAccess             }
  37.                        S_BBS,     { SuperBBS                 }
  38.                        Q_BBS,     { QuickBBS                 }
  39.  
  40.                        LAST_BBS   { Last member of list      }
  41.                       );
  42.  
  43. Var CurrentBBSType : BBSTypeList;
  44.  
  45. Implementation
  46.  
  47. Type BBSIndentifier = String[10];
  48.  
  49. Const BBSTypeParams : Array[Succ(No_BBS)..Pred(Last_BBS)] of BBSindentifier
  50.                     = (
  51.                       'RA',
  52.                       'SBBS',
  53.                       'QBBS'
  54.                       );
  55.  
  56.  
  57. Function DetectBBSType:BBSTypeList;
  58. Var BBSPtr : BBSTypeList;
  59.     BBSStr : BBSIndentifier;
  60.     C      : Byte;
  61.  
  62. Begin
  63. BBSPtr:=No_BBS;
  64.  
  65. BBSStr:=GetEnv('BBS');
  66. If BBSStr<>''
  67.    Then Begin
  68.         For C:=1 To Length(BBSStr) Do
  69.           BBSStr[C]:=Upcase(BBSStr[C]);
  70.  
  71.         BBSPtr:=Pred(LAST_BBS);
  72.         While (BBSPtr>No_BBS) And (BBSStr<>BBSTypeParams[BBSPtr]) Do
  73.          BBSPtr:=Pred(BBSPtr);
  74.         End;
  75.  
  76. If BBSPtr>No_BBS
  77.    Then Begin
  78.         DetectBBSType:=BBSPtr;
  79.         Exit;
  80.         End;
  81.  
  82.  
  83. If GetEnv('Quick')<>''  { Second way of detecting QBBS }
  84.    Then Begin
  85.         DetectBBSType:=Q_BBS;
  86.         Exit;
  87.         End;
  88.  
  89. DetectBBSType:=RA_BBS;   { Default value! }
  90. End;
  91.  
  92. Begin
  93. CurrentBBSType:= DetectBBSType;
  94. End.
  95.