 {
 $Id$
}

 {proboard v1.31}

  {
   char name[80];       /* Name of file area                                */
   char listpath[80];   /* Path for file-list                               */
   char filepath[80];   /* Path for files                                   */
   uint level;          /* Level needed for access                          */
   long flags;          /* Flags needed for access                          */
   char type;           /* 1 = CDROM File listing type                      */
   int  maxfiles;       /* Max files per day in this area downloadable      */
   int  maxkb;          /* Max Kbytes per day in this area                  */
   bool notops;         /* Set to 1 -> should not be listed in TOPFILES.A?? */
   bool free;           /* Set to 1 -> free area                            */
   char extra[13];      /* Reserved                                         */
  }


Procedure Bbs5;
Type
  FilesRecord   = Record
    name       : array[1..80] of char;      { Name of file area }
    listpath   : array[1..80] of char;      { Path for file-list }
    filepath   : array[1..80] of char;      { Path for files }
    level      : integer;         { Level needed for access }
    flags      : longint;         { Flags needed for access }
    typ        : char;            { 1 = CDROM File listing type }
    maxfiles   : integer;         { Max files per day in this area downloadable }
    maxkb      : integer;         { Max Kbytes per day in this area }
    notops     : boolean;         { Set to 1 -> should not be listed in TOPFILES.A?? }
    free       : boolean;         { Set to 1 -> free area }
    extra      : array[1..13] of char;      { Reserved }
  End;
Var
  Ffile : File of FilesRecord;
  F     : Filesrecord;
  Tel   : Word;
  X     : Integer;
Begin
  Writeln('Converting ProBoard 1.31 file areas.',#10#13);

  Assign(Ffile, BbsPath + 'FILECFG.PRO');
  {$I-} Reset(Ffile); {$I+}
  If ioresult <> 0 then
    Begin
      Writeln('Cannot find '+bbspath+'FILECFG.PRO!');
      Halt;
    End;

  AddToFile(false);

  Tel := 0;
  While not eof(ffile) do
    Begin
      FillChar(Bbs,sizeof(bbs),#0);

      {$I-} Read(Ffile,F); {$I+}
      If ioresult <> 0 then
        Begin
          Writeln('Error reading '+bbspath+'FILECFG.PRO!');
          Halt;
        End;

      Inc(Tel);
      If F.name[1] <> #0 then
        Begin
          Inc(Number);
          Bbs.on   := False;

          X := 1;
          While F.Name[x] <> #0 do
            Begin
              Bbs.Name := Bbs.name + F.name[x];
              Inc(x);
            End;

          Bbs.nr   := Tel;

          X := 1;
          While F.Filepath[x] <> #0 do
            Begin
              Bbs.path := Bbs.Path + F.filepath[x];
              Inc(X);
            End;

          AddToFile(saveset);
        End;
    End;
  Close(Ffile);
End;

