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