summaryrefslogtreecommitdiff
path: root/plugins/helpers
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-08-05 13:20:54 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-08-05 13:20:54 +0000
commit58072b25fc6f1439e1a2752cde6fc94e780972c2 (patch)
treec441fea24a3ef4717921834c79a08213c41f0d7e /plugins/helpers
parent1d9e3c88c6a4930241d82812c299a31b739c1aa6 (diff)
removed not used functions
git-svn-id: http://svn.miranda-ng.org/main/trunk@5591 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/helpers')
-rw-r--r--plugins/helpers/gen_helpers.cpp92
-rw-r--r--plugins/helpers/gen_helpers.h35
2 files changed, 6 insertions, 121 deletions
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp
index ba88fec81d..ce19a5bd51 100644
--- a/plugins/helpers/gen_helpers.cpp
+++ b/plugins/helpers/gen_helpers.cpp
@@ -19,15 +19,6 @@
#include "commonheaders.h"
#include "gen_helpers.h"
-char *Hlp_GetProtocolNameA(const char *proto) {
-
- char protoname[256];
- if ((!ProtoServiceExists(proto, PS_GETNAME)) || (CallProtoService(proto, PS_GETNAME, (WPARAM)sizeof(protoname), (LPARAM)protoname)))
- return NULL;
-
- return mir_strdup(protoname);
-}
-
TCHAR *Hlp_GetProtocolName(const char *proto) {
char protoname[256];
@@ -38,19 +29,6 @@ TCHAR *Hlp_GetProtocolName(const char *proto) {
}
-char *Hlp_GetDlgItemTextA(HWND hwndDlg, int nIDDlgItem) {
-
- int len = SendDlgItemMessageA(hwndDlg, nIDDlgItem, WM_GETTEXTLENGTH, 0, 0);
- if (len < 0)
- return NULL;
-
- char *res = ( char* )mir_alloc((len+1));
- ZeroMemory(res, (len+1));
- GetDlgItemTextA(hwndDlg, nIDDlgItem, res, len+1);
-
- return res;
-}
-
TCHAR *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) {
int len = SendDlgItemMessage(hwndDlg, nIDDlgItem, WM_GETTEXTLENGTH, 0, 0);
@@ -64,19 +42,6 @@ TCHAR *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) {
return res;
}
-char *Hlp_GetWindowTextA(HWND hwndDlg)
-{
- int len = SendMessageA(hwndDlg, WM_GETTEXTLENGTH, 0, 0);
- if (len < 0)
- return NULL;
-
- char *res = ( char* )mir_alloc((len+1));
- ZeroMemory(res, (len+1));
- GetWindowTextA(hwndDlg, res, len+1);
-
- return res;
-}
-
TCHAR *Hlp_GetWindowText(HWND hwndDlg)
{
int len = SendMessage(hwndDlg, WM_GETTEXTLENGTH, 0, 0);
@@ -95,7 +60,8 @@ TCHAR *Hlp_GetWindowText(HWND hwndDlg)
**/
// Logging
-static int WriteToDebugLogA(const char *szMsg) {
+static int WriteToDebugLogA(const char *szMsg)
+{
int res = 0;
if (ServiceExists(MS_NETLIB_LOG))
@@ -127,52 +93,8 @@ int AddDebugLogMessageA(const char* fmt, ...)
return res;
}
-int AddDebugLogMessage(const TCHAR* fmt, ...) {
-
- int res;
- TCHAR tszText[MAX_DEBUG], tszFinal[MAX_DEBUG];
- char *szFinal;
- va_list va;
-
- va_start(va,fmt);
- mir_vsntprintf(tszText, SIZEOF(tszText), fmt, va);
- va_end(va);
-#ifdef MODULENAME
- mir_sntprintf(tszFinal, SIZEOF(tszFinal), _T("%s: %s"), MODULENAME, tszText);
-#else
- _tcsncpy(tszFinal, tszText, SIZEOF(tszFinal));
-#endif
-
-
- szFinal = mir_t2a(tszFinal);
-
- res = WriteToDebugLogA(szFinal);
- mir_free(szFinal);
-
- return res;
-}
-
-int AddErrorLogMessageA(const char* fmt, ...) {
-
- int res;
- char szText[MAX_DEBUG], szFinal[MAX_DEBUG];
- va_list va;
-
- va_start(va,fmt);
- mir_vsnprintf(szText, sizeof(szText), fmt, va);
- va_end(va);
-#ifdef MODULENAME
- mir_snprintf(szFinal, sizeof(szFinal), "%s: %s", MODULENAME, szText);
-#else
- strncpy(szFinal, szText, SIZEOF(szFinal));
-#endif
- res = WriteToDebugLogA(szFinal);
- MessageBoxA(NULL, szFinal, "Error", MB_OK|MB_ICONERROR);
-
- return res;
-}
-
-int AddErrorLogMessage(const TCHAR* fmt, ...) {
+int AddDebugLogMessage(const TCHAR* fmt, ...)
+{
int res;
TCHAR tszText[MAX_DEBUG], tszFinal[MAX_DEBUG];
@@ -192,20 +114,18 @@ int AddErrorLogMessage(const TCHAR* fmt, ...) {
szFinal = mir_t2a(tszFinal);
res = WriteToDebugLogA(szFinal);
- MessageBoxA(NULL, szFinal, "Error", MB_OK|MB_ICONERROR);
mir_free(szFinal);
return res;
}
-
-//
int ttoi(TCHAR *string)
{
return ( string == NULL) ? 0 : _ttoi( string );
}
-TCHAR *itot(int num) {
+TCHAR *itot(int num)
+{
char tRes[32];
diff --git a/plugins/helpers/gen_helpers.h b/plugins/helpers/gen_helpers.h
index 29c1dafbf7..c4c46dc6bd 100644
--- a/plugins/helpers/gen_helpers.h
+++ b/plugins/helpers/gen_helpers.h
@@ -19,16 +19,10 @@
#ifndef __GEN_HELPERS_H
#define __GEN_HELPERS_H
-char *Hlp_GetProtocolNameA(const char *proto);
TCHAR *Hlp_GetProtocolName(const char *proto);
-
-char *Hlp_GetDlgItemTextA(HWND hwndDlg, int nIDDlgItem);
TCHAR *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem);
-char *Hlp_GetWindowTextA(HWND hwndDlg);
TCHAR *Hlp_GetWindowText(HWND hwndDlg);
-char* u2a( wchar_t* src );
-wchar_t* a2u( char* src );
int ttoi(TCHAR *string);
TCHAR *itot(int num);
@@ -36,9 +30,6 @@ TCHAR *itot(int num);
#define __LOGLEVEL_DEBUG 10
#define __LOGLEVEL_INFO 9
-#define __LOGLEVEL_WARN 8
-#define __LOGLEVEL_ERROR 7
-#define __LOGLEVEL_FATAL 6
#ifndef LOGLEVEL
#ifdef _DEBUG
@@ -50,8 +41,6 @@ TCHAR *itot(int num);
int AddDebugLogMessageA(const char* fmt, ...);
int AddDebugLogMessage(const TCHAR* fmt, ...);
-int AddErrorLogMessageA(const char* fmt, ...);
-int AddErrorLogMessage(const TCHAR* fmt, ...);
#if LOGLEVEL >= __LOGLEVEL_DEBUG
#define log_debugA AddDebugLogMessageA
@@ -69,28 +58,4 @@ static __inline int log_infoA(const char* fmt, ...) { return 0; }
static __inline int log_info(const TCHAR* fmt, ...) { return 0; }
#endif
-#if LOGLEVEL >= __LOGLEVEL_WARN
-#define log_warnA AddDebugLogMessageA
-#define log_warn AddDebugLogMessage
-#else
-static __inline int log_warnA(const char* fmt, ...) { return 0; }
-static __inline int log_warn(const TCHAR* fmt, ...) { return 0; }
-#endif
-
-#if LOGLEVEL >= __LOGLEVEL_ERROR
-#define log_errorA AddErrorLogMessageA
-#define log_error AddErrorLogMessage
-#else
-static __inline int log_errorA(const char* fmt, ...) { return 0; }
-static __inline int log_error(const TCHAR* fmt, ...) { return 0; }
-#endif
-
-#if LOGLEVEL >= __LOGLEVEL_FATAL
-#define log_fatalA AddErrorLogMessageA
-#define log_fatal AddErrorMessage
-#else
-static __inline int log_fatalA(const char* fmt, ...) { return 0; }
-static __inline int log_fatal(const TCHAR* fmt, ...) { return 0; }
-#endif
-
#endif