Sage-ST ä

Loglib

Documentation

CloseLogFile CreateLogFile FlushBlockFields GatherLogFile
GetCurrent GetFirst GetLast GetNext
GetPrevious GetRecNum LoadBlockFields LoadMemoryRecord
OpenLogFile PostErrorMessage PresentLog PrintLogReport
ProcessLogFile RepairLogFile STRPostErrorMessage SetMessageStatus
SortFilteredLog TransferLogEntries UpdateDataBase VerifiedLogFile




  procedure SetMessageStatus
             (const messageON : boolean); stdcall;

  exports SetMessageStatus name 'LogLib_SetMessageStatus';




  procedure CloseLogFile
             (var   LogFile : FileLG;
              var   state   : Files.FileState); stdcall;

  exports CloseLogFile name 'LogLib_CloseLogFile';

  //*
  //  CloseLogFile - Close log file, discontinue processing.
  //
  //
  //  CloseLogFile closes the log file access.
  //
  //  CALLING SEQUENCE -
  //
  //    CloseLogFile (LogFile, state)
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      The handle to the log file.
  //
  //    state : Files.FileState
  //      The state of the file after attempting to close.
  //
  //  EXAMPLE -
  //
  //    CloseLogFile (LogFile, State);
  //




  procedure CreateLogFile
             (var   LogFile  : FileLG;
              const FileName : array of char;
              var   state    : Files.FileState); stdcall;

  exports CreateLogFile name 'LogLib_CreateLogFile';

  //*
  //  CreateLogFile - Create a new log file.
  //
  //
  //  CreateLogFile creates a new log file and/or overwrites an existing one.
  //  This makes this file available to be used by the transfer routine to
  //  copy log entries from one file to another.
  //
  //  CALLING SEQUENCE -
  //
  //    CreateLogFile (LogFile, FileName, State)
  //
  //  ENTRY -
  //
  //    FileName : array of char
  //      The name of the log file to create.  Please see the note at the
  //      beginning of the LogLib documentation about legal log names.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      The handle to the log file.
  //
  //    State : Files.FileState
  //      The state of the file after attempting to create.
  //
  //  EXAMPLE -
  //
  //    CreateLogFile (LogFile, 'TEST.A01', State);
  //




  function GatherLogFile
             (const Path       : array of char;
              const LogName    : array of char;
              const outputPath : array of char;
              const outputName : array of char) : boolean; stdcall;

  exports GatherLogFile name 'LogLib_GatherLogFile';

  //*
  //  GatherLogFile - Gather log files into one log file.
  //
  //
  //  GatherLogFile gathers the requested log files into one log file.
  //  All logs files may be gathered by sending in an '*' for the name.
  //
  //  CALLING SEQUENCE -
  //
  //    GatherLogFile (path, name, outputPath, outputName)
  //
  //  ENTRY -
  //
  //    path : array of char
  //      Path to the log files to be gathered.
  //
  //    name : array of char
  //      Name of the log files to gather.  This name may include the
  //      '?' and '*' wildcard characters.
  //
  //    outputPath : array of char
  //      This is the path to the output file for the log entries.
  //
  //    outputName : array of char
  //      This is the name of the output file for the log entries.  This name
  //      must NOT include an extension.  When this routine completes the
  //      outputName fill have an extension of '.A01'.
  //
  //  EXAMPLE -
  //
  //    GatherLogFile ('C:\TEST\', 'MYAPP*.L*', 'C:\TEST2\', 'MYAPP');
  //




  procedure GetCurrent
             (var   LogFile : FileLG;
              const Raw     : boolean;
              var   Header  : LogHeadDefinition); stdcall;

  exports GetCurrent name 'LogLib_GetCurrent';

  //*
  //  GetCurrent - Gets the header information for current log entry.
  //
  //
  //  GetCurrent reads the current log entry information from the log file.
  //  Whether the entry is to come from the raw or filtered file must be
  //  specified with the Raw flag.
  //
  //  CALLING SEQUENCE -
  //
  //    GetCurrent (LogFile, Raw, Header)
  //
  //  ENTRY -
  //
  //    Raw : boolean
  //      True - Read the current entry in the raw file.
  //      False - Read the current entry in the filtered file.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      Handle to the log file.
  //
  //    Header : LogHeadDefinition
  //      Record containing current log entry information
  //
  //  EXAMPLE -
  //
  //    GetCurrent (LogFile, False, Head);
  //




  procedure GetFirst
             (var   LogFile   : FileLG;
              const Raw       : boolean;
              var   Header    : LogHeadDefinition;
              var   Available : boolean); stdcall;

  exports GetFirst name 'LogLib_GetFirst';

  //*
  //  GetFirst - Gets the header information for first log entry.
  //
  //
  //  GetFirst reads the first log entry information from the log file.
  //  Whether the entry is to come from the raw or filtered file must be
  //  specified with the Raw flag.
  //
  //  CALLING SEQUENCE -
  //
  //    GetFirst (LogFile, Raw, Header, Available)
  //
  //  ENTRY -
  //
  //    Raw : boolean
  //      True - Read the first entry in the raw file.
  //      False - Read the first entry in the filtered file.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      Handle to the log file.
  //
  //    Header : LogHeadDefinition
  //      Record containing first log entry information
  //
  //    Available : boolean
  //      True - The requested record is available
  //      False - The requested record is NOT available
  //
  //  EXAMPLE -
  //
  //    GetFirst (LogFile, False, Head, Available);
  //




  procedure GetLast
             (var   LogFile   : FileLG;
              const Raw       : boolean;
              var   Header    : LogHeadDefinition;
              var   Available : boolean); stdcall;

  exports GetLast name 'LogLib_GetLast';

  //*
  //  GetLast - Gets the header information for last log entry.
  //
  //
  //  GetLast reads the last log entry information from the log file.
  //  Whether the entry is to come from the raw or filtered file must be
  //  specified with the Raw flag.
  //
  //  CALLING SEQUENCE -
  //
  //    GetLast (LogFile, Raw, Header, Available)
  //
  //  ENTRY -
  //
  //    Raw : boolean
  //      True - Read the last entry in the raw file.
  //      False - Read the last entry in the filtered file.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      Handle to the log file.
  //
  //    Header : LogHeadDefinition
  //      Record containing last log entry information
  //
  //    Available : boolean
  //      True - The requested record is available
  //      False - The requested record is NOT available
  //
  //  EXAMPLE -
  //
  //    GetLast (LogFile, False, Head, Available);
  //




  procedure GetNext
             (var   LogFile   : FileLG;
              const Raw       : boolean;
              var   Header    : LogHeadDefinition;
              var   Available : boolean); stdcall;

  exports GetNext name 'LogLib_GetNext';

  //*
  //  GetNext - Gets the header information for next log entry.
  //
  //
  //  GetNext reads the next log entry information from the log file.
  //  Whether the entry is to come from the raw or filtered file must be
  //  specified with the Raw flag.
  //
  //  CALLING SEQUENCE -
  //
  //    GetNext (LogFile, Raw, Header, Available)
  //
  //  ENTRY -
  //
  //    Raw : boolean
  //      True - Read the next entry in the raw file.
  //      False - Read the next entry in the filtered file.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      Handle to the log file.
  //
  //    Header : LogHeadDefinition
  //      Record containing next log entry information
  //
  //    Available : boolean
  //      True - The requested record is available
  //      False - The requested record is NOT available
  //
  //  EXAMPLE -
  //
  //    GetNext (LogFile, False, Head, Available);
  //




  procedure GetPrevious
             (var   LogFile   : FileLG;
              const Raw       : boolean;
              var   Header    : LogHeadDefinition;
              var   Available : boolean); stdcall;

  exports GetPrevious name 'LogLib_GetPrevious';

  //*
  //  GetPrevious - Gets the header information for previous log entry.
  //
  //
  //  GetPrevious reads the previous log entry information from the log file.
  //  Whether the entry is to come from the raw or filtered file must be
  //  specified with the Raw flag.
  //
  //  CALLING SEQUENCE -
  //
  //    GetPrevious (LogFile, Raw, Header, Available)
  //
  //  ENTRY -
  //
  //    Raw : boolean
  //      True - Read the previous entry in the raw file.
  //      False - Read the previous entry in the filtered file.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      Handle to the log file.
  //
  //    Header : LogHeadDefinition
  //      Record containing previous log entry information
  //
  //    Available : boolean
  //      True - The requested record is available
  //      False - The requested record is NOT available
  //
  //  EXAMPLE -
  //
  //    GetPrevious (LogFile, False, Head, Available);
  //




  procedure GetRecNum
             (var   LogFile      : FileLG;
              const Raw          : boolean;
              const RequestedRec : ModSys.INT32;
              var   Header       : LogHeadDefinition;
              var   Available    : boolean); stdcall;

  exports GetRecNum name 'LogLib_GetRecNum';

  //*
  //  GetRecNum - Gets the header information for specified log entry.
  //
  //
  //  GetRecNum reads the specified log entry information from the log file.
  //  Whether the entry is to come from the raw or filtered file must be
  //  specified with the Raw flag.
  //
  //  CALLING SEQUENCE -
  //
  //    GetRecNum (LogFile, Raw, RequestedRec, Header, Available)
  //
  //  ENTRY -
  //
  //    Raw : boolean
  //      True - Read the previous entry in the raw file.
  //      False - Read the previous entry in the filtered file.
  //
  //    RequestedRec : ModSys.INT32
  //      The number of the record to read.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      Handle to the log file.
  //
  //    Header : LogHeadDefinition
  //      Record containing previous log entry information
  //
  //    Available : boolean
  //      True - The requested record is available
  //      False - The requested record is NOT available
  //
  //  EXAMPLE -
  //
  //    GetRecNum (LogFile, False, 24, Head, Available);
  //




  procedure LoadBlockFields
             (var   LogFile : FileLG;
              const Raw     : boolean;
              const Method  : UpdateType); stdcall;

  exports LoadBlockFields name 'LogLib_LoadBlockFields';

  //*
  //  LoadBlockFields - Load block data from log to block fields.
  //
  //
  //  LoadBlockFields reads the block data from the log file and puts it into
  //  the block data field of the record.
  //
  //  CALLING SEQUENCE -
  //
  //    LoadBlockFields (LogFile, Raw, Method)
  //
  //  ENTRY -
  //
  //    Raw : boolean
  //      True - Read the data from the raw file.
  //
  //      False - Read the data from the filtered file.
  //
  //    Method : LogLib.UpdateType
  //      The method to be used to write the data.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      The handle to the log file.
  //
  //  EXAMPLE -
  //
  //    LoadBlockFields (LogFile, True, LogLib.ADD);
  //




  procedure FlushBlockFields
             (var   LogFile : FileLG;
              const Raw     : boolean); stdcall;

  exports FlushBlockFields name 'LogLib_FlushBlockFields';

  //*
  //  FlushBlockFields - Flush (get rid of) any saved block field data.
  //
  //
  //  FlushBlockFields flushes (gets rid of) any of the block data that
  //  was being accumulated to use with a record.  If the record is not
  //  going to be used then this routine flushes the block data also.
  //
  //  CALLING SEQUENCE -
  //
  //    FlushBlockFields (LogFile, Raw, Method)
  //
  //  ENTRY -
  //
  //    Raw : boolean
  //      True - Read the data from the raw file.
  //
  //      False - Read the data from the filtered file.
  //
  //    Method : LogLib.UpdateType
  //      The method to be used to write the data.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      The handle to the log file.
  //
  //  EXAMPLE -
  //
  //    FlushBlockFields (LogFile, True, LogLib.ADD);
  //




  procedure LoadMemoryRecord
             (var   LogFile : FileLG;
              const Raw     : boolean;
              var   Success : boolean); stdcall;

  exports LoadMemoryRecord name 'LogLib_LoadMemoryRecord';

  //*
  //  LoadMemoryRecord - Load memory record for requested log entry.
  //
  //
  //  LoadRecord loads the memory record with the data from the log file for
  //  the requested record.
  //
  //  CALLING SEQUENCE -
  //
  //    LoadMemoryRecord (LogFile, Raw, Success)
  //
  //  ENTRY -
  //
  //    Raw : boolean
  //      True - Read the data from the raw file.
  //
  //     False - Read the data from the filtered file.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      The handle to the log file.
  //
  //    Success : boolean
  //      Was the operation successful?
  //
  //  EXAMPLE -
  //
  //    LoadMemoryRecord (LogFile, True, Success);
  //




  procedure OpenLogFile
             (var   LogFile   : FileLG;
              const FileName  : array of char;
              const Modify    : boolean;
              var   TotalRecs : cardinal;
              var   state     : Files.FileState); stdcall;

  exports OpenLogFile name 'LogLib_OpenLogFile';

  //*
  //  OpenLogFile - Opens the specified log file.
  //
  //
  //  OpenLogFile opens the requested log file for processing.  The file may
  //  be opened for modification or as a read only file.
  //
  //  CALLING SEQUENCE -
  //
  //    OpenLogFile (LogFile, FileName, Modify, State)
  //
  //  ENTRY -
  //
  //    FileName : array of char
  //      Name of the log file to open.  Please see the note about legal log
  //      file names at the beginning of the LogLib documentation.
  //
  //    Modify : boolean
  //      boolean value as to whether the file may be modified while open.
  //
  //  EXIT -
  //
  //    LogFile : FileLG
  //      Handle to the log file.
  //
  //    TotalRecs : cardinal
  //      Total number of RAW records in this log.
  //
  //    State : Files.FileState
  //      The state of the file upon returning.
  //
  //  EXAMPLE -
  //
  //    OpenLogFile (LogFile, 'MYAPP.A01', True, TotalRecs, State);
  //




  procedure PostErrorMessage
             (const Message : array of char); overload; stdcall;

  exports PostErrorMessage (const Message : array of char) name 'LogLib_PostErrorMessage';

  //*
  //  PostErrorMessage - Allows a user error message while updating.
  //
  //
  //  PostErrorMessage allows a user error message to be posted to the
  //  error file during the time that the UpdateDataBase procedure is
  //  running.  This is NOT a valid call at any other time.
  //
  //  CALLING SEQUENCE -
  //
  //    PostErrorMessage (Message)
  //
  //  ENTRY -
  //
  //    Message : array of char
  //      The message to post to the error file.
  //
  //  EXAMPLE -
  //
  //    PostErrorMessage ('Unknown Error Occurred');
  //




  procedure PostErrorMessage
             (const Message : string); overload; stdcall;

  exports PostErrorMessage (const Message : string) name 'LogLib_STRPostErrorMessage';

  //*
  //  STRPostErrorMessage - See documentation of PostErrorMessage.
  //




  procedure PresentLog
             (var   LogFile : FileLG;
              const LProc   : PresentProc); stdcall;

  exports PresentLog name 'LogLib_PresentLog';

  //*
  //  PresentLog - Scroll log file entries on screen.
  //
  //
  //  PresentLog opens a window on screen and scrolls the information about
  //  the entries in the log file.  Only the filtered log will be presented.
  //
  //  CALLING SEQUENCE -
  //
  //    PresentLog (LogFile, LProc)
  //
  //  ENTRY -
  //
  //    LogFile : FileLG
  //      The handle to a valid opened log file to display.
  //
  //  EXAMPLE -
  //
  //    procedure LoadRoutine
  //         (RecordsStart : in     ModSys.INT32;
  //          RecordsMax   : in     ModSys.INT32);
  //
  //
  //    begin
  //      -- |
  //      -- The records from RecordsStart to RecordsMax have been selected.
  //      -- At this point you can load them, print them, etc.
  //      -- |
  //    end LoadRoutine;
  //
  //    procedure PresentMyLog is new Loglib.PresentLog
  //         (LoadRoutine);
  //
  //    begin
  //      PresentMyLog (LogHandle, state);
  //




  procedure PrintLogReport
             (var   LogFile  : FileLG;
              const DestFile : array of char;
              const DflName  : array of char;
              const Raw      : boolean;
              const StartRec : ModSys.INT32;
              const EndRec   : ModSys.INT32); stdcall;

  exports PrintLogReport name 'LogLib_PrintLogReport';

  //*
  //  PrintLogReport - Print report of log file to output file.
  //
  //
  //  PrintLogReport prints a report of the contents of the log file to the
  //  requested output.
  //
  //  CALLING SEQUENCE -
  //
  //    PrintLogReport (LogFile, DestFile, DFLName, Raw, StartRec, EndRec)
  //
  //  ENTRY -
  //
  //    LogFile : FileLG
  //      The handle to a valid opened log file.
  //
  //    DestFile : array of char
  //      The name of destination for the report.
  //
  //    DFLName : array of char
  //      The name of the DFL file that this log file belongs to.
  //
  //    Raw : boolean
  //      True - Read the data from the raw file.
  //      False - Read the data from the filtered file.
  //
  //    StartRec : ModSys.INT32
  //      The number of the starting log entry to use.
  //
  //    EndRec : ModSys.INT32
  //      The number of the ending log entry to use.  If this number is greater
  //      than the number of entries in the log then the report will stop at the
  //      end of the log file.
  //
  //  EXAMPLE -
  //
  //    PrintLogReport (LogHandle, 'MYAPP.RPT', 'MYAPP.DFL', False, 1, 100);
  //




  procedure ProcessLogFile
             (var   LogFile : FileLG;
              const Raw     : boolean;
              const PProc   : ProcessProc); stdcall;

  exports ProcessLogFile name 'LogLib_ProcessLogFile';

  //*
  //  ProcessLogFile - Read the log file entries into memory sequentially.
  //
  //
  //  ProcessLogFile reads the log entries starting at the first and continuing
  //  sequentially through the file.  The entry is read, the memory record is
  //  loaded and then the PProc is called.  If the block data is to be loaded
  //  then the proper routine will need to be called from inside the PProc.
  //
  //  CALLING SEQUENCE -
  //
  //    ProcessLogFile (LogFile, Raw)
  //
  //  ENTRY -
  //
  //    LogFile : FileLG
  //      The handle to a valid opened log file to process.
  //
  //  EXIT -
  //
  //    Raw : boolean
  //      True - Read the data from the raw file.
  //      False - Read the data from the filtered file.
  //
  //  EXAMPLE -
  //
  //    procedure ProcessProc
  //          (LogFile  : in out FileLG;
  //           LogHead  : in     LogHeadDefinition;
  //           ContinueOn : in out boolean) is
  //
  //    begin
  //       -- |
  //       -- The memory record for the current entry is loaded.  Validate
  //       -- it, transfer it, print it, etc.
  //       -- |
  //    end ProcessProc;
  //
  //    procedure ProcessMyLog is new Loglib.ProcessLog
  //         (ProcessProc);
  //
  //     begin
  //      ProcessMyLog (LogHandle, state);
  //




  procedure SortFilteredLog
             (var   LogFile    : FileLG;
              const SortMethod : SortMethodType;
              const Force      : boolean); stdcall;

  exports SortFilteredLog name 'LogLib_SortFilteredLog';

  //*
  //  SortFilteredLog - Sort the filtered log in a different order.
  //
  //
  //  SortFilteredLog allows the filtered log to be sorted in one of four
  //  different methods to allow efficiency of processing.  The four methods
  //  are 1) Date - date + time 2) Relation - Relation + Date + Time
  //  3) UserID - UserID + Date + Time 4) UserRelation - UserID + Relation
  //  + Date + Time.
  //
  //  CALLING SEQUENCE -
  //
  //    SortFilteredLog (LogFile, SortMethod, Force)
  //
  //  ENTRY -
  //
  //    LogFile : FileLG
  //      The handle to a valid opened log file.
  //
  //    SortMethod : SortMethodType
  //      The method of sorting to be used.
  //
  //    Force : boolean
  //      True - Sort the file even if it is current sorted in this method.
  //      False - Don't sort if current sorted in the defined SortMethod.
  //
  //  EXAMPLE -
  //
  //    SortFilteredLog (LogHandle, LogLib.Date, True);
  //




  procedure TransferLogEntries
             (var   LogFile  : FileLG;
              var   DestLog  : FileLG;
              const Raw      : boolean;
              const StartRec : ModSys.INT32;
              const EndRec   : ModSys.INT32); stdcall;

  exports TransferLogEntries name 'LogLib_TransferLogEntries';

  //*
  //  TransferLogEntries - Transfer current entry in LogFile to DestLog.
  //
  //
  //  TransferLogEntries allows the user to transfer the current log entry
  //  (Raw or Filtered as defined by Raw) to a second opened log file.  If
  //  it is a filtered entry then the corresponding log entry will be
  //  transferred along with the requested log entry.
  //
  //  CALLING SEQUENCE -
  //
  //    TransferLogEntry (LogFile, DestLog, Raw, StartRec, EndRec)
  //
  //  ENTRY -
  //
  //    LogFile : FileLG
  //      The handle to a valid opened log file.
  //
  //    Raw : boolean
  //      True - Read the data from the raw file.
  //      False - Read the data from the filtered file.
  //
  //    StartRec : ModSys.INT32
  //      The starting record number to use.
  //
  //    EndRec : ModSys.INT32
  //      The ending record number to use.
  //
  //  EXIT -
  //
  //    DestFile : FileLG
  //      The handle to a valid opened destination log file.
  //
  //  EXAMPLE -
  //
  //    TransferLogEntries (LogHandle, LogDest, True, 1, 100);
  //




  procedure UpdateDataBase
             (var   LogFile      : FileLG;
              const Raw          : boolean;
              const StartRec     : ModSys.INT32;
              const EndRec       : ModSys.INT32;
              const ExternalFile : boolean;
              const UProc        : UpdateProc;
              var   Error        : boolean); stdcall;

  exports UpdateDataBase name 'LogLib_UpdateDataBase';

  //*
  //  UpdateDataBase - Update database from entries in log file.
  //
  //
  //  UpdateDataBase reads the entries of the log file and updates the database.
  //
  //  CALLING SEQUENCE -
  //
  //    UpdateDataBase (LogFile, Raw, StartRec, EndRec, ExternalFile, UProc, Error)
  //
  //  ENTRY -
  //
  //    LogFile : FileLG
  //      Handle to a log file.
  //
  //    Raw : boolean
  //      True - Read the data from the raw file.
  //      False - Read the data from the filtered file.
  //
  //    StartRec : ModSys.INT32
  //      The starting RAW record number to use.
  //
  //    EndRec : ModSys.INT32
  //      The highest numbered RAW record to use.
  //
  //    ExternalFile : boolean
  //      True - This file was created externally and is being merged into the
  //             current data base.
  //
  //      False - This file was created directly on the current database.
  //
  //    UProc : UpdateProc
  //      procedure to call as each record is processed.  In this procedure the
  //      user is responsible to locate the record that is to be updated and
  //      rewrite or write it.
  //
  //    Error : boolean
  //      True - An error occurred while processing.
  //      False - No errors encountered during processing.
  //
  //  EXAMPLE -
  //
  //    procedure UpdateRoutine
  //              (    Relation  : array of char;
  //                  Operation : UpdateType;
  //               var ContinueOn  : boolean);
  //
  //    begin
  //      The current memory record for the Relation is loaded with data
  //      as defined by the Operation.  Take any actions necessary and
  //      then return the Continue flag is True to do another record
  //      or False to stop.
  //
  //    end;  // UpdateRoutine
  //
  //
  //    begin
  //     LogLib.UpdateDataBase (LogFile, True, 1, 150, False, UpdateRoutine, Error);
  //




  function VerifiedLogFile
             (const LogFileName : array of char) : boolean; stdcall;

  exports VerifiedLogFile name 'LogLib_VerifiedLogFile';

  //*
  //  VerifiedLogFile - Verify if the records seem to be intact in this log file.
  //
  //
  //  This routine reads through the records in the log file and returns a boolean
  //  indicating if at least the structure of all the records seems to be valid.
  //  An invalid return value would indicate that at least one record does not
  //  match the size recorded for it.
  //
  //  CALLING SEQUENCE -
  //
  //    VerifiedLogFile (LogFileName)
  //
  //  ENTRY -
  //
  //    LogFile : array of char
  //      The name of the log file to check.
  //
  //  EXIT -
  //
  //    boolean
  //      True - All records match the internal size recorded for them.
  //      False - A record was detected which does not matche the size it should be.
  //




  procedure RepairLogFile
             (const OriginalLogFile : array of char;
              const RepairedLogFile : array of char;
              var   BadRecordsFound : cardinal;
              var   Success         : boolean); stdcall;

  exports RepairLogFile name 'LogLib_RepairLogFile';

  //*
  //  RepairLogFile - Repair a log file that contains a corrupted record.
  //
  //
  //  This routines reads through a log file and makes a new copy which does
  //  not contain the corrupted record.  By throwing out one record at least
  //  some of the data recorded can be saved.  If you try to update using a
  //  corrupted file most if not all the data might be lost.  This routine
  //  provides a mechanism to at least recover most of it.
  //
  //  CALLING SEQUENCE -
  //
  //    RepairLogFile (OriginalLogFile, RepairedLogFile, BadRecordsFound, Success)
  //
  //  ENTRY -
  //
  //    OriginalLogFile : array of char
  //      The name of the original log file, the one that is thought to contain a
  //      corrupted record.
  //
  //    RepairedLogFile : array of char
  //      The name of the file that will receive the good records.  Once this routine
  //      finishes this should be a clean log file that will not contain any
  //      corrupted records.
  //
  //  EXIT -
  //
  //    BadRecordsFound : cardinal
  //      The number of bad records encountered and cleaned out of the file.
  //
  //    Success : boolean
  //      True - The file was successfully processed which indicates that all possible
  //             good records were recovered.
  //      False - The file could not be processed.  The file may be so corrupted as to
  //               be completely unrecoverable.
  //




Send mail to   warren.merrill@inl.gov with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance