diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-31 11:46:05 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-31 11:46:05 +0000 |
commit | 1ce3da1cca093143d9629bc46e221dd8be962e12 (patch) | |
tree | b99d12d635a65f8c78499137137df2bd591b50be /include | |
parent | 03512ff2ed0f3d1ed6857ee85b0eb7268931ec3f (diff) |
- 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
Diffstat (limited to 'include')
-rw-r--r-- | include/m_core.h | 6 | ||||
-rw-r--r-- | include/m_protocols.h | 2 | ||||
-rw-r--r-- | include/m_protosvc.h | 23 |
3 files changed, 13 insertions, 18 deletions
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"
|