- メインページ
- モジュール
- データ構造
- ファイル

- ファイル一覧
- グローバル

# plugin.h

説明を見る。

    00001
    00009 /*******************************************************************************
    00010   TPI - flexible but useless plug-in framework.
    00011   Copyright (C) 2002-2009 Silky
    00012
    00013   This library is free software; you can redistribute it and/or modify it under
    00014   the terms of the GNU Lesser General Public License as published by the Free
    00015   Software Foundation; either version 2.1 of the License, or (at your option)
    00016   any later version.
    00017
    00018   This library is distributed in the hope that it will be useful, but WITHOUT
    00019   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    00020   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
    00021   for more details.
    00022
    00023   You should have received a copy of the GNU Lesser General Public License along
    00024   with this library; if not, write to the Free Software Foundation, Inc.,
    00025   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    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_CREATE          0x0001
    00147 #define TPI_COMMAND_ADD             0x0002
    00148 #define TPI_COMMAND_EXTRACT         0x0004
    00149 #define TPI_COMMAND_DELETE          0x0008
    00150 #define TPI_COMMAND_UPDATE          0x0010
    00151 #define TPI_COMMAND_TEST            0x0020
    00152 #define TPI_COMMAND_REPAIR          0x0040
    00153 #define TPI_COMMAND_MOVE            0x0080
    00154 #define TPI_COMMAND_SFX             0x0100
    00155 #define TPI_COMMAND_UNSFX           0x0200
    00166 #define TPI_NOTIFY_COMMON           0x0001
    00167 #define TPI_NOTIFY_SETPARAM         0x0002
    00180 #define TPI_MESSAGE_STATUS          0x0001
    00181 #define TPI_MESSAGE_ASK             0x0002
    00184 #define TPI_MESSAGE_ERROR           0x1000
    00185 #define TPI_MESSAGE_WARNING         0x1001
    00195 #define TPI_STATUS_OPENARCHIVE      0x0001
    00196 #define TPI_STATUS_CLOSEARCHIVE     0x0002
    00197 #define TPI_STATUS_SEEKFILE         0x0003
    00198 #define TPI_STATUS_BEGINPROCESS     0x0004
    00199 #define TPI_STATUS_INPROCESS        0x0005
    00200 #define TPI_STATUS_ENDPROCESS       0x0006
    00201 #define TPI_STATUS_TESTARCHIVE      0x0007
    00202 #define TPI_STATUS_COPYARCHIVE      0x0008
    00212 #define TPI_PARAM_PASSWORD          0x0001
    00213 #define TPI_PARAM_NEXTVOLUME        0x0002
    00222 #define TPI_CALLBACK_CONTINUE       TRUE
    00223 #define TPI_CALLBACK_CANCEL         0x1000
    00224 #define TPI_CALLBACK_SKIP           0x1001
    00225 #define TPI_CALLBACK_UNSUPPORTED    0x1002
    00234 #define TPI_ATTRIBUTE_READONLY          0x00000001
    00235 #define TPI_ATTRIBUTE_HIDDEN            0x00000002
    00236 #define TPI_ATTRIBUTE_SYSTEM            0x00000004
    00237 #define TPI_ATTRIBUTE_DIRECTORY         0x00000010
    00238 #define TPI_ATTRIBUTE_ARCHIVE           0x00000020
    00239 #define TPI_ATTRIBUTE_ENCRYPTED         0x00004000
    00241
    00242
    00243 // *****************************************************************************
    00246 // *****************************************************************************
    00247
    00248 #pragma pack(1)
    00249
    00250 typedef struct _TPI_tagFORMATINFO
    00251 {
    00252     bool            fArchive;
    00253     bool            fComment;
    00254     bool            fCompressHeader;
    00255     bool            fEncryptKeyFile;
    00256     bool            fEncryptPassword;
    00257     bool            fEncryptHeader;
    00258     bool            fMMOptimize;
    00259     bool            fMultiVolume;
    00260     bool            fSFX;
    00261     bool            fSolid;
    00262     unsigned short  nCompressLevelMin;
    00263     unsigned short  nCompressLevelMax;
    00264     unsigned short  nRecoveryRecordMin;
    00265     unsigned short  nRecoveryRecordMax;
    00266     wxULongLong_t   nTypeId;
    00267     wxULongLong_t   eSupportedCommand;
    00268     wxString        szTypeName;
    00269     wxString        szSuffix;
    00270     wxString        szEngineName;
    00271     wxString        szTPIName;
    00272     void *          pCustomInfo;
    00273 }   TPI_FORMATINFO;
    00274
    00276 typedef struct _TPI_tagFILEINFO
    00277 {
    00278     unsigned short  eDanger;
    00279     unsigned short  eOSType;
    00280     unsigned short  wCompressRatio;
    00283     unsigned long   dwAttribute;
    00284     unsigned long   dwCRC32;
    00285     wxULongLong_t   nPackedSize;
    00286     wxULongLong_t   nUnpackedSize;
    00287     wxULongLong_t   nFileId;
    00288     wxDateTime      tmAccess;
    00289     wxDateTime      tmCreate;
    00290     wxDateTime      tmModified;
    00291     wxFileName      fnFileName;
    00292     wxString        szStoredName;
    00293     wxString        szMethod;
    00294     wxString        szComment;
    00295     void *          pCustomInfo;
    00296 }   TPI_FILEINFO;
    00297
    00299 typedef struct _TPI_tagARCHIVEINFO
    00300 {
    00301     bool            fSFX;
    00302     bool            fSolid;
    00303     bool            fMMOptimize;
    00304     bool            fEncryptData;
    00305     bool            fEncryptHeader;
    00306     bool            fCompressHeader;
    00307     unsigned short  eOSType;
    00308     unsigned short  nCompressLevel;
    00309     unsigned short  nRecoveryRecord;
    00310     unsigned short  wCompressRatio;
    00311     wxULongLong_t   nFileSize;
    00312     wxULongLong_t   nPackedSize;
    00313     wxULongLong_t   nReadSize;
    00314     wxULongLong_t   nUnpackedSize;
    00315     wxULongLong_t   nSplitSize;
    00316     wxDateTime      tmAccess;
    00317     wxDateTime      tmCreate;
    00318     wxDateTime      tmModified;
    00319     wxFileName      fnArchive;
    00320     wxString        szComment;
    00321     TPI_FORMATINFO  fiInfo;
    00322     void *          pCustomInfo;
    00323 }   TPI_ARCHIVEINFO;
    00324
    00326 typedef struct _TPI_tagSWITCHES
    00327 {
    00328     bool            fStoreDirectoryPathes;
    00329     bool            fMakeSFX;
    00330     bool            fSolid;
    00331     bool            fMMOptimize;
    00332     bool            fEncryptHeader;
    00333     bool            fCompressHeader;
    00334     unsigned short  nCompressLevel;
    00335     unsigned short  nRecoveryRecord;
    00336     wxULongLong_t   nArchiveType;
    00337     wxULongLong_t   nSplitSize;
    00338     wxFileName      fnDestinationDirectory;
    00339     wxString        szPassword;
    00340     wxString        szKeyFile;
    00341     wxString        szComment;
    00342     void *          pCustomSwitches;
    00343 }   TPI_SWITCHES;
    00344
    00346 typedef struct _TPI_tagPROCESSINFO
    00347 {
    00350     unsigned int    eMessage;
    00353     unsigned int    eStatus;
    00354     TPI_FILEINFO    fiInfo;
    00355     wxULongLong_t   nProcessedSize;
    00356     wxFileName      fnDestination;
    00357     wxString        szParam;
    00358     void *          pCustomInfo;
    00359 }   TPI_PROCESSINFO;
    00360
    00362
    00363 // *****************************************************************************
    00366 // *****************************************************************************
    00367
    00375 typedef int(__stdcall * TPI_PROC)(unsigned int _eMsg, void * _pInfo);
    00376
    00378
    00379 #pragma pack()
    00380
    00381 // *****************************************************************************
    00384 // *****************************************************************************
    00385
    00386 #ifdef __cplusplus
    00387 extern "C"
    00388 {
    00389 #endif
    00390
    00398 int __stdcall GetPluginInformation
    00399 (
    00400     unsigned int _eInfoId,
    00401     wxULongLong_t _nSubOption,
    00402     void * _pPtr
    00403 );
    00404
    00411 int __stdcall GetFormatInformation
    00412 (
    00413     TPI_FORMATINFO * _fiInfo,
    00414     bool _bFirst
    00415 );
    00416
    00422 int __stdcall LoadPlugin
    00423 (
    00424     const wxString & _szArcName,
    00425     wxULongLong_t _nTypeId
    00426 );
    00427
    00432 int __stdcall FreePlugin
    00433 (
    00434     void * _pReserved
    00435 );
    00436
    00442 int __stdcall CheckArchive
    00443 (
    00444     const wxString & _szArcName,
    00445     wxULongLong_t * _nFileCount
    00446 );
    00447
    00453 int __stdcall OpenArchive
    00454 (
    00455     const wxString & _szArcName,
    00456     void * * _hArchive
    00457 );
    00458
    00463 int __stdcall CloseArchive
    00464 (
    00465     void * _hArchive
    00466 );
    00467
    00474 int __stdcall GetFileInformation
    00475 (
    00476     void * _hArchive,
    00477     TPI_FILEINFO * _fiInfo,
    00478     bool _bFirst
    00479 );
    00480
    00486 int __stdcall GetArchiveInformation
    00487 (
    00488     void * _hArchive,
    00489     TPI_ARCHIVEINFO * _aiInfo
    00490 );
    00491
    00500 int __stdcall Command
    00501 (
    00502     wxULongLong_t _eCommand,
    00503     TPI_SWITCHES * _swInfo,
    00504     const wxString & _szArcName,
    00505     const wxArrayString & _szFiles
    00506 );
    00507
    00512 int __stdcall SetCallbackProc
    00513 (
    00514     TPI_PROC _prArcProc
    00515 );
    00516
    00517 #ifdef __cplusplus
    00518 }
    00519 #endif
    00520
    00522
    00523 #endif /* __TPI_API_SPEC */