summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-11 14:01:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-11 14:01:25 +0000
commit773421e8ba17637d994088c393d406226b516a30 (patch)
tree130c0bf529e30f493ae4f2abbe1230d31fecdeed /include
parent3fc8b6f686262e8a595fc10b2bd947526ca77bdc (diff)
- m_hNetlibUser moved to PROTO_INTERFACE;
- unified protocol loggers git-svn-id: http://svn.miranda-ng.org/main/trunk@6435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include')
-rw-r--r--include/m_core.h3
-rw-r--r--include/m_protoint.h16
2 files changed, 19 insertions, 0 deletions
diff --git a/include/m_core.h b/include/m_core.h
index accab97bf1..e242aa38f5 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -632,6 +632,9 @@ typedef INT_PTR (__cdecl PROTO_INTERFACE::*ProtoServiceFuncParam)(WPARAM, LPARAM
MIR_CORE_DLL(void) ProtoCreateServiceParam(struct PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFuncParam, LPARAM);
#endif
+MIR_CORE_DLL(void) ProtoLogA(struct PROTO_INTERFACE *pThis, LPCSTR szFormat, va_list args);
+MIR_CORE_DLL(void) ProtoLogW(struct PROTO_INTERFACE *pThis, LPCWSTR wszFormat, va_list args);
+
// avatar support functions
// returns image extension by a PA_* constant or empty string for PA_FORMAT_UNKNOWN
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 769b4ff027..255cda85ff 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -53,10 +53,24 @@ struct PROTO_INTERFACE : public MZeroedObject
TCHAR* m_tszUserName;
char* m_szModuleName;
HANDLE m_hProtoIcon;
+ HANDLE m_hNetlibUser;
//////////////////////////////////////////////////////////////////////////////////////
// Helpers
+ __forceinline void debugLogA(LPCSTR szFormat, ...)
+ {
+ va_list args;
+ va_start(args, szFormat);
+ ProtoLogA(this, szFormat, args);
+ }
+ __forceinline void debugLogW(LPCWSTR wszFormat, ...)
+ {
+ va_list args;
+ va_start(args, wszFormat);
+ ProtoLogW(this, wszFormat, args);
+ }
+
__forceinline INT_PTR ProtoBroadcastAck(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam) {
return ::ProtoBroadcastAck(m_szModuleName, hContact, type, hResult, hProcess, lParam); }
@@ -121,10 +135,12 @@ struct PROTO_INTERFACE : public MZeroedObject
__forceinline void setWString(HANDLE hContact, const char *name, const WCHAR* value) { db_set_ws(hContact, m_szModuleName, name, value); }
#if defined(_UNICODE)
+ #define debugLog debugLogW
#define getTString getWString
#define getTStringA getWStringA
#define setTString setWString
#else
+ #define debugLog debugLogA
#define getTString getString
#define getTStringA getStringA
#define setTString setString