made the headers a bit more doxygen friendly
authorDavid Anderson <dvander@alliedmods.net>
Mon Feb 18 23:11:25 2008 +0000 (2008-02-18)
changeset 513ed5a3e60826a
parent 512 ba8057900247
child 514 099d37d50e04
made the headers a bit more doxygen friendly
sourcemm/IPluginManager.h
sourcemm/ISmmAPI.h
sourcemm/ISmmPlugin.h
sourcemm/ISmmPluginExt.h
sourcemm/svn_version.h
     1.1 --- a/sourcemm/IPluginManager.h	Mon Feb 18 03:57:26 2008 +0000
     1.2 +++ b/sourcemm/IPluginManager.h	Mon Feb 18 23:11:25 2008 +0000
     1.3 @@ -1,4 +1,4 @@
     1.4 -/**
     1.5 +/*
     1.6   * vim: set ts=4 :
     1.7   * ======================================================
     1.8   * Metamod:Source
     1.9 @@ -60,6 +60,9 @@
    1.10  		Pl_Running=0,
    1.11  	};
    1.12  
    1.13 +	/**
    1.14 +	 * @brief Programmatic management of the "loaded plugin" list.
    1.15 +	 */
    1.16  	class ISmmPluginManager
    1.17  	{
    1.18  	public:
    1.19 @@ -68,51 +71,50 @@
    1.20  		 *  then the plugin is considered to be "hot" - it might refuse its own load later!
    1.21  		 *  Also, a hot plugin might not have an error message.
    1.22  		 *
    1.23 -		 * @param file String containing file name
    1.24 -		 * @param source Specifies who loaded the plugin
    1.25 -		 * @param status Status of the plugin 
    1.26 -		 * @param ismm Pointer to Smm API
    1.27 -		 * @param error String buffer for error messages
    1.28 -		 * @param maxlen Maximum length of buffer
    1.29 -		 * @return Id of plugin
    1.30 +		 * @param file 		String containing file name.
    1.31 +		 * @param source 	Specifies who loaded the plugin.
    1.32 +		 * @param already 	Whether or not the plugin was already loaded.
    1.33 +		 * @param error 	String buffer for error messages.
    1.34 +		 * @param maxlen 	Maximum length of buffer.
    1.35 +		 * @return 			Id of plugin.
    1.36  		 */
    1.37  		virtual PluginId Load(const char *file, PluginId source, bool &already, char *error, size_t maxlen) =0;
    1.38  
    1.39  		/**
    1.40 -		 * @brief Unloads a plugin
    1.41 +		 * @brief Unloads a plugin.
    1.42  		 *
    1.43 -		 * @param id Id of plugin
    1.44 -		 * @param error String buffer for error messages
    1.45 -		 * @param maxlen Maximum length of buffer
    1.46 -		 * @return True on success, false otherwise
    1.47 +		 * @param id 		Id of plugin
    1.48 +		 * @param force		True to forcefully unload, false to let plugin opt-out.
    1.49 +		 * @param error 	String buffer for error messages
    1.50 +		 * @param maxlen 	Maximum length of buffer
    1.51 +		 * @return 			True on success, false otherwise
    1.52  		 */
    1.53  		virtual bool Unload(PluginId id, bool force, char *error, size_t maxlen) =0;
    1.54  	
    1.55  		/**
    1.56  		 * @brief Pauses a plugin
    1.57  		 *
    1.58 -		 * @param id Id of plugin
    1.59 -		 * @param error String buffer for error messages
    1.60 -		 * @param maxlen Maximum length of buffer
    1.61 -		 * @return True on success, false otherwise
    1.62 +		 * @param id 		Id of plugin
    1.63 +		 * @param error 	String buffer for error messages
    1.64 +		 * @param maxlen 	Maximum length of buffer
    1.65 +		 * @return 			True on success, false otherwise
    1.66  		 */
    1.67  		virtual bool Pause(PluginId id, char *error, size_t maxlen) =0;
    1.68  	
    1.69  		/**
    1.70  		 * @brief Unpauses a plugin
    1.71  		 *
    1.72 -		 * @param id Id of plugin
    1.73 -		 * @param force If true, forces the plugin to unload
    1.74 -		 * @param error String buffer for error messages
    1.75 -		 * @param maxlen Maximum length of buffer
    1.76 -		 * @return True on success, false otherwise
    1.77 +		 * @param id 		Id of plugin
    1.78 +		 * @param error 	String buffer for error messages
    1.79 +		 * @param maxlen 	Maximum length of buffer
    1.80 +		 * @return 			True on success, false otherwise
    1.81  		 */
    1.82  		virtual bool Unpause(PluginId id, char *error, size_t maxlen) =0;
    1.83  	
    1.84  		/**
    1.85  		 * @brief Unloads all plugins forcefully
    1.86  		 * 
    1.87 -		 * @return True on success, false otherwise
    1.88 +		 * @return 			True on success, false otherwise
    1.89  		 */
    1.90  		virtual bool UnloadAll() =0;
    1.91  	
    1.92 @@ -132,7 +134,7 @@
    1.93  		 *
    1.94  		 * @param id		Id of plugin
    1.95  		 * @param error		Message buffer
    1.96 -		 * @param maxlen	Size of error buffer
    1.97 +		 * @param maxlength	Size of error buffer
    1.98  		 * @return			Status value
    1.99  		 */
   1.100  		virtual bool QueryRunning(PluginId id, char *error, size_t maxlength) =0;
     2.1 --- a/sourcemm/ISmmAPI.h	Mon Feb 18 03:57:26 2008 +0000
     2.2 +++ b/sourcemm/ISmmAPI.h	Mon Feb 18 23:11:25 2008 +0000
     2.3 @@ -1,4 +1,4 @@
     2.4 -/**
     2.5 +/*
     2.6   * vim: set ts=4 :
     2.7   * ======================================================
     2.8   * Metamod:Source
     2.9 @@ -29,7 +29,7 @@
    2.10  #define _INCLUDE_ISMM_API_H
    2.11  
    2.12  /**
    2.13 - * @brief External API interface
    2.14 + * @brief Core API calls that are provided to plugins.
    2.15   * @file ISmmAPI.h
    2.16   */
    2.17  
    2.18 @@ -57,6 +57,9 @@
    2.19  	class ISmmPlugin;
    2.20  	class IMetamodListener;
    2.21  
    2.22 +	/**
    2.23 +	 * The core API that Metamod:Source provides to plugins.
    2.24 +	 */
    2.25  	class ISmmAPI
    2.26  	{
    2.27  	public:
    2.28 @@ -196,6 +199,7 @@
    2.29  		 * @param maxlength		Maximum length of iface buffer.  Must be at least 
    2.30  		 * 						strlen(iface)+4 chars.
    2.31  		 * @return				The newly incremented iface version number.
    2.32 +		 * @deprecated			Use InterfaceSearch() or VInterfaceMatch instead.
    2.33  		 */
    2.34  		virtual int FormatIface(char iface[], unsigned int maxlength) =0;
    2.35  
    2.36 @@ -324,6 +328,7 @@
    2.37  		 * @return				Highest interface version of IServerPluginCallbacks.
    2.38  		 *						Returns 0 if SourceMM's VSP listener isn't 
    2.39  		 *						currently enabled.
    2.40 +		 * @deprecated			Use GetVSPInfo() instead.
    2.41  		 */
    2.42  		virtual int GetVSPVersion() =0;
    2.43  
    2.44 @@ -343,7 +348,7 @@
    2.45  		 * This is useful for late-loading plugins which need to decide whether 
    2.46  		 * to add a listener or not (or need to get the pointer at all).
    2.47  		 *
    2.48 -		 * @param				Optional pointer to store the VSP version.
    2.49 +		 * @param pVersion		Optional pointer to store the VSP version.
    2.50  		 * @return				IServerPluginCallbacks pointer, or NULL if an
    2.51  		 * 						IMetamodListener event has yet to occur for 
    2.52  		 * 						EnableVSPListener().
    2.53 @@ -366,21 +371,21 @@
    2.54  						  const char *format,
    2.55  						  ...) =0;
    2.56  
    2.57 -	/**
    2.58 -	 * @brief Formats a string.  This is a platform safe wrapper around 
    2.59 -	 * vsnprintf/_vsnprintf.
    2.60 -	 *
    2.61 -	 * @param buffer		Buffer to write to.
    2.62 -	 * @param maxlength		Maximum length of the buffer.
    2.63 -	 * @param format		Format specifiers.
    2.64 -	 * @param ap			Format argument list.
    2.65 -	 * @return				Number of bytes actually written, not including the 
    2.66 -	 *						null terminator.
    2.67 -	 */
    2.68 -	virtual size_t FormatArgs(char *buffer,
    2.69 -							  size_t maxlength,
    2.70 -							  const char *format,
    2.71 -							  va_list ap) =0;
    2.72 +		/**
    2.73 +		 * @brief Formats a string.  This is a platform safe wrapper around 
    2.74 +		 * vsnprintf/_vsnprintf.
    2.75 +		 *
    2.76 +		 * @param buffer		Buffer to write to.
    2.77 +		 * @param maxlength		Maximum length of the buffer.
    2.78 +		 * @param format		Format specifiers.
    2.79 +		 * @param ap			Format argument list.
    2.80 +		 * @return				Number of bytes actually written, not including the 
    2.81 +		 *						null terminator.
    2.82 +		 */
    2.83 +		virtual size_t FormatArgs(char *buffer,
    2.84 +								  size_t maxlength,
    2.85 +								  const char *format,
    2.86 +								  va_list ap) =0;
    2.87  	};
    2.88  }
    2.89  
     3.1 --- a/sourcemm/ISmmPlugin.h	Mon Feb 18 03:57:26 2008 +0000
     3.2 +++ b/sourcemm/ISmmPlugin.h	Mon Feb 18 23:11:25 2008 +0000
     3.3 @@ -1,4 +1,4 @@
     3.4 -/**
     3.5 +/*
     3.6   * vim: set ts=4 :
     3.7   * ======================================================
     3.8   * Metamod:Source
     3.9 @@ -29,8 +29,9 @@
    3.10  #define _INCLUDE_ISMM_PLUGIN_H
    3.11  
    3.12  /**
    3.13 - * @brief Plugin API interface
    3.14 - * @file ISmmPlugin.h
    3.15 + * @brief Plugin API interface.
    3.16 + * @file ISmmPlugin.h These are callbacks that plugins can implement without hooks.
    3.17 + * The pure-virtual ISmmPlugin callbacks must be implemented for the load to load.
    3.18   */
    3.19  
    3.20  #include <interface.h>
    3.21 @@ -421,6 +422,15 @@
    3.22  #define PL_EXPOSURE		CreateInterface
    3.23  #define PL_EXPOSURE_C	"CreateInterface"
    3.24  
    3.25 +/**
    3.26 + * @brief Exposes the plugin to the MM:S loader.
    3.27 + *
    3.28 + * @param name		Deprecated - should be a variable name (like name).
    3.29 + * @param var		Name of the variable that contains the singleton.
    3.30 + *					This macro automatically takes the address of it, so 
    3.31 + * 					you should not pass a pointer to your plugin's 
    3.32 + *					singleton.
    3.33 + */
    3.34  #define PLUGIN_EXPOSE(name, var) \
    3.35  	ISmmAPI *g_SMAPI = NULL; \
    3.36  	ISmmPlugin *g_PLAPI = NULL; \
    3.37 @@ -433,12 +443,20 @@
    3.38  		return NULL; \
    3.39  	}
    3.40  
    3.41 +
    3.42 +/**
    3.43 + * @brief This should be in one of your header files, if you wish 
    3.44 + * to use values like g_SHPtr in other files.
    3.45 + */
    3.46  #define PLUGIN_GLOBALVARS()	\
    3.47  	extern SourceHook::ISourceHook *g_SHPtr; \
    3.48  	extern ISmmAPI *g_SMAPI; \
    3.49  	extern ISmmPlugin *g_PLAPI; \
    3.50  	extern PluginId g_PLID; 
    3.51  
    3.52 +/**
    3.53 + * @brief This should be the first line in your Load callback.
    3.54 + */
    3.55  #define PLUGIN_SAVEVARS() \
    3.56  	g_SMAPI = ismm; \
    3.57  	g_SHPtr = static_cast<SourceHook::ISourceHook *>(ismm->MetaFactory(MMIFACE_SOURCEHOOK, NULL, NULL)); \
     4.1 --- a/sourcemm/ISmmPluginExt.h	Mon Feb 18 03:57:26 2008 +0000
     4.2 +++ b/sourcemm/ISmmPluginExt.h	Mon Feb 18 23:11:25 2008 +0000
     4.3 @@ -1,156 +1,157 @@
     4.4 -/**
     4.5 - * vim: set ts=4 :
     4.6 - * ======================================================
     4.7 - * Metamod:Source
     4.8 - * Copyright (C) 2004-2007 AlliedModders LLC and authors.
     4.9 - * All rights reserved.
    4.10 - * ======================================================
    4.11 - *
    4.12 - * This software is provided 'as-is', without any express or implied warranty.
    4.13 - * In no event will the authors be held liable for any damages arising from 
    4.14 - * the use of this software.
    4.15 - * 
    4.16 - * Permission is granted to anyone to use this software for any purpose, 
    4.17 - * including commercial applications, and to alter it and redistribute it 
    4.18 - * freely, subject to the following restrictions:
    4.19 - *
    4.20 - * 1. The origin of this software must not be misrepresented; you must not 
    4.21 - * claim that you wrote the original software. If you use this software in a 
    4.22 - * product, an acknowledgment in the product documentation would be 
    4.23 - * appreciated but is not required.
    4.24 - * 2. Altered source versions must be plainly marked as such, and must not be
    4.25 - * misrepresented as being the original software.
    4.26 - * 3. This notice may not be removed or altered from any source distribution.
    4.27 - *
    4.28 - * Version: $Id$
    4.29 - */
    4.30 -
    4.31 -#ifndef _INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_
    4.32 -#define _INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_
    4.33 -
    4.34 -#include <stddef.h>
    4.35 -
    4.36 -/**
    4.37 - * @file ISmmPluginExt.h 	Definitions for extended plugin exposure syntax.
    4.38 - * @brief Provides an alternate method for loading plugins, without needing to 
    4.39 - * 		  include the default headers and all their Half-Life baggage.
    4.40 - */
    4.41 -
    4.42 -#define SOURCE_ENGINE_UNKNOWN			0				/**< Could not determine the engine version */
    4.43 -#define SOURCE_ENGINE_ORIGINAL			1				/**< Original Source Engine (used by The Ship) */
    4.44 -#define SOURCE_ENGINE_EPISODEONE		2				/**< Episode 1 Source Engine (second major SDK) */
    4.45 -#define SOURCE_ENGINE_ORANGEBOX			3				/**< Orange Box Source Engine (third major SDK) */
    4.46 -
    4.47 -#define METAMOD_PLAPI_VERSION			14				/**< Version of this header file */
    4.48 -#define METAMOD_PLAPI_NAME				"ISmmPlugin"	/**< Name of the plugin interface */
    4.49 -
    4.50 -namespace SourceMM
    4.51 -{
    4.52 -	class ISmmPlugin;
    4.53 -	class ISmmAPI;
    4.54 -
    4.55 +/*
    4.56 + * vim: set ts=4 :
    4.57 + * ======================================================
    4.58 + * Metamod:Source
    4.59 + * Copyright (C) 2004-2007 AlliedModders LLC and authors.
    4.60 + * All rights reserved.
    4.61 + * ======================================================
    4.62 + *
    4.63 + * This software is provided 'as-is', without any express or implied warranty.
    4.64 + * In no event will the authors be held liable for any damages arising from 
    4.65 + * the use of this software.
    4.66 + * 
    4.67 + * Permission is granted to anyone to use this software for any purpose, 
    4.68 + * including commercial applications, and to alter it and redistribute it 
    4.69 + * freely, subject to the following restrictions:
    4.70 + *
    4.71 + * 1. The origin of this software must not be misrepresented; you must not 
    4.72 + * claim that you wrote the original software. If you use this software in a 
    4.73 + * product, an acknowledgment in the product documentation would be 
    4.74 + * appreciated but is not required.
    4.75 + * 2. Altered source versions must be plainly marked as such, and must not be
    4.76 + * misrepresented as being the original software.
    4.77 + * 3. This notice may not be removed or altered from any source distribution.
    4.78 + *
    4.79 + * Version: $Id$
    4.80 + */
    4.81 +
    4.82 +#ifndef _INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_
    4.83 +#define _INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_
    4.84 +
    4.85 +#include <stddef.h>
    4.86 +
    4.87 +/**
    4.88 + * @file ISmmPluginExt.h Provides an alternate method for loading plugins, 
    4.89 + * without needing to include the default headers and all their Half-Life baggage.
    4.90 + *
    4.91 + * @brief Definitions for extended plugin loading.
    4.92 + */
    4.93 +
    4.94 +#define SOURCE_ENGINE_UNKNOWN			0				/**< Could not determine the engine version */
    4.95 +#define SOURCE_ENGINE_ORIGINAL			1				/**< Original Source Engine (used by The Ship) */
    4.96 +#define SOURCE_ENGINE_EPISODEONE		2				/**< Episode 1 Source Engine (second major SDK) */
    4.97 +#define SOURCE_ENGINE_ORANGEBOX			3				/**< Orange Box Source Engine (third major SDK) */
    4.98 +
    4.99 +#define METAMOD_PLAPI_VERSION			14				/**< Version of this header file */
   4.100 +#define METAMOD_PLAPI_NAME				"ISmmPlugin"	/**< Name of the plugin interface */
   4.101 +
   4.102 +namespace SourceMM
   4.103 +{
   4.104 +	class ISmmPlugin;
   4.105 +	class ISmmAPI;
   4.106 +
   4.107  	/**
   4.108  	 * @brief Used to uniquely identify plugins.
   4.109  	 */
   4.110 -	typedef int PluginId;
   4.111 -
   4.112 -	#define METAMOD_FAIL_API_V1			7				/**< Minimum API version to detect for V1 */
   4.113 -	#define METAMOD_FAIL_API_V2			14				/**< Minimum API version to detect for V2 */
   4.114 -
   4.115 -	/**
   4.116 -	 * Use this to instantiate a plugin that will always fail.
   4.117 -	 * This class definition works against major API versions 1 and 2.
   4.118 -	 */
   4.119 -	class ISmmFailPlugin
   4.120 -	{
   4.121 -	public:
   4.122 -		/**
   4.123 -		 * @brief You must return METAMOD_FAIL_API_V1 or METAMOD_FAIL_API_V2 here, 
   4.124 -		 * depending on which Metamod:Source version you detected.
   4.125 -		 */
   4.126 -		virtual int GetApiVersion() = 0;
   4.127 -
   4.128 -		/**
   4.129 -		 * @brief Do not change.
   4.130 -		 */
   4.131 -		virtual ~ISmmFailPlugin()
   4.132 -		{
   4.133 -		}
   4.134 -
   4.135 -		/**
   4.136 -		 * @brief Return false here -- fill in the error buffer appropriately.
   4.137 -		 *
   4.138 -		 * Do not ever return true.  If you do, MM:S will crash because the class layout is 
   4.139 -		 * incomplete against ISmmPlugin.
   4.140 -		 * 
   4.141 -		 * @param id			Ignore.
   4.142 -		 * @param ismm			Ignore.
   4.143 -		 * @param error			Error buffer (must be filled).
   4.144 -		 * @param maxlength		Maximum size of error buffer.
   4.145 -		 * @param late			Ignore.
   4.146 -		 * @return				Must return false.
   4.147 -		 */
   4.148 -		virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlength, bool late) =0;
   4.149 -	};
   4.150 -}
   4.151 -
   4.152 -typedef SourceMM::ISmmPlugin METAMOD_PLUGIN;
   4.153 -
   4.154 -/**
   4.155 - * @brief Contains version information.
   4.156 - */
   4.157 -struct MetamodVersionInfo
   4.158 -{
   4.159 -	int api_major;			/**< ISmmAPI major version */
   4.160 -	int api_minor;			/**< ISmmAPI minor version */
   4.161 -	int sh_iface;			/**< SourceHook interface version */
   4.162 -	int sh_impl;			/**< SourceHook implementation version */
   4.163 -	int pl_min;				/**< Plugin API minimum version */
   4.164 -	int pl_max;				/**< Plugin API maximum version */
   4.165 -	int source_engine;		/**< Source Engine version (SOURCE_* constants) */
   4.166 -};
   4.167 -
   4.168 -/**
   4.169 - * @brief Contains information about loading a plugin.
   4.170 - */
   4.171 -struct MetamodLoaderInfo
   4.172 -{
   4.173 -	const char *pl_file;	/**< File path to the plugin being loaded. */
   4.174 -	const char *pl_path;	/**< Folder path containing the plugin. */
   4.175 -};
   4.176 -
   4.177 -/**
   4.178 - * @brief If a function of this type is exposed as "CreateInterface_MMS", then
   4.179 - * Metamod:Source will attempt to call this function before calling 
   4.180 - * CreateInterface.  If this function returns a valid ISmmPlugin pointer, then 
   4.181 - * CreateInterface will not be called.
   4.182 - *
   4.183 - * This is useful for implementing a mini-loader plugin for multiple versions.
   4.184 - *
   4.185 - * @param mvi				MetamodVersionInfo structure.
   4.186 - * @param mli				MetamodLoaderInfo structure.
   4.187 - * @return					ISmmAPI pointer, or NULL if none.
   4.188 - */
   4.189 -typedef METAMOD_PLUGIN *(*METAMOD_FN_LOAD)(const MetamodVersionInfo *mvi, 
   4.190 -										   const MetamodLoaderInfo *mli);
   4.191 -
   4.192 -/**
   4.193 - * @brief If a function of this type is exposed as "UnloadInterface_MMS", then
   4.194 - * Metamod:Source will attempt to call this function after calling 
   4.195 - * ISmmAPI::Unload(), and before closing the library.  This lets loader plugins 
   4.196 - * clean up before exiting.
   4.197 - *
   4.198 - * Note: This function will be ignored unless CreateInterfce_MMS was exposed.
   4.199 - * It may be called even if ISmmAPI::Unload() could not be called.
   4.200 - */
   4.201 -typedef void (*METAMOD_FN_UNLOAD)();
   4.202 -
   4.203 -/**
   4.204 - * @brief Original type of load function.  CreateInterfaceFn from Valve.
   4.205 - * 
   4.206 - * Plugins will expose this as "CreateInterface".
   4.207 - */
   4.208 -typedef void *(*METAMOD_FN_ORIG_LOAD)(const char *, int *);
   4.209 -
   4.210 -#endif //INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_
   4.211 -
   4.212 +	typedef int PluginId;
   4.213 +
   4.214 +	#define METAMOD_FAIL_API_V1			7				/**< Minimum API version to detect for V1 */
   4.215 +	#define METAMOD_FAIL_API_V2			14				/**< Minimum API version to detect for V2 */
   4.216 +
   4.217 +	/**
   4.218 +	 * Use this to instantiate a plugin that will always fail.
   4.219 +	 * This class definition works against major API versions 1 and 2.
   4.220 +	 */
   4.221 +	class ISmmFailPlugin
   4.222 +	{
   4.223 +	public:
   4.224 +		/**
   4.225 +		 * @brief You must return METAMOD_FAIL_API_V1 or METAMOD_FAIL_API_V2 here, 
   4.226 +		 * depending on which Metamod:Source version you detected.
   4.227 +		 */
   4.228 +		virtual int GetApiVersion() = 0;
   4.229 +
   4.230 +		/**
   4.231 +		 * @brief Do not change.
   4.232 +		 */
   4.233 +		virtual ~ISmmFailPlugin()
   4.234 +		{
   4.235 +		}
   4.236 +
   4.237 +		/**
   4.238 +		 * @brief Return false here -- fill in the error buffer appropriately.
   4.239 +		 *
   4.240 +		 * Do not ever return true.  If you do, MM:S will crash because the class layout is 
   4.241 +		 * incomplete against ISmmPlugin.
   4.242 +		 * 
   4.243 +		 * @param id			Ignore.
   4.244 +		 * @param ismm			Ignore.
   4.245 +		 * @param error			Error buffer (must be filled).
   4.246 +		 * @param maxlength		Maximum size of error buffer.
   4.247 +		 * @param late			Ignore.
   4.248 +		 * @return				Must return false.
   4.249 +		 */
   4.250 +		virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlength, bool late) =0;
   4.251 +	};
   4.252 +}
   4.253 +
   4.254 +typedef SourceMM::ISmmPlugin METAMOD_PLUGIN;
   4.255 +
   4.256 +/**
   4.257 + * @brief Contains version information.
   4.258 + */
   4.259 +struct MetamodVersionInfo
   4.260 +{
   4.261 +	int api_major;			/**< ISmmAPI major version */
   4.262 +	int api_minor;			/**< ISmmAPI minor version */
   4.263 +	int sh_iface;			/**< SourceHook interface version */
   4.264 +	int sh_impl;			/**< SourceHook implementation version */
   4.265 +	int pl_min;				/**< Plugin API minimum version */
   4.266 +	int pl_max;				/**< Plugin API maximum version */
   4.267 +	int source_engine;		/**< Source Engine version (SOURCE_* constants) */
   4.268 +};
   4.269 +
   4.270 +/**
   4.271 + * @brief Contains information about loading a plugin.
   4.272 + */
   4.273 +struct MetamodLoaderInfo
   4.274 +{
   4.275 +	const char *pl_file;	/**< File path to the plugin being loaded. */
   4.276 +	const char *pl_path;	/**< Folder path containing the plugin. */
   4.277 +};
   4.278 +
   4.279 +/**
   4.280 + * @brief If a function of this type is exposed as "CreateInterface_MMS", then
   4.281 + * Metamod:Source will attempt to call this function before calling 
   4.282 + * CreateInterface.  If this function returns a valid ISmmPlugin pointer, then 
   4.283 + * CreateInterface will not be called.
   4.284 + *
   4.285 + * This is useful for implementing a mini-loader plugin for multiple versions.
   4.286 + *
   4.287 + * @param mvi				MetamodVersionInfo structure.
   4.288 + * @param mli				MetamodLoaderInfo structure.
   4.289 + * @return					ISmmAPI pointer, or NULL if none.
   4.290 + */
   4.291 +typedef METAMOD_PLUGIN *(*METAMOD_FN_LOAD)(const MetamodVersionInfo *mvi, 
   4.292 +										   const MetamodLoaderInfo *mli);
   4.293 +
   4.294 +/**
   4.295 + * @brief If a function of this type is exposed as "UnloadInterface_MMS", then
   4.296 + * Metamod:Source will attempt to call this function after calling 
   4.297 + * ISmmAPI::Unload(), and before closing the library.  This lets loader plugins 
   4.298 + * clean up before exiting.
   4.299 + *
   4.300 + * Note: This function will be ignored unless CreateInterfce_MMS was exposed.
   4.301 + * It may be called even if ISmmAPI::Unload() could not be called.
   4.302 + */
   4.303 +typedef void (*METAMOD_FN_UNLOAD)();
   4.304 +
   4.305 +/**
   4.306 + * @brief Original type of load function.  CreateInterfaceFn from Valve.
   4.307 + * 
   4.308 + * Plugins will expose this as "CreateInterface".
   4.309 + */
   4.310 +typedef void *(*METAMOD_FN_ORIG_LOAD)(const char *, int *);
   4.311 +
   4.312 +#endif //INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_
   4.313 +
     5.1 --- a/sourcemm/svn_version.h	Mon Feb 18 03:57:26 2008 +0000
     5.2 +++ b/sourcemm/svn_version.h	Mon Feb 18 23:11:25 2008 +0000
     5.3 @@ -5,9 +5,9 @@
     5.4  
     5.5  #define SVN_PRODUCT_VERSION		"1.6.0"
     5.6  
     5.7 -#define SVN_REVISION			653
     5.8 -#define SVN_REVISION_STRING		"653"
     5.9 -#define SVN_FILE_VERSION		1,6,0,653
    5.10 -#define SVN_FILE_VERSION_STRING	"1.6.0.653"
    5.11 +#define SVN_REVISION			655
    5.12 +#define SVN_REVISION_STRING		"655"
    5.13 +#define SVN_FILE_VERSION		1,6,0,655
    5.14 +#define SVN_FILE_VERSION_STRING	"1.6.0.655"
    5.15  
    5.16  #endif //_INCLUDE_SVN_VERSION_H_