trace_plugin/plugin.cpp
author Scott Ehlert <ds@alliedmods.net>
Thu Sep 26 17:00:32 2013 -0500 (2013-09-26)
changeset 284 ca90ccdb8d49
parent 0 d15304fcb7a7
permissions -rw-r--r--
Fixed makefile error when issuing 'make clean' or 'make distclean'.
     1 // vi: set ts=4 sw=4 :
     2 // vim: set tw=75 :
     3 
     4 // plugin.cpp - generic plugin operation
     5 
     6 /*
     7  * Copyright (c) 2001-2003 Will Day <[email protected]>
     8  *
     9  *    This file is part of Metamod.
    10  *
    11  *    Metamod is free software; you can redistribute it and/or modify it
    12  *    under the terms of the GNU General Public License as published by the
    13  *    Free Software Foundation; either version 2 of the License, or (at
    14  *    your option) any later version.
    15  *
    16  *    Metamod is distributed in the hope that it will be useful, but
    17  *    WITHOUT ANY WARRANTY; without even the implied warranty of
    18  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    19  *    General Public License for more details.
    20  *
    21  *    You should have received a copy of the GNU General Public License
    22  *    along with Metamod; if not, write to the Free Software Foundation,
    23  *    Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    24  *
    25  *    In addition, as a special exception, the author gives permission to
    26  *    link the code of this program with the Half-Life Game Engine ("HL
    27  *    Engine") and Modified Game Libraries ("MODs") developed by Valve,
    28  *    L.L.C ("Valve").  You must obey the GNU General Public License in all
    29  *    respects for all of the code used other than the HL Engine and MODs
    30  *    from Valve.  If you modify this file, you may extend this exception
    31  *    to your version of the file, but you are not obligated to do so.  If
    32  *    you do not wish to do so, delete this exception statement from your
    33  *    version.
    34  *
    35  */
    36 
    37 #include <extdll.h>
    38 
    39 #include <meta_api.h>
    40 
    41 #include "plugin.h"
    42 #include "log_plugin.h"
    43 #include "trace_api.h"
    44 
    45 // Must provide at least one of these..
    46 META_FUNCTIONS gMetaFunctionTable = {
    47 	NULL,			// pfnGetEntityAPI				HL SDK; called before game DLL
    48 	NULL,			// pfnGetEntityAPI_Post			META; called after game DLL
    49 	GetEntityAPI2,	// pfnGetEntityAPI2				HL SDK2; called before game DLL
    50 	GetEntityAPI2_Post,			// pfnGetEntityAPI2_Post		META; called after game DLL
    51 	GetNewDLLFunctions,			// pfnGetNewDLLFunctions		HL SDK2; called before game DLL
    52 	GetNewDLLFunctions_Post,	// pfnGetNewDLLFunctions_Post	META; called after game DLL
    53 	GetEngineFunctions,			// pfnGetEngineFunctions		META; called before HL engine
    54 	GetEngineFunctions_Post,	// pfnGetEngineFunctions_Post	META; called after HL engine
    55 };
    56 
    57 cvar_t init_plugin_debug = {"trace_debug", "0", FCVAR_EXTDLL, 0, NULL};
    58 
    59 
    60 // Meta_Query, any desired checks for valid use.
    61 int plugin_query(void) {
    62 	return(TRUE);
    63 }
    64 
    65 // Meta_Attach.  Plugin startup.  Register commands and cvars.
    66 int plugin_attach(void) {
    67 	log_init("trace_debug");
    68 	trace_init();
    69 	return(TRUE);
    70 }
    71 
    72 // Meta_Detach.  Cleaning up.
    73 int plugin_detach(void) {
    74 	return(TRUE);
    75 }