Structure Code for QuickBBS Version 2.03
========================================

--QuickBBS is a trademark of Adam Hudson.

********************************************************************************
*                               "Disclaimer"                                   *
*                                                                              *
*  This file contains the data file structures used by QuickBBS. This info. is *
* taken from STRUCT.201 provided with Q-Main 2.01 and includes some other info *
* which was not listed that I thought some of you Utility Writters might find  *
* of use. There are NO GUARANTEE as to the info. listed below being correct,   *
* mainly because this is not the official structure file put out by the author *
* of QuickBBS (Adam Hudson).                                                   *
********************************************************************************


**NOTE** String Variable are 1 Byte larger than it's size. So a variable of
         String[10] would take up 11 Bytes.

   Turbo Pascal Variable Type    Length   Range
   ====================================================================
   Byte                        | 1 byte  | 0..255                     |
   Char                        | 1 byte  | 1 Character                |
   Boolean                     | 1 byte  | FALSE (0) or TRUE (1)      |
   Integer                     | 2 bytes | -32768..32767              |
   Word                        | 2 bytes | 0..65535                   |
   LongInt                     | 4 bytes | -2147483648..2147483647    |
   Real                        | 6 bytes | 10(-38) power..10(38) power|
   ====================================================================



==========================================================================
*********************
*Filename: USERS.BBS*
*********************

Type
  FlagType = Array[1..4] of Byte;

  UserRecord = Record
                 Name:               String[35];
                 City:               String[25];
                 Pwd:                String[15];
                 DataPhone,
                 HomePhone:          String[12];
                 LastTime:           String[5];
                 LastDate:           String[8];
                 Attrib:             Byte;
                 Flags:              FlagType;
                 Credit,
                 Pending,
                 TimesPosted,
                 HighMsgRead,
                 SecLvl,
                 Times,
                 Ups,
                 Downs,
                 UpK,
                 DownK,
                 TodayK,
                 Elapsed,
                 Len:                Integer;
                 ExtraSpace:         Array[1..8] of Byte;
               End;

(*  Attrib: (Attrib: Byte)

      Bit 0: Deleted
      Bit 1: Screen Clear Codes
      Bit 2: More Prompt
      Bit 3: ANSI
      Bit 4: No-Kill
      Bit 5: Ignore Download Hours
      Bit 6: ANSI Full Screen Editor
      Bit 7: [ Reserved ]
*)
==========================================================================


==========================================================================
***********************
*Filename: QNL_IDX.BBS*
***********************

   NodeIdxRecord = Record
                     Zone,
                     Net,
                     Node:      Integer;
                     NodeType:  Byte;
                   End;
==========================================================================


==========================================================================
***********************
*Filename: QNL_DAT.BBS*
***********************

   NodelistRecord = Record
                      NodeType:  Byte;
                      Zone,
                      Net,
                      Node:      Integer;
                      Name:      String[20];
                      City:      String[40];
                      Phone:     String[40];
                      Password:  String[8];
                      Flags:     Integer;
                      BaudRate:  Integer;
                      Cost:      Integer;
                    End;

(*  NodeType variable codes: (Nodetype: Byte)

      0 = Normal Node
      1 = Zone Coordinator
      2 = Region Coordinator
      3 = Net Coordinator
      4 = Hub Coordinator

*)
==========================================================================



==========================================================================
***********************
*Filename: MSGINFO.BBS*
***********************

      InfoRecord = Record
                     LowMsg:      Integer;     { Lowest Message in File }
                     HighMsg:     Integer;     { Highest Message in File }
                     TotalActive: Integer;     { Total Active Messages }
                     ActiveMsgs:  Array[1..200] of Integer;
                   End;
==========================================================================



==========================================================================
**********************
*Filename: MSGIDX.BBS*
**********************

      IdxRecord = Record
                    MsgNum:       Integer;
                    Board:        Byte;
                  End;
==========================================================================



==========================================================================
**********************
*Filename: MSGHDR.BBS*
**********************

          HdrRecord = Record
                        MsgNum,
                        ReplyTo,
                        SeeAlsoNum,
                        TRead:              Integer;
                        StartRec:           Word;
                        NumRecs,
                        DestNet,
                        DestNode,
                        OrigNet,
                        OrigNode:           Integer;
                        DestZone,
                        OrigZone:           Byte;
                        Cost:               Integer;
                        MsgAttr,
                        NetAttr,
                        Board:              Byte;
                        PostTime:           String[5];
                        PostDate:           String[8];
                        WhoTo,
                        WhoFrom:            String[35];
                        Subj:               String[72];
                      End;

(* Msg Attributes: (MsgAttr: Byte)

      Bit 0: Deleted
      Bit 1: Unmoved Outgoing Net Message
      Bit 2: Is a Net Mail Message
      Bit 3: Private
      Bit 4: Received
      Bit 5: Unmoved Outgoing Echo Message
      Bit 6: Local Bit
      Bit 7: [ Reserved ]

**NOTE** I at first thought that when Bit 0 is set to 1 (True) that the msg.
         would be flagged as deleted. I notice that even though I had my
         utility set it to 1 I was still able to read the message.
         The MsgNum (Integer Variable) in the corresponding record in
         MSGIDX.BBS must also be set to something invalid (such as -1).

   Net Attributes: (NetAttr: Byte)

      Bit 0: Kill Message after it's been sent
      Bit 1: Sent OK
      Bit 2: File(s) Attached
      Bit 3: Crash Priority
      Bit 4: Request Receipt
      Bit 5: Audit Request
      Bit 6: Is a Return Receipt
      Bit 7: [ Reserved ]
==========================================================================



==========================================================================
***************************************
*Filename: MSGTOIDX.BBS and MSGTXT.BBS*
***************************************

  Each record in the MSGTOIDX.BBS file is of type String[35], each entry
  is simply the name of the corresponding message in MSGHDR.BBS is
  addressed to.

  Each record in the MSGTXT.BBS file is of type String[255], each entry
  is used to store blocks of message text.  The variable "StartRec" in
  the MSGHDR.BBS file contains the starting record position for the
  text, the variable "NumRecs" indicates how many consecutive blocks
  of text there are in the MSGTXT.BBS file.
==========================================================================



==========================================================================
*************************************************
*Filename: SYSINFO.BBS, TIMELOG.BBS, *.MNU files*
*************************************************

  SysInfoRecord = Record  { Used in the SYSINFO.BBS file }
                    CallCount:    LongInt;
                    LastCaller:   String[35];
                    ExtraSpace:   Array[1..128] of Byte;
                  End;

  TimeLogRecord = Record  { Used in the TIMELOG.BBS file }
                    StartDate:        String[8];
                    BusyPerHour:      Array[0..23] of Integer;
                    BusyPerDay:       Array[0..6] of Integer;
                  End;

     MenuRecord = Record  { Used for all *.MNU files }
                    Typ:      Byte;
                    Sec:      Integer;
                    Flags:    FlagType;
                    Str:      String[75];
                    Key:      Char;
                    Data:     String[80];
                    Fg,
                    Bg:       Byte;
                  End;
==========================================================================



==========================================================================
************************
*Filename: LASTREAD.BBS*
************************

      Lastread = Array[1..200] of Integer;

 LASTREAD.BBS is a file of Lastread. This stores the last message read for
each user for each individual message area.
==========================================================================



==========================================================================
**********************
*Filename: CONFIG.BBS*
**********************

      EventRecord = Record  { Part of Configuration Record }
                      Status:       Byte; { 0=Deleted 1=Enabled 2=Disabled }
                      RunTime:      String[5];
                      ErrorLevel:   Byte;
                      Days:         Byte;
                      Forced:       Boolean;
                      LastTimeRun:  String[8];
                    End;

      BoardRecord = Record  { Part of Configuration Record }
                      Name:         String[16];
                      Typ:          Byte; { 0=Standard 1=Net 2=EMail 3=Echo }
                      Kinds:        Byte; { 0=Both 1=Pvt 2=Pub 3=Read-Only }
                      Combined:     Boolean;
                      Aliases:      Boolean;

                      ReadSecLvl:   Integer;
                      ReadFlags:    FlagType;

                      WriteSecLvl:  Integer;
                      WriteFlags:   FlagType;

                      SysopSecLvl:  Integer;
                      SysopFlags:   FlagType;
                    End;

     ConfigRecord = Record  { Used for the CONFIG.BBS file }
                      (*  Modem Parameters  *)
                      CommPort:      Integer;
                      InitBaud,
                      InitTimes,
                      AnswerWait:    Integer;
                      ModemInitStr,
                      ModemBusyStr:  String[70];
                      ModemInitResp,
                      ModemBusyResp,
                      Resp300,
                      Resp1200,
                      Resp2400:      String[40];

                      (*  System Paths  *)
                      MenuPath,
                      TextPath,
                      NetPath:      String[66];

                      (*  Restriction Parameters  *)
                      MinBaud,
                      GraphicsBaud,
                      XferBaud:      Integer;
                      LowBaudStart,
                      LowBaudEnd,
                      DownloadStart,
                      DownloadEnd,
                      PagingStart,
                      PagingEnd:     String[5];

                      (*  Matrix Information  *)
                      MatrixZone,
                      MatrixNet,
                      MatrixNode:    Integer;
                      AkaNet,
                      AkaNode:       Array[1..5] of Integer;
                      NetMailBoard:  Integer;

                      (*  Default Information for New Users  *)
                      DefaultSec:                Integer;
                      DefaultCredit:             Integer;
                      DefaultFlags:              FlagType;

                      (*  Sysop Security Levels  *)
                      EditorCmdStr:    String[70];
                      OriginLine:      String[60];
                      SysopName:       String[35];
                      AutoLogonChar,
                      FastLogon,
                      ScreenBlanking,
                      UseLastRead,
                      MonoMode,
                      DirectWrite,
                      SnowCheck,
                      NetEchoExit,
                      OneWordNames,
                      CheckMail,
                      AskHomePhone,
                      AskDataPhone,
                      GraphicsAvail:   Boolean;
                      InactiveTimeOut: Integer;
                      LogonTime:       Integer;
                      DefFgColor:      Integer;
                      DefBgColor:      Integer;
                      PasswordTries:   Integer;
                      MaxPageTimes:    Integer;
                      PageBellLen:     Integer;

                      UseZoneGates:    Boolean;
                      ExtraSpace:      Array[1..511] of Byte;

                      EventRec:        Array[1..30] of EventRecord;
                      BoardRec:        Array[1..200] of BoardRecord;
                    End;

   The New Options added to QuickBBS 2.02 is stored in UserZone Gates and
 Extraspace. Below is what I determined:

  Option                             Stored
  ======================================================================
  User Xmodem Protocal             | Bollean Variable UserZoneGates
  Use Ymodem (Xmodem-1k) Protocal  | First Byte of EXTRASPACE
  Use Sealink Protocal             | Second Byte of EXTRASPACE
  Use Zmodem Protocal              | Third Byte of EXTRASPACE
* Allow "Batch" Downloads          | Fourth Byte of EXTRASPACE
* Force (xxx)xxx-xxxx Phone Entry  | Fith Bye of EXTRASPACE
* Require Password on Entries      | Sixth Byte of EXTRASPACE
  Message Quotting String          | Byte 8-10 of EXTRASPACE
                                   | (Byte 7 stores the size)
* Upload time Credit Factory       | Byte 11-12 of EXTRASPACE
  Type 7 and 15 Loading Message    | Byte 14-83 of EXTRASPACE
                                   | (Byte 13 stores the size)
  Type 6 command prompt            | Byte 85-154 of EXTRASPACE
                                   | (Byte 14 stores the size)
  ======================================================================
* = Feature not yet implemented

 ***NOTE*** To store any character, store the Ordinal Value of it.
==========================================================================



==========================================================================
************************
*Filename: EXITINFO.BBS*
************************

  ExitRecord = Record
                 BaudRate:        Integer;
                 SysInfo:         SysInfoRecord;
                 TimeLogInfo:     TimeLogRecord;
                 UserInfo:        UserRecord;
                 EventInfo:       EventRecord;
                 NetMailEntered:  Boolean;
                 EchoMailEntered: Boolean;
                 LoginTime:       String[5];
                 LoginDate:       String[8];
                 TmLimit:         Integer;
                 LoginSec:        LongInt;
                 Credit:          LongInt;
                 UserRecNum:      Integer;
                 ReadThru:        Integer;
                 PageTimes:       Integer;
                 DownLimit:       Integer;
               End;
==========================================================================
