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_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + TPI_ERROR_ARC_MISC + 1
00108 #define TPI_ERROR_ARC_ENCRYPTED TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + TPI_ERROR_ARC_MISC + 2
00109 #define TPI_ERROR_ARC_BROKEN_MISC TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + 30
00110 #define TPI_ERROR_ARC_BROKEN_SUM TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + TPI_ERROR_ARC_BROKEN_MISC + 1
00111 #define TPI_ERROR_ARC_BROKEN_SIZE TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + TPI_ERROR_ARC_BROKEN_MISC + 2
00112 #define TPI_ERROR_ARC_BROKEN_HEADER TPI_ERROR_IO_MISC + TPI_ERROR_T_IO_ARCHIVE + TPI_ERROR_ARC_BROKEN_MISC + 3
00122 #define TPI_INFO_VERSION_MAJOR 0x0001
00123 #define TPI_INFO_VERSION_MINOR 0x0002
00124 #define TPI_INFO_VERSION_API 0x0003
00125 #define TPI_INFO_SUPPORTED_TYPE 0x0004
00126 #define TPI_INFO_SUPPORTED_SUFFIX 0x0005
00134 #define TPI_COMMAND_ADD 0x0001
00135 #define TPI_COMMAND_EXTRACT 0x0002
00136 #define TPI_COMMAND_DELETE 0x0003
00137 #define TPI_COMMAND_UPDATE 0x0004
00138 #define TPI_COMMAND_TEST 0x0005
00139 #define TPI_COMMAND_REPAIR 0x0006
00140 #define TPI_COMMAND_MOVE 0x0007
00141 #define TPI_COMMAND_SFX 0x0011
00142 #define TPI_COMMAND_UNSFX 0x0012
00153 #define TPI_NOTIFY_COMMON 0x0001
00154 #define TPI_NOTIFY_SETPARAM 0x0002
00167 #define TPI_MESSAGE_STATUS 0x0001
00168
00170 #define TPI_MESSAGE_ERROR 0x0002
00171 #define TPI_MESSAGE_WARNING 0x0003
00181 #define TPI_STATUS_OPENARCHIVE 0x0001
00182 #define TPI_STATUS_CLOSEARCHIVE 0x0002
00183 #define TPI_STATUS_SEEKFILE 0x0003
00184 #define TPI_STATUS_BEGINPROCESS 0x0004
00185 #define TPI_STATUS_INPROCESS 0x0005
00186 #define TPI_STATUS_ENDPROCESS 0x0006
00187 #define TPI_STATUS_TESTARCHIVE 0x0007
00188 #define TPI_STATUS_COPYARCHIVE 0x0008
00197 #define TPI_CALLBACK_CONTINUE TRUE
00198 #define TPI_CALLBACK_CANCEL 0x1000
00199 #define TPI_CALLBACK_UNSUPPORTED 0x1001
00208 #define TPI_ATTRIBUTE_READONLY 0x00000001
00209 #define TPI_ATTRIBUTE_HIDDEN 0x00000002
00210 #define TPI_ATTRIBUTE_SYSTEM 0x00000004
00211 #define TPI_ATTRIBUTE_DIRECTORY 0x00000010
00212 #define TPI_ATTRIBUTE_ARCHIVE 0x00000020
00213 #define TPI_ATTRIBUTE_ENCRYPTED 0x00004000
00215
00216
00217
00220
00221
00222 #pragma pack(1)
00223
00224 typedef struct _TPI_tagLIBINFO
00225 {
00226 wxFileName fnLibrary;
00227 wxString szTypeName;
00228 wxString szSuffix;
00229 wxULongLong llFileId;
00230 } TPI_LIBINFO;
00231
00233 typedef struct _TPI_tagFILEINFO
00234 {
00237 unsigned long dwAttribute;
00238 unsigned long dwCRC32;
00239 wxDateTime tmAccess;
00240 wxDateTime tmCreate;
00241 wxDateTime tmModified;
00242 unsigned int uOSType;
00243 wxULongLong llPackedSize;
00244 wxULongLong llUnpackedSize;
00245 wxFileName fnFileName;
00246 wxString szStoredName;
00247 wxString szMethod;
00248 unsigned short wCompressRatio;
00249 wxULongLong llFileID;
00250 void * pCustomInfo;
00251 } TPI_FILEINFO;
00252
00254 typedef struct _TPI_tagARCHIVEINFO
00255 {
00256 bool fSolid;
00257 bool fMMOptimize;
00258 bool fEncryptData;
00259 bool fEncryptHeader;
00260 short sCompressLevel;
00261 short sRecoveryRecord;
00262 wxDateTime tmAccess;
00263 wxDateTime tmCreate;
00264 wxDateTime tmModified;
00265 int nSFXType;
00266 unsigned int uOSType;
00267 wxULongLong llFileSize;
00268 wxULongLong llPackedSize;
00269 wxULongLong llReadSize;
00270 wxULongLong llUnpackedSize;
00271 wxULongLong llSplitSize;
00272 wxFileName fnArchive;
00273 wxString szComment;
00274 unsigned short wCompressRatio;
00275 void * pCustomInfo;
00276 } TPI_ARCHIVEINFO;
00277
00279 typedef struct _TPI_tagSWITCHES
00280 {
00281 bool fStoreDirectoryPathes;
00282 bool fMakeSFX;
00283 bool fSolid;
00284 bool fMMOptimize;
00285 bool fEncryptHeader;
00286 wxFileName fnDestinationDirectory;
00287 short sCompressLevel;
00288 short sRecoveryRecord;
00289 wxULongLong llSplitSize;
00290 wxString szPassword;
00291 wxString szKeyFile;
00292 wxString szComment;
00293 int eArchiveType;
00294 void * pCustomSwitches;
00295 } TPI_SWITCHES;
00296
00298 typedef struct _TPI_tagPROCESSINFO
00299 {
00302 unsigned int uMessage;
00305 unsigned int uStatus;
00306 TPI_FILEINFO fiInfo;
00307 wxULongLong llProcessedSize;
00308 wxFileName fnDestination;
00309 void * pCustomInfo;
00310 } TPI_PROCESSINFO;
00311
00313
00314
00317
00318
00326 typedef int(__stdcall * TPI_PROC)(unsigned int _uMsg, void * _pInfo);
00327
00329
00330 #pragma pack()
00331
00332
00335
00336
00337 #ifdef __cplusplus
00338 extern "C"
00339 {
00340 #endif
00341
00349 int __stdcall GetPluginInformation
00350 (
00351 unsigned int _uInfoId,
00352 wxULongLong _llSubOption,
00353 void * _pPtr
00354 );
00355
00361 int __stdcall LoadPlugin
00362 (
00363 const wxString & _szArcName,
00364 wxULongLong _llSubOption
00365 );
00366
00371 int __stdcall FreePlugin
00372 (
00373 void * _pReserved
00374 );
00375
00381 int __stdcall CheckArchive
00382 (
00383 const wxString & _szArcName,
00384 int * _nFileCount
00385 );
00386
00392 int __stdcall OpenArchive
00393 (
00394 const wxString & _szArcName,
00395 void * * _hArchive
00396 );
00397
00402 int __stdcall CloseArchive
00403 (
00404 void * _hArchive
00405 );
00406
00413 int __stdcall GetFileInformation
00414 (
00415 void * _hArchive,
00416 TPI_FILEINFO * _fiInfo,
00417 bool _bFirst
00418 );
00419
00425 int __stdcall GetArchiveInformation
00426 (
00427 void * _hArchive,
00428 TPI_ARCHIVEINFO * _aiInfo
00429 );
00430
00439 int __stdcall Command
00440 (
00441 unsigned int _uCommand,
00442 TPI_SWITCHES * _swInfo,
00443 const wxString & _szArcName,
00444 const wxArrayString & _szFiles
00445 );
00446
00451 int __stdcall SetCallbackProc
00452 (
00453 TPI_PROC _prArcProc
00454 );
00455
00456 #ifdef __cplusplus
00457 }
00458 #endif
00459
00461
00462 #endif