From 1ce3da1cca093143d9629bc46e221dd8be962e12 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 May 2015 11:46:05 +0000 Subject: - MAllStrings: a handy union to hold an incoming string parameter of any type; - FNAMECHAR: atavism extincted; - PROTOSEARCHRESULT: structure prepared to use results of any type, including utf git-svn-id: http://svn.miranda-ng.org/main/trunk@13932 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/m_core.h | 6 ++++++ include/m_protocols.h | 2 -- include/m_protosvc.h | 23 +++++++---------------- 3 files changed, 13 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/m_core.h b/include/m_core.h index e29dc0f100..9ed2a86a9d 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -483,6 +483,12 @@ __forceinline char* lrtrimp(char *str) { return ltrimp(rtrim(str)); }; /////////////////////////////////////////////////////////////////////////////// // text conversion functions +typedef union { + char *a; // utf8 or ansi strings + TCHAR *t; // strings of TCHARs + wchar_t w; // strings of WCHARs +} MAllStrings; + #ifdef _UNICODE #define mir_t2a(s) mir_u2a(s) #define mir_a2t(s) mir_a2u(s) diff --git a/include/m_protocols.h b/include/m_protocols.h index 15da03bc01..fb26cb58c0 100644 --- a/include/m_protocols.h +++ b/include/m_protocols.h @@ -105,8 +105,6 @@ typedef struct { // when type == ACKTYPE_FILE && (result == ACKRESULT_DATA || result == ACKRESULT_FILERESUME), // lParam points to this -#define FNAMECHAR TCHAR - #define PFTS_RECEIVING 0 #define PFTS_SENDING 1 #define PFTS_UNICODE 2 diff --git a/include/m_protosvc.h b/include/m_protosvc.h index 82a5291be2..9c9518b95f 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -323,23 +323,14 @@ will pick this up and everything will be good. #define PSR_TCHAR 0 #endif - typedef struct { int cbSize; - FNAMECHAR *nick; - FNAMECHAR *firstName; - FNAMECHAR *lastName; - FNAMECHAR *email; - FNAMECHAR *id; + MAllStrings nick; + MAllStrings firstName; + MAllStrings lastName; + MAllStrings email; + MAllStrings id; int flags; - char reserved[8*sizeof(HANDLE)/sizeof(DWORD)]; - //Protocols may extend this structure with extra members at will and supply - //a larger cbSize to reflect the new information, but they must not change - //any elements above this comment - //The 'reserved' field is part of the basic structure, not space to - //overwrite with protocol-specific information. - //If modules do this, they should take steps to ensure that information - //they put there will be retained by anyone trying to save this structure. } PROTOSEARCHRESULT; #define PS_BASICSEARCH "/BasicSearch" #define PS_BASICSEARCHW "/BasicSearchW" @@ -395,7 +386,7 @@ typedef struct { typedef struct { size_t nSize; int nFieldCount; - TCHAR ** pszFields; + TCHAR **pszFields; PROTOSEARCHRESULT psr; } CUSTOMSEARCHRESULTS; @@ -446,7 +437,7 @@ typedef struct { #define FILERESUME_SKIP 4 typedef struct { int action; //a FILERESUME_ flag - const FNAMECHAR *szFilename; //full path. Only valid if action == FILERESUME_RENAME + const TCHAR *szFilename; // full path. Only valid if action == FILERESUME_RENAME } PROTOFILERESUME; #define PS_FILERESUME "/FileResume" #define PS_FILERESUMEW "/FileResumeW" -- cgit v1.2.3