amxmodx/dlls/mysqlx/module.cpp

31 lines
607 B
C++
Raw Normal View History

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