summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mmap_SA
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mmap_SA')
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/main.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/commonheaders.h3
-rw-r--r--plugins/Dbx_mmap_SA/dbcontacts.cpp14
-rw-r--r--plugins/Dbx_mmap_SA/dbmodulechain.cpp16
-rw-r--r--plugins/Dbx_mmap_SA/dbpreset.cpp20
-rw-r--r--plugins/Dbx_mmap_SA/dbsettings.cpp28
-rw-r--r--plugins/Dbx_mmap_SA/init.cpp6
7 files changed, 39 insertions, 52 deletions
diff --git a/plugins/Dbx_mmap_SA/Import_SA/main.cpp b/plugins/Dbx_mmap_SA/Import_SA/main.cpp
index 331984958a..ed83861e0f 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/main.cpp
+++ b/plugins/Dbx_mmap_SA/Import_SA/main.cpp
@@ -46,8 +46,6 @@ INT_PTR CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPara
HINSTANCE hInst;
PLUGINLINK *pluginLink;
static HWND hwndWizard = NULL;
-struct MM_INTERFACE mmi;
-struct UTF8_INTERFACE utfi;
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -131,8 +129,6 @@ static int OnExit(WPARAM wParam, LPARAM lParam)
extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
{
pluginLink = link;
- mir_getMMI( &mmi );
- mir_getUTFI( &utfi );
mir_getLP( &pluginInfo );
hImportService = CreateServiceFunction(IMPORT_SERVICE, ImportCommand);
diff --git a/plugins/Dbx_mmap_SA/commonheaders.h b/plugins/Dbx_mmap_SA/commonheaders.h
index 065fc3ab3e..8596e60821 100644
--- a/plugins/Dbx_mmap_SA/commonheaders.h
+++ b/plugins/Dbx_mmap_SA/commonheaders.h
@@ -62,9 +62,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern PLUGINLINK *pluginLink;
-extern struct MM_INTERFACE memoryManagerInterface;
-extern struct LIST_INTERFACE li;
-
extern CRITICAL_SECTION csDbAccess;
extern struct DBHeader dbHeader;
extern HANDLE hDbFile;
diff --git a/plugins/Dbx_mmap_SA/dbcontacts.cpp b/plugins/Dbx_mmap_SA/dbcontacts.cpp
index 51e533266d..0afd3469ab 100644
--- a/plugins/Dbx_mmap_SA/dbcontacts.cpp
+++ b/plugins/Dbx_mmap_SA/dbcontacts.cpp
@@ -62,8 +62,8 @@ DBCachedContactValueList* AddToCachedContactList(HANDLE hContact, int index)
DBCachedContactValueList* VL;
VL = (DBCachedContactValueList*)HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedContactValueList));
VL->hContact = hContact;
- if (index == -1) li.List_GetIndex(&lContacts,VL,&index);
- li.List_Insert(&lContacts,VL,index);
+ if (index == -1) List_GetIndex(&lContacts,VL,&index);
+ List_Insert(&lContacts,VL,index);
return VL;
}
@@ -115,7 +115,7 @@ static INT_PTR FindNextContact(WPARAM wParam,LPARAM lParam)
VLtemp.hContact = (HANDLE)wParam;
EnterCriticalSection(&csDbAccess);
while(VLtemp.hContact) {
- if ( li.List_GetIndex(&lContacts,&VLtemp,&index)) {
+ if ( List_GetIndex(&lContacts,&VLtemp,&index)) {
VL = ( DBCachedContactValueList* )lContacts.items[index];
if (VL->hNext != NULL) {
if (!lParam || CheckProto(VL->hNext,(const char*)lParam)) {
@@ -174,7 +174,7 @@ static INT_PTR DeleteContact(WPARAM wParam,LPARAM lParam)
{ DBCachedContactValueList VLtemp;
VLtemp.hContact = (HANDLE)wParam;
- if ( li.List_GetIndex(&lContacts,&VLtemp,&index))
+ if ( List_GetIndex(&lContacts,&VLtemp,&index))
{
DBCachedContactValueList *VL = ( DBCachedContactValueList* )lContacts.items[index];
DBCachedContactValue* V = VL->first;
@@ -188,7 +188,7 @@ static INT_PTR DeleteContact(WPARAM wParam,LPARAM lParam)
if (VLtemp.hContact == hLastCachedContact)
hLastCachedContact = NULL;
- li.List_Remove(&lContacts,index);
+ List_Remove(&lContacts,index);
} }
dbc=(struct DBContact*)DBRead(wParam,sizeof(struct DBContact),NULL);
@@ -229,7 +229,7 @@ static INT_PTR DeleteContact(WPARAM wParam,LPARAM lParam)
{
DBCachedContactValueList VLtemp;
VLtemp.hContact = (HANDLE)ofsThis;
- if ( li.List_GetIndex(&lContacts,&VLtemp,&index))
+ if ( List_GetIndex(&lContacts,&VLtemp,&index))
{
DBCachedContactValueList *VL = ( DBCachedContactValueList* )lContacts.items[index];
VL->hNext = ( HANDLE )ofsNext;
@@ -285,7 +285,7 @@ static INT_PTR IsDbContact(WPARAM wParam,LPARAM lParam)
int index;
DBCachedContactValueList VLtemp;
VLtemp.hContact = (HANDLE)wParam;
- if ( li.List_GetIndex(&lContacts,&VLtemp,&index))
+ if ( List_GetIndex(&lContacts,&VLtemp,&index))
ret = TRUE;
else {
dbc=(struct DBContact*)DBRead(ofsContact,sizeof(struct DBContact),NULL);
diff --git a/plugins/Dbx_mmap_SA/dbmodulechain.cpp b/plugins/Dbx_mmap_SA/dbmodulechain.cpp
index 62d0b6b3c7..cc73248182 100644
--- a/plugins/Dbx_mmap_SA/dbmodulechain.cpp
+++ b/plugins/Dbx_mmap_SA/dbmodulechain.cpp
@@ -50,15 +50,15 @@ void AddToList(char *name, DWORD len, DWORD ofs)
mn->name = name;
mn->ofs = ofs;
- if (li.List_GetIndex(&lMods,mn,&index))
+ if (List_GetIndex(&lMods,mn,&index))
DatabaseCorruption( _T("%s (Module Name not unique)"));
- li.List_Insert(&lMods,mn,index);
+ List_Insert(&lMods,mn,index);
- if (li.List_GetIndex(&lOfs,mn,&index))
+ if (List_GetIndex(&lOfs,mn,&index))
DatabaseCorruption( _T("%s (Module Offset not unique)"));
- li.List_Insert(&lOfs,mn,index);
+ List_Insert(&lOfs,mn,index);
}
@@ -98,8 +98,8 @@ int InitModuleNames(void)
void UninitModuleNames(void)
{
HeapDestroy(hModHeap);
- li.List_Destroy(&lMods);
- li.List_Destroy(&lOfs);
+ List_Destroy(&lMods);
+ List_Destroy(&lOfs);
}
static DWORD FindExistingModuleNameOfs(const char *szName)
@@ -114,7 +114,7 @@ static DWORD FindExistingModuleNameOfs(const char *szName)
if (lastmn && ModCompare(&mn,lastmn) == 0)
return lastmn->ofs;
- if (li.List_GetIndex(&lMods,&mn,&index)) {
+ if (List_GetIndex(&lMods,&mn,&index)) {
pmn = (ModuleName*)lMods.items[index];
lastmn = pmn;
return pmn->ofs;
@@ -168,7 +168,7 @@ char *GetModuleNameByOfs(DWORD ofs)
mn.name = NULL;
mn.ofs = ofs;
- if (li.List_GetIndex(&lOfs,&mn,&index)) {
+ if (List_GetIndex(&lOfs,&mn,&index)) {
pmn = (ModuleName*)lOfs.items[index];
lastmn = pmn;
return pmn->name;
diff --git a/plugins/Dbx_mmap_SA/dbpreset.cpp b/plugins/Dbx_mmap_SA/dbpreset.cpp
index 3bf17a298e..9e04f56353 100644
--- a/plugins/Dbx_mmap_SA/dbpreset.cpp
+++ b/plugins/Dbx_mmap_SA/dbpreset.cpp
@@ -64,7 +64,7 @@ int InitPreset()
// no preset
if (!fp) return 0;
- lstPresets = li.List_Create(0, 50);
+ lstPresets = List_Create(0, 50);
lstPresets->sortFunc = (FSortFunc)DBPresetItem_Cmp;
while(!feof(fp))
@@ -99,31 +99,31 @@ int InitPreset()
case 'B':
item = DBPresetItem_Create(szSection, szName, DBVT_BYTE);
item->dbv.bVal = (BYTE)strtol(szValue+1,NULL,0);
- li.List_InsertPtr(lstPresets, item);
+ List_InsertPtr(lstPresets, item);
break;
case 'w':
case 'W':
item = DBPresetItem_Create(szSection, szName, DBVT_WORD);
item->dbv.wVal = (WORD)strtol(szValue+1,NULL,0);
- li.List_InsertPtr(lstPresets, item);
+ List_InsertPtr(lstPresets, item);
break;
case 'd':
case 'D':
item = DBPresetItem_Create(szSection, szName, DBVT_DWORD);
item->dbv.dVal = (DWORD)strtoul(szValue+1,NULL,0);
- li.List_InsertPtr(lstPresets, item);
+ List_InsertPtr(lstPresets, item);
break;
case 's':
case 'S':
item = DBPresetItem_Create(szSection, szName, DBVT_ASCIIZ);
item->dbv.pszVal = mir_strdup(szValue+1);
- li.List_InsertPtr(lstPresets, item);
+ List_InsertPtr(lstPresets, item);
break;
case 'u':
case 'U':
item = DBPresetItem_Create(szSection, szName, DBVT_UTF8);
item->dbv.pszVal = mir_strdup(szValue+1);
- li.List_InsertPtr(lstPresets, item);
+ List_InsertPtr(lstPresets, item);
break;
case 'n':
case 'N':
@@ -142,7 +142,7 @@ int InitPreset()
item = DBPresetItem_Create(szSection, szName, DBVT_BLOB);
item->dbv.pbVal = buf;
item->dbv.cpbVal = len;
- li.List_InsertPtr(lstPresets, item);
+ List_InsertPtr(lstPresets, item);
break;
}
}
@@ -159,7 +159,7 @@ void UninitPreset()
if (!lstPresets) return;
for (i = 0; i < lstPresets->realCount; ++i)
DBPresetItem_Destroy((DBPresetItem *)lstPresets->items[i]);
- li.List_Destroy(lstPresets);
+ List_Destroy(lstPresets);
}
int DBPreset_QuerySetting(const char *szModule, const char *szSetting, DBVARIANT *dbv, BOOL isStatic)
@@ -172,7 +172,7 @@ int DBPreset_QuerySetting(const char *szModule, const char *szSetting, DBVARIANT
search.szModule = (char *)szModule;
search.szSetting = (char *)szSetting;
DBPresetItem_Hash(&search);
- item = (DBPresetItem *)li.List_Find(lstPresets, &search);
+ item = (DBPresetItem *)List_Find(lstPresets, &search);
if (!item) return FALSE;
@@ -208,7 +208,7 @@ int DBPreset_CompareSetting(const char *szModule, const char *szSetting, DBVARIA
search.szModule = (char *)szModule;
search.szSetting = (char *)szSetting;
DBPresetItem_Hash(&search);
- item = (DBPresetItem *)li.List_Find(lstPresets, &search);
+ item = (DBPresetItem *)List_Find(lstPresets, &search);
if (!item) return FALSE;
if (item->dbv.type != item->dbv.type) return FALSE;
diff --git a/plugins/Dbx_mmap_SA/dbsettings.cpp b/plugins/Dbx_mmap_SA/dbsettings.cpp
index b34b7baba3..d8ad0e643e 100644
--- a/plugins/Dbx_mmap_SA/dbsettings.cpp
+++ b/plugins/Dbx_mmap_SA/dbsettings.cpp
@@ -68,7 +68,7 @@ static char* InsertCachedSetting( const char* szName, size_t cbNameLen, int inde
char* newValue = (char*)HeapAlloc( hCacheHeap, 0, cbNameLen );
*newValue = 0;
strcpy(newValue+1,szName+1);
- li.List_Insert(&lSettings,newValue,index);
+ List_Insert(&lSettings,newValue,index);
return newValue;
}
@@ -85,7 +85,7 @@ static char* GetCachedSetting(const char *szModuleName,const char *szSettingName
if (lastsetting && strcmp(szFullName+1,lastsetting) == 0)
return lastsetting;
- if (li.List_GetIndex(&lSettings,szFullName,&index))
+ if (List_GetIndex(&lSettings,szFullName,&index))
lastsetting = (char*)lSettings.items[index]+1;
else
lastsetting = InsertCachedSetting( szFullName, settingNameLen+moduleNameLen+3, index )+1;
@@ -133,11 +133,11 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo
if ( hContact == 0 ) {
DBCachedGlobalValue Vtemp, *V;
Vtemp.name = szSetting;
- if ( li.List_GetIndex(&lGlobalSettings,&Vtemp,&index)) {
+ if ( List_GetIndex(&lGlobalSettings,&Vtemp,&index)) {
V = (DBCachedGlobalValue*)lGlobalSettings.items[index];
if ( bAllocate == -1 ) {
FreeCachedVariant( &V->value );
- li.List_Remove(&lGlobalSettings,index);
+ List_Remove(&lGlobalSettings,index);
HeapFree(hCacheHeap,0,V);
return NULL;
} }
@@ -147,7 +147,7 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo
V = (DBCachedGlobalValue*)HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedGlobalValue));
V->name = szSetting;
- li.List_Insert(&lGlobalSettings,V,index);
+ List_Insert(&lGlobalSettings,V,index);
}
return &V->value;
@@ -162,7 +162,7 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo
else {
VLtemp.hContact=hContact;
- if ( !li.List_GetIndex(&lContacts,&VLtemp,&index))
+ if ( !List_GetIndex(&lContacts,&VLtemp,&index))
{
if ( bAllocate != 1 )
return NULL;
@@ -529,20 +529,20 @@ static INT_PTR SetSettingResident(WPARAM wParam, LPARAM lParam)
strcpy( szTemp+1, ( char* )lParam );
EnterCriticalSection(&csDbAccess);
- if ( !li.List_GetIndex( &lSettings, szTemp, &idx ))
+ if ( !List_GetIndex( &lSettings, szTemp, &idx ))
szSetting = InsertCachedSetting( szTemp, cbSettingNameLen, idx );
else
szSetting = (char *)lSettings.items[idx];
*szSetting = (char)wParam;
- if ( !li.List_GetIndex( &lResidentSettings, szSetting+1, &idx ))
+ if ( !List_GetIndex( &lResidentSettings, szSetting+1, &idx ))
{
if (wParam)
- li.List_Insert(&lResidentSettings,szSetting+1,idx);
+ List_Insert(&lResidentSettings,szSetting+1,idx);
}
else if (!wParam)
- li.List_Remove(&lResidentSettings,idx);
+ List_Remove(&lResidentSettings,idx);
LeaveCriticalSection(&csDbAccess);
}
@@ -1163,8 +1163,8 @@ int InitSettings(void)
void UninitSettings(void)
{
HeapDestroy(hCacheHeap);
- li.List_Destroy(&lContacts);
- li.List_Destroy(&lSettings);
- li.List_Destroy(&lGlobalSettings);
- li.List_Destroy(&lResidentSettings);
+ List_Destroy(&lContacts);
+ List_Destroy(&lSettings);
+ List_Destroy(&lGlobalSettings);
+ List_Destroy(&lResidentSettings);
}
diff --git a/plugins/Dbx_mmap_SA/init.cpp b/plugins/Dbx_mmap_SA/init.cpp
index afc8cba593..0f2cc52ca4 100644
--- a/plugins/Dbx_mmap_SA/init.cpp
+++ b/plugins/Dbx_mmap_SA/init.cpp
@@ -23,9 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
-struct MM_INTERFACE mmi;
-struct LIST_INTERFACE li;
-struct UTF8_INTERFACE utfi;
int hLangpack;
extern char szDbPath[MAX_PATH];
@@ -132,9 +129,6 @@ static int LoadDatabase( char * profile, void * plink )
pluginLink=link;
// set the memory, lists & UTF8 manager
- mir_getLI( &li );
- mir_getMMI( &mmi );
- mir_getUTFI( &utfi );
mir_getLP( &pluginInfo );
{ // Are we running under unicode Miranda core ?