From 8751885ea79df4b666b65bb2b6900617785e0da7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 4 Jun 2013 07:55:00 +0000 Subject: end of base64* zoo git-svn-id: http://svn.miranda-ng.org/main/trunk@4879 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/delphi/m_core.inc | 4 ++-- include/delphi/m_netlib.inc | 45 --------------------------------------------- include/m_netlib.h | 32 -------------------------------- include/m_utils.h | 12 ------------ 4 files changed, 2 insertions(+), 91 deletions(-) (limited to 'include') diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index 0b14858923..0be77bbe48 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -553,9 +553,9 @@ procedure mir_sha1_hash(dataIn:pmir_sha1_byte_t; len:int;hashout:SHA1Hash); stdc /////////////////////////////////////////////////////////////////////////////// // strings -function mir_base64_decode(str:pAnsiChar):pAnsiChar; stdcall; +function mir_base64_decode(str:pAnsiChar; var resultSize:int):PByte; stdcall; external CoreDLL name 'mir_base64_decode'; -function mir_base64_encode(str:pAnsiChar):pAnsiChar; stdcall; +function mir_base64_encode(data:PByte; dataSize:int):pAnsiChar; stdcall; external CoreDLL name 'mir_base64_encode'; function rtrim(str:pAnsiChar):pAnsiChar; stdcall; diff --git a/include/delphi/m_netlib.inc b/include/delphi/m_netlib.inc index 69df8f5793..3c86e7517b 100644 --- a/include/delphi/m_netlib.inc +++ b/include/delphi/m_netlib.inc @@ -282,14 +282,6 @@ type combinePackets : int; // MIRANDA_VER >= 0x0900 end; - PNETLIBBASE64 = ^TNETLIBBASE64; - TNETLIBBASE64 = record - pszEncoded: PAnsiChar; - cchEncoded: int; - pbDecoded : PByte; - cbDecoded : int; - end; - type PNETLIBBUFFER = ^TNETLIBBUFFER; TNETLIBBUFFER = record @@ -506,43 +498,6 @@ const } MS_NETLIB_URLENCODE:PAnsiChar = 'Netlib/UrlEncode'; - { - wParam : 0 - lParam : Pointer to a TNETLIBBASE64 initialised structure - Affects: Decodes a Base64 null terminated string, see notes - Returns: [non zero] on success, NULL(0) on failure - Notes : TNETLIBBASE64.pszEncoded and cchEncoded must contain a pointer to - a buffer to use as input, and it's length, the length - should not include space taken for null termination -- - - - Output is placed in ..pbDecoded and ..cbDecoded for buffer and - length of buffer -- the maxiumum output for a given input can - be worked out with Netlib_GetBase64DecodedBufferSize() function - see below. - - - For more information on Base64 see rfc-1421. - Errors : ERROR_INVALID_PARAMETER, ERROR_INVALID_DATA, ERROR_BUFFER_OVERFLOW - } - MS_NETLIB_BASE64DECODE:PAnsiChar = 'Netlib/Base64Decode'; - - { - wParam : 0 - lParam : Pointer to an initialised TNETLIBBASE64 structure - Affect : Base64 encode a string, see notes - Returns: [non zero] on success, NULL(0) on failure - Notes : TNETLIBBASE64.pbDecode and TNETLIBBASE64.cbDecoded contain - the input buffer and it's length -- - TNETLIBBASE64.pszEncoded and TNETLIBBASE64.cchEncoded contain the - buffer in which to put the output and it's length. - - - The maximum output size for a given input can be worked - out with the function Netlib_GetBase64EncodedBufferSize() below - .pszEncoded is null terminated, on return TNETLIBBASE64.cchEncoded - is set to the actual length excluding 0. - Errors : ERROR_INVALID_PARAMETER, ERROR_BUFFER_OVERFLOW - } - MS_NETLIB_BASE64ENCODE:PAnsiChar = 'Netlib/Base64Encode'; - { Converts string representation of IP and port into numerical SOCKADDR_INET IPv4 could supplied in formats address:port or address diff --git a/include/m_netlib.h b/include/m_netlib.h index 8403adfc97..c955d14317 100644 --- a/include/m_netlib.h +++ b/include/m_netlib.h @@ -389,40 +389,8 @@ typedef struct { //Errors: ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY #define MS_NETLIB_URLENCODE "Netlib/UrlEncode" -//Base64 decode a string. See rfc1421. -//wParam = 0 -//lParam = (LPARAM)(NETLIBBASE64*)&nlb64 -//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib) -//nlb64.pszEncoded and nlb64.cchEncoded contain the input string and its length -//(excluding terminating zero). -//nlb64.pbDecoded and nlb64.cbDecoded contain the buffer in which to put the -//output and the length of this buffer. The maximum output size for a given -//input is available from the macro Netlib_GetBase64DecodedBufferSize() below. -//On return nlb64.cbDecoded is set to the actual length of the decoded data. -//Errors: ERROR_INVALID_PARAMETER, ERROR_INVALID_DATA, ERROR_BUFFER_OVERFLOW -typedef struct { - char *pszEncoded; - int cchEncoded; - PBYTE pbDecoded; - int cbDecoded; -} NETLIBBASE64; #define Netlib_GetBase64DecodedBufferSize(cchEncoded) (((cchEncoded)>>2)*3) -#define MS_NETLIB_BASE64DECODE "Netlib/Base64Decode" - -//Base64 encode a string. See rfc1421. -//wParam = 0 -//lParam = (LPARAM)(NETLIBBASE64*)&nlb64 -//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib) -//nlb64.pbDecoded and nlb64.cbDecoded contain the input buffer and its length -//nlb64.pszEncoded and nlb64.cchEncoded contain the buffer in which to put the -//output and the length of this buffer. The maximum output size for a given -//input is available from the macro Netlib_GetBase64EncodedBufferSize() below. -//nlb64.pszEncoded is terminated with a 0. -//On return nlb64.cchEncoded is set to the actual length of the decoded data, -//excluding the terminating 0. -//Errors: ERROR_INVALID_PARAMETER, ERROR_BUFFER_OVERFLOW #define Netlib_GetBase64EncodedBufferSize(cbDecoded) (((cbDecoded)*4+11)/12*4+1) -#define MS_NETLIB_BASE64ENCODE "Netlib/Base64Encode" // Converts string representation of IP and port into numerical SOCKADDR_INET // IPv4 could supplied in formats address:port or address diff --git a/include/m_utils.h b/include/m_utils.h index 3c8a01af89..17640c6d32 100644 --- a/include/m_utils.h +++ b/include/m_utils.h @@ -348,18 +348,6 @@ __forceinline INT_PTR Utils_AssertInsideScreen(RECT *rc) { //Always returns 0 #define MS_UTILS_GETRANDOM "Utils/GetRandom" -//Generates Base64 encoded string -//wParam = 0 (unused) -//lParam = (LPARAM)(char*)pointer to source string -//Returns (char*)pointer to encoded string -#define MS_UTILS_ENCODEBASE64 "Utils/EncodeBase64" - -//Generates Base64 decoded string -//wParam = 0 (unused) -//lParam = (LPARAM)(char*)pointer to encoded string -//Returns (char*)pointer to decoded string -#define MS_UTILS_DECODEBASE64 "Utils/DecodeBase64" - //Replace variables in text //wParam = (char*/TCHAR*/WCHAR*)string (depends on RVF_UNICODE/RVF_TCHAR flag) //lParam = (REPLACEVARSDATA *) data about variables, item with key = 0 terminates the list -- cgit v1.2.3