summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-25 21:02:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-25 21:02:11 +0300
commit45bf5f51cc788cb8f19e1b8fcd5b8818dc7a2e00 (patch)
tree40a087f36b75b4c1fb7218bd06052df2968bf2d2 /include
parent8ba9e423e683d570702476dd93571cea26a27c1a (diff)
GCEVENT::GCEF_UTF8 - flag for direct communication with utf8-encoded chat events (UTF16LE by default)
Diffstat (limited to 'include')
-rw-r--r--include/m_chat.h19
-rw-r--r--include/m_core.h16
2 files changed, 22 insertions, 13 deletions
diff --git a/include/m_chat.h b/include/m_chat.h
index 6701507374..cd290c04e4 100644
--- a/include/m_chat.h
+++ b/include/m_chat.h
@@ -347,18 +347,19 @@ EXTERN_C MIR_APP_DLL(struct SESSION_INFO*) Chat_NewSession(
#define GCEF_ADDTOLOG 0x0001 // force adding to log
#define GCEF_SILENT 0x0002 // never add to log
#define GCEF_NOTNOTIFY 0x0004
+#define GCEF_UTF8 0x0008
struct GCEVENT
{
- LPCSTR pszModule; // Name of the protocol (same as you registered with)
- LPCTSTR ptszID; // Unique identifier of the session, or NULL to broadcast to all sessions as specified above
- int iType; // Use GC_EVENT_* as defined above. Only one event per service call.
-
- LPCTSTR ptszText; //
- LPCTSTR ptszNick; //
- LPCTSTR ptszUID; //
- LPCTSTR ptszStatus; //
- LPCTSTR ptszUserInfo; //
+ LPCSTR pszModule; // Name of the protocol (same as you registered with)
+ MAllCStrings pszID; // Unique identifier of the session, or NULL to broadcast to all sessions as specified above
+ int iType; // Use GC_EVENT_* as defined above. Only one event per service call.
+
+ MAllCStrings pszText; //
+ MAllCStrings pszNick; //
+ MAllCStrings pszUID; //
+ MAllCStrings pszStatus; //
+ MAllCStrings pszUserInfo; //
BOOL bIsMe; // Is this event from the Miranda user?
DWORD dwFlags; // event flags: GCEF_*
diff --git a/include/m_core.h b/include/m_core.h
index b75cd0c700..610a04ff7e 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -428,15 +428,23 @@ __forceinline char* lrtrimp(char *str) { return ltrimp(rtrim(str)); };
///////////////////////////////////////////////////////////////////////////////
// text conversion functions
-typedef union {
+union MAllStrings
+{
char *a; // utf8 or ansi strings
wchar_t *w; // strings of WCHARs
-} MAllStrings;
+};
-typedef union {
+union MAllCStrings
+{
+ const char *a; // utf8 or ansi strings
+ const wchar_t *w; // strings of WCHARs
+};
+
+union MAllStringArray
+{
char **a; // array of utf8 or ansi strings
wchar_t **w; // array of strings of WCHARs
-} MAllStringArray;
+};
MIR_CORE_DLL(wchar_t*) mir_a2u_cp(const char* src, int codepage);
MIR_CORE_DLL(wchar_t*) mir_a2u(const char* src);