"Fossies" - the Fresh Open Source Software Archive

Member "unrar/dll.hpp" (4 May 2022, 4885 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 "dll.hpp" see the Fossies "Dox" file reference documentation.

    1 #ifndef _UNRAR_DLL_
    2 #define _UNRAR_DLL_
    3 
    4 #pragma pack(push, 1)
    5 
    6 #define ERAR_SUCCESS             0
    7 #define ERAR_END_ARCHIVE        10
    8 #define ERAR_NO_MEMORY          11
    9 #define ERAR_BAD_DATA           12
   10 #define ERAR_BAD_ARCHIVE        13
   11 #define ERAR_UNKNOWN_FORMAT     14
   12 #define ERAR_EOPEN              15
   13 #define ERAR_ECREATE            16
   14 #define ERAR_ECLOSE             17
   15 #define ERAR_EREAD              18
   16 #define ERAR_EWRITE             19
   17 #define ERAR_SMALL_BUF          20
   18 #define ERAR_UNKNOWN            21
   19 #define ERAR_MISSING_PASSWORD   22
   20 #define ERAR_EREFERENCE         23
   21 #define ERAR_BAD_PASSWORD       24
   22 
   23 #define RAR_OM_LIST              0
   24 #define RAR_OM_EXTRACT           1
   25 #define RAR_OM_LIST_INCSPLIT     2
   26 
   27 #define RAR_SKIP              0
   28 #define RAR_TEST              1
   29 #define RAR_EXTRACT           2
   30 
   31 #define RAR_VOL_ASK           0
   32 #define RAR_VOL_NOTIFY        1
   33 
   34 #define RAR_DLL_VERSION       8
   35 
   36 #define RAR_HASH_NONE         0
   37 #define RAR_HASH_CRC32        1
   38 #define RAR_HASH_BLAKE2       2
   39 
   40 
   41 #ifdef _UNIX
   42 #define CALLBACK
   43 #define PASCAL
   44 #define LONG long
   45 #define HANDLE void *
   46 #define LPARAM long
   47 #define UINT unsigned int
   48 #endif
   49 
   50 #define RHDF_SPLITBEFORE 0x01
   51 #define RHDF_SPLITAFTER  0x02
   52 #define RHDF_ENCRYPTED   0x04
   53 #define RHDF_SOLID       0x10
   54 #define RHDF_DIRECTORY   0x20
   55 
   56 
   57 struct RARHeaderData
   58 {
   59   char         ArcName[260];
   60   char         FileName[260];
   61   unsigned int Flags;
   62   unsigned int PackSize;
   63   unsigned int UnpSize;
   64   unsigned int HostOS;
   65   unsigned int FileCRC;
   66   unsigned int FileTime;
   67   unsigned int UnpVer;
   68   unsigned int Method;
   69   unsigned int FileAttr;
   70   char         *CmtBuf;
   71   unsigned int CmtBufSize;
   72   unsigned int CmtSize;
   73   unsigned int CmtState;
   74 };
   75 
   76 
   77 struct RARHeaderDataEx
   78 {
   79   char         ArcName[1024];
   80   wchar_t      ArcNameW[1024];
   81   char         FileName[1024];
   82   wchar_t      FileNameW[1024];
   83   unsigned int Flags;
   84   unsigned int PackSize;
   85   unsigned int PackSizeHigh;
   86   unsigned int UnpSize;
   87   unsigned int UnpSizeHigh;
   88   unsigned int HostOS;
   89   unsigned int FileCRC;
   90   unsigned int FileTime;
   91   unsigned int UnpVer;
   92   unsigned int Method;
   93   unsigned int FileAttr;
   94   char         *CmtBuf;
   95   unsigned int CmtBufSize;
   96   unsigned int CmtSize;
   97   unsigned int CmtState;
   98   unsigned int DictSize;
   99   unsigned int HashType;
  100   char         Hash[32];
  101   unsigned int RedirType;
  102   wchar_t      *RedirName;
  103   unsigned int RedirNameSize;
  104   unsigned int DirTarget;
  105   unsigned int MtimeLow;
  106   unsigned int MtimeHigh;
  107   unsigned int CtimeLow;
  108   unsigned int CtimeHigh;
  109   unsigned int AtimeLow;
  110   unsigned int AtimeHigh;
  111   unsigned int Reserved[988];
  112 };
  113 
  114 
  115 struct RAROpenArchiveData
  116 {
  117   char         *ArcName;
  118   unsigned int OpenMode;
  119   unsigned int OpenResult;
  120   char         *CmtBuf;
  121   unsigned int CmtBufSize;
  122   unsigned int CmtSize;
  123   unsigned int CmtState;
  124 };
  125 
  126 typedef int (CALLBACK *UNRARCALLBACK)(UINT msg,LPARAM UserData,LPARAM P1,LPARAM P2);
  127 
  128 #define ROADF_VOLUME       0x0001
  129 #define ROADF_COMMENT      0x0002
  130 #define ROADF_LOCK         0x0004
  131 #define ROADF_SOLID        0x0008
  132 #define ROADF_NEWNUMBERING 0x0010
  133 #define ROADF_SIGNED       0x0020
  134 #define ROADF_RECOVERY     0x0040
  135 #define ROADF_ENCHEADERS   0x0080
  136 #define ROADF_FIRSTVOLUME  0x0100
  137 
  138 #define ROADOF_KEEPBROKEN  0x0001
  139 
  140 struct RAROpenArchiveDataEx
  141 {
  142   char         *ArcName;
  143   wchar_t      *ArcNameW;
  144   unsigned int  OpenMode;
  145   unsigned int  OpenResult;
  146   char         *CmtBuf;
  147   unsigned int  CmtBufSize;
  148   unsigned int  CmtSize;
  149   unsigned int  CmtState;
  150   unsigned int  Flags;
  151   UNRARCALLBACK Callback;
  152   LPARAM        UserData;
  153   unsigned int  OpFlags;
  154   wchar_t      *CmtBufW;
  155   unsigned int  Reserved[25];
  156 };
  157 
  158 enum UNRARCALLBACK_MESSAGES {
  159   UCM_CHANGEVOLUME,UCM_PROCESSDATA,UCM_NEEDPASSWORD,UCM_CHANGEVOLUMEW,
  160   UCM_NEEDPASSWORDW
  161 };
  162 
  163 typedef int (PASCAL *CHANGEVOLPROC)(char *ArcName,int Mode);
  164 typedef int (PASCAL *PROCESSDATAPROC)(unsigned char *Addr,int Size);
  165 
  166 #ifdef __cplusplus
  167 extern "C" {
  168 #endif
  169 
  170 HANDLE PASCAL RAROpenArchive(struct RAROpenArchiveData *ArchiveData);
  171 HANDLE PASCAL RAROpenArchiveEx(struct RAROpenArchiveDataEx *ArchiveData);
  172 int    PASCAL RARCloseArchive(HANDLE hArcData);
  173 int    PASCAL RARReadHeader(HANDLE hArcData,struct RARHeaderData *HeaderData);
  174 int    PASCAL RARReadHeaderEx(HANDLE hArcData,struct RARHeaderDataEx *HeaderData);
  175 int    PASCAL RARProcessFile(HANDLE hArcData,int Operation,char *DestPath,char *DestName);
  176 int    PASCAL RARProcessFileW(HANDLE hArcData,int Operation,wchar_t *DestPath,wchar_t *DestName);
  177 void   PASCAL RARSetCallback(HANDLE hArcData,UNRARCALLBACK Callback,LPARAM UserData);
  178 void   PASCAL RARSetChangeVolProc(HANDLE hArcData,CHANGEVOLPROC ChangeVolProc);
  179 void   PASCAL RARSetProcessDataProc(HANDLE hArcData,PROCESSDATAPROC ProcessDataProc);
  180 void   PASCAL RARSetPassword(HANDLE hArcData,char *Password);
  181 int    PASCAL RARGetDllVersion();
  182 
  183 #ifdef __cplusplus
  184 }
  185 #endif
  186 
  187 #pragma pack(pop)
  188 
  189 #endif