summaryrefslogtreecommitdiff
path: root/include/m_protoint.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-28 11:55:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-28 11:55:00 +0000
commitae3cee537d478fba0f32e561a12d62213a85a4d5 (patch)
tree9c724d25e3726acb53c6e55489804533a7c8a30b /include/m_protoint.h
parent2eb1daf5d940beac69c2cf9de0d27c74adb03a37 (diff)
- stubs for PROTO get* & set* functions removed from mir_core;
- helpers themselves made inline; - added missing helpers for getWStringA - removed completely obsolete DB header for ICQ git-svn-id: http://svn.miranda-ng.org/main/trunk@5507 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_protoint.h')
-rw-r--r--include/m_protoint.h102
1 files changed, 66 insertions, 36 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 1905f85a18..69aa6339b4 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -57,48 +57,78 @@ struct PROTO_INTERFACE : public MZeroedObject
//////////////////////////////////////////////////////////////////////////////////////
// Helpers
- __forceinline INT_PTR ProtoBroadcastAck(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam)
- { return ::ProtoBroadcastAck(m_szModuleName, hContact, type, hResult, hProcess, lParam); }
+ __forceinline INT_PTR ProtoBroadcastAck(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam) {
+ return ::ProtoBroadcastAck(m_szModuleName, hContact, type, hResult, hProcess, lParam); }
__forceinline INT_PTR delSetting(const char *name) { return db_unset(NULL, m_szModuleName, name); }
__forceinline INT_PTR delSetting(HANDLE hContact, const char *name) { return db_unset(hContact, m_szModuleName, name); }
- __forceinline bool getBool(const char *name, bool defaultValue) { return ProtoGetBool0(this, name, defaultValue); }
- __forceinline bool getBool(HANDLE hContact, const char *name, bool defaultValue) { return ProtoGetBool(this, hContact, name, defaultValue); }
- __forceinline bool isChatRoom(HANDLE hContact) { return getBool(hContact, "ChatRoom", false); }
-
- __forceinline int getByte(const char *name, BYTE defaultValue) { return ProtoGetByte0(this, name, defaultValue); }
- __forceinline int getByte(HANDLE hContact, const char *name, BYTE defaultValue) { return ProtoGetByte(this, hContact, name, defaultValue); }
-
- __forceinline int getWord(const char *name, WORD defaultValue) { return ProtoGetWord0(this, name, defaultValue); }
- __forceinline int getWord(HANDLE hContact, const char *name, WORD defaultValue) { return ProtoGetWord(this, hContact, name, defaultValue); }
-
- __forceinline DWORD getDword(const char *name, DWORD defaultValue) { return ProtoGetDword0(this, name, defaultValue); }
- __forceinline DWORD getDword(HANDLE hContact, const char *name, DWORD defaultValue) { return ProtoGetDword(this, hContact, name, defaultValue); }
-
- __forceinline int getString(const char *name, DBVARIANT *result) { return ProtoGetString0(this, name, result); }
- __forceinline int getString(HANDLE hContact, const char *name, DBVARIANT *result) { return ProtoGetString(this, hContact, name, result); }
-
- __forceinline int getTString(const char *name, DBVARIANT *result) { return ProtoGetTString0(this, name, result); }
- __forceinline int getTString(HANDLE hContact, const char *name, DBVARIANT *result) { return ProtoGetTString(this, hContact, name, result); }
+ __forceinline bool getBool(const char *name, bool defaultValue) {
+ return db_get_b(NULL, m_szModuleName, name, defaultValue) != 0; }
+ __forceinline bool getBool(HANDLE hContact, const char *name, bool defaultValue) {
+ return db_get_b(hContact, m_szModuleName, name, defaultValue) != 0; }
- __forceinline char* getStringA(const char *name) { return ProtoGetStringA0(this, name); }
- __forceinline char* getStringA(HANDLE hContact, const char *name) { return ProtoGetStringA(this, hContact, name); }
-
- __forceinline void setByte(const char *name, BYTE value) { ProtoSetByte0(this, name, value); }
- __forceinline void setByte(HANDLE hContact, const char *name, BYTE value) { ProtoSetByte(this, hContact, name, value); }
-
- __forceinline void setWord(const char *name, WORD value) { ProtoSetWord0(this, name, value); }
- __forceinline void setWord(HANDLE hContact, const char *name, WORD value) { ProtoSetWord(this, hContact, name, value); }
-
- __forceinline void setDword(const char *name, DWORD value) { ProtoSetDword0(this, name, value); }
- __forceinline void setDword(HANDLE hContact, const char *name, DWORD value) { ProtoSetDword(this, hContact, name, value); }
-
- __forceinline void setString(const char *name, const char* value) { ProtoSetString0(this, name, value); }
- __forceinline void setString(HANDLE hContact, const char *name, const char* value) { ProtoSetString(this, hContact, name, value); }
+ __forceinline bool isChatRoom(HANDLE hContact) { return getBool(hContact, "ChatRoom", false); }
- __forceinline void setTString(const char *name, const TCHAR* value) { ProtoSetTString0(this, name, value); }
- __forceinline void setTString(HANDLE hContact, const char *name, const TCHAR* value) { ProtoSetTString(this, hContact, name, value); }
+ __forceinline int getByte(const char *name, BYTE defaultValue) {
+ return db_get_b(NULL, m_szModuleName, name, defaultValue); }
+ __forceinline int getByte(HANDLE hContact, const char *name, BYTE defaultValue) {
+ return db_get_b(hContact, m_szModuleName, name, defaultValue); }
+
+ __forceinline int getWord(const char *name, WORD defaultValue) {
+ return db_get_w(NULL, m_szModuleName, name, defaultValue); }
+ __forceinline int getWord(HANDLE hContact, const char *name, WORD defaultValue) {
+ return db_get_w(hContact, m_szModuleName, name, defaultValue); }
+
+ __forceinline DWORD getDword(const char *name, DWORD defaultValue) {
+ return db_get_dw(NULL, m_szModuleName, name, defaultValue); }
+ __forceinline DWORD getDword(HANDLE hContact, const char *name, DWORD defaultValue) {
+ return db_get_dw(hContact, m_szModuleName, name, defaultValue); }
+
+ __forceinline INT_PTR getString(const char *name, DBVARIANT *result) {
+ return db_get_s(NULL, m_szModuleName, name, result); }
+ __forceinline INT_PTR getString(HANDLE hContact, const char *name, DBVARIANT *result) {
+ return db_get_s(hContact, m_szModuleName, name, result); }
+
+ __forceinline INT_PTR getWString(const char *name, DBVARIANT *result) {
+ return db_get_ws(NULL, m_szModuleName, name, result); }
+ __forceinline INT_PTR getWString(HANDLE hContact, const char *name, DBVARIANT *result) {
+ return db_get_ws(hContact, m_szModuleName, name, result); }
+
+ __forceinline char* getStringA(const char *name) {
+ return db_get_sa(NULL, m_szModuleName, name); }
+ __forceinline char* getStringA(HANDLE hContact, const char *name) {
+ return db_get_sa(hContact, m_szModuleName, name); }
+
+ __forceinline WCHAR* getWStringA(const char *name) {
+ return db_get_wsa(NULL, m_szModuleName, name); }
+ __forceinline WCHAR* getWStringA(HANDLE hContact, const char *name) {
+ return db_get_wsa(hContact, m_szModuleName, name); }
+
+ __forceinline void setByte(const char *name, BYTE value) { db_set_b(NULL, m_szModuleName, name, value); }
+ __forceinline void setByte(HANDLE hContact, const char *name, BYTE value) { db_set_b(hContact, m_szModuleName, name, value); }
+
+ __forceinline void setWord(const char *name, WORD value) { db_set_w(NULL, m_szModuleName, name, value); }
+ __forceinline void setWord(HANDLE hContact, const char *name, WORD value) { db_set_w(hContact, m_szModuleName, name, value); }
+
+ __forceinline void setDword(const char *name, DWORD value) { db_set_dw(NULL, m_szModuleName, name, value); }
+ __forceinline void setDword(HANDLE hContact, const char *name, DWORD value) { db_set_dw(hContact, m_szModuleName, name, value); }
+
+ __forceinline void setString(const char *name, const char* value) { db_set_s(NULL, m_szModuleName, name, value); }
+ __forceinline void setString(HANDLE hContact, const char *name, const char* value) { db_set_s(hContact, m_szModuleName, name, value); }
+
+ __forceinline void setWString(const char *name, const WCHAR* value) { db_set_ws(NULL, m_szModuleName, name, value); }
+ __forceinline void setWString(HANDLE hContact, const char *name, const WCHAR* value) { db_set_ws(hContact, m_szModuleName, name, value); }
+
+ #if defined(_UNICODE)
+ #define getTString getWString
+ #define getTStringA getWStringA
+ #define setTString setWString
+ #else
+ #define getTString getString
+ #define getTStringA getStringA
+ #define setTString setString
+ #endif
//////////////////////////////////////////////////////////////////////////////////////
// Virtual functions