00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00031 #define wxUSE_UNICODE 1
00032
00035 #include <wx/wx.h>
00036 #include <wx/filename.h>
00037
00038 #ifndef __TPI_API_SPEC
00039 #define __TPI_API_SPEC
00040
00041 #ifdef __GNUC__
00042 #define __stdcall __attribute__((__stdcall__))
00043 #endif
00044
00045
00048
00049
00061 #define TPI_ERROR_SUCCESS 1000
00062 #define TPI_ERROR_S_ENDOFDATA TPI_ERROR_SUCCESS + 1
00071 #define TPI_ERROR_UNDEFINED 2000
00072 #define TPI_ERROR_U_LOAD_LIBRARY TPI_ERROR_UNDEFINED + 1
00073 #define TPI_ERROR_U_USE_LIBRARY TPI_ERROR_UNDEFINED + 2
00074 #define TPI_ERROR_U_FREE_LIBRARY TPI_ERROR_UNDEFINED + 3
00083 #define TPI_ERROR_DEFINED 3000
00084 #define TPI_ERROR_D_PARAMETER TPI_ERROR_DEFINED + 1
00085 #define TPI_ERROR_D_UNSUPPORTED TPI_ERROR_DEFINED + 2
00086 #define TPI_ERROR_D_SKIPPED TPI_ERROR_DEFINED + 3
00087 #define TPI_ERROR_D_OUTOFMEMORY TPI_ERROR_DEFINED + 4
00088 #define TPI_ERROR_D_USEMEMORY TPI_ERROR_DEFINED + 5
00098 #define TPI_ERROR_T_IO_MISC 0
00099 #define TPI_ERROR_T_IO_ARCHIVE TPI_ERROR_T_IO_MISC + 100
00100 #define TPI_ERROR_T_IO_FILE TPI_ERROR_T_IO_MISC + 200
00101 #define TPI_ERROR_T_IO_WORKING TPI_ERROR_T_IO_MISC + 300
00102 #define TPI_ERROR_T_IO_DIRECTORY TPI_ERROR_T_IO_MISC + 400
00105 #define TPI_ERROR_IO_MISC 4000
00106 #define TPI_ERROR_IO_NOTFOUND TPI_ERROR_IO_MISC + 1
00107 #define TPI_ERROR_IO_ACCESS TPI_ERROR_IO_MISC + 2
00108 #define TPI_ERROR_IO_OPEN TPI_ERROR_IO_MISC + 3
00109 #define TPI_ERROR_IO_CLOSE TPI_ERROR_IO_MISC + 4
00110 #define TPI_ERROR_IO_READ TPI_ERROR_IO_MISC + 5
00111 #define TPI_ERROR_IO_WRITE TPI_ERROR_IO_MISC + 6
00112 #define TPI_ERROR_IO_GETINFO TPI_ERROR_IO_MISC + 7
00113 #define TPI_ERROR_IO_POINT TPI_ERROR_IO_MISC + 8
00114 #define TPI_ERROR_IO_COPY TPI_ERROR_IO_MISC + 9
00115 #define TPI_ERROR_IO_MOVE TPI_ERROR_IO_MISC + 10
00116 #define TPI_ERROR_IO_DELETE TPI_ERROR_IO_MISC + 11
00117 #define TPI_ERROR_IO_SETINFO TPI_ERROR_IO_MISC + 12
00119 #define TPI_ERROR_ARC_MISC TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + 20
00120 #define TPI_ERROR_ARC_UNSUPPORTED TPI_ERROR_ARC_MISC + 1
00121 #define TPI_ERROR_ARC_ENCRYPTED TPI_ERROR_ARC_MISC + 2
00122 #define TPI_ERROR_ARC_DANGER TPI_ERROR_ARC_MISC + 3
00123 #define TPI_ERROR_ARC_BROKEN_MISC TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + 30
00124 #define TPI_ERROR_ARC_BROKEN_SUM TPI_ERROR_ARC_BROKEN_MISC + 1
00125 #define TPI_ERROR_ARC_BROKEN_SIZE TPI_ERROR_ARC_BROKEN_MISC + 2
00126 #define TPI_ERROR_ARC_BROKEN_HEADER TPI_ERROR_ARC_BROKEN_MISC + 3
00136 #define TPI_INFO_VERSION_MAJOR 0x0001
00137 #define TPI_INFO_VERSION_MINOR 0x0002
00138 #define TPI_INFO_VERSION_API 0x0003
00146 #define TPI_COMMAND_ADD 0x0001
00147 #define TPI_COMMAND_EXTRACT 0x0002
00148 #define TPI_COMMAND_DELETE 0x0004
00149 #define TPI_COMMAND_UPDATE 0x0008
00150 #define TPI_COMMAND_TEST 0x0010
00151 #define TPI_COMMAND_REPAIR 0x0020
00152 #define TPI_COMMAND_MOVE 0x0040
00153 #define TPI_COMMAND_SFX 0x0080
00154 #define TPI_COMMAND_UNSFX 0x0100
00165 #define TPI_NOTIFY_COMMON 0x0001
00166 #define TPI_NOTIFY_SETPARAM 0x0002
00179 #define TPI_MESSAGE_STATUS 0x0001
00180 #define TPI_MESSAGE_ASK 0x0002
00183 #define TPI_MESSAGE_ERROR 0x1000
00184 #define TPI_MESSAGE_WARNING 0x1001
00194 #define TPI_STATUS_OPENARCHIVE 0x0001
00195 #define TPI_STATUS_CLOSEARCHIVE 0x0002
00196 #define TPI_STATUS_SEEKFILE 0x0003
00197 #define TPI_STATUS_BEGINPROCESS 0x0004
00198 #define TPI_STATUS_INPROCESS 0x0005
00199 #define TPI_STATUS_ENDPROCESS 0x0006
00200 #define TPI_STATUS_TESTARCHIVE 0x0007
00201 #define TPI_STATUS_COPYARCHIVE 0x0008
00211 #define TPI_PARAM_PASSWORD 0x0001
00212 #define TPI_PARAM_NEXTVOLUME 0x0002
00221 #define TPI_CALLBACK_CONTINUE TRUE
00222 #define TPI_CALLBACK_CANCEL 0x1000
00223 #define TPI_CALLBACK_SKIP 0x1001
00224 #define TPI_CALLBACK_UNSUPPORTED 0x1002
00233 #define TPI_ATTRIBUTE_READONLY 0x00000001
00234 #define TPI_ATTRIBUTE_HIDDEN 0x00000002
00235 #define TPI_ATTRIBUTE_SYSTEM 0x00000004
00236 #define TPI_ATTRIBUTE_DIRECTORY 0x00000010
00237 #define TPI_ATTRIBUTE_ARCHIVE 0x00000020
00238 #define TPI_ATTRIBUTE_ENCRYPTED 0x00004000
00240
00241
00242
00245
00246
00247 #pragma pack(1)
00248
00249 typedef struct _TPI_tagFORMATINFO
00250 {
00251 bool fArchive;
00252 bool fComment;
00253 bool fEncryptKeyFile;
00254 bool fEncryptPassword;
00255 bool fEncryptHeader;
00256 bool fMMOptimize;
00257 bool fMultiVolume;
00258 bool fSFX;
00259 bool fSolid;
00260 short sCompressLevelMin;
00261 short sCompressLevelMax;
00262 short sRecoveryRecordMin;
00263 short sRecoveryRecordMax;
00264 wxString szTypeName;
00265 wxString szSuffix;
00266 wxString szEngineName;
00267 wxString szTPIName;
00268 wxULongLong_t llSupportedCommand;
00269 wxULongLong llTypeId;
00270 void * pCustomInfo;
00271 } TPI_FORMATINFO;
00272
00274 typedef struct _TPI_tagFILEINFO
00275 {
00278 unsigned long dwAttribute;
00279 unsigned long dwCRC32;
00280 wxDateTime tmAccess;
00281 wxDateTime tmCreate;
00282 wxDateTime tmModified;
00283 unsigned int uDanger;
00284 unsigned int uOSType;
00285 wxULongLong llPackedSize;
00286 wxULongLong llUnpackedSize;
00287 wxFileName fnFileName;
00288 wxString szStoredName;
00289 wxString szMethod;
00290 wxString szComment;
00291 unsigned short wCompressRatio;
00292 wxULongLong llFileID;
00293 void * pCustomInfo;
00294 } TPI_FILEINFO;
00295
00297 typedef struct _TPI_tagARCHIVEINFO
00298 {
00299 bool fSolid;
00300 bool fMMOptimize;
00301 bool fEncryptData;
00302 bool fEncryptHeader;
00303 short sCompressLevel;
00304 short sRecoveryRecord;
00305 wxDateTime tmAccess;
00306 wxDateTime tmCreate;
00307 wxDateTime tmModified;
00308 int nSFXType;
00309 unsigned int uOSType;
00310 wxULongLong llFileSize;
00311 wxULongLong llPackedSize;
00312 wxULongLong llReadSize;
00313 wxULongLong llUnpackedSize;
00314 wxULongLong llSplitSize;
00315 wxFileName fnArchive;
00316 wxString szComment;
00317 unsigned short wCompressRatio;
00318 TPI_FORMATINFO fiInfo;
00319 void * pCustomInfo;
00320 } TPI_ARCHIVEINFO;
00321
00323 typedef struct _TPI_tagSWITCHES
00324 {
00325 bool fStoreDirectoryPathes;
00326 bool fMakeSFX;
00327 bool fSolid;
00328 bool fMMOptimize;
00329 bool fEncryptHeader;
00330 wxFileName fnDestinationDirectory;
00331 short sCompressLevel;
00332 short sRecoveryRecord;
00333 wxULongLong llSplitSize;
00334 wxString szPassword;
00335 wxString szKeyFile;
00336 wxString szComment;
00337 int eArchiveType;
00338 void * pCustomSwitches;
00339 } TPI_SWITCHES;
00340
00342 typedef struct _TPI_tagPROCESSINFO
00343 {
00346 unsigned int uMessage;
00349 unsigned int uStatus;
00350 TPI_FILEINFO fiInfo;
00351 wxULongLong llProcessedSize;
00352 wxFileName fnDestination;
00353 wxString szParam;
00354 void * pCustomInfo;
00355 } TPI_PROCESSINFO;
00356
00358
00359
00362
00363
00371 typedef int(__stdcall * TPI_PROC)(unsigned int _uMsg, void * _pInfo);
00372
00374
00375 #pragma pack()
00376
00377
00380
00381
00382 #ifdef __cplusplus
00383 extern "C"
00384 {
00385 #endif
00386
00394 int __stdcall GetPluginInformation
00395 (
00396 unsigned int _uInfoId,
00397 wxULongLong _llSubOption,
00398 void * _pPtr
00399 );
00400
00407 int __stdcall GetFormatInformation
00408 (
00409 TPI_FORMATINFO * _fiInfo,
00410 bool _bFirst
00411 );
00412
00418 int __stdcall LoadPlugin
00419 (
00420 const wxString & _szArcName,
00421 wxULongLong _llSubOption
00422 );
00423
00428 int __stdcall FreePlugin
00429 (
00430 void * _pReserved
00431 );
00432
00438 int __stdcall CheckArchive
00439 (
00440 const wxString & _szArcName,
00441 int * _nFileCount
00442 );
00443
00449 int __stdcall OpenArchive
00450 (
00451 const wxString & _szArcName,
00452 void * * _hArchive
00453 );
00454
00459 int __stdcall CloseArchive
00460 (
00461 void * _hArchive
00462 );
00463
00470 int __stdcall GetFileInformation
00471 (
00472 void * _hArchive,
00473 TPI_FILEINFO * _fiInfo,
00474 bool _bFirst
00475 );
00476
00482 int __stdcall GetArchiveInformation
00483 (
00484 void * _hArchive,
00485 TPI_ARCHIVEINFO * _aiInfo
00486 );
00487
00496 int __stdcall Command
00497 (
00498 unsigned int _uCommand,
00499 TPI_SWITCHES * _swInfo,
00500 const wxString & _szArcName,
00501 const wxArrayString & _szFiles
00502 );
00503
00508 int __stdcall SetCallbackProc
00509 (
00510 TPI_PROC _prArcProc
00511 );
00512
00513 #ifdef __cplusplus
00514 }
00515 #endif
00516
00518
00519 #endif