summaryrefslogtreecommitdiff
path: root/modules/dbsqlite/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/dbsqlite/main.cpp')
-rw-r--r--modules/dbsqlite/main.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/dbsqlite/main.cpp b/modules/dbsqlite/main.cpp
new file mode 100644
index 0000000..c6462df
--- /dev/null
+++ b/modules/dbsqlite/main.cpp
@@ -0,0 +1,56 @@
+#include <windows.h>
+#include <stdio.h>
+
+#include <pluginapi.h>
+#include <plugin_helper.h>
+
+#include "sqlite3.h"
+
+PLUGINLINK *pluginLink;
+sqlite3* db;
+char* db_err;
+
+HINSTANCE hInst;
+BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
+{
+ hInst = hinstDLL;
+ return TRUE;
+}
+
+PLUGININFO pluginInfo =
+{
+ sizeof(PLUGININFO),
+ (char*)"SQLite database support plugin",
+ (char*)"Support for data storage in local sql database through libsqlite",
+ (char*)"sss",
+ (char*)"sss123next@list.ru",
+ PLUGIN_MAKE_VERSION(0,0,0,1),
+ F_DB_PLUGIN
+};
+
+extern "C" __declspec(dllexport) PLUGININFO* SetPluginInfo()
+{
+ return &pluginInfo;
+}
+
+extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ pluginLink = link;
+ sqlite3_open(".\\database.sql3", &db);
+ MessageBoxA(0, "dbsqlite plugin loaded", "INFO", MB_OK);
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) OnModulesLoaded()
+{
+// sqlite3_exec(db, "", 0, 0, &db_err);
+ for(;;)
+ Sleep(1000);
+ return 0;
+}
+extern "C" int __declspec(dllexport) Unload()
+{
+ sqlite3_close(db);
+ return 0;
+}
+