"Fossies" - the Fresh Open Source Software Archive

Member "unrar/recvol.hpp" (4 May 2022, 2405 Bytes) of package /linux/misc/unrarsrc-6.1.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "recvol.hpp" see the Fossies "Dox" file reference documentation.

    1 #ifndef _RAR_RECVOL_
    2 #define _RAR_RECVOL_
    3 
    4 #define REV5_SIGN      "Rar!\x1aRev"
    5 #define REV5_SIGN_SIZE             8
    6 
    7 class RecVolumes3
    8 {
    9   private:
   10     File *SrcFile[256];
   11     Array<byte> Buf;
   12 
   13 #ifdef RAR_SMP
   14     ThreadPool *RSThreadPool;
   15 #endif
   16   public:
   17     RecVolumes3(RAROptions *Cmd,bool TestOnly);
   18     ~RecVolumes3();
   19     void Make(RAROptions *Cmd,wchar *ArcName);
   20     bool Restore(RAROptions *Cmd,const wchar *Name,bool Silent);
   21     void Test(RAROptions *Cmd,const wchar *Name);
   22 };
   23 
   24 
   25 struct RecVolItem
   26 {
   27   File *f;
   28   wchar Name[NM];
   29   uint CRC;
   30   uint64 FileSize;
   31   bool New;   // Newly created RAR volume.
   32   bool Valid; // If existing RAR volume is valid.
   33 };
   34 
   35 
   36 class RecVolumes5;
   37 struct RecRSThreadData
   38 {
   39   RecVolumes5 *RecRSPtr;
   40   RSCoder16 *RS;
   41   bool Encode;
   42   uint DataNum;
   43   const byte *Data;
   44   size_t StartPos;
   45   size_t Size;
   46 };
   47 
   48 class RecVolumes5
   49 {
   50   private:
   51     void ProcessRS(RAROptions *Cmd,uint DataNum,const byte *Data,uint MaxRead,bool Encode);
   52     void ProcessRS(RAROptions *Cmd,uint MaxRead,bool Encode);
   53     uint ReadHeader(File *RecFile,bool FirstRev);
   54 
   55     Array<RecVolItem> RecItems;
   56 
   57     byte *RealReadBuffer; // Real pointer returned by 'new'.
   58     byte *ReadBuffer;     // Pointer aligned for SSE instructions.
   59 
   60     byte *RealBuf;        // Real pointer returned by 'new'.
   61     byte *Buf;            // Store ECC or recovered data here, aligned for SSE.
   62     size_t RecBufferSize; // Buffer area allocated for single volume.
   63 
   64     uint DataCount;   // Number of archives.
   65     uint RecCount;    // Number of recovery volumes.
   66     uint TotalCount;  // Total number of archives and recovery volumes.
   67 
   68     bool *ValidFlags; // Volume validity flags for recovering.
   69     uint MissingVolumes; // Number of missing or bad RAR volumes.
   70 
   71 #ifdef RAR_SMP
   72     ThreadPool *RecThreadPool;
   73 #endif
   74     uint MaxUserThreads; // Maximum number of threads defined by user.
   75     RecRSThreadData *ThreadData; // Array to store thread parameters.
   76   public: // 'public' only because called from thread functions.
   77     void ProcessAreaRS(RecRSThreadData *td);
   78   public:
   79     RecVolumes5(RAROptions *Cmd,bool TestOnly);
   80     ~RecVolumes5();
   81     bool Restore(RAROptions *Cmd,const wchar *Name,bool Silent);
   82     void Test(RAROptions *Cmd,const wchar *Name);
   83 };
   84 
   85 bool RecVolumesRestore(RAROptions *Cmd,const wchar *Name,bool Silent);
   86 void RecVolumesTest(RAROptions *Cmd,Archive *Arc,const wchar *Name);
   87 
   88 #endif