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

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

# 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
    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        szMethod;
    00247     unsigned short  wCompressRatio;
    00248     wxULongLong     llFileID;
    00249     void *          pCustomInfo;
    00250 }   TPI_FILEINFO;
    00251
    00253 typedef struct _TPI_tagARCHIVEINFO
    00254 {
    00255     wxDateTime      tmAccess;
    00256     wxDateTime      tmCreate;
    00257     wxDateTime      tmModified;
    00258     int             nSFXType;
    00259     unsigned int    uOSType;
    00260     wxULongLong     llFileSize;
    00261     wxULongLong     llPackedSize;
    00262     wxULongLong     llReadSize;
    00263     wxULongLong     llUnpackedSize;
    00264     wxFileName      fnArchive;
    00265     unsigned short  wCompressRatio;
    00266     void *          pCustomInfo;
    00267 }   TPI_ARCHIVEINFO;
    00268
    00270 typedef struct _TPI_tagSWITCHES
    00271 {
    00272     bool            fStoreDirectoryPathes;
    00273     bool            fMakeSFX;
    00274     wxFileName      fnDestinationDirectory;
    00275     int             eArchiveType;
    00276     void *          pCustomSwitches;
    00277 }   TPI_SWITCHES;
    00278
    00280 typedef struct _TPI_tagPROCESSINFO
    00281 {
    00284     unsigned int    uMessage;
    00287     unsigned int    uStatus;
    00288     TPI_FILEINFO    fiInfo;
    00289     wxULongLong     llProcessedSize;
    00290     wxFileName      fnDestination;
    00291     void *          pCustomInfo;
    00292 }   TPI_PROCESSINFO;
    00293
    00295
    00296 // *****************************************************************************
    00299 // *****************************************************************************
    00300
    00308 typedef int(__stdcall * TPI_PROC)(unsigned int _uMsg, void * _pInfo);
    00309
    00311
    00312 #pragma pack()
    00313
    00314 // *****************************************************************************
    00317 // *****************************************************************************
    00318
    00319 #ifdef __cplusplus
    00320 extern "C"
    00321 {
    00322 #endif
    00323
    00331 int __stdcall GetPluginInformation
    00332 (
    00333     unsigned int _uInfoId,
    00334     wxULongLong _llSubOption,
    00335     void * _pPtr
    00336 );
    00337
    00343 int __stdcall LoadPlugin
    00344 (
    00345     const wxString & _szArcName,
    00346     wxULongLong _llSubOption
    00347 );
    00348
    00353 int __stdcall FreePlugin
    00354 (
    00355     void * _pReserved
    00356 );
    00357
    00363 int __stdcall CheckArchive
    00364 (
    00365     const wxString & _szArcName,
    00366     int * _nFileCount
    00367 );
    00368
    00374 int __stdcall OpenArchive
    00375 (
    00376     const wxString & _szArcName,
    00377     void * * _hArchive
    00378 );
    00379
    00384 int __stdcall CloseArchive
    00385 (
    00386     void * _hArchive
    00387 );
    00388
    00395 int __stdcall GetFileInformation
    00396 (
    00397     void * _hArchive,
    00398     TPI_FILEINFO * _fiInfo,
    00399     bool _bFirst
    00400 );
    00401
    00407 int __stdcall GetArchiveInformation
    00408 (
    00409     void * _hArchive,
    00410     TPI_ARCHIVEINFO * _aiInfo
    00411 );
    00412
    00421 int __stdcall Command
    00422 (
    00423     unsigned int _uCommand,
    00424     TPI_SWITCHES * _swInfo,
    00425     const wxString & _szArcName,
    00426     const wxArrayString & _szFiles
    00427 );
    00428
    00433 int __stdcall SetCallbackProc
    00434 (
    00435     TPI_PROC _prArcProc
    00436 );
    00437
    00438 #ifdef __cplusplus
    00439 }
    00440 #endif
    00441
    00443
    00444 #endif /* __TPI_API_SPEC */