loader/loader_bridge.h
author Nicholas Hastings <skamonkey@gmail.com>
Thu Apr 25 11:32:34 2013 -0400 (2013-04-25)
changeset 837 978c7cd9b0b2
parent 683 b507295429f9
permissions -rw-r--r--
Merge.
     1 /**
     2  * vim: set ts=4 sw=4 tw=99 noet :
     3  * ======================================================
     4  * Metamod:Source
     5  * Copyright (C) 2004-2009 AlliedModders LLC and authors.
     6  * All rights reserved.
     7  * ======================================================
     8  *
     9  * This software is provided 'as-is', without any express or implied warranty.
    10  * In no event will the authors be held liable for any damages arising from 
    11  * the use of this software.
    12  * 
    13  * Permission is granted to anyone to use this software for any purpose, 
    14  * including commercial applications, and to alter it and redistribute it 
    15  * freely, subject to the following restrictions:
    16  *
    17  * 1. The origin of this software must not be misrepresented; you must not 
    18  * claim that you wrote the original software. If you use this software in a 
    19  * product, an acknowledgment in the product documentation would be 
    20  * appreciated but is not required.
    21  * 2. Altered source versions must be plainly marked as such, and must not be
    22  * misrepresented as being the original software.
    23  * 3. This notice may not be removed or altered from any source distribution.
    24  */
    25 
    26 #ifndef _INCLUDE_METAMOD_SOURCE_LOADER_BRIDGE_H_
    27 #define _INCLUDE_METAMOD_SOURCE_LOADER_BRIDGE_H_
    28 
    29 typedef void* (*QueryValveInterface)(const char *pName, int *pReturnCode);
    30 class IServerPluginCallbacks;
    31 
    32 struct vsp_bridge_info
    33 {
    34 	QueryValveInterface 		engineFactory;
    35 	QueryValveInterface 		gsFactory;
    36 	IServerPluginCallbacks *	vsp_callbacks;
    37 	unsigned int				vsp_version;
    38 };
    39 
    40 class IVspBridge
    41 {
    42 public:
    43 	virtual bool Load(const vsp_bridge_info *info, char *buffer, size_t maxlength) = 0;
    44 	virtual void Unload() = 0;
    45 	virtual const char *GetDescription() = 0;
    46 };
    47 
    48 struct gamedll_bridge_info
    49 {
    50 	QueryValveInterface engineFactory;
    51 	QueryValveInterface fsFactory;
    52 	QueryValveInterface physicsFactory;
    53 	QueryValveInterface	gsFactory;
    54 	void *				pGlobals;
    55 	unsigned int		dllVersion;
    56 	void *				isgd;
    57 	const char *		vsp_listener_path;
    58 };
    59 
    60 class IGameDllBridge
    61 {
    62 public:
    63 	virtual bool DLLInit_Pre(const gamedll_bridge_info *info, char *buffer, size_t maxlength) = 0;
    64 	virtual void DLLInit_Post(int *isgdUnload) = 0;
    65 	virtual void *QueryInterface(const char *name, int *ret) = 0;
    66 	virtual void Unload() = 0;
    67 };
    68 
    69 #endif /* _INCLUDE_METAMOD_SOURCE_LOADER_BRIDGE_H_ */
    70