1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/extensions/mysql/extension.cpp Wed May 30 03:25:18 2007 +0000
1.3 @@ -0,0 +1,48 @@
1.4 +/**
1.5 + * vim: set ts=4 :
1.6 + * ===============================================================
1.7 + * Sample SourceMod Extension
1.8 + * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
1.9 + * ===============================================================
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or
1.12 + * modify it under the terms of the GNU General Public License
1.13 + * as published by the Free Software Foundation; either version 2
1.14 + * of the License, or (at your option) any later version.
1.15 + * This program is distributed in the hope that it will be useful,
1.16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.18 + * GNU General Public License for more details.
1.19 + *
1.20 + * You should have received a copy of the GNU General Public License
1.21 + * along with this program; if not, write to the Free Software
1.22 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1.23 + *
1.24 + * Version: $Id: extension.cpp 763 2007-05-09 05:20:03Z damagedsoul $
1.25 + */
1.26 +
1.27 +#include "extension.h"
1.28 +#include "mysql/MyDriver.h"
1.29 +#include <assert.h>
1.30 +#include <stdlib.h>
1.31 +
1.32 +/**
1.33 + * @file extension.cpp
1.34 + * @brief Implement extension code here.
1.35 + */
1.36 +
1.37 +DBI_MySQL g_MySqlDBI; /**< Global singleton for extension's main interface */
1.38 +
1.39 +SMEXT_LINK(&g_MySqlDBI);
1.40 +
1.41 +bool DBI_MySQL::SDK_OnLoad(char *error, size_t maxlength, bool late)
1.42 +{
1.43 + dbi->AddDriver(&g_MyDriver);
1.44 +
1.45 + return true;
1.46 +}
1.47 +
1.48 +void DBI_MySQL::SDK_OnUnload()
1.49 +{
1.50 + dbi->RemoveDriver(&g_MyDriver);
1.51 +}