SourceMod SDK  1.7
smsdk_ext.h File Reference

Contains wrappers for making Extensions easier to write. More...

#include "smsdk_config.h"
#include <IExtensionSys.h>
#include <IHandleSys.h>
#include <sp_vm_api.h>
#include <sm_platform.h>
#include <ISourceMod.h>
#include <ISmmPlugin.h>
#include <eiface.h>
#include <metamod_wrappers.h>

Go to the source code of this file.

Classes

class  SDKExtension
 

Macros

#define SM_MKIFACE(name)   SMINTERFACE_##name##_NAME, SMINTERFACE_##name##_VERSION
 
#define SM_GET_IFACE(prefix, addr)
 
#define SM_GET_LATE_IFACE(prefix, addr)   g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)
 
#define SM_CHECK_IFACE(prefix, addr)
 

Functions

 PLUGIN_GLOBALVARS ()
 

Variables

SDKExtensiong_pExtensionIface
 
IExtensionmyself
 
IShareSysg_pShareSys
 
IShareSyssharesys
 
ISourceModg_pSM
 
ISourceModsmutils
 
IVEngineServer * engine
 
IServerGameDLL * gamedll
 

Detailed Description

Contains wrappers for making Extensions easier to write.

vim: set ts=4 sw=4 tw=99 noet:

SourceMod Base Extension Code

Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3.0, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

As a special exception, AlliedModders LLC gives you permission to link the code of this program (as well as its derivative works) to "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software by the Valve Corporation. You must obey the GNU General Public License in all respects for all other code used. Additionally, AlliedModders LLC grants this exception to all derivative works. AlliedModders LLC defines further exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), or http://www.sourcemod.net/license.php.

Version: $Id$

Macro Definition Documentation

#define SM_CHECK_IFACE (   prefix,
  addr 
)
Value:
if (!addr) \
{ \
if (error != NULL && maxlength) \
{ \
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
if (len >= maxlength) \
{ \
error[maxlength - 1] = '\0'; \
} \
} \
return false; \
}

Validates a SourceMod interface pointer

#define SM_GET_IFACE (   prefix,
  addr 
)
Value:
{ \
if (error != NULL && maxlength) \
{ \
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
if (len >= maxlength) \
{ \
error[maxlength - 1] = '\0'; \
} \
} \
return false; \
}
IShareSys * g_pShareSys
Definition: smsdk_ext.cpp:42
#define SM_MKIFACE(name)
Definition: smsdk_ext.h:325
virtual bool RequestInterface(const char *iface_name, unsigned int iface_vers, IExtension *myself, SMInterface **pIface)=0
Requests an interface from the global interface system. If found, the interface's internal reference ...
Defines the base functionality required by a shared interface.
Definition: IShareSys.h:92
IExtension * myself
Definition: smsdk_ext.cpp:41

Automates retrieving SourceMod interfaces

#define SM_GET_LATE_IFACE (   prefix,
  addr 
)    g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)

Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad()

#define SM_MKIFACE (   name)    SMINTERFACE_##name##_NAME, SMINTERFACE_##name##_VERSION

Creates a SourceMod interface macro pair

Variable Documentation

IVEngineServer* engine

IVEngineServer pointer

IShareSys* g_pShareSys

Share system

ISourceMod* g_pSM

SourceMod helpers

IServerGameDLL* gamedll

IServerGameDLL pointer

IExtension* myself

Ourself

IShareSys* sharesys

Share system

ISourceMod* smutils

SourceMod helpers