loader/loader_bridge.h
author David Anderson <dvander@alliedmods.net>
Wed Nov 26 00:19:30 2008 -0600 (2008-11-26)
changeset 608 30b546cc4e03
parent 582 4a962b0ad436
child 683 b507295429f9
permissions -rw-r--r--
Updated changelog, added license headers.
dvander@608
     1
/**
dvander@608
     2
 * vim: set ts=4 :
dvander@608
     3
 * ======================================================
dvander@608
     4
 * Metamod:Source
dvander@608
     5
 * Copyright (C) 2004-2008 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
 * Version: $Id$
dvander@608
    26
 */
dvander@608
    27
dvander@546
    28
#ifndef _INCLUDE_METAMOD_SOURCE_LOADER_BRIDGE_H_
dvander@546
    29
#define _INCLUDE_METAMOD_SOURCE_LOADER_BRIDGE_H_
dvander@546
    30
dvander@546
    31
typedef void* (*QueryValveInterface)(const char *pName, int *pReturnCode);
dvander@546
    32
class IServerPluginCallbacks;
dvander@546
    33
dvander@546
    34
struct vsp_bridge_info
dvander@546
    35
{
dvander@546
    36
	QueryValveInterface 		engineFactory;
dvander@546
    37
	QueryValveInterface 		gsFactory;
dvander@546
    38
	IServerPluginCallbacks *	vsp_callbacks;
dvander@546
    39
	unsigned int				vsp_version;
dvander@546
    40
};
dvander@546
    41
dvander@546
    42
class IVspBridge
dvander@546
    43
{
dvander@546
    44
public:
dvander@547
    45
	virtual bool Load(const vsp_bridge_info *info, char *buffer, size_t maxlength) = 0;
dvander@546
    46
	virtual void Unload() = 0;
dvander@546
    47
	virtual const char *GetDescription() = 0;
dvander@546
    48
};
dvander@546
    49
dvander@579
    50
struct gamedll_bridge_info
dvander@579
    51
{
dvander@579
    52
	QueryValveInterface engineFactory;
dvander@579
    53
	QueryValveInterface fsFactory;
dvander@579
    54
	QueryValveInterface physicsFactory;
dvander@579
    55
	QueryValveInterface	gsFactory;
dvander@579
    56
	void *				pGlobals;
dvander@579
    57
	unsigned int		dllVersion;
dvander@579
    58
	void *				isgd;
dvander@579
    59
};
dvander@579
    60
dvander@579
    61
class IGameDllBridge
dvander@579
    62
{
dvander@579
    63
public:
dvander@579
    64
	virtual bool DLLInit_Pre(const gamedll_bridge_info *info, char *buffer, size_t maxlength) = 0;
dvander@582
    65
	virtual void DLLInit_Post(int *isgdUnload) = 0;
dvander@579
    66
	virtual void *QueryInterface(const char *name, int *ret) = 0;
dvander@579
    67
	virtual void Unload() = 0;
dvander@579
    68
};
dvander@579
    69
dvander@546
    70
#endif /* _INCLUDE_METAMOD_SOURCE_LOADER_BRIDGE_H_ */
dvander@546
    71