diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-03 14:05:33 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-03 14:05:33 +0300 |
commit | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (patch) | |
tree | d92de519c6bc13e0ce3d8e42ba64deeb46d474dc /include/m_protocols.h | |
parent | 66b61f42871089f3962920924f9030cd6dff2ad8 (diff) |
code cleaning: old unions replaced with MAllStrings & MAllStringsArray
Diffstat (limited to 'include/m_protocols.h')
-rw-r--r-- | include/m_protocols.h | 61 |
1 files changed, 23 insertions, 38 deletions
diff --git a/include/m_protocols.h b/include/m_protocols.h index 537cb5308d..e97e534faf 100644 --- a/include/m_protocols.h +++ b/include/m_protocols.h @@ -30,7 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct PROTO_INTERFACE;
#include "statusmodes.h"
+
#include <m_core.h>
+#include <m_system_cpp.h>
typedef struct {
MCONTACT hContact;
@@ -81,7 +83,8 @@ typedef struct { #define ACKRESULT_CONNECTPROXY 110 // connecting to file proxy
#define ACKRESULT_SEARCHRESULT 111 // result of extended search
-typedef struct {
+struct ACKDATA
+{
int cbSize;
const char *szModule; // the name of the protocol module which initiated this ack
MCONTACT hContact;
@@ -89,7 +92,7 @@ typedef struct { int result; // an ACKRESULT_ constant
HANDLE hProcess; // a caller-defined process code
LPARAM lParam; // caller-defined extra info
-} ACKDATA;
+};
#define ME_PROTO_ACK "Proto/Ack"
@@ -106,40 +109,22 @@ typedef struct { #define PFTS_UNICODE 2
#define PFTS_UTF 4
-typedef struct tagPROTOFILETRANSFERSTATUS
+struct PROTOFILETRANSFERSTATUS
{
- size_t cbSize;
- MCONTACT hContact;
- DWORD flags; // one of PFTS_* constants
-
- union {
- char **pszFiles;
- wchar_t **ptszFiles;
- wchar_t **pwszFiles;
- };
-
- int totalFiles;
- int currentFileNumber;
- unsigned __int64 totalBytes;
- unsigned __int64 totalProgress;
-
- union {
- char *szWorkingDir;
- wchar_t *tszWorkingDir;
- wchar_t *wszWorkingDir;
- };
-
- union {
- char *szCurrentFile;
- wchar_t *tszCurrentFile;
- wchar_t *wszCurrentFile;
- };
-
- unsigned __int64 currentFileSize;
- unsigned __int64 currentFileProgress;
- unsigned __int64 currentFileTime; // as seconds since 1970
-}
- PROTOFILETRANSFERSTATUS;
+ size_t cbSize;
+ MCONTACT hContact;
+ DWORD flags; // one of PFTS_* constants
+ MAllStringArray pszFiles;
+ int totalFiles;
+ int currentFileNumber;
+ uint64_t totalBytes;
+ uint64_t totalProgress;
+ MAllStrings szWorkingDir;
+ MAllStrings szCurrentFile;
+ uint64_t currentFileSize;
+ uint64_t currentFileProgress;
+ uint64_t currentFileTime; // as seconds since 1970
+};
#define PROTOCOLDESCRIPTOR_V3_SIZE (sizeof(size_t)+sizeof(INT_PTR)+sizeof(char*))
@@ -306,19 +291,19 @@ struct MIR_APP_EXPORT PROTOACCOUNT // wParam = (WPARAM)(int*)piNumAccounts
// lParam = (LPARAM)(PROTOACCOUNT**)paAccounts
-MIR_APP_DLL(void) Proto_EnumAccounts(int *nAccs, PROTOACCOUNT ***pAccs);
+EXTERN_C MIR_APP_DLL(void) Proto_EnumAccounts(int *nAccs, PROTOACCOUNT ***pAccs);
/////////////////////////////////////////////////////////////////////////////////////////
// creates new account
// return value = PROTOACCOUNT* or NULL
-MIR_APP_DLL(PROTOACCOUNT*) Proto_CreateAccount(const char *pszInternal, const char *pszBaseProto, const wchar_t *ptszAccountName);
+EXTERN_C MIR_APP_DLL(PROTOACCOUNT*) Proto_CreateAccount(const char *pszInternal, const char *pszBaseProto, const wchar_t *ptszAccountName);
/////////////////////////////////////////////////////////////////////////////////////////
// constructs the appropriate PROTOACCOUNT::ppro member if needed
// returns true if succeeded
-MIR_APP_DLL(bool) Proto_ActivateAccount(PROTOACCOUNT *pAccount);
+EXTERN_C MIR_APP_DLL(bool) Proto_ActivateAccount(PROTOACCOUNT *pAccount);
/////////////////////////////////////////////////////////////////////////////////////////
// retrieves an account's interface by its physical name (database module)
|