SourceMod SDK  1.7
IExtensionSys.h File Reference

Defines the interface for loading/unloading/managing extensions. More...

#include <IShareSys.h>
#include <ILibrarySys.h>

Go to the source code of this file.

Classes

class  SourceMod::IExtension
 Encapsulates an IExtensionInterface and its dependencies. More...
 
class  SourceMod::IExtensionInterface
 The interface an extension must expose. More...
 
class  SourceMod::IExtensionManager
 Manages the loading/unloading of extensions. More...
 

Macros

#define SMINTERFACE_EXTENSIONAPI_VERSION   8
 Version code of the IExtensionInterface API itself. More...
 
#define SOURCEMOD_INTERFACE_EXTENSIONS   "SM_ExtensionManager"
 Returned via OnMetamodQuery() to get an IExtensionManager pointer.
 
#define SOURCEMOD_NOTICE_EXTENSIONS   "SM_ExtensionsAttachable"
 Fired through OnMetamodQuery() to notify plugins that SourceMod is loaded. More...
 
#define SMINTERFACE_EXTENSIONMANAGER_NAME   "IExtensionManager"
 
#define SMINTERFACE_EXTENSIONMANAGER_VERSION   2
 
#define SM_IFACEPAIR(name)   SMINTERFACE_##name##_NAME, SMINTERFACE_##name##_VERSION
 
#define SM_FIND_IFACE_OR_FAIL(prefix, variable, errbuf, errsize)
 
#define SM_FIND_IFACE(prefix, variable)   sharesys->RequestInterface(SM_IFACEPAIR(prefix), myself, (SMInterface **)&variable);
 

Typedefs

typedef void * SourceMod::ITERATOR
 

Detailed Description

Defines the interface for loading/unloading/managing extensions.

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

SourceMod

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_FIND_IFACE_OR_FAIL (   prefix,
  variable,
  errbuf,
  errsize 
)
Value:
if (!sharesys->RequestInterface(SM_IFACEPAIR(prefix), myself, (SMInterface **)&variable)) \
{ \
if (errbuf) \
{ \
size_t len = snprintf(errbuf, \
errsize, \
"Could not find interface: %s (version: %d)", \
SM_IFACEPAIR(prefix)); \
if (len >= errsize) \
{ \
errbuf[errsize - 1] = '\0'; \
} \
} \
return false; \
}
IShareSys * sharesys
Definition: smsdk_ext.cpp:43
IExtension * myself
Definition: smsdk_ext.cpp:41
#define SMINTERFACE_EXTENSIONAPI_VERSION   8

Version code of the IExtensionInterface API itself.

Note: This is bumped when IShareSys is changed, because IShareSys itself is not versioned.

V6 - added TestFeature() to IShareSys. V7 - added OnDependenciesDropped() to IExtensionInterface. V8 - added OnCoreMapEnd() to IExtensionInterface.

#define SOURCEMOD_NOTICE_EXTENSIONS   "SM_ExtensionsAttachable"

Fired through OnMetamodQuery() to notify plugins that SourceMod is loaded.

Plugins should not return an interface pointer or IFACE_OK, instead, they should attach as needed by searching for SOURCEMOD_INTERFACE_EXTENSIONS.

This may be fired more than once; if already attached, an extension should not attempt to re-attach. The purpose of this is to notify Metamod:Source plugins which load after SourceMod loads.