2006-04-23 05:10:06 +04:00
|
|
|
#include "amxxmodule.h"
|
|
|
|
#include "mysql2_header.h"
|
|
|
|
|
2006-05-08 01:40:12 +04:00
|
|
|
static g_ident = 0;
|
|
|
|
|
2006-04-23 05:10:06 +04:00
|
|
|
void OnAmxxAttach()
|
|
|
|
{
|
|
|
|
MF_AddNatives(g_BaseSqlNatives);
|
|
|
|
MF_AddNatives(g_ThreadSqlNatives);
|
2006-04-24 14:27:25 +04:00
|
|
|
MF_RegisterFunction(&g_Mysql, "GetSqlDriver");
|
2006-05-11 16:11:42 +04:00
|
|
|
if (!MF_RequestFunction("GetDbDriver") && !MF_FindLibrary("SQLITE", LibType_Library))
|
2006-04-24 14:27:25 +04:00
|
|
|
{
|
|
|
|
MF_AddNatives(g_OldCompatNatives);
|
2006-05-08 01:40:12 +04:00
|
|
|
MF_AddLibraries("dbi", LibType_Class, &g_ident);
|
2006-04-24 14:27:25 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-05-08 01:40:12 +04:00
|
|
|
void OnAmxxDetach()
|
|
|
|
{
|
|
|
|
ShutdownThreading();
|
|
|
|
MF_RemoveLibraries(&g_ident);
|
|
|
|
}
|
|
|
|
|
|
|
|
void OnPluginsUnloaded()
|
2006-04-24 14:27:25 +04:00
|
|
|
{
|
|
|
|
FreeAllHandles(Handle_OldResult);
|
|
|
|
FreeAllHandles(Handle_OldDb);
|
|
|
|
FreeAllHandles(Handle_Connection);
|
2006-04-23 05:10:06 +04:00
|
|
|
}
|
2006-04-24 19:14:34 +04:00
|
|
|
|