From 8ff324e9c3ba6f1820af06e4fbae5b375b848e12 Mon Sep 17 00:00:00 2001 From: sirakaba Date: Fri, 9 Oct 2009 11:13:58 +0000 Subject: [PATCH] =?utf8?q?TPIHandle=E5=86=85=E3=81=AB=E6=9B=B8=E5=BA=AB?= =?utf8?q?=E3=81=AE=E3=83=8F=E3=83=B3=E3=83=89=E3=83=AB=E3=82=92=E4=BF=9D?= =?utf8?q?=E6=8C=81=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E5=A4=89=E6=9B=B4?= =?utf8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@29 9df91469-1e22-0410-86e7-ea8537beb833 --- src/common/handle/TPIHandle.cpp | 16 ++++++++-------- src/common/handle/TPIHandle.h | 9 +++++---- src/frontend/frm_main.cpp | 13 ++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/common/handle/TPIHandle.cpp b/src/common/handle/TPIHandle.cpp index 4ee34ad..977f081 100644 --- a/src/common/handle/TPIHandle.cpp +++ b/src/common/handle/TPIHandle.cpp @@ -115,7 +115,7 @@ int TPIHandle::CheckArchive(const wxString & _szArcName, int * _nFileCount) return ((int (__stdcall *)(const wxString &, int *)) p)(_szArcName, _nFileCount); } -int TPIHandle::OpenArchive(const wxString & _szArcName, void * * _hArchive) +int TPIHandle::OpenArchive(const wxString & _szArcName) { if (! this->lib.HasSymbol(wxT("OpenArchive"))) { @@ -127,10 +127,10 @@ int TPIHandle::OpenArchive(const wxString & _szArcName, void * * _hArchive) return -1; } - return ((int (__stdcall *)(const wxString &, void * *)) p)(_szArcName, _hArchive); + return ((int (__stdcall *)(const wxString &, void * *)) p)(_szArcName, & this->archive); } -int TPIHandle::CloseArchive(void * _hArchive) +int TPIHandle::CloseArchive(void) { if (! this->lib.HasSymbol(wxT("CloseArchive"))) { @@ -142,10 +142,10 @@ int TPIHandle::CloseArchive(void * _hArchive) return -1; } - return ((int (__stdcall *)(void *)) p)(_hArchive); + return ((int (__stdcall *)(void *)) p)(this->archive); } -int TPIHandle::GetFileInformation(void * _hArchive, TPI_FILEINFO * _fiInfo, bool _bFirst) +int TPIHandle::GetFileInformation(TPI_FILEINFO * _fiInfo, bool _bFirst) { if (! this->lib.HasSymbol(wxT("GetFileInformation")) || ! _fiInfo) { @@ -173,10 +173,10 @@ int TPIHandle::GetFileInformation(void * _hArchive, TPI_FILEINFO * _fiInfo, bool _fiInfo->llFileID = 0; _fiInfo->pCustomInfo = NULL; - return ((int (__stdcall *)(void *, TPI_FILEINFO *, bool)) p)(_hArchive, _fiInfo, _bFirst); + return ((int (__stdcall *)(void *, TPI_FILEINFO *, bool)) p)(this->archive, _fiInfo, _bFirst); } -int TPIHandle::GetArchiveInformation(void * _hArchive, TPI_ARCHIVEINFO * _aiInfo) +int TPIHandle::GetArchiveInformation(TPI_ARCHIVEINFO * _aiInfo) { if (! this->lib.HasSymbol(wxT("GetArchiveInformation")) || ! _aiInfo) { @@ -209,7 +209,7 @@ int TPIHandle::GetArchiveInformation(void * _hArchive, TPI_ARCHIVEINFO * _aiInfo _aiInfo->wCompressRatio = 0; _aiInfo->pCustomInfo = NULL; - return ((int (__stdcall *)(void *, TPI_ARCHIVEINFO *)) p)(_hArchive, _aiInfo); + return ((int (__stdcall *)(void *, TPI_ARCHIVEINFO *)) p)(this->archive, _aiInfo); } int TPIHandle::Command(unsigned int _uCommand, TPI_SWITCHES * _swInfo, const wxString & _szArcName, const wxArrayString & _szFiles) diff --git a/src/common/handle/TPIHandle.h b/src/common/handle/TPIHandle.h index aea42f4..e27a339 100644 --- a/src/common/handle/TPIHandle.h +++ b/src/common/handle/TPIHandle.h @@ -38,16 +38,17 @@ class TPIHandle bool FreeLibrary(void); int CheckArchive(const wxString &, int *); - int OpenArchive(const wxString &, void * *); - int CloseArchive(void *); - int GetFileInformation(void *, TPI_FILEINFO *, bool); - int GetArchiveInformation(void *, TPI_ARCHIVEINFO *); + int OpenArchive(const wxString &); + int CloseArchive(void); + int GetFileInformation(TPI_FILEINFO *, bool); + int GetArchiveInformation(TPI_ARCHIVEINFO *); int Command(unsigned int, TPI_SWITCHES *, const wxString &, const wxArrayString &); int SetCallbackProc(TPI_PROC); private: wxDynamicLibrary lib; + void * archive; }; #endif diff --git a/src/frontend/frm_main.cpp b/src/frontend/frm_main.cpp index 2286de8..9e77e15 100644 --- a/src/frontend/frm_main.cpp +++ b/src/frontend/frm_main.cpp @@ -693,8 +693,7 @@ void MainFrame::LoadArc(wxString szFileName) TPICallbackProc(TPI_NOTIFY_COMMON, & piInfo); // ‘ŒÉ‚ðŠJ‚­B - void * hArc = NULL; - if (tpi.OpenArchive(szFileName, & hArc) != TPI_ERROR_SUCCESS) + if (tpi.OpenArchive(szFileName) != TPI_ERROR_SUCCESS) { procDlg.Show(false); tpi.FreeLibrary(); @@ -724,7 +723,7 @@ void MainFrame::LoadArc(wxString szFileName) this->fileinfo.Alloc(nFileCount); // ƒtƒ@ƒCƒ‹î•ñ‚ðƒ[ƒhB - if (tpi.GetFileInformation(hArc, & piInfo.fiInfo, true) == TPI_ERROR_SUCCESS) + if (tpi.GetFileInformation(& piInfo.fiInfo, true) == TPI_ERROR_SUCCESS) { do { @@ -733,7 +732,7 @@ void MainFrame::LoadArc(wxString szFileName) if (TPICallbackProc(TPI_NOTIFY_COMMON, & piInfo) == TPI_CALLBACK_CANCEL) { procDlg.Show(false); - tpi.CloseArchive(hArc); + tpi.CloseArchive(); wxCommandEvent e; this->OnArcClose(e); ::wxMessageBox(wxT("Fault : Canceled by user!")); @@ -780,7 +779,7 @@ void MainFrame::LoadArc(wxString szFileName) // î•ñ‚ð•Û‘¶‚µ‚ăJƒEƒ“ƒgƒAƒbƒvB this->fileinfo.Add(piInfo.fiInfo); } - while (tpi.GetFileInformation(hArc, & piInfo.fiInfo, false) == TPI_ERROR_SUCCESS); + while (tpi.GetFileInformation(& piInfo.fiInfo, false) == TPI_ERROR_SUCCESS); } // ŽG‘½ˆ—B @@ -792,7 +791,7 @@ void MainFrame::LoadArc(wxString szFileName) // ‘ŒÉ‚̏î•ñ‚ðŽæ“¾B TPI_ARCHIVEINFO aiInfo; - if (tpi.GetArchiveInformation(hArc, & aiInfo) != TPI_ERROR_SUCCESS) + if (tpi.GetArchiveInformation(& aiInfo) != TPI_ERROR_SUCCESS) { procDlg.Show(false); tpi.FreeLibrary(); @@ -809,7 +808,7 @@ void MainFrame::LoadArc(wxString szFileName) this->statusbar->SetStatusText(szFileName, 5); // ‘ŒÉ‚ð•Â‚¶‚éB - if (tpi.CloseArchive(hArc) != TPI_ERROR_SUCCESS) + if (tpi.CloseArchive() != TPI_ERROR_SUCCESS) { ::wxMessageBox(wxT("Fault : CloseArchive()!")); } -- 2.11.0