extensions/bintools/extension.h
author Scott Ehlert <ds@alliedmods.net>
Wed May 09 05:20:03 2007 +0000 (2007-05-09)
changeset 757 b799caa9a190
parent 739 d22243bb5864
child 1226 478550a4d5ec
permissions -rw-r--r--
Whew, massive-ish reorgranization for extensions and such. I will inevitably be shot for this.
(Yes, bail, it all compiles on both platforms)
faluco@739
     1
/**
faluco@739
     2
 * vim: set ts=4 :
faluco@739
     3
 * ===============================================================
ds@757
     4
 * SourceMod BinTools Extension
ds@757
     5
 * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
faluco@739
     6
 * ===============================================================
faluco@739
     7
 *
ds@757
     8
 * This program is free software; you can redistribute it and/or
ds@757
     9
 * modify it under the terms of the GNU General Public License
ds@757
    10
 * as published by the Free Software Foundation; either version 2
ds@757
    11
 * of the License, or (at your option) any later version.
ds@757
    12
 * This program is distributed in the hope that it will be useful,
ds@757
    13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ds@757
    14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ds@757
    15
 * GNU General Public License for more details.
faluco@739
    16
 * 
ds@757
    17
 * You should have received a copy of the GNU General Public License
ds@757
    18
 * along with this program; if not, write to the Free Software
ds@757
    19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
faluco@739
    20
 *
faluco@739
    21
 * Version: $Id$
faluco@739
    22
 */
faluco@739
    23
faluco@739
    24
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
faluco@739
    25
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
faluco@739
    26
faluco@739
    27
/**
faluco@739
    28
 * @file extension.h
faluco@739
    29
 * @brief Sample extension code header.
faluco@739
    30
 */
faluco@739
    31
faluco@739
    32
#include "smsdk_ext.h"
faluco@739
    33
faluco@739
    34
faluco@739
    35
/**
ds@757
    36
 * @brief Implementation of the BinTools extension.
faluco@739
    37
 * Note: Uncomment one of the pre-defined virtual functions in order to use it.
faluco@739
    38
 */
faluco@739
    39
class BinTools : public SDKExtension
faluco@739
    40
{
faluco@739
    41
public:
faluco@739
    42
	/**
faluco@739
    43
	 * @brief This is called after the initial loading sequence has been processed.
faluco@739
    44
	 *
faluco@739
    45
	 * @param error		Error message buffer.
ds@757
    46
	 * @param maxlength	Size of error message buffer.
faluco@739
    47
	 * @param late		Whether or not the module was loaded after map load.
faluco@739
    48
	 * @return			True to succeed loading, false to fail.
faluco@739
    49
	 */
ds@757
    50
	virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
faluco@739
    51
	
faluco@739
    52
	/**
faluco@739
    53
	 * @brief This is called right before the extension is unloaded.
faluco@739
    54
	 */
faluco@739
    55
	//virtual void SDK_OnUnload();
faluco@739
    56
faluco@739
    57
	/**
faluco@739
    58
	 * @brief This is called once all known extensions have been loaded.
faluco@739
    59
	 * Note: It is is a good idea to add natives here, if any are provided.
faluco@739
    60
	 */
faluco@739
    61
	//virtual void SDK_OnAllLoaded();
faluco@739
    62
faluco@739
    63
	/**
faluco@739
    64
	 * @brief Called when the pause state is changed.
faluco@739
    65
	 */
faluco@739
    66
	//virtual void SDK_OnPauseChange(bool paused);
faluco@739
    67
faluco@739
    68
	/**
faluco@739
    69
	 * @brief this is called when Core wants to know if your extension is working.
faluco@739
    70
	 *
faluco@739
    71
	 * @param error		Error message buffer.
ds@757
    72
	 * @param maxlength	Size of error message buffer.
faluco@739
    73
	 * @return			True if working, false otherwise.
faluco@739
    74
	 */
ds@757
    75
	//virtual bool QueryRunning(char *error, size_t maxlength);
faluco@739
    76
public:
faluco@739
    77
#if defined SMEXT_CONF_METAMOD
faluco@739
    78
	/**
ds@757
    79
	 * @brief Called when Metamod is attached, before the extension version is called.
ds@757
    80
	 *
ds@757
    81
	 * @param error			Error buffer.
ds@757
    82
	 * @param maxlength		Maximum size of error buffer.
ds@757
    83
	 * @param late			Whether or not Metamod considers this a late load.
ds@757
    84
	 * @return				True to succeed, false to fail.
faluco@739
    85
	 */
ds@757
    86
	//virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late);
faluco@739
    87
ds@757
    88
	/**
ds@757
    89
	 * @brief Called when Metamod is detaching, after the extension version is called.
ds@757
    90
	 * NOTE: By default this is blocked unless sent from SourceMod.
ds@757
    91
	 *
ds@757
    92
	 * @param error			Error buffer.
ds@757
    93
	 * @param maxlength		Maximum size of error buffer.
ds@757
    94
	 * @return				True to succeed, false to fail.
ds@757
    95
	 */
ds@757
    96
	//virtual bool SDK_OnMetamodUnload(char *error, size_t maxlength);
ds@757
    97
ds@757
    98
	/**
ds@757
    99
	 * @brief Called when Metamod's pause state is changing.
ds@757
   100
	 * NOTE: By default this is blocked unless sent from SourceMod.
ds@757
   101
	 *
ds@757
   102
	 * @param paused		Pause state being set.
ds@757
   103
	 * @param error			Error buffer.
ds@757
   104
	 * @param maxlength		Maximum size of error buffer.
ds@757
   105
	 * @return				True to succeed, false to fail.
ds@757
   106
	 */
ds@757
   107
	//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength);
faluco@739
   108
#endif
faluco@739
   109
};
faluco@739
   110
faluco@739
   111
extern ISourcePawnEngine *g_SPEngine;
faluco@739
   112
ds@757
   113
#endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_