sourcemod/core/interfaces/IPluginSys.h
David Anderson c63d26e1c5 initial import of the first four core interfaces
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40145
2006-11-05 00:29:44 +00:00

60 lines
1.5 KiB
C++

#ifndef _INCLUDE_SOURCEMOD_PLUGINMNGR_INTERFACE_H_
#define _INCLUDE_SOURCEMOD_PLUGINMNGR_INTERFACE_H_
#include <IShareSys.h>
#define SMINTERFACE_PLUGINMANAGER_NAME "IPluginManager"
#define SMINTERFACE_PLUGINMANAGER_VERSION 1
namespace SourceMod
{
class IPlugin : public IUnloadableParent
{
public:
UnloadableParentType GetParentType()
{
return ParentType_Module;
}
};
enum PluginLifetime
{
PluginLifetime_Forever,
PluginLifetime_Map
};
class IPluginManager : public SMInterface
{
public:
virtual const char *GetInterfaceName()
{
return SMINTERFACE_PLUGINMANAGER_NAME;
}
virtual unsigned int GetInterfaceVersion()
{
return SMINTERFACE_PLUGINMANAGER_VERSION;
}
public:
/**
* @brief Attempts to load a plugin.
*
* @param path Path and filename of plugin, relative to plugins folder.
* @param extended Whether or not the plugin is a static plugin or optional plugin.
* @param debug Whether or not to default the plugin into debug mode.
* @param lifetime Lifetime of the plugin.
* @param error Buffer to hold any error message.
* @param err_max Maximum length of error message buffer.
* @return A new plugin pointer on success, false otherwise.
*/
virtual IPlugin *LoadPlugin(const char *path,
bool extended,
bool debug,
PluginLifetime lifetime,
char error[],
size_t err_max) =0;
};
};
#endif //_INCLUDE_SOURCEMOD_PLUGINMNGR_INTERFACE_H_