00001 /* 00002 * vim: set ts=4 : 00003 * ====================================================== 00004 * Metamod:Source 00005 * Copyright (C) 2004-2007 AlliedModders LLC and authors. 00006 * All rights reserved. 00007 * ====================================================== 00008 * 00009 * This software is provided 'as-is', without any express or implied warranty. 00010 * In no event will the authors be held liable for any damages arising from 00011 * the use of this software. 00012 * 00013 * Permission is granted to anyone to use this software for any purpose, 00014 * including commercial applications, and to alter it and redistribute it 00015 * freely, subject to the following restrictions: 00016 * 00017 * 1. The origin of this software must not be misrepresented; you must not 00018 * claim that you wrote the original software. If you use this software in a 00019 * product, an acknowledgment in the product documentation would be 00020 * appreciated but is not required. 00021 * 2. Altered source versions must be plainly marked as such, and must not be 00022 * misrepresented as being the original software. 00023 * 3. This notice may not be removed or altered from any source distribution. 00024 * 00025 * Version: $Id: ISmmPluginExt.h 612 2008-01-10 18:19:32Z dvander $ 00026 */ 00027 00028 #ifndef _INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_ 00029 #define _INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_ 00030 00031 #include <stddef.h> 00032 00040 #define SOURCE_ENGINE_UNKNOWN 0 00041 #define SOURCE_ENGINE_ORIGINAL 1 00042 #define SOURCE_ENGINE_EPISODEONE 2 00043 #define SOURCE_ENGINE_ORANGEBOX 3 00045 #define METAMOD_PLAPI_VERSION 14 00046 #define METAMOD_PLAPI_NAME "ISmmPlugin" 00048 namespace SourceMM 00049 { 00050 class ISmmPlugin; 00051 class ISmmAPI; 00052 00056 typedef int PluginId; 00057 00058 #define METAMOD_FAIL_API_V1 7 00059 #define METAMOD_FAIL_API_V2 14 00065 class ISmmFailPlugin 00066 { 00067 public: 00072 virtual int GetApiVersion() = 0; 00073 00077 virtual ~ISmmFailPlugin() 00078 { 00079 } 00080 00094 virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlength, bool late) =0; 00095 }; 00096 } 00097 00098 typedef SourceMM::ISmmPlugin METAMOD_PLUGIN; 00099 00103 struct MetamodVersionInfo 00104 { 00105 int api_major; 00106 int api_minor; 00107 int sh_iface; 00108 int sh_impl; 00109 int pl_min; 00110 int pl_max; 00111 int source_engine; 00112 }; 00113 00117 struct MetamodLoaderInfo 00118 { 00119 const char *pl_file; 00120 const char *pl_path; 00121 }; 00122 00135 typedef METAMOD_PLUGIN *(*METAMOD_FN_LOAD)(const MetamodVersionInfo *mvi, 00136 const MetamodLoaderInfo *mli); 00137 00147 typedef void (*METAMOD_FN_UNLOAD)(); 00148 00154 typedef void *(*METAMOD_FN_ORIG_LOAD)(const char *, int *); 00155 00156 #endif //INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_ 00157