summaryrefslogtreecommitdiff
path: root/protocols/EmLanProto/src/stdafx.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-27 18:41:03 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-27 18:41:03 +0000
commit9070dd01ae46fa9187684b66405a751fb4822702 (patch)
tree0c4b6dc600b17a55dafde419f5b50d99f1942729 /protocols/EmLanProto/src/stdafx.h
parent75a2eab4a30c503df310118d0d75ff503d59e562 (diff)
adaptation of old good E-mage LAN proto
git-svn-id: http://svn.miranda-ng.org/main/trunk@2523 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/EmLanProto/src/stdafx.h')
-rw-r--r--protocols/EmLanProto/src/stdafx.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/protocols/EmLanProto/src/stdafx.h b/protocols/EmLanProto/src/stdafx.h
new file mode 100644
index 0000000000..f6c9db86be
--- /dev/null
+++ b/protocols/EmLanProto/src/stdafx.h
@@ -0,0 +1,80 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define _CRT_SECURE_NO_WARNINGS
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+#include <winsock2.h>
+
+#include "newpluginapi.h"
+
+#include "m_options.h"
+#include "m_system.h"
+
+#include "m_database.h"
+#include "m_protomod.h"
+#include "statusmodes.h"
+#include "m_protosvc.h"
+#include "m_options.h"
+#include "m_langpack.h"
+#include <prsht.h>
+
+#define PROTONAME "EM_LAN_PROTO"
+#define VER PLUGIN_MAKE_VERSION(0, 0, 1, 1)
+
+//#define ME_ICQ_STATUSMSGREQ "ICQ/StatusMsgReq"
+//
+//#define ICQ_MSGTYPE_GETAWAYMSG 0xE8
+//#define ICQ_MSGTYPE_GETOCCUMSG 0xE9
+//#define ICQ_MSGTYPE_GETNAMSG 0xEA
+//#define ICQ_MSGTYPE_GETDNDMSG 0xEB
+//#define ICQ_MSGTYPE_GETFFCMSG 0xEC
+
+//#define VERBOSE
+
+#ifdef VERBOSE
+#include <fstream>
+extern std::fstream emlanLog;
+#define EMLOG(x) emlanLog << "[" << __FUNCTION__ << "] [" << __FILE__ << ":" << __LINE__ << "] " << x << std::endl
+#define EMLOGIF(x, y) if (y) EMLOG(x)
+inline const char* showErrName(int err)
+{
+ const char* name = "unknown";
+ switch (err)
+ {
+ case 0: name = "NOERROR"; break;
+ case WSANOTINITIALISED: name = "WSANOTINITIALIZED"; break;
+ case WSAENETDOWN: name = "WSAENETDOWN"; break;
+ case WSAEACCES: name = "WSAEACCES"; break;
+ case WSAEFAULT: name = "WSAEFAULT"; break;
+ case WSAENOTCONN: name = "WSAENOTCONN"; break;
+ case WSAEINTR: name = "WSAEINTR"; break;
+ case WSAEINPROGRESS: name = "WSAEINPROGRESS"; break;
+ case WSAENETRESET: name = "WSAENETRESET"; break;
+ case WSAENOTSOCK: name = "WSAENOTSOCK"; break;
+ case WSAEOPNOTSUPP: name = "WSAEOPNOTSUPP"; break;
+ case WSAESHUTDOWN: name = "WSAESHUTDOWN"; break;
+ case WSAEWOULDBLOCK: name = "WSAEWOULDBLOCK"; break;
+ case WSAEMSGSIZE: name = "WSAEMSGSIZE"; break;
+ case WSAEINVAL: name = "WSAEINVAL"; break;
+ case WSAECONNABORTED: name = "WSAECONNABORTED"; break;
+ case WSAETIMEDOUT: name = "WSAETIMEDOUT"; break;
+ case WSAECONNRESET: name = "WSAECONNRESET"; break;
+ case WSAENOBUFS: name = "WSAENOBUFS"; break;
+ case WSAEHOSTUNREACH: name = "WSAEHOSTUNREACH"; break;
+ }
+ return name;
+}
+#define EMLOGERR() { int err = WSAGetLastError(); const char* name = showErrName(err); EMLOG( "Error: " << err << '(' << name << ')' ); }
+#define EMLOGERRIF(y) if (y) EMLOGERR()
+#else
+#define EMLOG(x)
+#define EMLOGIF(x, y)
+#define EMLOGERR()
+#define EMLOGERRIF()
+#endif