ds@1952: /**
ds@1952: * vim: set ts=4 :
ds@1952: * =============================================================================
ds@1952: * SourceMod BinTools Extension
ds@1952: * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
ds@1952: * =============================================================================
ds@1952: *
ds@1952: * This program is free software; you can redistribute it and/or modify it under
ds@1952: * the terms of the GNU General Public License, version 3.0, as published by the
ds@1952: * Free Software Foundation.
ds@1952: *
ds@1952: * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1952: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1952: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
ds@1952: * details.
ds@1952: *
ds@1952: * You should have received a copy of the GNU General Public License along with
ds@1952: * this program. If not, see .
ds@1952: *
ds@1952: * As a special exception, AlliedModders LLC gives you permission to link the
ds@1952: * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1952: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1952: * by the Valve Corporation. You must obey the GNU General Public License in
ds@1952: * all respects for all other code used. Additionally, AlliedModders LLC grants
ds@1952: * this exception to all derivative works. AlliedModders LLC defines further
ds@1952: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1952: * or .
ds@1952: *
ds@1952: * Version: $Id$
ds@1952: */
ds@1952:
ds@1952: #ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
ds@1952: #define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
ds@1952:
ds@1952: /**
ds@1952: * @file extension.h
ds@1952: * @brief Sample extension code header.
ds@1952: */
ds@1952:
ds@1952: #include "smsdk_ext.h"
ds@1952:
ds@1952:
ds@1952: /**
ds@1952: * @brief Implementation of the BinTools extension.
ds@1952: * Note: Uncomment one of the pre-defined virtual functions in order to use it.
ds@1952: */
ds@1952: class BinTools : public SDKExtension
ds@1952: {
ds@1952: public:
ds@1952: /**
ds@1952: * @brief This is called after the initial loading sequence has been processed.
ds@1952: *
ds@1952: * @param error Error message buffer.
ds@1952: * @param maxlength Size of error message buffer.
ds@1952: * @param late Whether or not the module was loaded after map load.
ds@1952: * @return True to succeed loading, false to fail.
ds@1952: */
ds@1952: virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
ds@1952:
ds@1952: /**
ds@1952: * @brief This is called right before the extension is unloaded.
ds@1952: */
ds@1952: //virtual void SDK_OnUnload();
ds@1952:
ds@1952: /**
ds@1952: * @brief This is called once all known extensions have been loaded.
ds@1952: * Note: It is is a good idea to add natives here, if any are provided.
ds@1952: */
ds@1952: //virtual void SDK_OnAllLoaded();
ds@1952:
ds@1952: /**
ds@1952: * @brief Called when the pause state is changed.
ds@1952: */
ds@1952: //virtual void SDK_OnPauseChange(bool paused);
ds@1952:
ds@1952: /**
ds@1952: * @brief this is called when Core wants to know if your extension is working.
ds@1952: *
ds@1952: * @param error Error message buffer.
ds@1952: * @param maxlength Size of error message buffer.
ds@1952: * @return True if working, false otherwise.
ds@1952: */
ds@1952: //virtual bool QueryRunning(char *error, size_t maxlength);
ds@1952: public:
ds@1952: #if defined SMEXT_CONF_METAMOD
ds@1952: /**
ds@1952: * @brief Called when Metamod is attached, before the extension version is called.
ds@1952: *
ds@1952: * @param error Error buffer.
ds@1952: * @param maxlength Maximum size of error buffer.
ds@1952: * @param late Whether or not Metamod considers this a late load.
ds@1952: * @return True to succeed, false to fail.
ds@1952: */
ds@1952: //virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late);
ds@1952:
ds@1952: /**
ds@1952: * @brief Called when Metamod is detaching, after the extension version is called.
ds@1952: * NOTE: By default this is blocked unless sent from SourceMod.
ds@1952: *
ds@1952: * @param error Error buffer.
ds@1952: * @param maxlength Maximum size of error buffer.
ds@1952: * @return True to succeed, false to fail.
ds@1952: */
ds@1952: //virtual bool SDK_OnMetamodUnload(char *error, size_t maxlength);
ds@1952:
ds@1952: /**
ds@1952: * @brief Called when Metamod's pause state is changing.
ds@1952: * NOTE: By default this is blocked unless sent from SourceMod.
ds@1952: *
ds@1952: * @param paused Pause state being set.
ds@1952: * @param error Error buffer.
ds@1952: * @param maxlength Maximum size of error buffer.
ds@1952: * @return True to succeed, false to fail.
ds@1952: */
ds@1952: //virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength);
ds@1952: #endif
ds@1952: };
ds@1952:
ds@1952: extern ISourcePawnEngine *g_SPEngine;
ds@1952:
ds@1952: #endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_