(* Developers notes and Turbo Pascal structures for RemoteAccess 2.50 GAMMA

   Copyright (c) 1996 Andrew Milner & Wantree Development
   All Rights Reserved

   If you develop software which accesses any of the following files,
   you should read the following notes. They refer to important 
   structure changes in this release.

        MESSAGES.RA
        FILES.RA
        MGROUPS.RA
        FGROUPS.RA

   The area number to which records in the above files refer is no
   longer dependent upon the position of the record in the file.
   This is to allow utilities to move, copy, insert and delete
   areas and groups at will, without the need to renumber every
   reference to every moved area or group.

   The following applies to the record structure of all the above
   files as published in this document.

   If you look at each record definition, you will notice that the
   MESSAGErecord and FILESrecord structures each have 4 unused
   bytes at the beginning, and that the GROUPrecord structure has 2
   unused bytes at the beginning.

   In RA 2.50, the first two bytes of each of these records are
   redefined as a single word value (2 byte unsigned integer). This
   word holds the area number of that record - the name of the new
   field is 'AreaNum'. This has the following implications:

   1. To get the Hudson message-base board number for a record from
   MESSAGES.RA, do NOT rely on its position. The AreaNum field
   contains the actual board number.

   2. To access the correct FDB files from a file area record in
   FILES.RA, use the value contained in the AreaNum field, NOT the
   number of the position of the record.

   3. Utilities are now free to move any record to any location in
   these files without having to worry about renumbering FDB files
   or menu entries.

   4. When ADDING a new record, utilities MUST assign a valid area
   number to the record in the AreaNum field. Valid numbers are in
   the range 1 to 65535, and MUST be unique. See the note about
   index files below for information on how to determine the next
   available unique number.

   The INDEX files
   ---------------
   In order to provide the fastest possible access to the above four
   files, each is now indexed. The index files have the same path
   and base name with an extension of 'RDX' - for example, the index
   file for C:\RA\FILES.RA would be C:\RA\FILES.RDX.

   The index files are automatically generated by RACONFIG after
   editing areas. They must also be generated by any utility which:

   1. Adds, deletes or moves a record within its file, or
   2. Changes the AreaNum field of any record.

   FAILURE TO REINDEX WILL CAUSE UNPREDICTABLE RESULTS FOR THE
   SYSOP! RA and its utilities all check to make sure that the index
   files are up to date.

   The format of the index files is very simple. It is a flat file
   of word (2 byte unsigned integer) records which contains one
   record for each AreaNum value in the corresponding file. The
   physical position of each index record is equal to the AreaNum
   value minus 1. The value of the index record is equal to the
   physical position of the record for that area number in the main
   file PLUS 1. A value of zero indicates that the area number is
   not currently used.

   For example:

   File offest  FILES.RA AreaNum    FILES.RDX record value
        0             1                   1
        1             2                   2
        2             10                  0
        3             11                  0
        4             12                  0
        5             13                  0
        6             -                   0
        7             -                   0
        8             -                   0
        9             -                   3
       10             -                   4
       11             -                   5
       12             -                   6

   In the above example table, to look up the correct record in
   FILES.RA for a particular area number, the code might look
   something like this in Pascal:

   Seek(RDX, AreaNum-1);
   Read(RDX, Index);
   Seek(FILESRA, Index-1);
   Read(FILESRA, FILESRAinfo);

   Determining the next free unique area number is a simple matter
   of scanning the index file until a value of zero is encountered.

*)

type
  AskType        = (Yes, No, Ask, Only);
  VideoType      = (Auto, Short, Long);
  MsgType        = (LocalMail, NetMail, EchoMail, Internet, Newsgroup);
  MsgKindsType   = (Both, Private, Public, ROnly, NoReply);
  OrphanType     = (Ignore, Create, Kill);
  FlagType       = array[1..4] of Byte;
  ResetType      = (Never, Week, Month, Year);
  Time           = String[5];
  Date           = String[8];
  LongDate       = String[9];
  ByteArray32    = Array[1..32] of Byte;

  NetAddress     = record
                     Zone,
                     Net,
                     Node,
                     Point          : Word;
                   end;

  LIMITSrecord   = record
                     Security,
                     Ltime,
                     L300,
                     L1200,
                     L2400,
                     L4800,
                     L7200,
                     L9600,
                     L12000,
                     L14400,
                     L16800,
                     L19200,
                     L38400,
                     Llocal,
                     RatioNum,
                     RatioK         : Word;
                     PerMinCost     : Real;

                     L21600,
                     L24000,
                     L26400,
                     L28800,
                     L57600,
                     L64000         : Word;

                     FlexiTime      : Real;
                     LsessionTime   : Word;
                     ResetAmt       : Word;
                     ResetPeriod    : ResetType;
                     ResetOffset    : Word;

                     L31200,
                     L33600         : Word;
                     FreeSpace      : Array[1..13] of Byte;
                   end;

  LANGUAGErecord = record
                     Name           : String[20];
                     Attribute      : Byte;
                     DefName,
                     MenuPath,
                     TextPath,
                     QuesPath       : String[60];
                     Security       : Word;
                     Flags,
                     NotFlagsMask   : FlagType;
                     FreeSpace      : Array[1..190] of Byte;
                   end;

  MSGINFOrecord  = record
                     LowMsg,
                     HighMsg,
                     TotalMsgs      : Word;
                     TotalOnBoard   : array[1..200] of Word;
                   end;

  HMBMSGIDXrecord = record
                      MsgNum         : Integer;
                      Board          : Byte;
                    end;

  MSGTOIDXrecord = String[35];

  HMBMSGHDRrecord= record
                     MsgNum         : Integer;
                     PrevReply,
                     NextReply,
                     TimesRead      : Word;
                     StartBlock     : Word;
                     NumBlocks,
                     DestNet,
                     DestNode,
                     OrigNet,
                     OrigNode       : Word;
                     DestZone,
                     OrigZone       : Byte;
                     Cost           : Word;
                     MsgAttr,
                     NetAttr,
                     Board          : Byte;
                     PostTime       : Time;
                     PostDate       : Date;
                     WhoTo,
                     WhoFrom        : MSGTOIDXrecord;
                     Subject        : String[72];
                   end;

  MSGTXTrecord   = String[255];

  USERONrecord   = record
                     Name,
                     Handle         : MSGTOIDXrecord;
                     Line           : Byte;
                     Baud           : Word;
                     City           : String[25];
                     Status,
                     Attribute      : Byte;
                     StatDesc       : String[10];
                     FreeSpace      : Array[1..98] of Byte;
                     NoCalls        : Word;
                   end;

                   { Status byte - 0 : Browsing (in a menu)
                                   1 : Uploading/downloading
                                   2 : Reading/posting messages
                                   3 : In a door/external utility
                                   4 : Chatting with sysop
                                   5 : Answering questionnaire 
                                   6 : RTC
                                   7 : New user logon
                                 255 : User-defined - display StatDesc

                     Attribute   - Bit 0 : Hidden
                                       1 : Wants chat
                                       2 : Reserved for RANETMGR
                                       3 : Do not disturb flag 
                                       6 : Ready (0=busy) }

  LASTCALLrecord = record
                     Line           : Byte;
                     Name,
                     Handle         : MSGTOIDXrecord;
                     City           : String[25];
                     Baud           : Word;
                     Times          : LongInt;
                     LogOn          : String[5];
                     LogOff         : String[5];
                     Attribute      : Byte;
                   end;

                { Attribute - Bit 0 : Hidden }

  FILESHDRrecord = record
                     Name           : String[12];
                     Size,
                     CRC32          : LongInt;
                     Uploader       : String[35];
                     UploadDate,
                     FileDate,
                     LastDL         : LongInt;
                     TimesDL        : Word;
                     Attrib         : Byte;
                     Password       : String[15];
                     KeyWord        : Array[1..5] of String[15];
                     Cost           : Word;
                     LongDescPtr    : LongInt;
                     FreeSpace      : Array[1..20] of Byte;
                   end;

          {Attrib - Bit 0 : Deleted
                        1 : Unlisted
                        2 : Free (don't adjust ratio) - Does NOT affect "Cost"
                        3 : Not available (don't allow downloads)
                        4 : Locked (no kill)
                        5 : Missing/offline
                        6 : No time restrictions - always allow DL
          }

  FILESIDXrecord = record
                     Name           : String[12];
                     UploadDate     : LongInt;
                     KeyWordCRC     : Array[1..5] of LongInt;
                     LongDescPtr    : LongInt;
                   end;

  LASTREADrecord = array[1..200] of Word;

  USERSIDXrecord = record
                     NameCRC32,
                     HandleCRC32    : LongInt;
                   end;

  COMBINEDrecord = array[1..200] of Word; 

  USERSrecord    = record
                     Name           : MSGTOIDXrecord;
                     Location       : String[25];
                     Organisation,
                     Address1,
                     Address2,
                     Address3       : String[50];
                     Handle         : String[35];
                     Comment        : String[80];
                     PasswordCRC    : LongInt;
                     DataPhone,
                     VoicePhone     : String[15];
                     LastTime       : Time;
                     LastDate       : Date;

                     Attribute,

                      { Bit 0 : Deleted
                            1 : Clear screen
                            2 : More prompt
                            3 : ANSI
                            4 : No-kill
                            5 : Xfer priority
                            6 : Full screen msg editor
                            7 : Quiet mode }

                     Attribute2     : Byte;

                      { Bit 0 : Hot-keys
                            1 : AVT/0
                            2 : Full screen message viewer
                            3 : Hidden from userlist 
                            4 : Page priority 
                            5 : No echomail in mailbox scan
                            6 : Guest account 
                            7 : Post bill enabled }

                     Flags          : FlagType;
                     Credit,
                     Pending        : LongInt;
                     MsgsPosted,
                     Security       : Word;
                     LastRead,
                     NoCalls,
                     Uploads,
                     Downloads,
                     UploadsK,
                     DownloadsK,
                     TodayK         : LongInt;
                     Elapsed        : Integer;
                     ScreenLength   : Word;
                     LastPwdChange  : Byte;
                     Group          : Word;
                     CombinedInfo   : COMBINEDrecord;
                     FirstDate,
                     BirthDate,
                     SubDate        : Date;
                     ScreenWidth,
                     Language,
                     DateFormat     : Byte;      
                     ForwardTo      : String[35];
                     MsgArea,
                     FileArea       : Word;
                     DefaultProtocol: Char;
                     FileGroup      : Word;
                     LastDOBCheck   : Byte;
                     Sex            : Byte;
                     XIrecord       : LongInt;
                     MsgGroup       : Word;

                     Attribute3     : Byte;

                      { Bit 0 : Mailbox check: scan selected areas only }

                     Password       : String[15];

                     FreeSpace      : Array[1..31] of Byte;
                   end;

  USERSXIrecord  = record
                     FreeSpace      : Array[1..200] of Byte;
                   end;

  SYSINFOrecord  = record
                     TotalCalls     : LongInt;
                     LastCaller,
                     LastHandle     : MSGTOIDXrecord;
                     ExtraSpace     : array[1..92] of Byte;
                   end;

  TIMELOGrecord  = record
                     StartDate      : Date;
                     BusyPerHour    : array[0..23] of Word;
                     BusyPerDay     : array[0..6] of Word;
                   end;

  MNUrecord      = record
                     Typ            : Byte;
                     Security,
                     MaxSec         : Word;
                     NotFlagsMask,
                     Flags          : FlagType;
                     TimeLeft,
                     TimeUsed       : Word;
                     Age,
                     TermAttrib     : Byte;

                     {Bit 0 : ANSI
                          1 : AVT
                          2 : RIP}

                     MinSpeed,
                     MaxSpeed,
                     Credit,
                     OptionCost,
                     PerMinCost     : LongInt;
                     Node,
                     Group          : ByteArray32;
                     StartTime,
                     StopTime       : Array[1..7] of Word;
                     Display        : String[135];
                     HotKey         : String[8];
                     MiscData       : String[135];
                     Foreground,
                     Background     : Byte;
                     FreeSpace      : Array[1..50] of Byte;
                   end;

  EVENTrecord    = record
                     Status         : Byte; { 0=Deleted 1=Enabled 2=Disabled }
                     StartTime      : Time;
                     ErrorLevel     : Byte;
                     Days           : Byte;
                     Forced         : Boolean;
                     LastTimeRun    : Date;
                   end;

  EVENTrecordArray = array[1..20] of EVENTrecord;

  MESSAGErecord  = record
                     AreaNum,   
                     Unused         : Word;
                     Name           : String[40];
                     Typ            : MsgType;
                     MsgKinds       : MsgKindsType;
                     Attribute      : Byte;

                      { Bit 0 : Enable EchoInfo
                            1 : Combined access
                            2 : File attaches
                            3 : Allow aliases
                            4 : Use SoftCRs as characters
                            5 : Force handle     
                            6 : Allow deletes 
                            7 : Is a JAM area }

                     DaysKill,    { Kill older than 'x' days }
                     RecvKill       : Byte; { Kill recv msgs, recv for more than 'x' days }
                     CountKill      : Word;

                     ReadSecurity   : Word;
                     ReadFlags,
                     ReadNotFlags   : FlagType;

                     WriteSecurity  : Word;
                     WriteFlags,
                     WriteNotFlags  : FlagType;

                     SysopSecurity  : Word;
                     SysopFlags,
                     SysopNotFlags  : FlagType;

                     OriginLine     : String[60];
                     AkaAddress     : Byte;
  
                     Age            : Byte;

                     JAMbase        : String[60];
                     Group          : Word;
                     AltGroup       : Array[1..3] of Word;

                     Attribute2     : Byte;

                      { Bit 0 : Include in all groups }

                     NetmailArea    : Word;
                     FreeSpace2     : Array[1..7] of Byte;
                   end;

  GROUPrecord    = record
                     AreaNum        : Word;
                     Name           : String[40];
                     Security       : Word;
                     Flags,
                     NotFlagsMask   : FlagType;
                     FreeSpace      : Array[1..100] of Byte;
                   end;

  FILESrecord    = record
                     AreaNum,
                     Unused         : Word;
                     Name           : String[40];
                     Attrib         : Byte;

                      { Bit 0 : Include in new files scan
                            1 : Include in upload dupe scan
							2 : Permit long descriptions
                            3 : Area is on CD-ROM 
                            4 : All files are FREE 
                            5 : Allow DLs not in FDB 
                            6 : Allow users to password uploads
                            7 : Scan uploads }

                     FilePath       : String[40];
                     KillDaysDL,
                     KillDaysFD     : Word;
                     Password       : String[15];
                     MoveArea       : Word;
                     Age,
                     ConvertExt     : Byte;
                     Group          : Word;
                     Attrib2        : Byte;

                      { Bit 0 : Include in all groups }

                     DefCost,
                     UploadArea,
                     UploadSecurity : Word;
                     UploadFlags,
                     UploadNotFlags : FlagType;
                     Security       : Word;
                     Flags,
                     NotFlags       : FlagType;
                     ListSecurity   : Word;
                     ListFlags,
                     ListNotFlags   : FlagType;
                     AltGroup       : Array[1..3] of Word;
                     Device         : Byte;
                     FreeSpace      : Array[1..13] of Byte;
                   end;

  CONFrecord     = record
                     Name,
                     Parent         : String[8];
                     Desc           : String[70];
                     Attr           : Byte;

                      { Bit 0 : Private
                            1 : Unlisted
                            2 : Global  
                            3 : Permanent
                            4 : Use handles
                                          }

                     Moderator      : String[35];
                     Language       : String[20];
                     Password       : String[15];
                     Security       : Word;
                     Flags          : FlagType;
                     NumNodes       : Byte;
                     Active         : Array[1..250] of Byte;
                     Child          : Array[1..250] of Boolean;
                     NotFlagsMask   : FlagType;
                     FreeSpace      : Array[1..96] of Byte;
                   end;

  MODEMrecord  = record
                   ComPort,
                   InitTries        : Byte;
                   BufferSize,
                   ModemDelay       : Word;
                   MaxSpeed         : LongInt;
                   SendBreak,
                   LockModem,
                   AnswerPhone,
                   OffHook          : Boolean;
                   InitStr,
                   InitStr2,
                   BusyStr          : String[70];
                   InitResp,
                   BusyResp,
                   Connect300,
                   Connect1200,
                   Connect2400,
                   Connect4800,
                   Connect7200,
                   Connect9600,
                   Connect12k,
                   Connect14k,
                   Connect16k,
                   Connect19k,
                   Connect38k,
                   ConnectFax       : String[40];
                   RingStr,
                   AnswerStr        : String[20];
                   ErrorFreeString  : String[15];

                   Connect21k,
                   Connect24k,
                   Connect26k,
                   Connect28k,
                   Connect57k,
                   Connect64k       : String[40];

                   Connect31k,
                   Connect33k       : String[40];

                   FreeSpace        : Array[1..100] of Byte;
                 end;

  ARCrecord = record
                Extension : String[3];
                UnpackCmd,
                PackCmd   : String[60];
              end;

  CONFIGrecord = record
    VersionID           : Word;
    xCommPort           : Byte;
    xBaud               : LongInt;
    xInitTries          : Byte;
    xInitStr,
    xBusyStr            : String[70];
    xInitResp,
    xBusyResp,
    xConnect300,
    xConnect1200,
    xConnect2400,
    xConnect4800,
    xConnect9600,
    xConnect19k,
    xConnect38k         : String[40];
    xAnswerPhone        : Boolean;
    xRing,
    xAnswerStr          : String[20];
    xFlushBuffer        : Boolean;
    xModemDelay         : Integer;

    MinimumBaud,
    GraphicsBaud,
    TransferBaud        : word;
    SlowBaudTimeStart,
    SlowBaudTimeEnd,
    DownloadTimeStart,
    DownloadTimeEnd     : Time;

    PageStart           : Array[0..6] of Time;
    PageEnd             : Array[0..6] of Time;

    SeriNum,
    CustNum             : String[22];
{}  FreeSpace1          : Array[1..24] of Byte;
    PwdExpiry           : Word;

    MenuPath,
    TextPath,
    AttachPath,
    NodelistPath,
    MsgBasePath,
    SysPath,
    ExternalEdCmd       : String[60];

    Address             : Array[0..9] of NetAddress;
    SystemName          : String[30];

    NewSecurity         : Word;
    NewCredit           : Word;
    NewFlags            : FlagType;

    OriginLine          : String[60];
    QuoteString         : String[15];
    Sysop               : String[35];
    LogFileName         : String[60];
    FastLogon,
    AllowSysRem,
    MonoMode,
    StrictPwdChecking,
    DirectWrite,
    SnowCheck           : Boolean;
    CreditFactor        : Integer;

    UserTimeOut,
    LogonTime,
    PasswordTries,
    MaxPage,
    PageLength          : Word;
    CheckForMultiLogon,
    ExcludeSysopFromList,
    OneWordNames        : Boolean;
    CheckMail           : AskType;
    AskVoicePhone,
    AskDataPhone,
    DoFullMailCheck,
    AllowFileShells,
    FixUploadDates,
    FreezeChat          : Boolean;
    ANSI,                       { ANSI: Yes, no, or ask new users     }
    ClearScreen,                { Clear:        "                     }
    MorePrompt          : AskType;    { More:         "                     }
    UploadMsgs          : Boolean;
    KillSent            : AskType;    { Kill/Sent     "                     }

    CrashAskSec         : Word;       { Min sec# to ask 'Crash Mail ?'      }
    CrashAskFlags       : FlagType;
    CrashSec            : Word;       { Min sec# to always send crash mail. }
    CrashFlags          : FlagType;
    FAttachSec          : Word;       {        "    ask 'File Attach ?'     }
    FAttachFlags        : FlagType;

    NormFore,
    NormBack,
    StatFore,
    StatBack,
    HiBack,
    HiFore,
    WindFore,
    WindBack,
    ExitLocal,
    Exit300,
    Exit1200,
    Exit2400,
    Exit4800,
    Exit9600,
    Exit19k,
    Exit38k             : Byte;

    MultiLine           : Boolean;
    MinPwdLen           : Byte;
    MinUpSpace          : Word;
    HotKeys             : AskType;
    BorderFore,
    BorderBack,
    BarFore,
    BarBack,
    LogStyle,
    MultiTasker,
    PwdBoard            : Byte;
    xBufferSize         : Word;
    FKeys               : Array[1..10] of String[60];

    WhyPage             : Boolean;
    LeaveMsg            : Byte;
    ShowMissingFiles,
    xLockModem          : Boolean;
{}  FreeSpace2          : Array[1..10] of Byte;
    AllowNetmailReplies : Boolean;
    LogonPrompt         : String[40];
    CheckNewFiles       : AskType;
    ReplyHeader         : String[60];
    BlankSecs           : byte;
    ProtocolAttrib      : Array[1..6] of Byte;
    xErrorFreeString    : String[15];
    xDefaultCombined    : array[1..25] of Byte;
    RenumThreshold      : Word;
    LeftBracket,
    RightBracket        : Char;
    AskForHandle        : Boolean;
    AskForBirthDate     : Boolean;

    GroupMailSec        : Word;

    ConfirmMsgDeletes   : Boolean;

    FreeSpace4          : Array[1..30] of byte;

    TempScanDir         : String[60];
    ScanNow             : AskType;
    xUnknownArcAction,
    xFailedUnpackAction,
    FailedScanAction    : Byte; {Bit 0:Mark deleted, 1:Mark unlisted, 2:Mark notavail}
    xUnknownArcArea,
    xFailedUnpackArea,
    FailedScanArea      : Word;
    ScanCmd             : String[60];
    xDeductIfUnknown    : Boolean;

    NewUserGroup        : Byte;
    AVATAR              : AskType;
    BadPwdArea          : Byte;
    Location            : String[40];
    DoAfterAction       : Byte; {0 = wait for CR, > 0 = wait for x seconds}
{}  OldFileLine         : String[40];
    CRfore,
    CRback              : Byte;
    LangHdr             : String[40];
    xSendBreak          : Boolean;
{}  ListPath            : String[60];
    FullMsgView         : AskType;
    EMSI_Enable         : AskType;
    EMSI_NewUser        : Boolean;

    EchoChar            : String[1];
    xConnect7200,
    xConnect12000,
    xConnect14400       : String[40];
    Exit7200,
    Exit12000,
    Exit14400           : Byte;
    ChatCommand         : String[60];
    ExtEd               : AskType;
    NewuserLanguage     : Byte;
    LanguagePrompt      : String[40];
    VideoMode           : VideoType;
    AutoDetectANSI      : Boolean;
    xOffHook            : Boolean;
    NewUserDateFormat   : Byte;
    KeyboardPwd         : String[15];
    CapLocation         : Boolean;
    NewuserSub          : Byte;
    PrinterName         : String[4];
    HilitePromptFore,
    HiLitePromptBack    : Byte;
    xInitStr2           : String[70];
    AltJSwap            : Boolean;
    SemPath             : String[60];
    AutoChatCapture     : Boolean;

    FileBasePath        : String[60];
    NewFileTag          : Boolean;
    IgnoreDupeExt       : Boolean;
    TempCDFilePath      : String[60];
    TagFore,
    TagBack             : Byte;
    xConnect16k         : String[40];
    Exit16k,
    FilePayback         : Byte;
    FileLine,
    FileMissingLine     : String[200];
    NewUserULCredit     : Byte;
    NewUserULCreditK    : Word;
    ArcInfo             : Array[1..10] of ARCrecord;
    RAMGRAltFKeys       : Array[1..5] of String[60];
    ArcViewCmd          : String[60];
    xConnectFax         : String[40];
    ExitFax             : Byte;
    UseXMS,
    UseEMS              : Boolean;
    CheckDOB            : Byte;
    EchoCheck           : AskType;
    ccSec,
    ReturnRecSec        : Word;
    HonourNetReq        : Boolean;
    DefaultCombined     : COMBINEDrecord;
    AskForSex,
    AskForAddress       : Boolean;
    DLdesc              : AskType;
    NewPhoneScan        : Boolean;

    Exit21k,
    Exit24k,
    Exit26k,
    Exit28k,
    Exit57k,
    Exit64k             : Byte;

    TagLogoffWarning,
    LimitLocal,
    SavePasswords       : Boolean;

    BlankLogins         : Byte;
    ripiconpath         : string[60];

    Exit31k,
    Exit33k             : Byte;
    IncludeNewCDareas   : Boolean;

    FutureExpansion : Array[1..513] of Byte;
  end;

  EXITINFOrecord = record
                     Baud             : Word;
                     SysInfo          : SYSINFOrecord;
                     TimeLogInfo      : TIMELOGrecord;
                     UserInfo         : USERSrecord;
                     EventInfo        : EVENTrecord;
                     NetMailEntered,
                     EchoMailEntered  : Boolean;
                     LoginTime        : Time;
                     LoginDate        : Date;
                     TimeLimit        : Word;
                     LoginSec         : LongInt;
                     UserRecord       : Integer;
                     ReadThru,
                     NumberPages,
                     DownloadLimit    : Word;
                     TimeOfCreation   : Time;
                     LogonPasswordCRC : LongInt;
                     WantChat         : Boolean;

                     DeductedTime     : Integer;
                     MenuStack        : Array[1..50] of String[8];
                     MenuStackPointer : Byte;
                     UserXIinfo       : USERSXIrecord;
                     ErrorFreeConnect,
                     SysopNext        : Boolean;

                     EMSI_Session     : Boolean;        { These fields hold  }
                     EMSI_Crtdef,                       { data related to an }
                     EMSI_Protocols,                    { EMSI session       }
                     EMSI_Capabilities,
                     EMSI_Requests,
                     EMSI_Software    : String[40];
                     Hold_Attr1,
                     Hold_Attr2,
                     Hold_Len         : Byte;

                     PageReason       : String[80];
                     StatusLine       : Byte;
                     LastCostMenu     : String[8];
                     MenuCostPerMin   : Word;

                     DoesAVT,
                     RIPmode          : Boolean;
                     RIPVersion       : Byte;
                     ExtraSpace       : Array[1..85] of Byte;
                 end;

  PROTOCOLrecord = record
                     Name           : String[15];
                     ActiveKey      : Char;
                     OpusTypeCtlFile,
                     BatchAvailable : Boolean;
                     Attribute      : Byte; { 0=Disabled, 1=Enabled }
                     LogFileName,
                     CtlFileName,
                     DnCmdString,
                     DnCtlString,
                     UpCmdString,
                     UpCtlString    : String[80];
                     UpLogKeyword,
                     DnLogKeyword   : String[20];
                     XferDescWordNum,
                     XferNameWordNum : Byte;
                   end;


