From 2afcb5082acababf52116edababce9b87b034f23 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 25 May 2013 19:00:17 +0000 Subject: PluginUpdater API added git-svn-id: http://svn.miranda-ng.org/main/trunk@4820 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Common.h | 83 +++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 41 deletions(-) (limited to 'plugins/PluginUpdater/src/Common.h') diff --git a/plugins/PluginUpdater/src/Common.h b/plugins/PluginUpdater/src/Common.h index e843f07125..151904a83d 100644 --- a/plugins/PluginUpdater/src/Common.h +++ b/plugins/PluginUpdater/src/Common.h @@ -122,38 +122,8 @@ extern aPopups PopupsList[POPUPS]; extern HANDLE Timer, hPipe; extern HWND hwndDialog; -void InitPopupList(); -void LoadOptions(); -BOOL NetlibInit(); -void IcoLibInit(); -void NetlibUnInit(); -int ModulesLoaded(WPARAM wParam, LPARAM lParam); - -int OnFoldersChanged(WPARAM, LPARAM); -int OnPreShutdown(WPARAM, LPARAM); -int OptInit(WPARAM, LPARAM); - -void BackupFile(TCHAR *ptszSrcFileName, TCHAR *ptszBackFileName); - void DoCheck(int iFlag); void DoGetList(int iFlag); -BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal, int CRCsum); -void ShowPopup(HWND hDlg, LPCTSTR Title, LPCTSTR Text, int Number, int ActType); -void __stdcall RestartMe(void*); -void __stdcall OpenPluginOptions(void*); -BOOL AllowUpdateOnStartup(); -void InitTimer(); - -INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam); -INT_PTR ShowListCommand(WPARAM wParam,LPARAM lParam); -INT_PTR EmptyFolder(WPARAM wParam,LPARAM lParam); - -INT_PTR CALLBACK DlgMsgPop(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - -int ImageList_AddIconFromIconLib(HIMAGELIST hIml, const char *name); - -bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath); -void strdel(TCHAR *parBuffer, int len); /////////////////////////////////////////////////////////////////////////////// @@ -161,33 +131,64 @@ struct ServListEntry { ServListEntry(const char* _name, const char* _hash, int _crc) : m_name( mir_a2t(_name)), - m_bNeedFree(true), m_crc(_crc) { strncpy(m_szHash, _hash, sizeof(m_szHash)); } - ServListEntry(TCHAR* _name) : - m_name(_name), - m_bNeedFree(false) - { - } - ~ServListEntry() { - if (m_bNeedFree) - mir_free(m_name); + mir_free(m_name); } TCHAR *m_name; + int m_crc; char m_szHash[32+1]; - bool m_bNeedFree; - int m_crc; }; typedef OBJLIST SERVLIST; /////////////////////////////////////////////////////////////////////////////// + +void InitPopupList(); +void LoadOptions(); +BOOL NetlibInit(); +void IcoLibInit(); +void ServiceInit(); +void NetlibUnInit(); +int ModulesLoaded(WPARAM wParam, LPARAM lParam); + +int OnFoldersChanged(WPARAM, LPARAM); +int OnPreShutdown(WPARAM, LPARAM); +int OptInit(WPARAM, LPARAM); + +void BackupFile(TCHAR *ptszSrcFileName, TCHAR *ptszBackFileName); + +bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes); +int CompareHashes(const ServListEntry *p1, const ServListEntry *p2); + +TCHAR* GetDefaultUrl(); +BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal, int CRCsum); + +void ShowPopup(HWND hDlg, LPCTSTR Title, LPCTSTR Text, int Number, int ActType); +void __stdcall RestartMe(void*); +void __stdcall OpenPluginOptions(void*); +BOOL AllowUpdateOnStartup(); +void InitTimer(); + +INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam); +INT_PTR ShowListCommand(WPARAM wParam,LPARAM lParam); +INT_PTR EmptyFolder(WPARAM wParam,LPARAM lParam); + +INT_PTR CALLBACK DlgMsgPop(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + +int ImageList_AddIconFromIconLib(HIMAGELIST hIml, const char *name); + +bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath); +void strdel(TCHAR *parBuffer, int len); + +/////////////////////////////////////////////////////////////////////////////// + int CalculateModuleHash(const TCHAR *tszFileName, char *dest); BOOL IsRunAsAdmin(); -- cgit v1.2.3