diff options
Diffstat (limited to 'plugins/YahooGroups/src')
-rw-r--r-- | plugins/YahooGroups/src/YahooGroups.cpp | 16 | ||||
-rw-r--r-- | plugins/YahooGroups/src/commonheaders.h | 30 | ||||
-rw-r--r-- | plugins/YahooGroups/src/list.h | 1 | ||||
-rw-r--r-- | plugins/YahooGroups/src/services.h | 1 | ||||
-rw-r--r-- | plugins/YahooGroups/src/utils.cpp | 37 | ||||
-rw-r--r-- | plugins/YahooGroups/src/utils.h | 3 | ||||
-rw-r--r-- | plugins/YahooGroups/src/version.h | 34 |
7 files changed, 43 insertions, 79 deletions
diff --git a/plugins/YahooGroups/src/YahooGroups.cpp b/plugins/YahooGroups/src/YahooGroups.cpp index 38f5656335..f867404140 100644 --- a/plugins/YahooGroups/src/YahooGroups.cpp +++ b/plugins/YahooGroups/src/YahooGroups.cpp @@ -28,18 +28,18 @@ int hLangpack = 0; PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
- __PLUGIN_DISPLAY_NAME,
- VERSION,
- __DESC,
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
__AUTHOR,
__AUTHOREMAIL,
__COPYRIGHT,
__AUTHORWEB,
- 0, //unicode aware
- {0x2f3fe8b9, 0x7327, 0x4008, {0xa6, 0x0d, 0x93, 0xf0, 0xf4, 0xf7, 0xf0, 0xf1}} //{2f3fe8b9-7327-4008-a60d-93f0f4f7f0f1}
-}; //not used
+ UNICODE_AWARE,
+ // {2F3FE8B9-7327-4008-A60D-93F0F4F7F0F1}
+ {0x2f3fe8b9, 0x7327, 0x4008, {0xa6, 0x0d, 0x93, 0xf0, 0xf4, 0xf7, 0xf0, 0xf1}}
+};
-
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfo;
@@ -68,7 +68,7 @@ extern "C" int __declspec(dllexport) Unload() return 0;
}
-bool WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInstance = hinstDLL;
if (fdwReason == DLL_PROCESS_ATTACH)
diff --git a/plugins/YahooGroups/src/commonheaders.h b/plugins/YahooGroups/src/commonheaders.h index 20125002f1..e89e48e214 100644 --- a/plugins/YahooGroups/src/commonheaders.h +++ b/plugins/YahooGroups/src/commonheaders.h @@ -24,36 +24,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define _CRT_SECURE_NO_WARNINGS
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <windows.h>
-#include <time.h>
-
-#include "version.h"
-#include "dlg_handlers.h"
-#include "hooked_events.h"
-#include "services.h"
-#include "list.h"
-#include "services.h"
-#include "utils.h"
-
-#include "resource.h"
#include <newpluginapi.h>
#include <m_database.h>
-#include <m_system.h>
#include <m_clist.h>
-#include <m_clui.h>
#include <m_contacts.h>
#include <m_langpack.h>
#include <m_options.h>
#include <m_protosvc.h>
-#include <m_protocols.h>
#include <m_popup.h>
-#include <m_utils.h>
-#include <m_message.h>
-#include <m_statusplugins.h>
+#include <win2k.h>
+
+#include "version.h"
+#include "dlg_handlers.h"
+#include "hooked_events.h"
+#include "services.h"
+#include "list.h"
+#include "services.h"
+#include "utils.h"
+#include "resource.h"
extern char ModuleName[];
extern HINSTANCE hInstance;
diff --git a/plugins/YahooGroups/src/list.h b/plugins/YahooGroups/src/list.h index 2bc3c160a8..ef34699e7c 100644 --- a/plugins/YahooGroups/src/list.h +++ b/plugins/YahooGroups/src/list.h @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
-
class CGroupsList
{
protected:
diff --git a/plugins/YahooGroups/src/services.h b/plugins/YahooGroups/src/services.h index 4e7b424fee..dff16431d0 100644 --- a/plugins/YahooGroups/src/services.h +++ b/plugins/YahooGroups/src/services.h @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define M_YAHOOGROUPS_SERVICES_H
#include "commonheaders.h"
-#include "list.h"
#define MS_YAHOOGROUPS_MOVE "YahooGroups/Groups/MoveToOfficialGroups"
#define MS_YAHOOGROUPS_RESET "YahooGroups/Groups/Reset"
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index a2108af1f0..0a77deb1e4 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -80,14 +80,14 @@ int Info(char *title, char *format, ...) return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION);
}
-int MyPUShowMessage(char *lpzText, BYTE kind)
+int MyPUShowMessage(TCHAR *lpzText, BYTE kind)
{
if (ServiceExists(MS_POPUP_SHOWMESSAGE))
{
- return PUShowMessage(lpzText, kind);
+ return PUShowMessageT(lpzText, kind);
}
else{
- char *title = (kind == SM_NOTIFY) ? Translate("Notify") : Translate("Warning");
+ TCHAR *title = (kind == SM_NOTIFY) ? TranslateT("Notify") : TranslateT("Warning");
return MessageBox(NULL, lpzText, title, MB_OK | (kind == SM_NOTIFY) ? MB_ICONINFORMATION : MB_ICONEXCLAMATION);
}
@@ -117,7 +117,7 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) {
char buffer[32] = {0};
strcpy(buffer, "0x");
- STRNCPY(buffer + 2, inData, HEX_SIZE);
+ strncpy(buffer + 2, inData, HEX_SIZE);
sscanf(buffer, "%x", &size);
outData = (unsigned char*)new char[size*2];
UINT i;
@@ -126,7 +126,7 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) buffer[4] = '\0'; //mark the end of the string
for (i = 0; i < size; i++)
{
- STRNCPY(buffer + 2, &tmp[i * 2], 2);
+ strncpy(buffer + 2, &tmp[i * 2], 2);
sscanf(buffer, "%x", &outData[i]);
}
i = size;
@@ -210,7 +210,6 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, count);
}
-#pragma warning (disable: 4312)
TCHAR *GetContactName(HANDLE hContact, char *szProto)
{
CONTACTINFO ctInfo;
@@ -246,16 +245,12 @@ TCHAR *GetContactName(HANDLE hContact, char *szProto) }
return buffer;
}
-#pragma warning (default: 4312)
-#pragma warning (disable: 4312)
void GetContactProtocol(HANDLE hContact, char *szProto, int size)
{
GetStringFromDatabase(hContact, "Protocol", "p", NULL, szProto, size);
}
-#pragma warning (default: 4312)
-#pragma warning (disable: 4312)
TCHAR *GetContactID(HANDLE hContact)
{
char protocol[256];
@@ -282,7 +277,7 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) {
case CNFT_BYTE:
{
- _stprintf(tmp, _T("%d"), ctInfo.bVal);
+ mir_sntprintf(tmp, SIZEOF(tmp), _T("%d"), ctInfo.bVal);
buffer = _tcsdup(tmp);
break;
@@ -290,7 +285,7 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) case CNFT_WORD:
{
- _stprintf(tmp, _T("%d"), ctInfo.wVal);
+ mir_sntprintf(tmp, SIZEOF(tmp), _T("%d"), ctInfo.wVal);
buffer = _tcsdup(tmp);
break;
@@ -298,7 +293,7 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) case CNFT_DWORD:
{
- _stprintf(tmp, _T("%ld"), ctInfo.dVal);
+ mir_sntprintf(tmp, SIZEOF(tmp), _T("%ld"), ctInfo.dVal);
buffer = _tcsdup(tmp);
break;
@@ -324,16 +319,14 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) return NULL;
}
}
-#pragma warning (default: 4312)
-#pragma warning (disable: 4312)
HANDLE GetContactFromID(TCHAR *szID, char *szProto)
{
HANDLE hContact = db_find_first();
TCHAR *szHandle;
TCHAR dispName[1024];
char cProtocol[256];
- char *tmp;
+ TCHAR *tmp;
int found = 0;
while (hContact)
@@ -341,8 +334,8 @@ HANDLE GetContactFromID(TCHAR *szID, char *szProto) GetContactProtocol(hContact, cProtocol, sizeof(cProtocol));
szHandle = GetContactID(hContact, cProtocol);
- tmp = (char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, 0);
- STRNCPY(dispName, tmp, sizeof(dispName));
+ tmp = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
+ _tcsncpy(dispName, tmp, SIZEOF(dispName));
if ((szHandle) && ((_tcsicmp(szHandle, szID) == 0) || (_tcsicmp(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0)))
{
@@ -442,12 +435,4 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, rChild.top += cy;
}
return rChild;
-}
-
-inline char *STRNCPY(char *output, const char *input, size_t size)
-{
- char *res = strncpy(output, input, size);
- output[size - 1] = 0;
-
- return res;
}
\ No newline at end of file diff --git a/plugins/YahooGroups/src/utils.h b/plugins/YahooGroups/src/utils.h index f2f0411de7..9133633caf 100644 --- a/plugins/YahooGroups/src/utils.h +++ b/plugins/YahooGroups/src/utils.h @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_YAHOOGROUPS_UTILS_H
#define M_YAHOOGROUPS_UTILS_H
-#include <stdarg.h>
#include "commonheaders.h"
//#define USE_LOG
@@ -59,6 +58,4 @@ void GetContactProtocol(HANDLE hContact, char *szProto, int size); int MyPUShowMessage(char *lpzText, BYTE kind);
-inline char *STRNCPY(char *output, const char *input, size_t size);
-
#endif
\ No newline at end of file diff --git a/plugins/YahooGroups/src/version.h b/plugins/YahooGroups/src/version.h index 1def768cf4..ef4f961521 100644 --- a/plugins/YahooGroups/src/version.h +++ b/plugins/YahooGroups/src/version.h @@ -21,25 +21,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_CMDLINE_VERSION_H
#define M_CMDLINE_VERSION_H
-#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 0
-#define __RELEASE_NUM 1
-#define __BUILD_NUM 1
-
-#define VERSION PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM)
-
-#define __PLUGINVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
-#define __PLUGINVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
-#define __STRINGIFY_(x) #x
-#define __STRINGIFY(x) __STRINGIFY_(x)
-#define __VERSION_STRING __STRINGIFY(__PLUGINVERSION_STRING_DOTS)
-
-#define __DESC "This plugin imports and creates the Yahoo groups defined in Yahoo Messenger."
-#define __AUTHOR "Cristian Libotean"
-#define __AUTHOREMAIL "eblis102@yahoo.com"
-#define __COPYRIGHT "© 2007 Cristian Libotean"
-#define __AUTHORWEB "http://www.miranda-ng.org/"
-
-#define __PLUGIN_DISPLAY_NAME "Yahoo Groups"
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 0
+#define __RELEASE_NUM 1
+#define __BUILD_NUM 1
+
+#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+
+#define __PLUGIN_NAME "Yahoo groups"
+#define __FILENAME "YahooGroups.dll"
+#define __DESCRIPTION "This plugin imports and creates the Yahoo groups defined in Yahoo Messenger."
+#define __AUTHOR "Cristian Libotean"
+#define __AUTHOREMAIL "eblis102@yahoo.com"
+#define __AUTHORWEB "http://miranda-ng.org/"
+#define __COPYRIGHT "© 2007 Cristian Libotean"
#endif //M_CMDLINE_VERSION_H
|