From 353c79463614e291eb37e629e8b0d1cb9c58d8e8 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 28 Sep 2010 18:15:02 +0300 Subject: code cleanup --- utilities.cpp | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index 3ab2e28..ebe8751 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -90,55 +90,3 @@ char *date() d[9]=tmp[5]; return d; } - - -void HistoryLog(HANDLE hContact, char *data, int event_type, int flags) -{ - DBEVENTINFO Event = {0}; - Event.cbSize = sizeof(Event); - Event.szModule = szReplacerModuleName; - Event.eventType = event_type; - Event.flags = flags, DBEF_UTF; - Event.timestamp = (DWORD)time(NULL); - Event.cbBlob = strlen(data)+1; - Event.pBlob = (PBYTE)_strdup(data); - CallService(MS_DB_EVENT_ADD, (WPARAM)(HANDLE)hContact,(LPARAM)&Event); -} - -static int ControlAddStringUtf(HWND ctrl, DWORD msg, const TCHAR *szString) -{ - int item = -1; - item = SendMessage(ctrl, msg, 0, (LPARAM)szString); - return item; -} - -int ComboBoxAddStringUtf(HWND hCombo, const TCHAR *szString, DWORD data) -{ - int item = ControlAddStringUtf(hCombo, CB_ADDSTRING, szString); - SendMessage(hCombo, CB_SETITEMDATA, item, data); - - return item; -} - - - - -#define NEWTSTR_MALLOC(A) (A==NULL)?NULL:strcpy((char*)mir_alloc(sizeof(char)*(strlen(A)+1)),A) - -const bool StriStr(const char *str, const char *substr) -{ - bool i = false; - char *str_up = NEWTSTR_MALLOC(str); - char *substr_up = NEWTSTR_MALLOC(substr); - - CharUpperBuffA(str_up, strlen(str_up)); - CharUpperBuffA(substr_up, strlen(substr_up)); - - if(strstr (str_up, substr_up)) - i = true; - - mir_free(str_up); - mir_free(substr_up); - - return i; -} -- cgit v1.2.3