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
00055 #define TPI_ERROR_SUCCESS 1000
00056 #define TPI_ERROR_S_ENDOFDATA TPI_ERROR_SUCCESS + 1
00065 #define TPI_ERROR_UNDEFINED 2000
00066 #define TPI_ERROR_U_LOAD_LIBRARY TPI_ERROR_UNDEFINED + 1
00067 #define TPI_ERROR_U_USE_LIBRARY TPI_ERROR_UNDEFINED + 2
00068 #define TPI_ERROR_U_FREE_LIBRARY TPI_ERROR_UNDEFINED + 3
00077 #define TPI_ERROR_DEFINED 3000
00078 #define TPI_ERROR_D_PARAMETER TPI_ERROR_DEFINED + 1
00079 #define TPI_ERROR_D_UNSUPPORTED TPI_ERROR_DEFINED + 2
00080 #define TPI_ERROR_D_SKIPPED TPI_ERROR_DEFINED + 3
00081 #define TPI_ERROR_D_OUTOFMEMORY TPI_ERROR_DEFINED + 4
00082 #define TPI_ERROR_D_USEMEMORY TPI_ERROR_DEFINED + 5
00092 #define TPI_ERROR_T_IO_MISC 0
00093 #define TPI_ERROR_T_IO_ARCHIVE TPI_ERROR_T_IO_MISC + 100
00094 #define TPI_ERROR_T_IO_FILE TPI_ERROR_T_IO_MISC + 200
00095 #define TPI_ERROR_T_IO_WORKING TPI_ERROR_T_IO_MISC + 300
00096 #define TPI_ERROR_T_IO_DIRECTORY TPI_ERROR_T_IO_MISC + 400
00099 #define TPI_ERROR_IO_MISC 4000
00100 #define TPI_ERROR_IO_NOTFOUND TPI_ERROR_IO_MISC + 1
00101 #define TPI_ERROR_IO_ACCESS TPI_ERROR_IO_MISC + 2
00102 #define TPI_ERROR_IO_OPEN TPI_ERROR_IO_MISC + 3
00103 #define TPI_ERROR_IO_CLOSE TPI_ERROR_IO_MISC + 4
00104 #define TPI_ERROR_IO_READ TPI_ERROR_IO_MISC + 5
00105 #define TPI_ERROR_IO_WRITE TPI_ERROR_IO_MISC + 6
00106 #define TPI_ERROR_IO_GETINFO TPI_ERROR_IO_MISC + 7
00107 #define TPI_ERROR_IO_POINT TPI_ERROR_IO_MISC + 8
00108 #define TPI_ERROR_IO_COPY TPI_ERROR_IO_MISC + 9
00109 #define TPI_ERROR_IO_MOVE TPI_ERROR_IO_MISC + 10
00110 #define TPI_ERROR_IO_DELETE TPI_ERROR_IO_MISC + 11
00111 #define TPI_ERROR_IO_SETINFO TPI_ERROR_IO_MISC + 12
00113 #define TPI_ERROR_ARC_MISC TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + 20
00114 #define TPI_ERROR_ARC_UNSUPPORTED TPI_ERROR_ARC_MISC + 1
00115 #define TPI_ERROR_ARC_ENCRYPTED TPI_ERROR_ARC_MISC + 2
00116 #define TPI_ERROR_ARC_DANGER TPI_ERROR_ARC_MISC + 3
00117 #define TPI_ERROR_ARC_BROKEN_MISC TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + 30
00118 #define TPI_ERROR_ARC_BROKEN_SUM TPI_ERROR_ARC_BROKEN_MISC + 1
00119 #define TPI_ERROR_ARC_BROKEN_SIZE TPI_ERROR_ARC_BROKEN_MISC + 2
00120 #define TPI_ERROR_ARC_BROKEN_HEADER TPI_ERROR_ARC_BROKEN_MISC + 3
00130 #define TPI_INFO_VERSION_MAJOR 0x0001
00131 #define TPI_INFO_VERSION_MINOR 0x0002
00132 #define TPI_INFO_VERSION_API 0x0003
00140 #define TPI_COMMAND_ADD 0x0001
00141 #define TPI_COMMAND_EXTRACT 0x0002
00142 #define TPI_COMMAND_DELETE 0x0004
00143 #define TPI_COMMAND_UPDATE 0x0008
00144 #define TPI_COMMAND_TEST 0x0010
00145 #define TPI_COMMAND_REPAIR 0x0020
00146 #define TPI_COMMAND_MOVE 0x0040
00147 #define TPI_COMMAND_SFX 0x0080
00148 #define TPI_COMMAND_UNSFX 0x0100
00159 #define TPI_NOTIFY_COMMON 0x0001
00160 #define TPI_NOTIFY_SETPARAM 0x0002
00173 #define TPI_MESSAGE_STATUS 0x0001
00174 #define TPI_MESSAGE_ASK 0x0002
00177 #define TPI_MESSAGE_ERROR 0x1000
00178 #define TPI_MESSAGE_WARNING 0x1001
00188 #define TPI_STATUS_OPENARCHIVE 0x0001
00189 #define TPI_STATUS_CLOSEARCHIVE 0x0002
00190 #define TPI_STATUS_SEEKFILE 0x0003
00191 #define TPI_STATUS_BEGINPROCESS 0x0004
00192 #define TPI_STATUS_INPROCESS 0x0005
00193 #define TPI_STATUS_ENDPROCESS 0x0006
00194 #define TPI_STATUS_TESTARCHIVE 0x0007
00195 #define TPI_STATUS_COPYARCHIVE 0x0008
00205 #define TPI_PARAM_PASSWORD 0x0001
00206 #define TPI_PARAM_NEXTVOLUME 0x0002
00215 #define TPI_CALLBACK_CONTINUE TRUE
00216 #define TPI_CALLBACK_CANCEL 0x1000
00217 #define TPI_CALLBACK_SKIP 0x1001
00218 #define TPI_CALLBACK_UNSUPPORTED 0x1002
00227 #define TPI_ATTRIBUTE_READONLY 0x00000001
00228 #define TPI_ATTRIBUTE_HIDDEN 0x00000002
00229 #define TPI_ATTRIBUTE_SYSTEM 0x00000004
00230 #define TPI_ATTRIBUTE_DIRECTORY 0x00000010
00231 #define TPI_ATTRIBUTE_ARCHIVE 0x00000020
00232 #define TPI_ATTRIBUTE_ENCRYPTED 0x00004000
00234
00235
00236
00239
00240
00241 #pragma pack(1)
00242
00243 typedef struct _TPI_tagFORMATINFO
00244 {
00245 bool fComment;
00246 bool fEncryptKeyFile;
00247 bool fEncryptPassword;
00248 bool fEncryptHeader;
00249 bool fMMOptimize;
00250 bool fMultiVolume;
00251 bool fSFX;
00252 bool fSolid;
00253 short sCompressLevelMin;
00254 short sCompressLevelMax;
00255 short sRecoveryRecordMin;
00256 short sRecoveryRecordMax;
00257 wxString szTypeName;
00258 wxString szSuffix;
00259 wxString szEngineName;
00260 wxString szTPIName;
00261 wxULongLong_t llSupportedCommand;
00262 wxULongLong llTypeId;
00263 void * pCustomInfo;
00264 } TPI_FORMATINFO;
00265
00267 typedef struct _TPI_tagFILEINFO
00268 {
00271 unsigned long dwAttribute;
00272 unsigned long dwCRC32;
00273 wxDateTime tmAccess;
00274 wxDateTime tmCreate;
00275 wxDateTime tmModified;
00276 unsigned int uDanger;
00277 unsigned int uOSType;
00278 wxULongLong llPackedSize;
00279 wxULongLong llUnpackedSize;
00280 wxFileName fnFileName;
00281 wxString szStoredName;
00282 wxString szMethod;
00283 unsigned short wCompressRatio;
00284 wxULongLong llFileID;
00285 void * pCustomInfo;
00286 } TPI_FILEINFO;
00287
00289 typedef struct _TPI_tagARCHIVEINFO
00290 {
00291 bool fSolid;
00292 bool fMMOptimize;
00293 bool fEncryptData;
00294 bool fEncryptHeader;
00295 short sCompressLevel;
00296 short sRecoveryRecord;
00297 wxDateTime tmAccess;
00298 wxDateTime tmCreate;
00299 wxDateTime tmModified;
00300 int nSFXType;
00301 unsigned int uOSType;
00302 wxULongLong llFileSize;
00303 wxULongLong llPackedSize;
00304 wxULongLong llReadSize;
00305 wxULongLong llUnpackedSize;
00306 wxULongLong llSplitSize;
00307 wxFileName fnArchive;
00308 wxString szComment;
00309 unsigned short wCompressRatio;
00310 TPI_FORMATINFO fiInfo;
00311 void * pCustomInfo;
00312 } TPI_ARCHIVEINFO;
00313
00315 typedef struct _TPI_tagSWITCHES
00316 {
00317 bool fStoreDirectoryPathes;
00318 bool fMakeSFX;
00319 bool fSolid;
00320 bool fMMOptimize;
00321 bool fEncryptHeader;
00322 wxFileName fnDestinationDirectory;
00323 short sCompressLevel;
00324 short sRecoveryRecord;
00325 wxULongLong llSplitSize;
00326 wxString szPassword;
00327 wxString szKeyFile;
00328 wxString szComment;
00329 int eArchiveType;
00330 void * pCustomSwitches;
00331 } TPI_SWITCHES;
00332
00334 typedef struct _TPI_tagPROCESSINFO
00335 {
00338 unsigned int uMessage;
00341 unsigned int uStatus;
00342 TPI_FILEINFO fiInfo;
00343 wxULongLong llProcessedSize;
00344 wxFileName fnDestination;
00345 wxString szParam;
00346 void * pCustomInfo;
00347 } TPI_PROCESSINFO;
00348
00350
00351
00354
00355
00363 typedef int(__stdcall * TPI_PROC)(unsigned int _uMsg, void * _pInfo);
00364
00366
00367 #pragma pack()
00368
00369
00372
00373
00374 #ifdef __cplusplus
00375 extern "C"
00376 {
00377 #endif
00378
00386 int __stdcall GetPluginInformation
00387 (
00388 unsigned int _uInfoId,
00389 wxULongLong _llSubOption,
00390 void * _pPtr
00391 );
00392
00399 int __stdcall GetFormatInformation
00400 (
00401 TPI_FORMATINFO * _fiInfo,
00402 bool _bFirst
00403 );
00404
00410 int __stdcall LoadPlugin
00411 (
00412 const wxString & _szArcName,
00413 wxULongLong _llSubOption
00414 );
00415
00420 int __stdcall FreePlugin
00421 (
00422 void * _pReserved
00423 );
00424
00430 int __stdcall CheckArchive
00431 (
00432 const wxString & _szArcName,
00433 int * _nFileCount
00434 );
00435
00441 int __stdcall OpenArchive
00442 (
00443 const wxString & _szArcName,
00444 void * * _hArchive
00445 );
00446
00451 int __stdcall CloseArchive
00452 (
00453 void * _hArchive
00454 );
00455
00462 int __stdcall GetFileInformation
00463 (
00464 void * _hArchive,
00465 TPI_FILEINFO * _fiInfo,
00466 bool _bFirst
00467 );
00468
00474 int __stdcall GetArchiveInformation
00475 (
00476 void * _hArchive,
00477 TPI_ARCHIVEINFO * _aiInfo
00478 );
00479
00488 int __stdcall Command
00489 (
00490 unsigned int _uCommand,
00491 TPI_SWITCHES * _swInfo,
00492 const wxString & _szArcName,
00493 const wxArrayString & _szFiles
00494 );
00495
00500 int __stdcall SetCallbackProc
00501 (
00502 TPI_PROC _prArcProc
00503 );
00504
00505 #ifdef __cplusplus
00506 }
00507 #endif
00508
00510
00511 #endif