00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #define wxUSE_UNICODE 1
00029 #include <wx/wx.h>
00030 #include <wx/filename.h>
00031
00032 #ifndef __TPI_API_SPEC
00033 #define __TPI_API_SPEC
00034
00035 #ifdef __GNUC__
00036 #define __stdcall __attribute__((__stdcall__))
00037 #endif
00038
00039
00042
00043
00050 #define TPI_ERROR_SUCCESS TRUE
00051
00058 #define TPI_ERROR_UNDEFINED 2000
00059 #define TPI_ERROR_U_LOAD_LIBRARY TPI_ERROR_UNDEFINED + 1
00060 #define TPI_ERROR_U_USE_LIBRARY TPI_ERROR_UNDEFINED + 2
00061 #define TPI_ERROR_U_FREE_LIBRARY TPI_ERROR_UNDEFINED + 3
00070 #define TPI_ERROR_DEFINED 3000
00071 #define TPI_ERROR_D_PARAMETER TPI_ERROR_DEFINED + 1
00072 #define TPI_ERROR_D_UNSUPPORTED TPI_ERROR_DEFINED + 2
00073 #define TPI_ERROR_D_SKIPPED TPI_ERROR_DEFINED + 3
00074 #define TPI_ERROR_D_OUTOFMEMORY TPI_ERROR_DEFINED + 4
00075 #define TPI_ERROR_D_USEMEMORY TPI_ERROR_DEFINED + 5
00085 #define TPI_ERROR_T_IO_MISC 0
00086 #define TPI_ERROR_T_IO_ARCHIVE TPI_ERROR_T_IO_MISC + 100
00087 #define TPI_ERROR_T_IO_FILE TPI_ERROR_T_IO_MISC + 200
00088 #define TPI_ERROR_T_IO_WORKING TPI_ERROR_T_IO_MISC + 300
00089 #define TPI_ERROR_T_IO_DIRECTORY TPI_ERROR_T_IO_MISC + 400
00092 #define TPI_ERROR_IO_MISC 4000
00093 #define TPI_ERROR_IO_NOTFOUND TPI_ERROR_IO_MISC + 1
00094 #define TPI_ERROR_IO_ACCESS TPI_ERROR_IO_MISC + 2
00095 #define TPI_ERROR_IO_OPEN TPI_ERROR_IO_MISC + 3
00096 #define TPI_ERROR_IO_CLOSE TPI_ERROR_IO_MISC + 4
00097 #define TPI_ERROR_IO_READ TPI_ERROR_IO_MISC + 5
00098 #define TPI_ERROR_IO_WRITE TPI_ERROR_IO_MISC + 6
00099 #define TPI_ERROR_IO_GETINFO TPI_ERROR_IO_MISC + 7
00100 #define TPI_ERROR_IO_POINT TPI_ERROR_IO_MISC + 8
00101 #define TPI_ERROR_IO_COPY TPI_ERROR_IO_MISC + 9
00102 #define TPI_ERROR_IO_MOVE TPI_ERROR_IO_MISC + 10
00103 #define TPI_ERROR_IO_DELETE TPI_ERROR_IO_MISC + 11
00104 #define TPI_ERROR_IO_SETINFO TPI_ERROR_IO_MISC + 12
00106 #define TPI_ERROR_ARC_MISC TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + 20
00107 #define TPI_ERROR_ARC_UNSUPPORTED TPI_ERROR_ARC_MISC + 1
00108 #define TPI_ERROR_ARC_ENCRYPTED TPI_ERROR_ARC_MISC + 2
00109 #define TPI_ERROR_ARC_DANGER TPI_ERROR_ARC_MISC + 3
00110 #define TPI_ERROR_ARC_BROKEN_MISC TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + 30
00111 #define TPI_ERROR_ARC_BROKEN_SUM TPI_ERROR_ARC_BROKEN_MISC + 1
00112 #define TPI_ERROR_ARC_BROKEN_SIZE TPI_ERROR_ARC_BROKEN_MISC + 2
00113 #define TPI_ERROR_ARC_BROKEN_HEADER TPI_ERROR_ARC_BROKEN_MISC + 3
00123 #define TPI_INFO_VERSION_MAJOR 0x0001
00124 #define TPI_INFO_VERSION_MINOR 0x0002
00125 #define TPI_INFO_VERSION_API 0x0003
00133 #define TPI_COMMAND_ADD 0x0001
00134 #define TPI_COMMAND_EXTRACT 0x0002
00135 #define TPI_COMMAND_DELETE 0x0004
00136 #define TPI_COMMAND_UPDATE 0x0008
00137 #define TPI_COMMAND_TEST 0x0010
00138 #define TPI_COMMAND_REPAIR 0x0020
00139 #define TPI_COMMAND_MOVE 0x0040
00140 #define TPI_COMMAND_SFX 0x0080
00141 #define TPI_COMMAND_UNSFX 0x0100
00152 #define TPI_NOTIFY_COMMON 0x0001
00153 #define TPI_NOTIFY_SETPARAM 0x0002
00166 #define TPI_MESSAGE_STATUS 0x0001
00167
00169 #define TPI_MESSAGE_ERROR 0x0002
00170 #define TPI_MESSAGE_WARNING 0x0003
00180 #define TPI_STATUS_OPENARCHIVE 0x0001
00181 #define TPI_STATUS_CLOSEARCHIVE 0x0002
00182 #define TPI_STATUS_SEEKFILE 0x0003
00183 #define TPI_STATUS_BEGINPROCESS 0x0004
00184 #define TPI_STATUS_INPROCESS 0x0005
00185 #define TPI_STATUS_ENDPROCESS 0x0006
00186 #define TPI_STATUS_TESTARCHIVE 0x0007
00187 #define TPI_STATUS_COPYARCHIVE 0x0008
00196 #define TPI_CALLBACK_CONTINUE TRUE
00197 #define TPI_CALLBACK_CANCEL 0x1000
00198 #define TPI_CALLBACK_UNSUPPORTED 0x1001
00207 #define TPI_ATTRIBUTE_READONLY 0x00000001
00208 #define TPI_ATTRIBUTE_HIDDEN 0x00000002
00209 #define TPI_ATTRIBUTE_SYSTEM 0x00000004
00210 #define TPI_ATTRIBUTE_DIRECTORY 0x00000010
00211 #define TPI_ATTRIBUTE_ARCHIVE 0x00000020
00212 #define TPI_ATTRIBUTE_ENCRYPTED 0x00004000
00214
00215
00216
00219
00220
00221 #pragma pack(1)
00222
00223 typedef struct _TPI_tagFORMATINFO
00224 {
00225 bool fComment;
00226 bool fEncryptKeyFile;
00227 bool fEncryptPassword;
00228 bool fEncryptHeader;
00229 bool fMMOptimize;
00230 bool fMultiVolume;
00231 bool fSFX;
00232 bool fSolid;
00233 short sCompressLevelMin;
00234 short sCompressLevelMax;
00235 short sRecoveryRecordMin;
00236 short sRecoveryRecordMax;
00237 wxString szTypeName;
00238 wxString szSuffix;
00239 wxString szEngineName;
00240 wxString szTPIName;
00241 wxULongLong_t llSupportedCommand;
00242 wxULongLong llTypeId;
00243 void * pCustomInfo;
00244 } TPI_FORMATINFO;
00245
00247 typedef struct _TPI_tagFILEINFO
00248 {
00251 unsigned long dwAttribute;
00252 unsigned long dwCRC32;
00253 wxDateTime tmAccess;
00254 wxDateTime tmCreate;
00255 wxDateTime tmModified;
00256 unsigned int uDanger;
00257 unsigned int uOSType;
00258 wxULongLong llPackedSize;
00259 wxULongLong llUnpackedSize;
00260 wxFileName fnFileName;
00261 wxString szStoredName;
00262 wxString szMethod;
00263 unsigned short wCompressRatio;
00264 wxULongLong llFileID;
00265 void * pCustomInfo;
00266 } TPI_FILEINFO;
00267
00269 typedef struct _TPI_tagARCHIVEINFO
00270 {
00271 bool fSolid;
00272 bool fMMOptimize;
00273 bool fEncryptData;
00274 bool fEncryptHeader;
00275 short sCompressLevel;
00276 short sRecoveryRecord;
00277 wxDateTime tmAccess;
00278 wxDateTime tmCreate;
00279 wxDateTime tmModified;
00280 int nSFXType;
00281 unsigned int uOSType;
00282 wxULongLong llFileSize;
00283 wxULongLong llPackedSize;
00284 wxULongLong llReadSize;
00285 wxULongLong llUnpackedSize;
00286 wxULongLong llSplitSize;
00287 wxFileName fnArchive;
00288 wxString szComment;
00289 unsigned short wCompressRatio;
00290 TPI_FORMATINFO fiInfo;
00291 void * pCustomInfo;
00292 } TPI_ARCHIVEINFO;
00293
00295 typedef struct _TPI_tagSWITCHES
00296 {
00297 bool fStoreDirectoryPathes;
00298 bool fMakeSFX;
00299 bool fSolid;
00300 bool fMMOptimize;
00301 bool fEncryptHeader;
00302 wxFileName fnDestinationDirectory;
00303 short sCompressLevel;
00304 short sRecoveryRecord;
00305 wxULongLong llSplitSize;
00306 wxString szPassword;
00307 wxString szKeyFile;
00308 wxString szComment;
00309 int eArchiveType;
00310 void * pCustomSwitches;
00311 } TPI_SWITCHES;
00312
00314 typedef struct _TPI_tagPROCESSINFO
00315 {
00318 unsigned int uMessage;
00321 unsigned int uStatus;
00322 TPI_FILEINFO fiInfo;
00323 wxULongLong llProcessedSize;
00324 wxFileName fnDestination;
00325 void * pCustomInfo;
00326 } TPI_PROCESSINFO;
00327
00329
00330
00333
00334
00342 typedef int(__stdcall * TPI_PROC)(unsigned int _uMsg, void * _pInfo);
00343
00345
00346 #pragma pack()
00347
00348
00351
00352
00353 #ifdef __cplusplus
00354 extern "C"
00355 {
00356 #endif
00357
00365 int __stdcall GetPluginInformation
00366 (
00367 unsigned int _uInfoId,
00368 wxULongLong _llSubOption,
00369 void * _pPtr
00370 );
00371
00378 int __stdcall GetFormatInformation
00379 (
00380 TPI_FORMATINFO * _fiInfo,
00381 bool _bFirst
00382 );
00383
00389 int __stdcall LoadPlugin
00390 (
00391 const wxString & _szArcName,
00392 wxULongLong _llSubOption
00393 );
00394
00399 int __stdcall FreePlugin
00400 (
00401 void * _pReserved
00402 );
00403
00409 int __stdcall CheckArchive
00410 (
00411 const wxString & _szArcName,
00412 int * _nFileCount
00413 );
00414
00420 int __stdcall OpenArchive
00421 (
00422 const wxString & _szArcName,
00423 void * * _hArchive
00424 );
00425
00430 int __stdcall CloseArchive
00431 (
00432 void * _hArchive
00433 );
00434
00441 int __stdcall GetFileInformation
00442 (
00443 void * _hArchive,
00444 TPI_FILEINFO * _fiInfo,
00445 bool _bFirst
00446 );
00447
00453 int __stdcall GetArchiveInformation
00454 (
00455 void * _hArchive,
00456 TPI_ARCHIVEINFO * _aiInfo
00457 );
00458
00467 int __stdcall Command
00468 (
00469 unsigned int _uCommand,
00470 TPI_SWITCHES * _swInfo,
00471 const wxString & _szArcName,
00472 const wxArrayString & _szFiles
00473 );
00474
00479 int __stdcall SetCallbackProc
00480 (
00481 TPI_PROC _prArcProc
00482 );
00483
00484 #ifdef __cplusplus
00485 }
00486 #endif
00487
00489
00490 #endif