From 0d489da11220c272765fcc64d390be6bb50ff87f Mon Sep 17 00:00:00 2001 From: sje Date: Fri, 27 Jul 2007 15:27:25 +0000 Subject: based on mmap git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@302 4f64403b-2f21-0410-a795-97e2b3489a10 --- db3x_autobackups/backup.c | 26 +- db3x_autobackups/commonheaders.h | 23 +- db3x_autobackups/database.c | 78 ++- db3x_autobackups/database.h | 31 +- db3x_autobackups/db3x.dep | 56 -- db3x_autobackups/db3x.dsp | 268 -------- db3x_autobackups/db3x.dsw | 29 - db3x_autobackups/db3x.mak | 471 ------------- db3x_autobackups/db3x.vcproj | 795 --------------------- db3x_autobackups/db3x_8.sln | 26 - db3x_autobackups/db3x_8.vcproj | 1023 ---------------------------- db3x_autobackups/db3x_mmap.dep | 20 + db3x_autobackups/db3x_mmap.dsp | 158 +++++ db3x_autobackups/db3x_mmap.dsw | 33 + db3x_autobackups/db3x_mmap.mak | 399 +++++++++++ db3x_autobackups/db3x_mmap.rc | 197 ++++++ db3x_autobackups/db3x_mmap.vcproj | 527 ++++++++++++++ db3x_autobackups/db3x_mmap_8.vcproj | 663 ++++++++++++++++++ db3x_autobackups/dbcache.c | 248 +++---- db3x_autobackups/dbcontacts.c | 73 +- db3x_autobackups/dbevents.c | 35 +- db3x_autobackups/dbheaders.c | 14 +- db3x_autobackups/dbmodulechain.c | 152 +++-- db3x_autobackups/dbsettings.c | 327 +++++---- db3x_autobackups/dbtime.c | 9 +- db3x_autobackups/docs/db3x-license.txt | 340 --------- db3x_autobackups/docs/db3x-readme.txt | 38 -- db3x_autobackups/docs/db3x-translation.txt | 43 -- db3x_autobackups/encrypt.c | 5 +- db3x_autobackups/init.c | 52 +- db3x_autobackups/options.c | 2 +- db3x_autobackups/resource.h | 42 +- db3x_autobackups/resource.rc | 250 +------ db3x_autobackups/sync.bat | 4 - db3x_autobackups/version.h | 3 + db3x_autobackups/version.rc | 39 ++ 36 files changed, 2629 insertions(+), 3870 deletions(-) delete mode 100644 db3x_autobackups/db3x.dep delete mode 100644 db3x_autobackups/db3x.dsp delete mode 100644 db3x_autobackups/db3x.dsw delete mode 100644 db3x_autobackups/db3x.mak delete mode 100644 db3x_autobackups/db3x.vcproj delete mode 100644 db3x_autobackups/db3x_8.sln delete mode 100644 db3x_autobackups/db3x_8.vcproj create mode 100644 db3x_autobackups/db3x_mmap.dep create mode 100644 db3x_autobackups/db3x_mmap.dsp create mode 100644 db3x_autobackups/db3x_mmap.dsw create mode 100644 db3x_autobackups/db3x_mmap.mak create mode 100644 db3x_autobackups/db3x_mmap.rc create mode 100644 db3x_autobackups/db3x_mmap.vcproj create mode 100644 db3x_autobackups/db3x_mmap_8.vcproj delete mode 100644 db3x_autobackups/docs/db3x-license.txt delete mode 100644 db3x_autobackups/docs/db3x-readme.txt delete mode 100644 db3x_autobackups/docs/db3x-translation.txt delete mode 100644 db3x_autobackups/sync.bat create mode 100644 db3x_autobackups/version.h create mode 100644 db3x_autobackups/version.rc diff --git a/db3x_autobackups/backup.c b/db3x_autobackups/backup.c index 8eb26da..92560d0 100644 --- a/db3x_autobackups/backup.c +++ b/db3x_autobackups/backup.c @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -#include "database.h" #include "options.h" #define SHOW_PROGRESS_TIME 1000 // show progress window when backup time exceeds this many milliseconds @@ -37,6 +36,8 @@ struct DBHeader dbHeader; UINT timer_id = 0; +void Map(); +void UnMap(); BOOL CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -153,34 +154,25 @@ int Backup() { EnterCriticalSection(&csDbAccess); + UnMap(); + file_size = GetFileSize(hDbFile, 0); if(file_size == 0) { + Map(); LeaveCriticalSection(&csDbAccess); CloseHandle(hBackupFile); DestroyWindow(progress_dialog); return 1; } - SetFilePointer(hDbFile, sizeof(dbHeader), 0, FILE_BEGIN); - - if(WriteFile(hBackupFile,&dbHeader,sizeof(dbHeader),&bytes_written,NULL) == TRUE) { - total_bytes_copied += bytes_written; - if(!options.disable_progress) { - SendMessage(prog, PBM_SETPOS, (WPARAM)(int)(100.0 * total_bytes_copied / file_size), 0); - UpdateWindow(progress_dialog); - } - } else { - LeaveCriticalSection(&csDbAccess); - CloseHandle(hBackupFile); - DestroyWindow(progress_dialog); - return 1; - } + SetFilePointer(hDbFile, 0, 0, FILE_BEGIN); while(ReadFile(hDbFile, buff, sizeof(buff), &bytes_read, 0) == TRUE && bytes_read > 0 && GetWindowLong(progress_dialog, GWL_USERDATA) == 0) { if(!WriteFile(hBackupFile, buff, bytes_read, &bytes_written, 0)) { + Map(); LeaveCriticalSection(&csDbAccess); CloseHandle(hBackupFile); DestroyWindow(progress_dialog); @@ -205,6 +197,7 @@ int Backup() { UpdateWindow(progress_dialog); } } + Map(); LeaveCriticalSection(&csDbAccess); CloseHandle(hBackupFile); @@ -220,7 +213,8 @@ int Backup() { return 0; } - DestroyWindow(progress_dialog); + if(!options.disable_progress) + DestroyWindow(progress_dialog); return 1; } diff --git a/db3x_autobackups/commonheaders.h b/db3x_autobackups/commonheaders.h index 4d4afad..521a985 100644 --- a/db3x_autobackups/commonheaders.h +++ b/db3x_autobackups/commonheaders.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2003 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2003 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -21,19 +21,21 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define MIRANDA_VER 0x0700 + #define _WIN32_WINNT 0x0501 #include +#include + #ifdef _DEBUG # define _ALPHA_BASE_ 1 // defined for CVS builds # define _ALPHA_FUSE_ 1 // defined for fuse powered core # define _CRTDBG_MAP_ALLOC # include -# include +//# include #endif -#include - #include #include #include @@ -43,17 +45,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include "resource.h" +#include "version.h" #include #include +#include #include #include #include +#include + +#include "database.h" extern PLUGINLINK *pluginLink; +extern struct MM_INTERFACE memoryManagerInterface; extern struct LIST_INTERFACE li; +extern CRITICAL_SECTION csDbAccess; +extern struct DBHeader dbHeader; +extern HANDLE hDbFile; + #ifdef __GNUC__ #define mir_i64(x) (x##LL) #else diff --git a/db3x_autobackups/database.c b/db3x_autobackups/database.c index d4c2215..f26289a 100644 --- a/db3x_autobackups/database.c +++ b/db3x_autobackups/database.c @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2003 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2003 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -21,7 +21,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -#include "database.h" + int ProfileManager(char *szDbDest,int cbDbDest); int ShouldAutoCreate(void); @@ -57,13 +57,17 @@ BOOL bUnloading=FALSE; static void UnloadDatabase(void) { + // update profile last modified time + DWORD bytesWritten; + SetFilePointer(hDbFile,0,NULL,FILE_BEGIN); + WriteFile(hDbFile,&dbSignature,1,&bytesWritten,NULL); + CloseHandle(hDbFile); } DWORD CreateNewSpace(int bytes) { DWORD ofsNew; - ofsNew=dbHeader.ofsFileEnd; dbHeader.ofsFileEnd+=bytes; DBWrite(0,&dbHeader,sizeof(dbHeader)); @@ -73,27 +77,34 @@ DWORD CreateNewSpace(int bytes) void DeleteSpace(DWORD ofs,int bytes) { - PBYTE buf; - log2("deletespace %d@%08x",bytes,ofs); + if (ofs+bytes == dbHeader.ofsFileEnd) { + log2("freespace %d@%08x",bytes,ofs); + dbHeader.ofsFileEnd=ofs; + } else { + log2("deletespace %d@%08x",bytes,ofs); + dbHeader.slackSpace+=bytes; + } + DBWrite(0,&dbHeader,sizeof(dbHeader)); + DBFill(ofs,bytes); +} - // reclaim a little space - will result in e.g. multiple db events with the same handle! -#ifdef DB_RECLAIM - if(ofs + bytes == dbHeader.ofsFileEnd) { - dbHeader.ofsFileEnd-=bytes; +DWORD ReallocSpace(DWORD ofs,int oldSize,int newSize) +{ + DWORD ofsNew; + + if (oldSize >= newSize) return ofs; + + if (ofs+oldSize == dbHeader.ofsFileEnd) { + ofsNew = ofs; + dbHeader.ofsFileEnd+=newSize-oldSize; DBWrite(0,&dbHeader,sizeof(dbHeader)); - // shrink file - SetFilePointer(hDbFile, dbHeader.ofsFileEnd, 0, FILE_BEGIN); - SetEndOfFile(hDbFile); - return; + log3("adding newspace %d@%08x+%d",newSize,ofsNew,oldSize); + } else { + ofsNew=CreateNewSpace(newSize); + DBMoveChunk(ofsNew,ofs,oldSize); + DeleteSpace(ofs,oldSize); } -#endif - - dbHeader.slackSpace+=bytes; - DBWrite(0,&dbHeader,sizeof(dbHeader)); - buf=(PBYTE)mir_alloc(bytes); - memset(buf,0,bytes); - DBWrite(ofs,buf,bytes); - mir_free(buf); + return ofsNew; } void UnloadDatabaseModule(void) @@ -165,21 +176,34 @@ int LoadDatabaseModule(void) CreateServiceFunction(MS_DB_GETPROFILEPATH,GetProfilePath); if(InitOptions()) return 1; - return 0; } static DWORD DatabaseCorrupted=0; +static char *msg = NULL; +static DWORD dwErr = 0; void __cdecl dbpanic(void *arg) { - - MessageBox(0,Translate("Miranda has detected corruption in your database. This corruption maybe fixed by DBTool. Please download it from http://www.miranda-im.org. Miranda will now shutdown."),Translate("Database Panic"),MB_SETFOREGROUND|MB_TOPMOST|MB_APPLMODAL|MB_ICONWARNING|MB_OK); + if (msg) + { + char err[256]; + + if (dwErr==ERROR_DISK_FULL) + msg = Translate("Disk is full. Miranda will now shutdown."); + + mir_snprintf(err, sizeof(err), msg, Translate("Database failure. Miranda will now shutdown."), dwErr); + + MessageBox(0,err,Translate("Database Error"),MB_SETFOREGROUND|MB_TOPMOST|MB_APPLMODAL|MB_ICONWARNING|MB_OK); + } + else + MessageBox(0,Translate("Miranda has detected corruption in your database. This corruption maybe fixed by DBTool. Please download it from http://www.miranda-im.org. Miranda will now shutdown."), + Translate("Database Panic"),MB_SETFOREGROUND|MB_TOPMOST|MB_APPLMODAL|MB_ICONWARNING|MB_OK); TerminateProcess(GetCurrentProcess(),255); return; } -void DatabaseCorruption(void) +void DatabaseCorruption(char *text) { int kill=0; @@ -187,6 +211,8 @@ void DatabaseCorruption(void) if (DatabaseCorrupted==0) { DatabaseCorrupted++; kill++; + msg = text; + dwErr = GetLastError(); } else { /* db is already corrupted, someone else is dealing with it, wait here so that we don't do any more damage */ diff --git a/db3x_autobackups/database.h b/db3x_autobackups/database.h index 3e09949..67ed205 100644 --- a/db3x_autobackups/database.h +++ b/db3x_autobackups/database.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2003 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2003 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -47,10 +47,17 @@ DBHeader \--> ... */ -#define DB_RESIZE_GRANULARITY 16384 +//#define DB_RESIZE_GRANULARITY 16384 #define DB_THIS_VERSION 0x00000700u #define DB_SETTINGS_RESIZE_GRANULARITY 128 +struct DBSignature { + char name[15]; + BYTE eof; +}; + +static struct DBSignature dbSignature={"Miranda ICQ DB",0x1A}; + #include struct DBHeader { BYTE signature[16]; // 'Miranda ICQ DB',0,26 @@ -167,19 +174,21 @@ typedef struct HANDLE hContact; HANDLE hNext; DBCachedContactValue* first; + DBCachedContactValue* last; } DBCachedContactValueList; - -//databasecorruption: called if any signatures are broken. very very fatal -void DatabaseCorruption(void); +//databasecorruption: with NULL called if any signatures are broken. very very fatal +void DatabaseCorruption(char *text); PBYTE DBRead(DWORD ofs,int bytesRequired,int *bytesAvail); //any preview result could be invalidated by the next call void DBWrite(DWORD ofs,PVOID pData,int count); +void DBFill(DWORD ofs,int bytes); void DBFlush(int setting); void DBMoveChunk(DWORD ofsDest,DWORD ofsSource,int bytes); DWORD CreateNewSpace(int bytes); void DeleteSpace(DWORD ofs,int bytes); -int GetProfileDirectory(char *szPath,int cbPath); +DWORD ReallocSpace(DWORD ofs,int oldSize,int newSize); +//void GetProfileDirectory(char *szPath,int cbPath); int GetDefaultProfilePath(char *szPath,int cbPath,int *specified); int ShouldShowProfileManager(void); int CheckDbHeaders(struct DBHeader * hdr); @@ -187,11 +196,9 @@ int CreateDbHeaders(HANDLE hFile); int LoadDatabaseModule(void); void UnloadDatabaseModule(void); -#ifdef _DEBUG -#define MAXCACHEDREADSIZE 512 -#else -#define MAXCACHEDREADSIZE 2048 //push it to 1K //technically 4096 would work, but I'm not going to push it -#endif +#define MAXCACHEDREADSIZE 65536 + +//#define DBLOGGING #ifdef _DEBUG //#define DBLOGGING diff --git a/db3x_autobackups/db3x.dep b/db3x_autobackups/db3x.dep deleted file mode 100644 index 20d2e5d..0000000 --- a/db3x_autobackups/db3x.dep +++ /dev/null @@ -1,56 +0,0 @@ -# Microsoft Developer Studio Generated Dependency File, included by db3x.mak - -.\commonheaders.c : \ - "..\..\include\m_database.h"\ - "..\..\include\m_langpack.h"\ - "..\..\include\m_plugins.h"\ - "..\..\include\m_system.h"\ - "..\..\include\newpluginapi.h"\ - "..\..\include\win2k.h"\ - ".\commonheaders.h"\ - - -.\database.c : \ - "..\..\include\m_plugins.h"\ - ".\database.h"\ - - -.\dbcache.c : \ - "..\..\include\m_plugins.h"\ - ".\database.h"\ - - -.\dbcontacts.c : \ - "..\..\include\m_plugins.h"\ - ".\database.h"\ - - -.\dbevents.c : \ - "..\..\include\m_plugins.h"\ - ".\database.h"\ - - -.\dbheaders.c : \ - "..\..\include\m_plugins.h"\ - ".\database.h"\ - - -.\dbmodulechain.c : \ - "..\..\include\m_plugins.h"\ - ".\database.h"\ - - -.\dbsettings.c : \ - "..\..\include\m_plugins.h"\ - ".\database.h"\ - - -.\encrypt.c : \ - "..\..\include\m_plugins.h"\ - ".\database.h"\ - - -.\init.c : \ - "..\..\include\m_plugins.h"\ - ".\database.h"\ - diff --git a/db3x_autobackups/db3x.dsp b/db3x_autobackups/db3x.dsp deleted file mode 100644 index a2f0d44..0000000 --- a/db3x_autobackups/db3x.dsp +++ /dev/null @@ -1,268 +0,0 @@ -# Microsoft Developer Studio Project File - Name="db3x" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=db3x - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "db3x.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "db3x.mak" CFG="db3x - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "db3x - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "db3x - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName ""$/Miranda/miranda/plugins/db3x", WKIAAAAA" -# PROP Scc_LocalPath "." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "db3x - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x5130000" /dll /pdb:none /machine:I386 /out:"dbx\dbx_3xA.dll" /IGNORE:4089 -# SUBTRACT LINK32 /map /debug - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr /Yu"commonheaders.h" /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /map /debug /machine:I386 /out:"../../bin/debug/plugins/dbx_3x.dll" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none /incremental:no - -!ENDIF - -# Begin Target - -# Name "db3x - Win32 Release" -# Name "db3x - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\backup.c -# End Source File -# Begin Source File - -SOURCE=.\commonheaders.c -# ADD CPP /Yc"commonheaders.h" -# End Source File -# Begin Source File - -SOURCE=.\database.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -# ADD CPP /Yu"commonheaders.h" - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\dbcache.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -# ADD CPP /Yu"commonheaders.h" - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\dbcontacts.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -# ADD CPP /Yu"commonheaders.h" - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\dbevents.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -# ADD CPP /Yu"commonheaders.h" - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\dbheaders.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -# ADD CPP /Yu"commonheaders.h" - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\dbmodulechain.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -# ADD CPP /Yu"commonheaders.h" - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\dbsettings.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -# ADD CPP /Yu"commonheaders.h" - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\dbtime.c -# End Source File -# Begin Source File - -SOURCE=.\encrypt.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -# ADD CPP /Yu"commonheaders.h" - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\finalcommand.c -# End Source File -# Begin Source File - -SOURCE=.\init.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -# ADD CPP /Yu"commonheaders.h" - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\options.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\commonheaders.h -# End Source File -# Begin Source File - -SOURCE=.\database.h -# End Source File -# Begin Source File - -SOURCE=.\encryption.h -# End Source File -# Begin Source File - -SOURCE=.\options.h -# End Source File -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\resource.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/db3x_autobackups/db3x.dsw b/db3x_autobackups/db3x.dsw deleted file mode 100644 index 0f90f8d..0000000 --- a/db3x_autobackups/db3x.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "db3x"=.\db3x.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/db3x_autobackups/db3x.mak b/db3x_autobackups/db3x.mak deleted file mode 100644 index faade4a..0000000 --- a/db3x_autobackups/db3x.mak +++ /dev/null @@ -1,471 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on db3x.dsp -!IF "$(CFG)" == "" -CFG=db3x - Win32 Debug -!MESSAGE No configuration specified. Defaulting to db3x - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "db3x - Win32 Release" && "$(CFG)" != "db3x - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "db3x.mak" CFG="db3x - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "db3x - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "db3x - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "db3x - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release - -ALL : "..\..\bin\release\plugins\dbx_3x.dll" - - -CLEAN : - -@erase "$(INTDIR)\commonheaders.obj" - -@erase "$(INTDIR)\database.obj" - -@erase "$(INTDIR)\db3x.pch" - -@erase "$(INTDIR)\dbcache.obj" - -@erase "$(INTDIR)\dbcontacts.obj" - -@erase "$(INTDIR)\dbevents.obj" - -@erase "$(INTDIR)\dbheaders.obj" - -@erase "$(INTDIR)\dbmodulechain.obj" - -@erase "$(INTDIR)\dbsettings.obj" - -@erase "$(INTDIR)\encrypt.obj" - -@erase "$(INTDIR)\init.obj" - -@erase "$(INTDIR)\resource.res" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\vc60.pdb" - -@erase "$(OUTDIR)\dbx_3x.exp" - -@erase "$(OUTDIR)\dbx_3x.lib" - -@erase "$(OUTDIR)\dbx_3x.map" - -@erase "$(OUTDIR)\dbx_3x.pdb" - -@erase "..\..\bin\release\plugins\dbx_3x.dll" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 -RSC_PROJ=/l 0x809 /fo"$(INTDIR)\resource.res" /d "NDEBUG" -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\db3x.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x5130000" /dll /incremental:no /pdb:"$(OUTDIR)\dbx_3x.pdb" /map:"$(INTDIR)\dbx_3x.map" /debug /machine:I386 /out:"../../bin/release/plugins/dbx_3x.dll" /implib:"$(OUTDIR)\dbx_3x.lib" /IGNORE:4089 -LINK32_OBJS= \ - "$(INTDIR)\commonheaders.obj" \ - "$(INTDIR)\database.obj" \ - "$(INTDIR)\dbcache.obj" \ - "$(INTDIR)\dbcontacts.obj" \ - "$(INTDIR)\dbevents.obj" \ - "$(INTDIR)\dbheaders.obj" \ - "$(INTDIR)\dbmodulechain.obj" \ - "$(INTDIR)\dbsettings.obj" \ - "$(INTDIR)\encrypt.obj" \ - "$(INTDIR)\init.obj" \ - "$(INTDIR)\resource.res" - -"..\..\bin\release\plugins\dbx_3x.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\Debug -# End Custom Macros - -ALL : "..\..\bin\debug\plugins\dbx_3x.dll" "$(OUTDIR)\db3x.bsc" - - -CLEAN : - -@erase "$(INTDIR)\commonheaders.obj" - -@erase "$(INTDIR)\commonheaders.sbr" - -@erase "$(INTDIR)\database.obj" - -@erase "$(INTDIR)\database.sbr" - -@erase "$(INTDIR)\db3x.pch" - -@erase "$(INTDIR)\dbcache.obj" - -@erase "$(INTDIR)\dbcache.sbr" - -@erase "$(INTDIR)\dbcontacts.obj" - -@erase "$(INTDIR)\dbcontacts.sbr" - -@erase "$(INTDIR)\dbevents.obj" - -@erase "$(INTDIR)\dbevents.sbr" - -@erase "$(INTDIR)\dbheaders.obj" - -@erase "$(INTDIR)\dbheaders.sbr" - -@erase "$(INTDIR)\dbmodulechain.obj" - -@erase "$(INTDIR)\dbmodulechain.sbr" - -@erase "$(INTDIR)\dbsettings.obj" - -@erase "$(INTDIR)\dbsettings.sbr" - -@erase "$(INTDIR)\encrypt.obj" - -@erase "$(INTDIR)\encrypt.sbr" - -@erase "$(INTDIR)\init.obj" - -@erase "$(INTDIR)\init.sbr" - -@erase "$(INTDIR)\resource.res" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\vc60.pdb" - -@erase "$(OUTDIR)\db3x.bsc" - -@erase "$(OUTDIR)\dbx_3x.exp" - -@erase "$(OUTDIR)\dbx_3x.lib" - -@erase "$(OUTDIR)\dbx_3x.map" - -@erase "$(OUTDIR)\dbx_3x.pdb" - -@erase "..\..\bin\debug\plugins\dbx_3x.dll" - -@erase "..\..\bin\debug\plugins\dbx_3x.ilk" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c -MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 -RSC_PROJ=/l 0x809 /fo"$(INTDIR)\resource.res" /d "_DEBUG" -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\db3x.bsc" -BSC32_SBRS= \ - "$(INTDIR)\commonheaders.sbr" \ - "$(INTDIR)\database.sbr" \ - "$(INTDIR)\dbcache.sbr" \ - "$(INTDIR)\dbcontacts.sbr" \ - "$(INTDIR)\dbevents.sbr" \ - "$(INTDIR)\dbheaders.sbr" \ - "$(INTDIR)\dbmodulechain.sbr" \ - "$(INTDIR)\dbsettings.sbr" \ - "$(INTDIR)\encrypt.sbr" \ - "$(INTDIR)\init.sbr" - -"$(OUTDIR)\db3x.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\dbx_3x.pdb" /map:"$(INTDIR)\dbx_3x.map" /debug /machine:I386 /out:"../../bin/debug/plugins/dbx_3x.dll" /implib:"$(OUTDIR)\dbx_3x.lib" /pdbtype:sept -LINK32_OBJS= \ - "$(INTDIR)\commonheaders.obj" \ - "$(INTDIR)\database.obj" \ - "$(INTDIR)\dbcache.obj" \ - "$(INTDIR)\dbcontacts.obj" \ - "$(INTDIR)\dbevents.obj" \ - "$(INTDIR)\dbheaders.obj" \ - "$(INTDIR)\dbmodulechain.obj" \ - "$(INTDIR)\dbsettings.obj" \ - "$(INTDIR)\encrypt.obj" \ - "$(INTDIR)\init.obj" \ - "$(INTDIR)\resource.res" - -"..\..\bin\debug\plugins\dbx_3x.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(NO_EXTERNAL_DEPS)" != "1" -!IF EXISTS("db3x.dep") -!INCLUDE "db3x.dep" -!ELSE -!MESSAGE Warning: cannot find "db3x.dep" -!ENDIF -!ENDIF - - -!IF "$(CFG)" == "db3x - Win32 Release" || "$(CFG)" == "db3x - Win32 Debug" -SOURCE=.\commonheaders.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yc"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\commonheaders.obj" "$(INTDIR)\db3x.pch" : $(SOURCE) "$(INTDIR)" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yc"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\commonheaders.obj" "$(INTDIR)\commonheaders.sbr" "$(INTDIR)\db3x.pch" : $(SOURCE) "$(INTDIR)" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\database.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\database.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\database.obj" "$(INTDIR)\database.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\dbcache.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\dbcache.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\dbcache.obj" "$(INTDIR)\dbcache.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\dbcontacts.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\dbcontacts.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\dbcontacts.obj" "$(INTDIR)\dbcontacts.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\dbevents.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\dbevents.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\dbevents.obj" "$(INTDIR)\dbevents.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\dbheaders.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\dbheaders.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\dbheaders.obj" "$(INTDIR)\dbheaders.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\dbmodulechain.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\dbmodulechain.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\dbmodulechain.obj" "$(INTDIR)\dbmodulechain.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\dbsettings.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\dbsettings.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\dbsettings.obj" "$(INTDIR)\dbsettings.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\encrypt.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\encrypt.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\encrypt.obj" "$(INTDIR)\encrypt.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\init.c - -!IF "$(CFG)" == "db3x - Win32 Release" - -CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\init.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "db3x - Win32 Debug" - -CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\init.obj" "$(INTDIR)\init.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\resource.rc - -"$(INTDIR)\resource.res" : $(SOURCE) "$(INTDIR)" - $(RSC) $(RSC_PROJ) $(SOURCE) - - - -!ENDIF - diff --git a/db3x_autobackups/db3x.vcproj b/db3x_autobackups/db3x.vcproj deleted file mode 100644 index dbfcd1f..0000000 --- a/db3x_autobackups/db3x.vcproj +++ /dev/null @@ -1,795 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/db3x_autobackups/db3x_8.sln b/db3x_autobackups/db3x_8.sln deleted file mode 100644 index 5cd7ec0..0000000 --- a/db3x_autobackups/db3x_8.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "db3x", "db3x_8.vcproj", "{8B778B6A-F5EF-49A4-8437-424832F2B280}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug|Win32 = Debug|Win32 - Release Unicode|Win32 = Release Unicode|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8B778B6A-F5EF-49A4-8437-424832F2B280}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {8B778B6A-F5EF-49A4-8437-424832F2B280}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {8B778B6A-F5EF-49A4-8437-424832F2B280}.Debug|Win32.ActiveCfg = Debug|Win32 - {8B778B6A-F5EF-49A4-8437-424832F2B280}.Debug|Win32.Build.0 = Debug|Win32 - {8B778B6A-F5EF-49A4-8437-424832F2B280}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {8B778B6A-F5EF-49A4-8437-424832F2B280}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {8B778B6A-F5EF-49A4-8437-424832F2B280}.Release|Win32.ActiveCfg = Release|Win32 - {8B778B6A-F5EF-49A4-8437-424832F2B280}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/db3x_autobackups/db3x_8.vcproj b/db3x_autobackups/db3x_8.vcproj deleted file mode 100644 index 03ee817..0000000 --- a/db3x_autobackups/db3x_8.vcproj +++ /dev/null @@ -1,1023 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/db3x_autobackups/db3x_mmap.dep b/db3x_autobackups/db3x_mmap.dep new file mode 100644 index 0000000..c2c2393 --- /dev/null +++ b/db3x_autobackups/db3x_mmap.dep @@ -0,0 +1,20 @@ +# Microsoft Developer Studio Generated Dependency File, included by db3x_mmap.mak + +.\commonheaders.c : \ + "..\..\include\m_database.h"\ + "..\..\include\m_langpack.h"\ + "..\..\include\m_plugins.h"\ + "..\..\include\m_system.h"\ + "..\..\include\m_utils.h"\ + "..\..\include\newpluginapi.h"\ + "..\..\include\win2k.h"\ + ".\commonheaders.h"\ + ".\database.h"\ + ".\version.h"\ + + +.\resource.rc : \ + ".\db3x_mmap.rc"\ + ".\version.h"\ + ".\version.rc"\ + diff --git a/db3x_autobackups/db3x_mmap.dsp b/db3x_autobackups/db3x_mmap.dsp new file mode 100644 index 0000000..7cd1188 --- /dev/null +++ b/db3x_autobackups/db3x_mmap.dsp @@ -0,0 +1,158 @@ +# Microsoft Developer Studio Project File - Name="db3x_mmap" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=db3x_mmap - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "db3x_mmap.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db3x_mmap.mak" CFG="db3x_mmap - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db3x_mmap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db3x_mmap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName ""$/Miranda/miranda/plugins/db3x_mmap", WKIAAAAA" +# PROP Scc_LocalPath "." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "db3x_mmap_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "db3x_mmap_EXPORTS" /Yu"commonheaders.h" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x5130000" /dll /map /debug /machine:I386 /out:"../../bin/release/plugins/dbx_mmap.dll" /IGNORE:4089 +# SUBTRACT LINK32 /pdb:none /incremental:yes + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr /Yu"commonheaders.h" /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /map /debug /machine:I386 /out:"../../bin/debug/plugins/dbx_mmap.dll" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none /incremental:no + +!ENDIF + +# Begin Target + +# Name "db3x_mmap - Win32 Release" +# Name "db3x_mmap - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\commonheaders.c +# ADD CPP /Yc"commonheaders.h" +# End Source File +# Begin Source File + +SOURCE=.\database.c +# End Source File +# Begin Source File + +SOURCE=.\dbcache.c +# End Source File +# Begin Source File + +SOURCE=.\dbcontacts.c +# End Source File +# Begin Source File + +SOURCE=.\dbevents.c +# End Source File +# Begin Source File + +SOURCE=.\dbheaders.c +# End Source File +# Begin Source File + +SOURCE=.\dbmodulechain.c +# End Source File +# Begin Source File + +SOURCE=.\dbsettings.c +# End Source File +# Begin Source File + +SOURCE=.\encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\init.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\commonheaders.h +# End Source File +# Begin Source File + +SOURCE=.\database.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\resource.rc +# End Source File +# End Group +# End Target +# End Project diff --git a/db3x_autobackups/db3x_mmap.dsw b/db3x_autobackups/db3x_mmap.dsw new file mode 100644 index 0000000..97289a3 --- /dev/null +++ b/db3x_autobackups/db3x_mmap.dsw @@ -0,0 +1,33 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "db3x_mmap"=.\db3x_mmap.dsp - Package Owner=<4> + +Package=<5> +{{{ + begin source code control + "$/Miranda/miranda/plugins/db3x_mmap", WKIAAAAA + . + end source code control +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/db3x_autobackups/db3x_mmap.mak b/db3x_autobackups/db3x_mmap.mak new file mode 100644 index 0000000..31eeae1 --- /dev/null +++ b/db3x_autobackups/db3x_mmap.mak @@ -0,0 +1,399 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on db3x_mmap.dsp +!IF "$(CFG)" == "" +CFG=db3x_mmap - Win32 Debug +!MESSAGE No configuration specified. Defaulting to db3x_mmap - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "db3x_mmap - Win32 Release" && "$(CFG)" != "db3x_mmap - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "db3x_mmap.mak" CFG="db3x_mmap - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db3x_mmap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "db3x_mmap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "..\..\bin\release\plugins\dbx_mmap.dll" + + +CLEAN : + -@erase "$(INTDIR)\commonheaders.obj" + -@erase "$(INTDIR)\database.obj" + -@erase "$(INTDIR)\db3x_mmap.pch" + -@erase "$(INTDIR)\dbcache.obj" + -@erase "$(INTDIR)\dbcontacts.obj" + -@erase "$(INTDIR)\dbevents.obj" + -@erase "$(INTDIR)\dbheaders.obj" + -@erase "$(INTDIR)\dbmodulechain.obj" + -@erase "$(INTDIR)\dbsettings.obj" + -@erase "$(INTDIR)\encrypt.obj" + -@erase "$(INTDIR)\init.obj" + -@erase "$(INTDIR)\resource.res" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(OUTDIR)\dbx_mmap.exp" + -@erase "$(OUTDIR)\dbx_mmap.lib" + -@erase "$(OUTDIR)\dbx_mmap.map" + -@erase "$(OUTDIR)\dbx_mmap.pdb" + -@erase "..\..\bin\release\plugins\dbx_mmap.dll" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "db3x_mmap_EXPORTS" /Fp"$(INTDIR)\db3x_mmap.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c +MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x809 /fo"$(INTDIR)\resource.res" /d "NDEBUG" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\db3x_mmap.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x5130000" /dll /incremental:no /pdb:"$(OUTDIR)\dbx_mmap.pdb" /map:"$(INTDIR)\dbx_mmap.map" /debug /machine:I386 /out:"../../bin/release/plugins/dbx_mmap.dll" /implib:"$(OUTDIR)\dbx_mmap.lib" /IGNORE:4089 +LINK32_OBJS= \ + "$(INTDIR)\commonheaders.obj" \ + "$(INTDIR)\database.obj" \ + "$(INTDIR)\dbcache.obj" \ + "$(INTDIR)\dbcontacts.obj" \ + "$(INTDIR)\dbevents.obj" \ + "$(INTDIR)\dbheaders.obj" \ + "$(INTDIR)\dbmodulechain.obj" \ + "$(INTDIR)\dbsettings.obj" \ + "$(INTDIR)\encrypt.obj" \ + "$(INTDIR)\init.obj" \ + "$(INTDIR)\resource.res" + +"..\..\bin\release\plugins\dbx_mmap.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +ALL : "..\..\bin\debug\plugins\dbx_mmap.dll" "$(OUTDIR)\db3x_mmap.bsc" + + +CLEAN : + -@erase "$(INTDIR)\commonheaders.obj" + -@erase "$(INTDIR)\commonheaders.sbr" + -@erase "$(INTDIR)\database.obj" + -@erase "$(INTDIR)\database.sbr" + -@erase "$(INTDIR)\db3x_mmap.pch" + -@erase "$(INTDIR)\dbcache.obj" + -@erase "$(INTDIR)\dbcache.sbr" + -@erase "$(INTDIR)\dbcontacts.obj" + -@erase "$(INTDIR)\dbcontacts.sbr" + -@erase "$(INTDIR)\dbevents.obj" + -@erase "$(INTDIR)\dbevents.sbr" + -@erase "$(INTDIR)\dbheaders.obj" + -@erase "$(INTDIR)\dbheaders.sbr" + -@erase "$(INTDIR)\dbmodulechain.obj" + -@erase "$(INTDIR)\dbmodulechain.sbr" + -@erase "$(INTDIR)\dbsettings.obj" + -@erase "$(INTDIR)\dbsettings.sbr" + -@erase "$(INTDIR)\encrypt.obj" + -@erase "$(INTDIR)\encrypt.sbr" + -@erase "$(INTDIR)\init.obj" + -@erase "$(INTDIR)\init.sbr" + -@erase "$(INTDIR)\resource.res" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(OUTDIR)\db3x_mmap.bsc" + -@erase "$(OUTDIR)\dbx_mmap.exp" + -@erase "$(OUTDIR)\dbx_mmap.lib" + -@erase "$(OUTDIR)\dbx_mmap.map" + -@erase "$(OUTDIR)\dbx_mmap.pdb" + -@erase "..\..\bin\debug\plugins\dbx_mmap.dll" + -@erase "..\..\bin\debug\plugins\dbx_mmap.ilk" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x_mmap.pch" /Yu"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c +MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x809 /fo"$(INTDIR)\resource.res" /d "_DEBUG" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\db3x_mmap.bsc" +BSC32_SBRS= \ + "$(INTDIR)\commonheaders.sbr" \ + "$(INTDIR)\database.sbr" \ + "$(INTDIR)\dbcache.sbr" \ + "$(INTDIR)\dbcontacts.sbr" \ + "$(INTDIR)\dbevents.sbr" \ + "$(INTDIR)\dbheaders.sbr" \ + "$(INTDIR)\dbmodulechain.sbr" \ + "$(INTDIR)\dbsettings.sbr" \ + "$(INTDIR)\encrypt.sbr" \ + "$(INTDIR)\init.sbr" + +"$(OUTDIR)\db3x_mmap.bsc" : "$(OUTDIR)" $(BSC32_SBRS) + $(BSC32) @<< + $(BSC32_FLAGS) $(BSC32_SBRS) +<< + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\dbx_mmap.pdb" /map:"$(INTDIR)\dbx_mmap.map" /debug /machine:I386 /out:"../../bin/debug/plugins/dbx_mmap.dll" /implib:"$(OUTDIR)\dbx_mmap.lib" /pdbtype:sept +LINK32_OBJS= \ + "$(INTDIR)\commonheaders.obj" \ + "$(INTDIR)\database.obj" \ + "$(INTDIR)\dbcache.obj" \ + "$(INTDIR)\dbcontacts.obj" \ + "$(INTDIR)\dbevents.obj" \ + "$(INTDIR)\dbheaders.obj" \ + "$(INTDIR)\dbmodulechain.obj" \ + "$(INTDIR)\dbsettings.obj" \ + "$(INTDIR)\encrypt.obj" \ + "$(INTDIR)\init.obj" \ + "$(INTDIR)\resource.res" + +"..\..\bin\debug\plugins\dbx_mmap.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("db3x_mmap.dep") +!INCLUDE "db3x_mmap.dep" +!ELSE +!MESSAGE Warning: cannot find "db3x_mmap.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" || "$(CFG)" == "db3x_mmap - Win32 Debug" +SOURCE=.\commonheaders.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + +CPP_SWITCHES=/nologo /MD /W3 /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "db3x_mmap_EXPORTS" /Fp"$(INTDIR)\db3x_mmap.pch" /Yc"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +"$(INTDIR)\commonheaders.obj" "$(INTDIR)\db3x_mmap.pch" : $(SOURCE) "$(INTDIR)" + $(CPP) @<< + $(CPP_SWITCHES) $(SOURCE) +<< + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + +CPP_SWITCHES=/nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DB3X_EXPORTS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\db3x_mmap.pch" /Yc"commonheaders.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c + +"$(INTDIR)\commonheaders.obj" "$(INTDIR)\commonheaders.sbr" "$(INTDIR)\db3x_mmap.pch" : $(SOURCE) "$(INTDIR)" + $(CPP) @<< + $(CPP_SWITCHES) $(SOURCE) +<< + + +!ENDIF + +SOURCE=.\database.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + + +"$(INTDIR)\database.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + + +"$(INTDIR)\database.obj" "$(INTDIR)\database.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ENDIF + +SOURCE=.\dbcache.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + + +"$(INTDIR)\dbcache.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + + +"$(INTDIR)\dbcache.obj" "$(INTDIR)\dbcache.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ENDIF + +SOURCE=.\dbcontacts.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + + +"$(INTDIR)\dbcontacts.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + + +"$(INTDIR)\dbcontacts.obj" "$(INTDIR)\dbcontacts.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ENDIF + +SOURCE=.\dbevents.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + + +"$(INTDIR)\dbevents.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + + +"$(INTDIR)\dbevents.obj" "$(INTDIR)\dbevents.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ENDIF + +SOURCE=.\dbheaders.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + + +"$(INTDIR)\dbheaders.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + + +"$(INTDIR)\dbheaders.obj" "$(INTDIR)\dbheaders.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ENDIF + +SOURCE=.\dbmodulechain.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + + +"$(INTDIR)\dbmodulechain.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + + +"$(INTDIR)\dbmodulechain.obj" "$(INTDIR)\dbmodulechain.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ENDIF + +SOURCE=.\dbsettings.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + + +"$(INTDIR)\dbsettings.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + + +"$(INTDIR)\dbsettings.obj" "$(INTDIR)\dbsettings.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ENDIF + +SOURCE=.\encrypt.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + + +"$(INTDIR)\encrypt.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + + +"$(INTDIR)\encrypt.obj" "$(INTDIR)\encrypt.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ENDIF + +SOURCE=.\init.c + +!IF "$(CFG)" == "db3x_mmap - Win32 Release" + + +"$(INTDIR)\init.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ELSEIF "$(CFG)" == "db3x_mmap - Win32 Debug" + + +"$(INTDIR)\init.obj" "$(INTDIR)\init.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\db3x_mmap.pch" + + +!ENDIF + +SOURCE=.\resource.rc + +"$(INTDIR)\resource.res" : $(SOURCE) "$(INTDIR)" + $(RSC) $(RSC_PROJ) $(SOURCE) + + + +!ENDIF + diff --git a/db3x_autobackups/db3x_mmap.rc b/db3x_autobackups/db3x_mmap.rc new file mode 100644 index 0000000..b700605 --- /dev/null +++ b/db3x_autobackups/db3x_mmap.rc @@ -0,0 +1,197 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_INSTALLINI DIALOGEX 0, 0, 212, 102 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Install Database Settings" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Yes",IDOK,26,83,50,14 + PUSHBUTTON "No",IDCANCEL,81,83,50,14 + LTEXT "A file containing new database settings has been placed in the Miranda IM directory.",IDC_STATIC,5,5,202,16 + LTEXT "Do you want to import the settings now?",IDC_STATIC,5,69,202,8 + PUSHBUTTON "No to all",IDC_NOTOALL,136,83,50,14 + LTEXT "",IDC_ININAME,5,24,143,16,SS_NOPREFIX | SS_CENTERIMAGE + PUSHBUTTON "&View contents",IDC_VIEWINI,149,25,58,14 + LTEXT "Security systems to prevent malicious changes are in place and you will be warned before changes that are not known to be safe.",IDC_SECURITYINFO,5,43,202,24 +END + +IDD_WARNINICHANGE DIALOGEX 0, 0, 187, 113 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Database Setting Change" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Database settings are being imported from",IDC_STATIC,5,5,177,8 + CONTROL "",IDC_ININAME,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,5,13,177,8 + LTEXT "This file wishes to change the setting",IDC_STATIC,5,24,177,8 + CONTROL "",IDC_SETTINGNAME,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,12,33,170,8 + LTEXT "to the value",IDC_STATIC,5,42,177,8 + CONTROL "",IDC_NEWVALUE,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,12,51,170,8 + LTEXT "",IDC_SECURITYINFO,5,60,177,8 + LTEXT "Do you want to allow this change?",IDC_STATIC,5,71,177,8 + CONTROL "&Allow all further changes to this section",IDC_WARNNOMORE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,80,169,10 + DEFPUSHBUTTON "&Yes",IDYES,5,94,50,14 + PUSHBUTTON "&No",IDNO,59,94,50,14 + PUSHBUTTON "Cancel Import",IDCANCEL,123,94,59,14 +END + +IDD_INIIMPORTDONE DIALOGEX 0, 0, 186, 73 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Database Import Complete" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "The import has completed from",IDC_STATIC,5,5,176,8 + CONTROL "",IDC_ININAME,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,5,13,176,8 + LTEXT "What do you want to do with the file now?",IDC_STATIC,5,24,176,8 + PUSHBUTTON "&Recycle",IDC_RECYCLE,5,36,50,14 + PUSHBUTTON "&Delete",IDC_DELETE,68,36,50,14 + EDITTEXT IDC_NEWNAME,5,55,117,12,ES_AUTOHSCROLL + PUSHBUTTON "&Move/Rename",IDC_MOVE,124,54,57,14 + PUSHBUTTON "&Leave",IDC_LEAVE,131,36,50,14 +END + +IDD_OPTIONS DIALOGEX 0, 0, 277, 228 +STYLE DS_SETFONT | WS_POPUP +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Automatic Backups",IDC_STATIC,7,7,263,214,WS_GROUP + RTEXT "Every:",IDC_STATIC,39,97,52,8 + EDITTEXT IDC_ED_PERIOD,98,93,28,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT + GROUPBOX "",IDC_STATIC,143,81,89,36,WS_GROUP + CONTROL "Days",IDC_RAD_DAYS,"Button",BS_AUTORADIOBUTTON | WS_GROUP,149,89,70,10 + CONTROL "Hours",IDC_RAD_HOURS,"Button",BS_AUTORADIOBUTTON,149,103,70,10 + EDITTEXT IDC_ED_FOLDER,18,163,176,14,ES_AUTOHSCROLL + LTEXT "Backup to folder:",IDC_STATIC,30,150,164,8 + PUSHBUTTON "Browse...",IDC_BUT_BROWSE,200,163,60,14 + RTEXT "Number of backups to keep:",IDC_STATIC,34,129,132,8 + EDITTEXT IDC_ED_NUMBACKUPS,175,127,28,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT + PUSHBUTTON "Backup NOW",IDC_BUT_NOW,95,199,75,14 + CONTROL "Disable progress bar",IDC_CHK_NOPROG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,182,184,10 + CONTROL "Disabled",IDC_RAD_DISABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,22,156,10 + CONTROL "When Miranda starts",IDC_RAD_START,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,40,156,10 + CONTROL "When Miranda exits",IDC_RAD_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,58,156,10 + CONTROL "Periodically:",IDC_RAD_PERIODIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,76,106,10 +END + +IDD_COPYPROGRESS DIALOGEX 0, 0, 254, 148 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION +CAPTION "Backup in Progress" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + PUSHBUTTON "Cancel",IDCANCEL,102,97,50,14 + CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,46,64,163,14 + EDITTEXT IDC_PROGRESSMESSAGE,31,37,190,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_INSTALLINI, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 207 + TOPMARGIN, 5 + BOTTOMMARGIN, 97 + END + + IDD_WARNINICHANGE, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 182 + TOPMARGIN, 5 + BOTTOMMARGIN, 108 + END + + IDD_INIIMPORTDONE, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 181 + TOPMARGIN, 5 + BOTTOMMARGIN, 68 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MENU ICON "icon1.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include \0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/db3x_autobackups/db3x_mmap.vcproj b/db3x_autobackups/db3x_mmap.vcproj new file mode 100644 index 0000000..1cd4b84 --- /dev/null +++ b/db3x_autobackups/db3x_mmap.vcproj @@ -0,0 +1,527 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/db3x_autobackups/db3x_mmap_8.vcproj b/db3x_autobackups/db3x_mmap_8.vcproj new file mode 100644 index 0000000..9680777 --- /dev/null +++ b/db3x_autobackups/db3x_mmap_8.vcproj @@ -0,0 +1,663 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/db3x_autobackups/dbcache.c b/db3x_autobackups/dbcache.c index dd3bc5a..601670d 100644 --- a/db3x_autobackups/dbcache.c +++ b/db3x_autobackups/dbcache.c @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2003 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2003 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -22,165 +22,124 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -#include "database.h" +BOOL safetyMode = TRUE; +static int flushBuffersTimerId; -#define CACHESECTIONSIZE 4096 -#define CACHESECTIONCOUNT 32 - -extern HANDLE hDbFile; -extern CRITICAL_SECTION csDbAccess; +static PBYTE pNull = 0; +static PBYTE pDbCache = NULL; +static HANDLE hMap = NULL; +static DWORD dwFileSize = 0; +static DWORD ChunkSize = 65536; -static BOOL safetyMode=TRUE; -static PBYTE pDbCache; -static DWORD lastUseCounter; -struct DBCacheSectionInfo { - DWORD ofsBase; - DWORD lastUsed; -} static cacheSectionInfo[CACHESECTIONCOUNT]; -static __inline int FindSectionForOffset(const DWORD ofs) +void Map() { - int i; - for(i=0;i=cacheSectionInfo[i].ofsBase && ofs ChunkSize) + { + if ((needed + dwFileSize) - dbHeader.ofsFileEnd > ChunkSize) + DatabaseCorruption("%s (Too large increment)"); + else + { + DWORD x = dbHeader.ofsFileEnd/ChunkSize; + dwFileSize = (x+1)*ChunkSize; + } + } + else + dwFileSize += ChunkSize; + +// FlushViewOfFile(pDbCache, 0); + UnmapViewOfFile(pDbCache); + pDbCache = NULL; + CloseHandle(hMap); + + Map(); } +void DBMoveChunk(DWORD ofsDest,DWORD ofsSource,int bytes) +{ + int x = 0; + log3("move %d %08x->%08x",bytes,ofsSource,ofsDest); + if (ofsDest+bytes>dwFileSize) ReMap(ofsDest+bytes-dwFileSize); + if (ofsSource+bytes>dwFileSize) { + x = ofsSource+bytes-dwFileSize; + log0("buggy move!"); + _ASSERT(0); + } + if (x > 0) + ZeroMemory(pDbCache+ofsDest+bytes-x, x); + if (ofsSource < dwFileSize) + MoveMemory(pDbCache+ofsDest,pDbCache+ofsSource, bytes-x); + logg(); +} //we are assumed to be in a mutex here PBYTE DBRead(DWORD ofs,int bytesRequired,int *bytesAvail) { - - int part1sect; - int part2sect; - - - part1sect = FindSectionForOffset(ofs); - if (ofs%CACHESECTIONSIZE+bytesRequired=dwFileSize) { + log2("read from outside %d@%08x",bytesRequired,ofs); + if (bytesAvail!=NULL) *bytesAvail = ChunkSize; + return pNull; } - //both sections are now consecutive, starting at part1sect - cacheSectionInfo[part1sect].lastUsed=++lastUseCounter; - cacheSectionInfo[part1sect+1].lastUsed=++lastUseCounter; - if(bytesAvail!=NULL) *bytesAvail=cacheSectionInfo[part1sect+1].ofsBase+CACHESECTIONSIZE-ofs; - return pDbCache+part1sect*CACHESECTIONSIZE+(ofs-cacheSectionInfo[part1sect].ofsBase); + log3((ofs+bytesRequired>dwFileSize)?"read %d@%08x, only %d avaliable":"read %d@%08x",bytesRequired,ofs,dwFileSize-ofs); + if (bytesAvail!=NULL) *bytesAvail = dwFileSize - ofs; + return pDbCache+ofs; } - - //we are assumed to be in a mutex here void DBWrite(DWORD ofs,PVOID pData,int bytes) { - //write direct, and rely on Windows' write caching - DWORD bytesWritten; - int i; - log2("write %d@%08x",bytes,ofs); - SetFilePointer(hDbFile,ofs,NULL,FILE_BEGIN); - if (WriteFile(hDbFile,pData,bytes,&bytesWritten,NULL)==0) - { - DatabaseCorruption(); - } + if (ofs+bytes>dwFileSize) ReMap(ofs+bytes-dwFileSize); + MoveMemory(pDbCache+ofs,pData,bytes); logg(); - //check if any of the cache sections contain this bit - for(i=0;i=cacheSectionInfo[i].ofsBase && ofs=cacheSectionInfo[i].ofsBase+CACHESECTIONSIZE) //don't finish at end - CopyMemory(pDbCache+i*CACHESECTIONSIZE,(PBYTE)pData+cacheSectionInfo[i].ofsBase-ofs,CACHESECTIONSIZE); - else CopyMemory(pDbCache+i*CACHESECTIONSIZE,(PBYTE)pData+cacheSectionInfo[i].ofsBase-ofs,bytes-(cacheSectionInfo[i].ofsBase-ofs)); - } - else { //start at beginning - if(ofs+bytes>=cacheSectionInfo[i].ofsBase+CACHESECTIONSIZE) //don't finish at end - CopyMemory(pDbCache+i*CACHESECTIONSIZE+ofs-cacheSectionInfo[i].ofsBase,pData,cacheSectionInfo[i].ofsBase+CACHESECTIONSIZE-ofs); - else CopyMemory(pDbCache+i*CACHESECTIONSIZE+ofs-cacheSectionInfo[i].ofsBase,pData,bytes); - } - } - } } -void DBMoveChunk(DWORD ofsDest,DWORD ofsSource,int bytes) +//we are assumed to be in a mutex here +void DBFill(DWORD ofs,int bytes) { - DWORD bytesRead; - PBYTE buf; - - log3("move %d %08x->%08x",bytes,ofsSource,ofsDest); - buf=(PBYTE)mir_alloc(bytes); - SetFilePointer(hDbFile,ofsSource,NULL,FILE_BEGIN); - ReadFile(hDbFile,buf,bytes,&bytesRead,NULL); - DBWrite(ofsDest,buf,bytes); - mir_free(buf); + log2("zerofill %d@%08x",bytes,ofs); + if (ofs+bytes<=dwFileSize) + ZeroMemory(pDbCache+ofs,bytes); logg(); } -static int flushBuffersTimerId; static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd,UINT message,UINT idEvent,DWORD dwTime) { + if (!pDbCache) return; + KillTimer(NULL,flushBuffersTimerId); log0("tflush1"); - FlushFileBuffers(hDbFile); + if (FlushViewOfFile(pDbCache, 0) == 0) + DatabaseCorruption(NULL); log0("tflush2"); } @@ -188,7 +147,10 @@ void DBFlush(int setting) { if(!setting) { log0("nflush1"); - if(safetyMode) FlushFileBuffers(hDbFile); + if(safetyMode && pDbCache) { + if (FlushViewOfFile(pDbCache, 0) == 0) + DatabaseCorruption(NULL); + } log0("nflush2"); return; } @@ -201,29 +163,39 @@ static int CacheSetSafetyMode(WPARAM wParam,LPARAM lParam) EnterCriticalSection(&csDbAccess); safetyMode=wParam; LeaveCriticalSection(&csDbAccess); - if(safetyMode) FlushFileBuffers(hDbFile); + DBFlush(1); return 0; } int InitCache(void) { - int i; - DWORD bytesRead; - + DWORD x; + SYSTEM_INFO sinf; + + GetSystemInfo(&sinf); + ChunkSize = sinf.dwAllocationGranularity; + + dwFileSize = GetFileSize(hDbFile, NULL); + + // Align to chunk + x = dwFileSize % ChunkSize; + if (x) dwFileSize += ChunkSize - x; + + Map(); + + // zero region for reads outside the file + pNull = calloc(ChunkSize,1); + CreateServiceFunction(MS_DB_SETSAFETYMODE,CacheSetSafetyMode); - pDbCache=(PBYTE)mir_alloc(CACHESECTIONSIZE*CACHESECTIONCOUNT); - lastUseCounter=CACHESECTIONCOUNT; - for(i=0;ihContact = hContact; + if (index == -1) li.List_GetIndex(&lContacts,VL,&index); + li.List_Insert(&lContacts,VL,index); + return VL; +} static int GetContactCount(WPARAM wParam,LPARAM lParam) { @@ -104,7 +114,7 @@ static int FindNextContact(WPARAM wParam,LPARAM lParam) DBCachedContactValueList VLtemp, *VL = NULL; VLtemp.hContact = (HANDLE)wParam; EnterCriticalSection(&csDbAccess); - while ( VLtemp.hContact ) { + while(VLtemp.hContact) { if ( li.List_GetIndex(&lContacts,&VLtemp,&index)) { VL = ( DBCachedContactValueList* )lContacts.items[index]; if (VL->hNext != NULL) { @@ -112,20 +122,18 @@ static int FindNextContact(WPARAM wParam,LPARAM lParam) LeaveCriticalSection(&csDbAccess); return (int)VL->hNext; } - - VLtemp.hContact = VL->hNext; - continue; - } } + else { + VLtemp.hContact = VL->hNext; + continue; + } } } dbc=(struct DBContact*)DBRead((DWORD)VLtemp.hContact,sizeof(struct DBContact),NULL); if (dbc->signature!=DBCONTACT_SIGNATURE) break; else { - if ( VL == NULL ) { - VL = (DBCachedContactValueList*)HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedContactValueList)); - VL->hContact = VLtemp.hContact; - li.List_Insert(&lContacts,VL,index); - } + if ( VL == NULL ) + VL = AddToCachedContactList(VLtemp.hContact,index); + VL->hNext = (HANDLE)dbc->ofsNext; if (VL->hNext != NULL && (!lParam || CheckProto(VL->hNext,(const char*)lParam))) { LeaveCriticalSection(&csDbAccess); @@ -172,13 +180,14 @@ static int DeleteContact(WPARAM wParam,LPARAM lParam) DBCachedContactValue* V = VL->first; while ( V != NULL ) { DBCachedContactValue* V1 = V->next; - if ( V->value.type == DBVT_ASCIIZ ) - HeapFree( hCacheHeap, 0, V->value.pszVal ); + FreeCachedVariant(&V->value); HeapFree( hCacheHeap, 0, V ); V = V1; } HeapFree( hCacheHeap, 0, VL ); + if (VLtemp.hContact == hLastCachedContact) + hLastCachedContact = NULL; li.List_Remove(&lContacts,index); } } @@ -211,7 +220,7 @@ static int DeleteContact(WPARAM wParam,LPARAM lParam) ofsThis=dbHeader.ofsFirstContact; dbcPrev=(struct DBContact*)DBRead(ofsThis,sizeof(struct DBContact),NULL); while(dbcPrev->ofsNext!=wParam) { - if(dbcPrev->ofsNext==0) DatabaseCorruption(); + if(dbcPrev->ofsNext==0) DatabaseCorruption(NULL); ofsThis=dbcPrev->ofsNext; dbcPrev=(struct DBContact*)DBRead(ofsThis,sizeof(struct DBContact),NULL); } @@ -258,14 +267,7 @@ static int AddContact(WPARAM wParam,LPARAM lParam) DBWrite(0,&dbHeader,sizeof(dbHeader)); DBFlush(0); - { int index; - - DBCachedContactValueList *VL = (DBCachedContactValueList*)HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedContactValueList)); - VL->hContact = (HANDLE)ofsNew; - - li.List_GetIndex(&lContacts,VL,&index); - li.List_Insert(&lContacts,VL,index); - } + AddToCachedContactList((HANDLE)ofsNew, -1); LeaveCriticalSection(&csDbAccess); NotifyEventHooks(hContactAddedEvent,(WPARAM)ofsNew,0); @@ -274,26 +276,23 @@ static int AddContact(WPARAM wParam,LPARAM lParam) static int IsDbContact(WPARAM wParam,LPARAM lParam) { - struct DBContact dbc; + struct DBContact *dbc; DWORD ofsContact=(DWORD)wParam; int ret; EnterCriticalSection(&csDbAccess); { int index; - DBCachedContactValueList VLtemp,*VL; + DBCachedContactValueList VLtemp; VLtemp.hContact = (HANDLE)wParam; if ( li.List_GetIndex(&lContacts,&VLtemp,&index)) ret = TRUE; else { - dbc=*(struct DBContact*)DBRead(ofsContact,sizeof(struct DBContact),NULL); - ret=dbc.signature==DBCONTACT_SIGNATURE; - - if (ret) { - VL = (DBCachedContactValueList*)HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedContactValueList)); - VL->hContact = (HANDLE)wParam; - li.List_Insert(&lContacts,VL,index); - } } } + dbc=(struct DBContact*)DBRead(ofsContact,sizeof(struct DBContact),NULL); + ret=dbc->signature==DBCONTACT_SIGNATURE; + if (ret) + AddToCachedContactList((HANDLE)wParam, index); + } } LeaveCriticalSection(&csDbAccess); return ret; diff --git a/db3x_autobackups/dbevents.c b/db3x_autobackups/dbevents.c index b45cee4..8897575 100644 --- a/db3x_autobackups/dbevents.c +++ b/db3x_autobackups/dbevents.c @@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -#include "database.h" +extern BOOL safetyMode; DWORD GetModuleNameOfs(const char *szName); char *GetModuleNameByOfs(DWORD ofs); @@ -41,9 +41,6 @@ static int FindLastEvent(WPARAM wParam,LPARAM lParam); static int FindNextEvent(WPARAM wParam,LPARAM lParam); static int FindPrevEvent(WPARAM wParam,LPARAM lParam); -extern CRITICAL_SECTION csDbAccess; -extern struct DBHeader dbHeader; - static HANDLE hEventDeletedEvent,hEventAddedEvent,hEventFilterAddedEvent; int InitEvents(void) @@ -90,6 +87,7 @@ static int AddEvent(WPARAM wParam,LPARAM lParam) struct DBContact dbc; struct DBEvent dbe,*dbeTest; DWORD ofsNew,ofsModuleName,ofsContact,ofsThis; + BOOL neednotify; if(dbei==NULL||dbei->cbSize!=sizeof(DBEVENTINFO)) return (int)NULL; if(dbei->timestamp==0) return (int)NULL; @@ -166,14 +164,22 @@ static int AddEvent(WPARAM wParam,LPARAM lParam) dbc.timestampFirstUnread=dbe.timestamp; dbc.ofsFirstUnreadEvent=ofsNew; } + neednotify = TRUE; } + else neednotify = safetyMode; + DBWrite(ofsContact,&dbc,sizeof(struct DBContact)); DBWrite(ofsNew,&dbe,offsetof(struct DBEvent,blob)); DBWrite(ofsNew+offsetof(struct DBEvent,blob),dbei->pBlob,dbei->cbBlob); DBFlush(0); + LeaveCriticalSection(&csDbAccess); log1("add event @ %08x",ofsNew); - NotifyEventHooks(hEventAddedEvent,wParam,(LPARAM)ofsNew); + + // Notify only in safe mode or on really new events + if (neednotify) + NotifyEventHooks(hEventAddedEvent,wParam,(LPARAM)ofsNew); + return (int)ofsNew; } @@ -278,7 +284,7 @@ static int GetEvent(WPARAM wParam,LPARAM lParam) int bytesToCopy,i; if(dbei==NULL||dbei->cbSize!=sizeof(DBEVENTINFO)) return 1; - if(dbei->cbBlob > 0 && dbei->pBlob == NULL) { + if(dbei->cbBlob>0 && dbei->pBlob==NULL) { dbei->cbBlob = 0; return 1; } @@ -295,16 +301,15 @@ static int GetEvent(WPARAM wParam,LPARAM lParam) if(dbei->cbBlobcbBlob) bytesToCopy=dbei->cbBlob; else bytesToCopy=dbe->cbBlob; dbei->cbBlob=dbe->cbBlob; - if(dbei->pBlob == 0 && bytesToCopy > 0) { - LeaveCriticalSection(&csDbAccess); - return 1; - } - for(i=0;;i+=MAXCACHEDREADSIZE) { - if(bytesToCopy-i<=MAXCACHEDREADSIZE) { - CopyMemory(dbei->pBlob+i,DBRead(wParam+offsetof(struct DBEvent,blob)+i,bytesToCopy-i,NULL),bytesToCopy-i); - break; + if (bytesToCopy && dbei->pBlob) + { + for(i=0;;i+=MAXCACHEDREADSIZE) { + if(bytesToCopy-i<=MAXCACHEDREADSIZE) { + CopyMemory(dbei->pBlob+i,DBRead(wParam+offsetof(struct DBEvent,blob)+i,bytesToCopy-i,NULL),bytesToCopy-i); + break; + } + CopyMemory(dbei->pBlob+i,DBRead(wParam+offsetof(struct DBEvent,blob)+i,MAXCACHEDREADSIZE,NULL),MAXCACHEDREADSIZE); } - CopyMemory(dbei->pBlob+i,DBRead(wParam+offsetof(struct DBEvent,blob)+i,MAXCACHEDREADSIZE,NULL),MAXCACHEDREADSIZE); } LeaveCriticalSection(&csDbAccess); return 0; diff --git a/db3x_autobackups/dbheaders.c b/db3x_autobackups/dbheaders.c index da7cb6e..6ae9b33 100644 --- a/db3x_autobackups/dbheaders.c +++ b/db3x_autobackups/dbheaders.c @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2003 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2003 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -22,16 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -#include "database.h" - -extern struct DBHeader dbHeader; -extern HANDLE hDbFile; - -struct DBSignature { - char name[15]; - BYTE eof; -}; -static struct DBSignature dbSignature={"Miranda ICQ DB",0x1A}; //the cache has not been loaded when these functions are used diff --git a/db3x_autobackups/dbmodulechain.c b/db3x_autobackups/dbmodulechain.c index 352a06c..9508850 100644 --- a/db3x_autobackups/dbmodulechain.c +++ b/db3x_autobackups/dbmodulechain.c @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2003 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2003 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -22,42 +22,73 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -#include "database.h" - -extern struct DBHeader dbHeader; static int EnumModuleNames(WPARAM wParam,LPARAM lParam); -struct ModuleName { +typedef struct { char *name; - DWORD hash; DWORD ofs; -}; -static struct ModuleName *moduleName; -static int moduleNameCount; +} ModuleName; + +HANDLE hModHeap = NULL; +static SortedList lMods, lOfs; + +static int ModCompare( ModuleName *mn1, ModuleName *mn2 ) +{ + return strcmp( mn1->name, mn2->name ); +} + +static int OfsCompare( ModuleName *mn1, ModuleName *mn2 ) +{ + return ( mn1->ofs - mn2->ofs ); +} + +void AddToList(char *name, DWORD len, DWORD ofs) +{ + int index; + ModuleName *mn = (ModuleName*)HeapAlloc(hModHeap,0,sizeof(ModuleName)); + mn->name = name; + mn->ofs = ofs; + + if (li.List_GetIndex(&lMods,mn,&index)) + DatabaseCorruption("%s (Module Name not unique)"); + + li.List_Insert(&lMods,mn,index); + + if (li.List_GetIndex(&lOfs,mn,&index)) + DatabaseCorruption("%s (Module Offset not unique)"); + + li.List_Insert(&lOfs,mn,index); +} + int InitModuleNames(void) { struct DBModuleName *dbmn; - DWORD ofsThis,ofsNext; + DWORD ofsThis; int nameLen; + char *mod; + + hModHeap=HeapCreate(0,0,0); + lMods.sortFunc=ModCompare; + lMods.increment=50; + lOfs.sortFunc=OfsCompare; + lOfs.increment=50; - moduleNameCount=0; - moduleName=NULL; ofsThis=dbHeader.ofsFirstModuleName; dbmn=(struct DBModuleName*)DBRead(ofsThis,sizeof(struct DBModuleName),NULL); while(ofsThis) { - if(dbmn->signature!=DBMODULENAME_SIGNATURE) DatabaseCorruption(); - moduleName=(struct ModuleName*)mir_realloc(moduleName,sizeof(struct ModuleName)*(moduleNameCount+1)); - moduleName[moduleNameCount].ofs=ofsThis; - moduleName[moduleNameCount].hash=dbmn->cbName; //very very simple hash so far - moduleName[moduleNameCount].name=(char*)mir_alloc(dbmn->cbName+1); - ofsNext=dbmn->ofsNext; + if(dbmn->signature!=DBMODULENAME_SIGNATURE) DatabaseCorruption(NULL); + nameLen=dbmn->cbName; - CopyMemory(moduleName[moduleNameCount].name,DBRead(ofsThis+offsetof(struct DBModuleName,name),nameLen,NULL),nameLen); - moduleName[moduleNameCount].name[nameLen]=0; - moduleNameCount++; - ofsThis=ofsNext; + + mod = (char*)HeapAlloc(hModHeap,0,nameLen+1); + CopyMemory(mod,DBRead(ofsThis+offsetof(struct DBModuleName,name),nameLen,NULL),nameLen); + mod[nameLen] = 0; + + AddToList(mod, nameLen, ofsThis); + + ofsThis=dbmn->ofsNext; dbmn=(struct DBModuleName*)DBRead(ofsThis,sizeof(struct DBModuleName),NULL); } CreateServiceFunction(MS_DB_MODULES_ENUM,EnumModuleNames); @@ -66,16 +97,29 @@ int InitModuleNames(void) void UninitModuleNames(void) { - int i; - for(i=0;iofs; + + if (li.List_GetIndex(&lMods,&mn,&index)) { + pmn = (ModuleName*)lMods.items[index]; + lastmn = pmn; + return pmn->ofs; + } + return 0; } @@ -83,11 +127,15 @@ static DWORD FindExistingModuleNameOfs(const char *szName,int nameLen) DWORD GetModuleNameOfs(const char *szName) { struct DBModuleName dbmn; - int nameLen=strlen(szName); + int nameLen; DWORD ofsNew,ofsExisting; + char *mod; - ofsExisting=FindExistingModuleNameOfs(szName,nameLen); + ofsExisting=FindExistingModuleNameOfs(szName); if(ofsExisting) return ofsExisting; + + nameLen = strlen(szName); + //need to create the module name ofsNew=CreateNewSpace(nameLen+offsetof(struct DBModuleName,name)); dbmn.signature=DBMODULENAME_SIGNATURE; @@ -98,34 +146,46 @@ DWORD GetModuleNameOfs(const char *szName) DBWrite(ofsNew,&dbmn,offsetof(struct DBModuleName,name)); DBWrite(ofsNew+offsetof(struct DBModuleName,name),(PVOID)szName,nameLen); DBFlush(0); + //add to cache - moduleName=(struct ModuleName*)mir_realloc(moduleName,sizeof(struct ModuleName)*(moduleNameCount+1)); - moduleName[moduleNameCount].ofs=ofsNew; - moduleName[moduleNameCount].hash=nameLen; //very very simple hash so far - moduleName[moduleNameCount].name=(char*)mir_alloc(nameLen+1); - strcpy(moduleName[moduleNameCount].name,szName); - moduleNameCount++; + mod = (char*)HeapAlloc(hModHeap,0,nameLen+1); + strcpy(mod,szName); + AddToList(mod, nameLen, ofsNew); + //quit return ofsNew; } -//it's OK that this is a bit slow - it's rarely used char *GetModuleNameByOfs(DWORD ofs) { - int i; + static ModuleName *lastmn = NULL; + ModuleName mn, *pmn; + int index; + + if (lastmn && lastmn->ofs == ofs) + return lastmn->name; - for(i=0;iname; + } + + DatabaseCorruption(NULL); return NULL; -} +} static int EnumModuleNames(WPARAM wParam,LPARAM lParam) { int i; int ret; - for(i=0;iname,pmn->ofs,wParam); if(ret) return ret; } return 0; diff --git a/db3x_autobackups/dbsettings.c b/db3x_autobackups/dbsettings.c index 2f464f4..a8d347d 100644 --- a/db3x_autobackups/dbsettings.c +++ b/db3x_autobackups/dbsettings.c @@ -23,67 +23,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" -#include "database.h" - DWORD GetModuleNameOfs(const char *szName); - -extern CRITICAL_SECTION csDbAccess; -extern struct DBHeader dbHeader; +DBCachedContactValueList* AddToCachedContactList(HANDLE hContact, int index); HANDLE hCacheHeap = NULL; -SortedList lContacts; +SortedList lContacts = {0}; +HANDLE hLastCachedContact = NULL; +static DBCachedContactValueList *LastVL = NULL; -static SortedList lSettings, lGlobalSettings; +static SortedList lSettings={0}, lGlobalSettings={0}, lResidentSettings={0}; static HANDLE hSettingChangeEvent = NULL; -#define SETTINGSGROUPOFSCOUNT 32 -struct SettingsGroupOfsCacheEntry { - DWORD ofsContact; - DWORD ofsModuleName; - DWORD ofsSettingsGroup; -}; -static struct SettingsGroupOfsCacheEntry settingsGroupOfsCache[SETTINGSGROUPOFSCOUNT]; -static int nextSGOCacheEntry; - -//this function caches results -static DWORD GetSettingsGroupOfsByModuleNameOfs(struct DBContact *dbc,DWORD ofsContact,DWORD ofsModuleName) +static DWORD GetSettingsGroupOfsByModuleNameOfs(struct DBContact *dbc,DWORD ofsModuleName) { struct DBContactSettings *dbcs; DWORD ofsThis; - int i; - for(i=0;iofsFirstSettings; while(ofsThis) { dbcs=(struct DBContactSettings*)DBRead(ofsThis,sizeof(struct DBContactSettings),NULL); - if(dbcs->signature!=DBCONTACTSETTINGS_SIGNATURE) DatabaseCorruption(); - if(dbcs->ofsModuleName==ofsModuleName) { - settingsGroupOfsCache[nextSGOCacheEntry].ofsContact=ofsContact; - settingsGroupOfsCache[nextSGOCacheEntry].ofsModuleName=ofsModuleName; - settingsGroupOfsCache[nextSGOCacheEntry].ofsSettingsGroup=ofsThis; - if(++nextSGOCacheEntry==SETTINGSGROUPOFSCOUNT) nextSGOCacheEntry=0; + if(dbcs->signature!=DBCONTACTSETTINGS_SIGNATURE) DatabaseCorruption(NULL); + if(dbcs->ofsModuleName==ofsModuleName) return ofsThis; - } + ofsThis=dbcs->ofsNext; } return 0; } -static void InvalidateSettingsGroupOfsCacheEntry(DWORD ofsSettingsGroup) -{ - int i; - - for(i=0;ipszVal = (char*)HeapAlloc(hCacheHeap,0,strlen(s->pszVal)+1); strcpy(d->pszVal,s->pszVal); } + else if ( szSave != NULL ) + HeapFree(hCacheHeap,0,szSave); +#ifdef DBLOGGING switch( d->type ) { case DBVT_BYTE: log1( "set cached byte: %d", d->bVal ); break; case DBVT_WORD: log1( "set cached word: %d", d->wVal ); break; @@ -139,9 +110,11 @@ static void SetCachedVariant( DBVARIANT* s /* new */, DBVARIANT* d /* cached */ case DBVT_UTF8: case DBVT_ASCIIZ: log1( "set cached string: '%s'", d->pszVal ); break; default: log1( "set cached crap: %d", d->type ); break; -} } + } +#endif +} -static void FreeCachedVariant( DBVARIANT* V ) +void FreeCachedVariant( DBVARIANT* V ) { if (( V->type == DBVT_ASCIIZ || V->type == DBVT_UTF8 ) && V->pszVal != NULL ) HeapFree(hCacheHeap,0,V->pszVal); @@ -177,21 +150,27 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo DBCachedContactValue *V, *V1; DBCachedContactValueList VLtemp,*VL; - VLtemp.hContact=hContact; - if ( li.List_GetIndex(&lContacts,&VLtemp,&index)) { - VL = (DBCachedContactValueList*)lContacts.items[index]; + if (hLastCachedContact==hContact && LastVL) { + VL = LastVL; } else { - if ( bAllocate != 1 ) - return NULL; + VLtemp.hContact=hContact; + + if ( !li.List_GetIndex(&lContacts,&VLtemp,&index)) + { + if ( bAllocate != 1 ) + return NULL; + + VL = AddToCachedContactList(hContact,index); + } + else VL = (DBCachedContactValueList*)lContacts.items[index]; - VL = (DBCachedContactValueList*)HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedContactValueList)); - VL->hContact = hContact; - li.List_Insert(&lContacts,VL,index); + LastVL = VL; + hLastCachedContact = hContact; } for ( V = VL->first; V != NULL; V = V->next) - if (strcmp(V->name,szSetting)==0) + if (V->name == szSetting) break; if ( V == NULL ) { @@ -199,19 +178,29 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo return NULL; V = HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedContactValue)); - V->next = VL->first; - VL->first = V; + if (VL->last) + VL->last->next = V; + else + VL->first = V; + VL->last = V; V->name = szSetting; } else if ( bAllocate == -1 ) { + LastVL = NULL; FreeCachedVariant(&V->value); - if ( VL->first == V ) + if ( VL->first == V ) { VL->first = V->next; - for ( V1=VL->first; V1 != NULL; V1 = V1->next ) - if ( V1->next == V ) { - V1->next = V->next; - break; - } + if (VL->last == V) + VL->last = V->next; // NULL + } + else + for ( V1 = VL->first; V1 != NULL; V1 = V1->next ) + if ( V1->next == V ) { + V1->next = V->next; + if (VL->last == V) + VL->last = V1; + break; + } HeapFree(hCacheHeap,0,V); return NULL; } @@ -224,23 +213,38 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo #define VLT(n) ((n==DBVT_UTF8)?DBVT_ASCIIZ:n) static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING *dbcgs,int isStatic) { - struct DBContact dbc; - struct DBContactSettings dbcs; + struct DBContact *dbc; DWORD ofsModuleName,ofsContact,ofsSettingsGroup,ofsBlobPtr; - int settingNameLen; + int settingNameLen,moduleNameLen; int bytesRemaining; PBYTE pBlob; char* szCachedSettingName; if ((!dbcgs->szSetting) || (!dbcgs->szModule)) return 1; + // the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name settingNameLen=strlen(dbcgs->szSetting); + moduleNameLen=strlen(dbcgs->szModule); + if ( settingNameLen > 0xFE ) + { + #ifdef _DEBUG + OutputDebugString("GetContactSettingWorker() got a > 255 setting name length. \n"); + #endif + return 1; + } + if ( moduleNameLen > 0xFE ) + { + #ifdef _DEBUG + OutputDebugString("GetContactSettingWorker() got a > 255 module name length. \n"); + #endif + return 1; + } EnterCriticalSection(&csDbAccess); log3("get [%08p] %s/%s",hContact,dbcgs->szModule,dbcgs->szSetting); - szCachedSettingName = GetCachedSetting(dbcgs->szModule,dbcgs->szSetting,settingNameLen); + szCachedSettingName = GetCachedSetting(dbcgs->szModule,dbcgs->szSetting,moduleNameLen,settingNameLen); { DBVARIANT* pCachedValue = GetCachedValuePtr( hContact, szCachedSettingName, 0 ); if ( pCachedValue != NULL ) { @@ -284,16 +288,15 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING ofsModuleName=GetModuleNameOfs(dbcgs->szModule); if(hContact==NULL) ofsContact=dbHeader.ofsUser; else ofsContact=(DWORD)hContact; - dbc=*(struct DBContact*)DBRead(ofsContact,sizeof(struct DBContact),NULL); - if(dbc.signature!=DBCONTACT_SIGNATURE) { + dbc=(struct DBContact*)DBRead(ofsContact,sizeof(struct DBContact),NULL); + if(dbc->signature!=DBCONTACT_SIGNATURE) { LeaveCriticalSection(&csDbAccess); return 1; } - ofsSettingsGroup=GetSettingsGroupOfsByModuleNameOfs(&dbc,ofsContact,ofsModuleName); + ofsSettingsGroup=GetSettingsGroupOfsByModuleNameOfs(dbc,ofsModuleName); if(ofsSettingsGroup) { - dbcs=*(struct DBContactSettings*)DBRead(ofsSettingsGroup,sizeof(struct DBContactSettings),&bytesRemaining); ofsBlobPtr=ofsSettingsGroup+offsetof(struct DBContactSettings,blob); - pBlob=(PBYTE)DBRead(ofsBlobPtr,1,&bytesRemaining); + pBlob = DBRead(ofsBlobPtr,sizeof(struct DBContactSettings),&bytesRemaining); while(pBlob[0]) { NeedBytes(1+settingNameLen); if(pBlob[0]==settingNameLen && !memcmp(pBlob+1,dbcgs->szSetting,settingNameLen)) { @@ -485,21 +488,32 @@ static int FreeVariant(WPARAM wParam,LPARAM lParam) static int SetSettingResident(WPARAM wParam,LPARAM lParam) { - char* szSetting; - size_t cbSettingNameLen = strlen(( char* )lParam ); - int idx; - char* szTemp = ( char* )alloca( cbSettingNameLen+2 ); - strcpy( szTemp+1, ( char* )lParam ); + size_t cbSettingNameLen = strlen(( char* )lParam) + 2; + if (cbSettingNameLen < 512) + { + char* szSetting; + int idx; + char szTemp[512]; + strcpy( szTemp+1, ( char* )lParam ); + + EnterCriticalSection(&csDbAccess); + if ( !li.List_GetIndex( &lSettings, szTemp, &idx )) + szSetting = InsertCachedSetting( szTemp, cbSettingNameLen, idx ); + else + szSetting = lSettings.items[ idx ]; - EnterCriticalSection(&csDbAccess); - if ( !li.List_GetIndex( &lSettings, szTemp, &idx )) - szSetting = InsertCachedSetting( szTemp, cbSettingNameLen+2, idx ); - else - szSetting = lSettings.items[ idx ]; + *szSetting = (char)wParam; - *szSetting = (char)wParam; + if ( !li.List_GetIndex( &lResidentSettings, szSetting+1, &idx )) + { + if (wParam) + li.List_Insert(&lResidentSettings,szSetting+1,idx); + } + else if (!wParam) + li.List_Remove(&lResidentSettings,idx); - LeaveCriticalSection(&csDbAccess); + LeaveCriticalSection(&csDbAccess); + } return 0; } @@ -513,13 +527,30 @@ static int WriteContactSetting(WPARAM wParam,LPARAM lParam) int settingNameLen=0; int moduleNameLen=0; int settingDataLen=0; - int bytesRequired,bytesRemaining; DWORD ofsContact,ofsSettingsGroup,ofsBlobPtr; if (dbcws == NULL) return 1; + // the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name + settingNameLen=strlen(dbcws->szSetting); + moduleNameLen=strlen(dbcws->szModule); + if ( settingNameLen > 0xFE ) + { + #ifdef _DEBUG + OutputDebugString("WriteContactSetting() got a > 255 setting name length. \n"); + #endif + return 1; + } + if ( moduleNameLen > 0xFE ) + { + #ifdef _DEBUG + OutputDebugString("WriteContactSetting() got a > 255 module name length. \n"); + #endif + return 1; + } + if (dbcws->value.type == DBVT_WCHAR) { if (dbcws->value.pszVal != NULL) { char* val = mir_utf8encodeW(dbcws->value.pwszVal); @@ -538,23 +569,6 @@ static int WriteContactSetting(WPARAM wParam,LPARAM lParam) return 1; if ((!dbcws->szModule) || (!dbcws->szSetting) || ((dbcws->value.type == DBVT_ASCIIZ || dbcws->value.type == DBVT_UTF8 )&& dbcws->value.pszVal == NULL) || (dbcws->value.type == DBVT_BLOB && dbcws->value.pbVal == NULL) ) return 1; - // the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name - settingNameLen=strlen(dbcws->szSetting); - moduleNameLen=strlen(dbcws->szModule); - if ( settingNameLen > 0xFE ) - { - #ifdef _DEBUG - OutputDebugString("WriteContactSetting() got a > 255 setting name length. \n"); - #endif - return 1; - } - if ( moduleNameLen > 0xFE ) - { - #ifdef _DEBUG - OutputDebugString("WriteContactSetting() got a > 255 module name length. \n"); - #endif - return 1; - } // the db can not tolerate strings/blobs longer than 0xFFFF since the format writes 2 lengths switch( dbcws->value.type ) { @@ -571,7 +585,7 @@ static int WriteContactSetting(WPARAM wParam,LPARAM lParam) EnterCriticalSection(&csDbAccess); { - char* szCachedSettingName = GetCachedSetting(dbcws->szModule, dbcws->szSetting, settingNameLen); + char* szCachedSettingName = GetCachedSetting(dbcws->szModule, dbcws->szSetting, moduleNameLen, settingNameLen); if ( dbcws->value.type != DBVT_BLOB ) { DBVARIANT* pCachedValue = GetCachedValuePtr((HANDLE)wParam, szCachedSettingName, 1); if ( pCachedValue != NULL ) { @@ -611,7 +625,7 @@ static int WriteContactSetting(WPARAM wParam,LPARAM lParam) } log0("write setting"); //make sure the module group exists - ofsSettingsGroup=GetSettingsGroupOfsByModuleNameOfs(&dbc,ofsContact,ofsModuleName); + ofsSettingsGroup=GetSettingsGroupOfsByModuleNameOfs(&dbc,ofsModuleName); if(ofsSettingsGroup==0) { //module group didn't exist - make it if(dbcws->value.type&DBVTF_VARIABLELENGTH) { if(dbcws->value.type==DBVT_ASCIIZ || dbcws->value.type==DBVT_UTF8) bytesRequired=strlen(dbcws->value.pszVal)+2; @@ -704,9 +718,8 @@ static int WriteContactSetting(WPARAM wParam,LPARAM lParam) if((DWORD)bytesRequired>dbcs.cbBlob) { //doesn't fit: move entire group struct DBContactSettings *dbcsPrev; - DWORD ofsDbcsPrev,oldSize,ofsNew; + DWORD ofsDbcsPrev,ofsNew; - InvalidateSettingsGroupOfsCacheEntry(ofsSettingsGroup); bytesRequired+=(DB_SETTINGS_RESIZE_GRANULARITY-(bytesRequired%DB_SETTINGS_RESIZE_GRANULARITY))%DB_SETTINGS_RESIZE_GRANULARITY; //find previous group to change its offset ofsDbcsPrev=dbc.ofsFirstSettings; @@ -714,17 +727,17 @@ static int WriteContactSetting(WPARAM wParam,LPARAM lParam) else { dbcsPrev=(struct DBContactSettings*)DBRead(ofsDbcsPrev,sizeof(struct DBContactSettings),NULL); while(dbcsPrev->ofsNext!=ofsSettingsGroup) { - if(dbcsPrev->ofsNext==0) DatabaseCorruption(); + if(dbcsPrev->ofsNext==0) DatabaseCorruption(NULL); ofsDbcsPrev=dbcsPrev->ofsNext; dbcsPrev=(struct DBContactSettings*)DBRead(ofsDbcsPrev,sizeof(struct DBContactSettings),NULL); } } + //create the new one - ofsNew=CreateNewSpace(bytesRequired+offsetof(struct DBContactSettings,blob)); - //copy across - DBMoveChunk(ofsNew,ofsSettingsGroup,bytesRequired+offsetof(struct DBContactSettings,blob)); - oldSize=dbcs.cbBlob; + ofsNew=ReallocSpace(ofsSettingsGroup, dbcs.cbBlob+offsetof(struct DBContactSettings,blob), bytesRequired+offsetof(struct DBContactSettings,blob)); + dbcs.cbBlob=bytesRequired; + DBWrite(ofsNew,&dbcs,offsetof(struct DBContactSettings,blob)); if(ofsDbcsPrev==0) { dbc.ofsFirstSettings=ofsNew; @@ -735,7 +748,6 @@ static int WriteContactSetting(WPARAM wParam,LPARAM lParam) dbcsPrev->ofsNext=ofsNew; DBWrite(ofsDbcsPrev,dbcsPrev,offsetof(struct DBContactSettings,blob)); } - DeleteSpace(ofsSettingsGroup,oldSize+offsetof(struct DBContactSettings,blob)); ofsBlobPtr+=ofsNew-ofsSettingsGroup; ofsSettingsGroup=ofsNew; pBlob=(PBYTE)DBRead(ofsBlobPtr,1,&bytesRemaining); @@ -780,14 +792,30 @@ static int DeleteContactSetting(WPARAM wParam,LPARAM lParam) DBCONTACTGETSETTING *dbcgs=(DBCONTACTGETSETTING*)lParam; struct DBContact *dbc; DWORD ofsModuleName,ofsSettingsGroup,ofsBlobPtr; - struct DBContactSettings dbcs; PBYTE pBlob; - int settingNameLen=strlen(dbcgs->szSetting),bytesRemaining; + int settingNameLen,moduleNameLen,bytesRemaining; char* szCachedSettingName; WPARAM saveWparam = wParam; if ((!dbcgs->szModule) || (!dbcgs->szSetting)) return 1; + // the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name + settingNameLen=strlen(dbcgs->szSetting); + moduleNameLen=strlen(dbcgs->szModule); + if ( settingNameLen > 0xFE ) + { + #ifdef _DEBUG + OutputDebugString("DeleteContactSetting() got a > 255 setting name length. \n"); + #endif + return 1; + } + if ( moduleNameLen > 0xFE ) + { + #ifdef _DEBUG + OutputDebugString("DeleteContactSetting() got a > 255 module name length. \n"); + #endif + return 1; + } EnterCriticalSection(&csDbAccess); ofsModuleName=GetModuleNameOfs(dbcgs->szModule); @@ -799,22 +827,11 @@ static int DeleteContactSetting(WPARAM wParam,LPARAM lParam) return 1; } //make sure the module group exists - ofsSettingsGroup=GetSettingsGroupOfsByModuleNameOfs(dbc,wParam,ofsModuleName); - if(ofsSettingsGroup==0) { - LeaveCriticalSection(&csDbAccess); - return 1; - } - dbc=(struct DBContact*)DBRead(wParam,sizeof(struct DBContact),NULL); - if(dbc->signature!=DBCONTACT_SIGNATURE) { - LeaveCriticalSection(&csDbAccess); - return 1; - } - ofsSettingsGroup=GetSettingsGroupOfsByModuleNameOfs(dbc,wParam,ofsModuleName); + ofsSettingsGroup=GetSettingsGroupOfsByModuleNameOfs(dbc,ofsModuleName); if(ofsSettingsGroup==0) { LeaveCriticalSection(&csDbAccess); return 1; } - dbcs=*(struct DBContactSettings*)DBRead(ofsSettingsGroup,sizeof(struct DBContactSettings),NULL); //find if the setting exists ofsBlobPtr=ofsSettingsGroup+offsetof(struct DBContactSettings,blob); pBlob=(PBYTE)DBRead(ofsBlobPtr,1,&bytesRemaining); @@ -851,14 +868,14 @@ static int DeleteContactSetting(WPARAM wParam,LPARAM lParam) DBMoveChunk(ofsSettingToCut,ofsSettingToCut+nameLen+valLen,ofsBlobPtr+1-ofsSettingToCut); } - szCachedSettingName = GetCachedSetting(dbcgs->szModule,dbcgs->szSetting,settingNameLen); + szCachedSettingName = GetCachedSetting(dbcgs->szModule,dbcgs->szSetting,moduleNameLen,settingNameLen); GetCachedValuePtr((HANDLE)saveWparam, szCachedSettingName, -1 ); //quit DBFlush(1); LeaveCriticalSection(&csDbAccess); { //notify - DBCONTACTWRITESETTING dbcws; + DBCONTACTWRITESETTING dbcws={0}; dbcws.szModule=dbcgs->szModule; dbcws.szSetting=dbcgs->szSetting; dbcws.value.type=DBVT_DELETED; @@ -870,8 +887,7 @@ static int DeleteContactSetting(WPARAM wParam,LPARAM lParam) static int EnumContactSettings(WPARAM wParam,LPARAM lParam) { DBCONTACTENUMSETTINGS *dbces=(DBCONTACTENUMSETTINGS*)lParam; - struct DBContact dbc; - struct DBContactSettings dbcs; + struct DBContact *dbc; DWORD ofsModuleName,ofsContact,ofsBlobPtr; int bytesRemaining, result; PBYTE pBlob; @@ -885,17 +901,16 @@ static int EnumContactSettings(WPARAM wParam,LPARAM lParam) ofsModuleName=GetModuleNameOfs(dbces->szModule); if(wParam==0) ofsContact=dbHeader.ofsUser; else ofsContact=wParam; - dbc=*(struct DBContact*)DBRead(ofsContact,sizeof(struct DBContact),NULL); - if(dbc.signature!=DBCONTACT_SIGNATURE) { + dbc=(struct DBContact*)DBRead(ofsContact,sizeof(struct DBContact),NULL); + if(dbc->signature!=DBCONTACT_SIGNATURE) { LeaveCriticalSection(&csDbAccess); return -1; } - dbces->ofsSettings=GetSettingsGroupOfsByModuleNameOfs(&dbc,ofsContact,ofsModuleName); + dbces->ofsSettings=GetSettingsGroupOfsByModuleNameOfs(dbc,ofsModuleName); if(!dbces->ofsSettings) { LeaveCriticalSection(&csDbAccess); return -1; } - dbcs=*(struct DBContactSettings*)DBRead(dbces->ofsSettings,sizeof(struct DBContactSettings),&bytesRemaining); ofsBlobPtr=dbces->ofsSettings+offsetof(struct DBContactSettings,blob); pBlob=(PBYTE)DBRead(ofsBlobPtr,1,&bytesRemaining); if(pBlob[0]==0) { @@ -917,6 +932,17 @@ static int EnumContactSettings(WPARAM wParam,LPARAM lParam) return result; } +static int EnumResidentSettings(WPARAM wParam,LPARAM lParam) +{ + int i; + int ret; + for(i = 0; i < lResidentSettings.realCount; i++) { + ret=((DBMODULEENUMPROC)lParam)(lResidentSettings.items[i],0,wParam); + if(ret) return ret; + } + return 0; +} + ///////////////////////////////////////////////////////////////////////////////////////// // // Module initialization procedure @@ -926,16 +952,18 @@ static int stringCompare( DBCachedSettingName* p1, DBCachedSettingName* p2 ) return strcmp( p1->name, p2->name ); } -static int stringCompare2( DBCachedGlobalValue* p1, DBCachedGlobalValue* p2 ) +static int ptrCompare( DBCachedGlobalValue* p1, DBCachedGlobalValue* p2 ) { - return strcmp( p1->name, p2->name ); + return (p1->name - p2->name); } -static int handleCompare( void* p1, void* p2 ) +static int stringCompare2( char* p1, char* p2 ) { - if ( *( long* )p1 == *( long* )p2 ) - return 0; + return strcmp( p1, p2); +} +static int handleCompare( void* p1, void* p2 ) +{ return *( long* )p1 - *( long* )p2; } @@ -949,15 +977,19 @@ int InitSettings(void) CreateServiceFunction(MS_DB_CONTACT_DELETESETTING,DeleteContactSetting); CreateServiceFunction(MS_DB_CONTACT_ENUMSETTINGS,EnumContactSettings); CreateServiceFunction(MS_DB_SETSETTINGRESIDENT,SetSettingResident); + CreateServiceFunction("DB/ResidentSettings/Enum",EnumResidentSettings); + hSettingChangeEvent=CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED); hCacheHeap=HeapCreate(0,0,0); lSettings.sortFunc=stringCompare; - lSettings.increment=50; + lSettings.increment=100; lContacts.sortFunc=handleCompare; - lContacts.increment=100; - lGlobalSettings.sortFunc=stringCompare2; - lGlobalSettings.increment=100; + lContacts.increment=50; + lGlobalSettings.sortFunc=ptrCompare; + lGlobalSettings.increment=50; + lResidentSettings.sortFunc=stringCompare2; + lResidentSettings.increment=50; return 0; } @@ -967,4 +999,5 @@ void UninitSettings(void) li.List_Destroy(&lContacts); li.List_Destroy(&lSettings); li.List_Destroy(&lGlobalSettings); + li.List_Destroy(&lResidentSettings); } diff --git a/db3x_autobackups/dbtime.c b/db3x_autobackups/dbtime.c index e9189b9..4544148 100644 --- a/db3x_autobackups/dbtime.c +++ b/db3x_autobackups/dbtime.c @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2003 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2003 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -#include "database.h" static int daysInMonth[12]={31,28,31,30,31,30,31,31,30,31,30,31}; static int IsLeapYear(int year) @@ -36,14 +35,14 @@ static int IsLeapYear(int year) static int CompareSystemTimes(SYSTEMTIME *st,SYSTEMTIME *switchDate) { FILETIME ft1,ft2; - + if(switchDate->wYear==0) { //strange day-in-month thing SYSTEMTIME tempst; //short-circuit if the months aren't the same if(st->wMonthwMonth) return -1; if(st->wMonth>switchDate->wMonth) return 1; - + tempst=*switchDate; tempst.wYear=st->wYear; tempst.wDay=1; diff --git a/db3x_autobackups/docs/db3x-license.txt b/db3x_autobackups/docs/db3x-license.txt deleted file mode 100644 index 7f11610..0000000 --- a/db3x_autobackups/docs/db3x-license.txt +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/db3x_autobackups/docs/db3x-readme.txt b/db3x_autobackups/docs/db3x-readme.txt deleted file mode 100644 index eb5707c..0000000 --- a/db3x_autobackups/docs/db3x-readme.txt +++ /dev/null @@ -1,38 +0,0 @@ -################################################################ -# Classic Database Driver for Miranda IM -################################################################ - -About ------ -The Classic Database Driver is used to store all contacts and -events in Miranda IM. - - -Requirements ------------- - - Miranda IM 0.4 - - -History -------- -0.4.0.0 - - DB driver separated from core (initial release) - - -Copyright ---------- -Copyright (C) 2003-2005 Miranda IM Development Team - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/db3x_autobackups/docs/db3x-translation.txt b/db3x_autobackups/docs/db3x-translation.txt deleted file mode 100644 index fc265cc..0000000 --- a/db3x_autobackups/docs/db3x-translation.txt +++ /dev/null @@ -1,43 +0,0 @@ -Miranda Language Pack Version 1 -Locale: 0809 -Authors: Miranda IM Development Team -Author-email: info@miranda-im.org -Last-Modified-Using: Miranda IM 0.4 -Plugins-included: - -; Generated by lpgen on Wed Apr 6 12:41:12 2005 -; Translations: 27 - -; database.c -;[Miranda has detected corruption in your database. This corruption maybe fixed by DBTool. Please download it from http://www.miranda-im.org. Miranda will now shutdown.] -;[Database Panic] - -; dbini.c -;[Invalid setting type. The first character of every value must be b, w, d, l, s or n.] -;[Install Database Settings] - -; resource.rc -;[&Allow all further changes to this section] -;[Yes] -;[&Yes] -;[No] -;[No to all] -;[&View contents] -;[&No] -;[Cancel Import] -;[&Recycle] -;[&Delete] -;[&Move/Rename] -;[&Leave] -;[A file containing new database settings has been placed in the Miranda IM directory.] -;[Do you want to import the settings now?] -;[Security systems to prevent malicious changes are in place and you will be warned before changes that are not known to be safe.] -;[Database settings are being imported from] -;[This file wishes to change the setting] -;[to the value] -;[Do you want to allow this change?] -;[The import has completed from] -;[What do you want to do with the file now?] -;[Database Setting Change] -;[Database Import Complete] - diff --git a/db3x_autobackups/encrypt.c b/db3x_autobackups/encrypt.c index 1382a27..bbd53bc 100644 --- a/db3x_autobackups/encrypt.c +++ b/db3x_autobackups/encrypt.c @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2003 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2003 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -#include "database.h" //VERY VERY VERY BASIC ENCRYPTION FUNCTION diff --git a/db3x_autobackups/init.c b/db3x_autobackups/init.c index a515d90..ae2e7fa 100644 --- a/db3x_autobackups/init.c +++ b/db3x_autobackups/init.c @@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -#include "database.h" -#include struct MM_INTERFACE mmi; struct LIST_INTERFACE li; @@ -135,11 +133,10 @@ static int UnloadDatabase(int wasLoaded) static int getFriendlyName( char * buf, size_t cch, int shortName ) { - strncpy(buf,shortName ? "db3x driver" : "db3x database support",cch); + strncpy(buf,shortName ? "db3x mmap driver" : "db3x mmap database support",cch); return 0; } - static DATABASELINK dblink = { sizeof(DATABASELINK), getCapability, @@ -150,41 +147,24 @@ static DATABASELINK dblink = { UnloadDatabase, }; -/* static PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), - "Miranda database driver", - PLUGIN_MAKE_VERSION(0,6,0,1), - "Provides Miranda database support: global settings, contacts, history, settings per contact.", + "Miranda mmap database driver - with AutoBackups", + __VERSION_DWORD, + "Provides Miranda database support and backup functionality", "Miranda-IM project", - "ghazan@miranda-im.org", - "Copyright 2000-2006 Miranda IM project", + "bio@msx.ru; ghazan@miranda-im.org; mail@scottellis.com.au", + "Copyright 2000-2007 Miranda IM project; Autobackups Copyright 2007 Scott Ellis", "", 0, DEFMOD_DB, - {0x1394a3ab, 0x2585, 0x4196, { 0x8f, 0x72, 0xe, 0xae, 0xc2, 0x45, 0xe, 0x11 }} //{1394A3AB-2585-4196-8F72-0EAEC2450E11} + { 0x9407902, 0x9b9b, 0x4f14, { 0xba, 0x18, 0xf6, 0x10, 0xbc, 0x1f, 0xde, 0x5f }} // {09407902-9B9B-4f14-BA18-F610BC1FDE5F} }; -*/ - -static PLUGININFOEX pluginInfo = { - sizeof(PLUGININFOEX), - "Miranda database - with AutoBackups", - PLUGIN_MAKE_VERSION(0,7,0,0), - "Provides Miranda database support: global settings, contacts, history, settings per contact.", - "Miranda-IM project", - "mail@scottellis.com.au", - "Copyright 2000-2007 Miranda-IM project", - "", - 0, - DEFMOD_DB, - //{0x1394a3ab, 0x2585, 0x4196, { 0x8f, 0x72, 0xe, 0xae, 0xc2, 0x45, 0xe, 0x11 }} //{1394A3AB-2585-4196-8F72-0EAEC2450E11} - { 0x52bbc116, 0x188a, 0x4b55, { 0x9a, 0x4f, 0xf6, 0x84, 0xb3, 0x46, 0x8b, 0x66 } } // {52BBC116-188A-4b55-9A4F-F684B3468B66} -}; BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID reserved) { - g_hInst = hInstDLL; + g_hInst=hInstDLL; return TRUE; } @@ -195,25 +175,11 @@ __declspec(dllexport) DATABASELINK* DatabasePluginInfo(void * reserved) __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirandaVersion) { - if ( mirandaVersion < PLUGIN_MAKE_VERSION(0,6,0,15)) { - MessageBox( NULL, _T("The db3x plugin cannot be loaded. It requires Miranda IM 0.6.0.15 or later."), _T("db3x Plugin"), MB_OK|MB_ICONWARNING|MB_SETFOREGROUND|MB_TOPMOST ); - return NULL; - } return &pluginInfo; } -__declspec(dllexport) PLUGININFO * MirandaPluginInfo(DWORD mirandaVersion) -{ - if ( mirandaVersion < PLUGIN_MAKE_VERSION(0,6,0,15)) { - MessageBox( NULL, _T("The db3x plugin cannot be loaded. It requires Miranda IM 0.6.0.15 or later."), _T("db3x Plugin"), MB_OK|MB_ICONWARNING|MB_SETFOREGROUND|MB_TOPMOST ); - return NULL; - } - pluginInfo.cbSize = sizeof(PLUGININFO); - return (PLUGININFO *)&pluginInfo; -} - static const MUUID interfaces[] = {MIID_DATABASE, MIID_LAST}; -__declspec(dllexport) const MUUID * MirandaPluginInterfaces(void) +__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) { return interfaces; } diff --git a/db3x_autobackups/options.c b/db3x_autobackups/options.c index f477ddf..b6e7034 100644 --- a/db3x_autobackups/options.c +++ b/db3x_autobackups/options.c @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include -#include "database.h" +#//include "database.h" #include "options.h" extern HINSTANCE g_hInst; diff --git a/db3x_autobackups/resource.h b/db3x_autobackups/resource.h index 3e69e1e..21d30cf 100644 --- a/db3x_autobackups/resource.h +++ b/db3x_autobackups/resource.h @@ -1,13 +1,14 @@ //{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by resource.rc +// Microsoft Visual C++ generated include file. +// Used by db3x_mmap.rc // #define IDC_NOTOALL 3 #define IDD_INSTALLINI 235 #define IDD_WARNINICHANGE 236 #define IDD_INIIMPORTDONE 237 -#define IDD_OPTIONS 238 -#define IDD_COPYPROGRESS 239 +#define IDD_OPTIONS 238 +#define IDD_COPYPROGRESS 239 +#define IDI_MENU 240 #define IDC_ININAME 1333 #define IDC_VIEWINI 1334 #define IDC_SECURITYINFO 1335 @@ -19,25 +20,20 @@ #define IDC_NEWNAME 1341 #define IDC_MOVE 1342 #define IDC_LEAVE 1343 - -#define IDC_ED_PERIOD 1344 -#define IDC_RAD_DAYS 1345 -#define IDC_RAD_HOURS 1346 -#define IDC_ED_FOLDER 1347 -#define IDC_BUT_BROWSE 1348 -#define IDC_ED_NUMBACKUPS 1349 -#define IDC_BUT_NOW 1350 -#define IDC_CHK_NOPROG 1351 -#define IDC_RAD_DISABLED 1352 -#define IDC_RAD_START 1353 -#define IDC_RAD_EXIT 1354 -#define IDC_RAD_PERIODIC 1355 - -#define IDC_PROGRESS 1356 -#define IDC_PROGRESSMESSAGE 1357 - -#define IDI_MENU 240 - +#define IDC_ED_PERIOD 1344 +#define IDC_RAD_DAYS 1345 +#define IDC_RAD_HOURS 1346 +#define IDC_ED_FOLDER 1347 +#define IDC_BUT_BROWSE 1348 +#define IDC_ED_NUMBACKUPS 1349 +#define IDC_BUT_NOW 1350 +#define IDC_CHK_NOPROG 1351 +#define IDC_RAD_DISABLED 1352 +#define IDC_RAD_START 1353 +#define IDC_RAD_EXIT 1354 +#define IDC_RAD_PERIODIC 1355 +#define IDC_PROGRESS 1356 +#define IDC_PROGRESSMESSAGE 1357 // Next default values for new objects // diff --git a/db3x_autobackups/resource.rc b/db3x_autobackups/resource.rc index 9d5d1da..47b87e4 100644 --- a/db3x_autobackups/resource.rc +++ b/db3x_autobackups/resource.rc @@ -1,248 +1,2 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_INSTALLINI DIALOGEX 0, 0, 212, 102 -STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "Install Database Settings" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "Yes",IDOK,26,83,50,14 - PUSHBUTTON "No",IDCANCEL,81,83,50,14 - LTEXT "A file containing new database settings has been placed in the Miranda IM directory.",IDC_STATIC,5,5,202,16 - LTEXT "Do you want to import the settings now?",IDC_STATIC,5,69,202,8 - PUSHBUTTON "No to all",IDC_NOTOALL,136,83,50,14 - LTEXT "",IDC_ININAME,5,24,143,16,SS_NOPREFIX | SS_CENTERIMAGE - PUSHBUTTON "&View contents",IDC_VIEWINI,149,25,58,14 - LTEXT "Security systems to prevent malicious changes are in place and you will be warned before changes that are not known to be safe.",IDC_SECURITYINFO,5,43,202,24 -END - -IDD_WARNINICHANGE DIALOGEX 0, 0, 187, 113 -STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "Database Setting Change" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Database settings are being imported from",IDC_STATIC,5, - 5,177,8 - CONTROL "",IDC_ININAME,"Static",SS_SIMPLE | SS_NOPREFIX | - WS_GROUP,5,13,177,8 - LTEXT "This file wishes to change the setting",IDC_STATIC,5,24, - 177,8 - CONTROL "",IDC_SETTINGNAME,"Static",SS_SIMPLE | SS_NOPREFIX | - WS_GROUP,12,33,170,8 - LTEXT "to the value",IDC_STATIC,5,42,177,8 - CONTROL "",IDC_NEWVALUE,"Static",SS_SIMPLE | SS_NOPREFIX | - WS_GROUP,12,51,170,8 - LTEXT "",IDC_SECURITYINFO,5,60,177,8 - LTEXT "Do you want to allow this change?",IDC_STATIC,5,71,177,8 - CONTROL "&Allow all further changes to this section",IDC_WARNNOMORE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,80,169,10 - DEFPUSHBUTTON "&Yes",IDYES,5,94,50,14 - PUSHBUTTON "&No",IDNO,59,94,50,14 - PUSHBUTTON "Cancel Import",IDCANCEL,123,94,59,14 -END - -IDD_INIIMPORTDONE DIALOGEX 0, 0, 186, 73 -STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "Database Import Complete" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "The import has completed from",IDC_STATIC,5,5,176,8 - CONTROL "",IDC_ININAME,"Static",SS_SIMPLE | SS_NOPREFIX | - WS_GROUP,5,13,176,8 - LTEXT "What do you want to do with the file now?",IDC_STATIC,5, - 24,176,8 - PUSHBUTTON "&Recycle",IDC_RECYCLE,5,36,50,14 - PUSHBUTTON "&Delete",IDC_DELETE,68,36,50,14 - EDITTEXT IDC_NEWNAME,5,55,117,12,ES_AUTOHSCROLL - PUSHBUTTON "&Move/Rename",IDC_MOVE,124,54,57,14 - PUSHBUTTON "&Leave",IDC_LEAVE,131,36,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_INSTALLINI, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 207 - TOPMARGIN, 5 - BOTTOMMARGIN, 97 - END - - IDD_WARNINICHANGE, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 182 - TOPMARGIN, 5 - BOTTOMMARGIN, 108 - END - - IDD_INIIMPORTDONE, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 181 - TOPMARGIN, 5 - BOTTOMMARGIN, 68 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include \0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (Australia) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_OPTIONS DIALOGEX 0, 0, 277, 228 -STYLE DS_SETFONT | WS_POPUP -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Automatic Backups",IDC_STATIC,7,7,263,214,WS_GROUP - RTEXT "Every:",IDC_STATIC,39,97,52,8 - EDITTEXT IDC_ED_PERIOD,98,93,28,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT - GROUPBOX "",IDC_STATIC,143,81,89,36,WS_GROUP - CONTROL "Days",IDC_RAD_DAYS,"Button",BS_AUTORADIOBUTTON | WS_GROUP,149,89,70,10 - CONTROL "Hours",IDC_RAD_HOURS,"Button",BS_AUTORADIOBUTTON,149,103,70,10 - EDITTEXT IDC_ED_FOLDER,18,163,176,14,ES_AUTOHSCROLL - LTEXT "Backup to folder:",IDC_STATIC,30,150,164,8 - PUSHBUTTON "Browse...",IDC_BUT_BROWSE,200,163,60,14 - RTEXT "Number of backups to keep:",IDC_STATIC,34,129,132,8 - EDITTEXT IDC_ED_NUMBACKUPS,175,127,28,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT - PUSHBUTTON "Backup NOW",IDC_BUT_NOW,95,199,75,14 - CONTROL "Disable progress bar",IDC_CHK_NOPROG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,182,184,10 - CONTROL "Disabled",IDC_RAD_DISABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,22,156,10 - CONTROL "When Miranda starts",IDC_RAD_START,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,40,156,10 - CONTROL "When Miranda exits",IDC_RAD_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,58,156,10 - CONTROL "Periodically:",IDC_RAD_PERIODIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,76,106,10 -END - -IDD_COPYPROGRESS DIALOG 0, 0, 254, 148 -STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION -CAPTION "Backup in Progress" -FONT 8, "MS Sans Serif" -BEGIN - PUSHBUTTON "Cancel",IDCANCEL,102,97,50,14 - CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,46,64,163,14 - EDITTEXT IDC_PROGRESSMESSAGE,31,37,190,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_OPTIONS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 270 - TOPMARGIN, 7 - BOTTOMMARGIN, 221 - END - - IDD_COPYPROGRESS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 247 - TOPMARGIN, 7 - BOTTOMMARGIN, 141 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MENU ICON "icon1.ico" -#endif // English (Australia) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED +#include "db3x_mmap.rc" +#include "version.rc" diff --git a/db3x_autobackups/sync.bat b/db3x_autobackups/sync.bat deleted file mode 100644 index 60d3f6b..0000000 --- a/db3x_autobackups/sync.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off - -rem *** this is just a dummy file, so that the 'post-build' copied from the project I -rem *** modified in miranda's svn does not cause an error :) \ No newline at end of file diff --git a/db3x_autobackups/version.h b/db3x_autobackups/version.h new file mode 100644 index 0000000..5bd20bc --- /dev/null +++ b/db3x_autobackups/version.h @@ -0,0 +1,3 @@ +#define __FILEVERSION_STRING 0,7,4,0 +#define __VERSION_STRING "0.7.4.0" +#define __VERSION_DWORD 0x00070400 diff --git a/db3x_autobackups/version.rc b/db3x_autobackups/version.rc new file mode 100644 index 0000000..4cb51b5 --- /dev/null +++ b/db3x_autobackups/version.rc @@ -0,0 +1,39 @@ + +#include +#include "version.h" + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "041904b0" + BEGIN + VALUE "FileDescription", "Miranda IM Mmap DataBase Engine 3x" + VALUE "FileVersion", __VERSION_STRING + VALUE "LegalCopyright", "Copyright (C) 2000-2007" + VALUE "OriginalFilename", "dbx_mmap.dll" + VALUE "ProductName", "Miranda IM Mmap DataBase Engine 3x" + VALUE "ProductVersion", __VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x419, 1200 + END +END -- cgit v1.2.3