diff options
author | George Hazan <george.hazan@gmail.com> | 2014-04-02 11:04:09 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-04-02 11:04:09 +0000 |
commit | a1cc2175f61db72a71b26c5be3787f977c021cfb (patch) | |
tree | e2e7dd7439577161323582769b4d04ba39373dc1 /include/m_core.h | |
parent | 7c783b8ec0603347548964bacf893de818d03ecf (diff) |
DBEVENTINFO::isMarkRead() - new helper to simplify bit logic
git-svn-id: http://svn.miranda-ng.org/main/trunk@8825 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_core.h')
-rw-r--r-- | include/m_core.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/include/m_core.h b/include/m_core.h index d30bed459e..6bb86f68a6 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -66,7 +66,9 @@ typedef UINT32 MCONTACT; #define DBVT_TCHAR DBVT_ASCIIZ
#endif
#define DBVTF_VARIABLELENGTH 0x80
-typedef struct {
+
+typedef struct
+{
BYTE type;
union {
BYTE bVal; char cVal;
@@ -87,25 +89,30 @@ typedef struct { };
} DBVARIANT;
-#define DBEF_SENT 2 // this event was sent by the user. If not set this
- // event was received.
-#define DBEF_READ 4 // event has been read by the user. It does not need
- // to be processed any more except for history.
+#define DBEF_SENT 2 // this event was sent by the user. If not set this event was received.
+#define DBEF_READ 4 // event has been read by the user. It does not need to be processed any more except for history.
#define DBEF_RTL 8 // event contains the right-to-left aligned text
#define DBEF_UTF 16 // event contains a text in utf-8
#define DBEF_ENCRYPTED 32 // event is encrypted (never reported outside a driver)
-typedef struct {
- int cbSize; // size of the structure in bytes
+typedef struct
+{
+ int cbSize; // size of the structure in bytes
char *szModule; // pointer to name of the module that 'owns' this
// event, ie the one that is in control of the data format
DWORD timestamp; // seconds since 00:00, 01/01/1970. Gives us times until
// 2106 unless you use the standard C library which is
// signed and can only do until 2038. In GMT.
DWORD flags; // the omnipresent flags
- WORD eventType; // module-defined event type field
+ WORD eventType; // module-defined event type field
DWORD cbBlob; // size of pBlob in bytes
PBYTE pBlob; // pointer to buffer containing module-defined event data
+
+#if defined(__cplusplus)
+ bool __forceinline markedRead() const
+ { return (flags & (DBEF_SENT | DBEF_READ)) != 0;
+ }
+#endif
} DBEVENTINFO;
MIR_CORE_DLL(INT_PTR) db_free(DBVARIANT *dbv);
|