From 25221b7d2afb70f82eb3805330fd39a6f6708049 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jun 2012 23:41:55 +0000 Subject: mk: removed all LIST_INTERFACE, MI_INTERFACE & UTF8_INTERFACE instances. all related functions moved to mir_core. git-svn-id: http://svn.miranda-ng.org/main/trunk@644 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/main.cpp | 5 ----- plugins/Variables/tokenregister.cpp | 18 ++++++++---------- plugins/Variables/variables.cpp | 18 ------------------ 3 files changed, 8 insertions(+), 33 deletions(-) (limited to 'plugins/Variables') diff --git a/plugins/Variables/main.cpp b/plugins/Variables/main.cpp index ae3125ed91..6db64cf7ef 100644 --- a/plugins/Variables/main.cpp +++ b/plugins/Variables/main.cpp @@ -20,8 +20,6 @@ #include "buildnumber.h" HINSTANCE hInst; -struct MM_INTERFACE mmi; -struct LIST_INTERFACE li; PLUGINLINK *pluginLink; DWORD g_mirandaVersion; int hLangpack = 0; @@ -85,9 +83,6 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) pluginLink = link; if (UnicodeCheck(pluginInfoEx.shortName, FALSE)) return 0; - - mir_getMMI( &mmi ); - mir_getLI( &li ); mir_getLP( &pluginInfoEx ); hExitHook = HookEvent(ME_SYSTEM_OKTOEXIT, Exit); diff --git a/plugins/Variables/tokenregister.cpp b/plugins/Variables/tokenregister.cpp index 54a40a5147..50c81ddad8 100644 --- a/plugins/Variables/tokenregister.cpp +++ b/plugins/Variables/tokenregister.cpp @@ -18,8 +18,6 @@ */ #include "variables.h" -extern struct LIST_INTERFACE li; - typedef struct { TOKENREGISTEREX tr; DWORD nameHash; @@ -50,7 +48,7 @@ static TokenRegisterEntry* FindTokenRegisterByName(TCHAR *name) temp.nameHash = NameHashFunction( name ); if ( List_GetIndex(( SortedList* )&tokens, &temp, &idx )) return tokens.items[ idx ]; - + return NULL; } @@ -68,12 +66,12 @@ int registerIntToken(TCHAR *szToken, TCHAR *(*parseFunction)(ARGUMENTSINFO *ai), } int deRegisterToken(TCHAR *token) { - + TokenRegisterEntry *tre; - + if (token == NULL) { return -1; - } + } EnterCriticalSection(&csRegister); tre = FindTokenRegisterByName( token ); if ( tre == NULL ) { @@ -131,7 +129,7 @@ INT_PTR registerToken(WPARAM wParam, LPARAM lParam) memcpy( &tre->tr, newVr, newVr->cbSize ); tre->nameHash = hash; - if ( !_tcscmp( newVr->tszTokenString, _T("alias"))) + if ( !_tcscmp( newVr->tszTokenString, _T("alias"))) log_debugA("alias"); if ( !( newVr->flags & TRF_PARSEFUNC ) && newVr->szService != NULL ) @@ -182,7 +180,7 @@ TCHAR *parseFromRegister(ARGUMENTSINFO *ai) int callRes; TCHAR *temp, *res; TOKENREGISTEREX *thisVr, trCopy; - + if ( (ai == NULL) || (ai->argc == 0) || (ai->targv[0] == NULL)) { return NULL; } @@ -206,7 +204,7 @@ TCHAR *parseFromRegister(ARGUMENTSINFO *ai) // unicode variables calls a non-unicode plugin unsigned int j; ARGUMENTSINFO cAi; - + memcpy(&cAi, ai, sizeof(ARGUMENTSINFO)); cAi.argv = ( char** )malloc(ai->argc*sizeof(char *)); for ( j=0; j < ai->argc; j++ ) @@ -257,7 +255,7 @@ TCHAR *parseFromRegister(ARGUMENTSINFO *ai) TOKENREGISTEREX* getTokenRegister( int i ) { TOKENREGISTEREX *retVr; - + EnterCriticalSection(&csRegister); retVr = ( i >= tokens.count || i < 0 ) ? NULL : &tokens.items[i]->tr; LeaveCriticalSection( &csRegister ); diff --git a/plugins/Variables/variables.cpp b/plugins/Variables/variables.cpp index 26190fb779..acc5f90a26 100644 --- a/plugins/Variables/variables.cpp +++ b/plugins/Variables/variables.cpp @@ -534,23 +534,6 @@ static INT_PTR freeMemory(WPARAM wParam, LPARAM lParam) { return 0; } -/* - MS_VARS_GET_MMI - this code is copied from Miranda's core (miranda.c) -*/ -INT_PTR getMemoryManagerInterface(WPARAM wParam, LPARAM lParam) { - - struct MM_INTERFACE *mmi = (struct MM_INTERFACE*) lParam; - if (mmi || mmi->cbSize == sizeof(struct MM_INTERFACE)) - { - mmi->mmi_malloc = malloc; - mmi->mmi_realloc = realloc; - mmi->mmi_free = free; - return 0; - } - return 1; -} - int setParseOptions(struct ParseOptions *po) { if (po == NULL) { @@ -580,7 +563,6 @@ int LoadVarModule() { hFormatStringService = CreateServiceFunction(MS_VARS_FORMATSTRING, formatStringService); hFreeMemoryService = CreateServiceFunction(MS_VARS_FREEMEMORY, freeMemory); hRegisterVariableService = CreateServiceFunction(MS_VARS_REGISTERTOKEN, registerToken); - hGetMMIService = CreateServiceFunction(MS_VARS_GET_MMI, getMemoryManagerInterface); // help dialog hCurSplitNS = LoadCursor(NULL, IDC_SIZENS); hUxTheme = NULL; -- cgit v1.2.3