extensions/mysql/extension.cpp
author David Anderson <dvander@alliedmods.net>
Fri Jun 22 17:24:48 2007 +0000 (2007-06-22)
changeset 1002 786f5abf93ea
parent 862 b8636f596080
child 1095 a9d7047a8d4b
permissions -rw-r--r--
fixed a bug where the "keyOnly" parameter to KvGotoNextKey was read backwards
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * Sample SourceMod Extension
     5  * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
     6  * ===============================================================
     7  *
     8  * This program is free software; you can redistribute it and/or
     9  * modify it under the terms of the GNU General Public License
    10  * as published by the Free Software Foundation; either version 2
    11  * of the License, or (at your option) any later version.
    12  * This program is distributed in the hope that it will be useful,
    13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    15  * GNU General Public License for more details.
    16  * 
    17  * You should have received a copy of the GNU General Public License
    18  * along with this program; if not, write to the Free Software
    19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    20  *
    21  * Version: $Id: extension.cpp 763 2007-05-09 05:20:03Z damagedsoul $
    22  */
    23 
    24 #include "extension.h"
    25 #include "mysql/MyDriver.h"
    26 #include <assert.h>
    27 #include <stdlib.h>
    28 
    29 /**
    30  * @file extension.cpp
    31  * @brief Implement extension code here.
    32  */
    33 
    34 DBI_MySQL g_MySqlDBI;		/**< Global singleton for extension's main interface */
    35 
    36 SMEXT_LINK(&g_MySqlDBI);
    37 
    38 bool DBI_MySQL::SDK_OnLoad(char *error, size_t maxlength, bool late)
    39 {
    40 	dbi->AddDriver(&g_MyDriver);
    41 
    42 	return true;
    43 }
    44 
    45 void DBI_MySQL::SDK_OnUnload()
    46 {
    47 	dbi->RemoveDriver(&g_MyDriver);
    48 }