FILEBONE support

This commit is contained in:
mysticbbs 2012-03-04 01:21:25 -05:00
parent f4831612f6
commit 226fac328c
1 changed files with 61 additions and 0 deletions

View File

@ -25,12 +25,16 @@ Var
Const Const
Header_GENERAL = 'General'; Header_GENERAL = 'General';
Header_IMPORTNA = 'Import_FIDONET.NA'; Header_IMPORTNA = 'Import_FIDONET.NA';
Header_FILEBONE = 'Import_FILEBONE.NA';
Header_UPLOAD = 'MassUpload'; Header_UPLOAD = 'MassUpload';
Function strAddr2Str (Addr : RecEchoMailAddr) : String; Function strAddr2Str (Addr : RecEchoMailAddr) : String;
Function GenerateMBaseIndex : LongInt; Function GenerateMBaseIndex : LongInt;
Function GenerateFBaseIndex : LongInt;
Function IsDupeMBase (FN: String) : Boolean; Function IsDupeMBase (FN: String) : Boolean;
Function IsDupeFBase (FN: String) : Boolean;
Procedure AddMessageBase (Var MBase: RecMessageBase); Procedure AddMessageBase (Var MBase: RecMessageBase);
Procedure AddFileBase (Var FBase: RecFileBase);
Function ShellDOS (ExecPath: String; Command: String) : LongInt; Function ShellDOS (ExecPath: String; Command: String) : LongInt;
Procedure ExecuteArchive (FName: String; Temp: String; Mask: String; Mode: Byte); Procedure ExecuteArchive (FName: String; Temp: String; Mask: String; Mode: Byte);
@ -81,6 +85,30 @@ Begin
Close (MBaseFile); Close (MBaseFile);
End; End;
Function IsDupeFBase (FN: String) : Boolean;
Var
FBaseFile : File of RecFileBase;
FBase : RecFileBase;
Begin
Result := False;
Assign (FBaseFile, bbsConfig.DataPath + 'fbases.dat');
{$I-} Reset (FBaseFile); {$I+}
If IoResult <> 0 Then Exit;
While Not Eof(FBaseFile) Do Begin
Read (FBaseFile, FBase);
If strUpper(FBase.FileName) = strUpper(FN) Then Begin
Result := True;
Break;
End;
End;
Close (FBaseFile);
End;
Function GenerateMBaseIndex : LongInt; Function GenerateMBaseIndex : LongInt;
Var Var
MBaseFile : File of RecMessageBase; MBaseFile : File of RecMessageBase;
@ -103,6 +131,28 @@ Begin
Close (MBaseFile); Close (MBaseFile);
End; End;
Function GenerateFBaseIndex : LongInt;
Var
FBaseFile : File of RecFileBase;
FBase : RecFileBase;
Begin
Assign (FBaseFile, bbsConfig.DataPath + 'fbases.dat');
Reset (FBaseFile);
Result := FileSize(FBaseFile);
While Not Eof(FBaseFile) Do Begin
Read (FBaseFile, FBase);
If FBase.Index = Result Then Begin
Inc (Result);
Reset (FBaseFile);
End;
End;
Close (FBaseFile);
End;
Procedure AddMessageBase (Var MBase: RecMessageBase); Procedure AddMessageBase (Var MBase: RecMessageBase);
Var Var
MBaseFile : File of RecMessageBase; MBaseFile : File of RecMessageBase;
@ -114,6 +164,17 @@ Begin
Close (MBaseFile); Close (MBaseFile);
End; End;
Procedure AddFileBase (Var FBase: RecFileBase);
Var
FBaseFile : File of RecFileBase;
Begin
Assign (FBaseFile, bbsConfig.DataPath + 'fbases.dat');
Reset (FBaseFile);
Seek (FBaseFile, FileSize(FBaseFile));
Write (FBaseFile, FBase);
Close (FBaseFile);
End;
Function ShellDOS (ExecPath: String; Command: String) : LongInt; Function ShellDOS (ExecPath: String; Command: String) : LongInt;
Var Var
Image : TConsoleImageRec; Image : TConsoleImageRec;