diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-05 00:46:19 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-05 00:46:19 +0300 |
commit | a8527496d9c8eb81710e718be7be8a9ae62a48b4 (patch) | |
tree | 962767f520dd3dea8f23fbd7161114fcab1431ff /modules/dbsqlite/main.cpp | |
parent | 03951c212bc3054a6b89a9fff9a125bace52224d (diff) |
new file: api/core_services.h
modified: api/pluginapi.h
modified: core/main.cpp
modified: core/plugin.h
new file: core/sqlite3.dll
new file: lib/libsqlite3.a
new file: modules/dbsqlite/Makefile
new file: modules/dbsqlite/main.cpp
new file: modules/dbsqlite/sqlite3.h
modified: modules/example/main.cpp
Diffstat (limited to 'modules/dbsqlite/main.cpp')
-rw-r--r-- | modules/dbsqlite/main.cpp | 56 |
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; +} + |