added natives for iterating plugins and retrieving plugin info

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40624
This commit is contained in:
David Anderson
2007-03-15 20:10:25 +00:00
parent dc9f6e405e
commit 0aadfbdfab
3 changed files with 309 additions and 0 deletions
+29
View File
@@ -43,6 +43,35 @@ public PlVers:__version =
filevers = SOURCEMOD_VERSION
};
/**
* Plugin status values.
*/
enum PluginStatus
{
Plugin_Running=0, /**< Plugin is running */
/* All states below are "temporarily" unexecutable */
Plugin_Paused, /**< Plugin is loaded but paused */
Plugin_Error, /**< Plugin is loaded but errored/locked */
/* All states below do not have all natives */
Plugin_Loaded, /**< Plugin has passed loading and can be finalized */
Plugin_Failed, /**< Plugin has a fatal failure */
Plugin_Created, /**< Plugin is created but not initialized */
Plugin_Uncompiled, /**< Plugin is not yet compiled by the JIT */
Plugin_BadLoad, /**< Plugin failed to load */
};
/**
* Plugin information properties.
*/
enum PluginInfo
{
PlInfo_Name, /**< Plugin name */
PlInfo_Author, /**< Plugin author */
PlInfo_Description, /**< Plugin description */
PlInfo_Version, /**< Plugin verison */
PlInfo_URL, /**< Plugin URL */
};
struct Extension
{
const String:name[], /* Short name */
+68
View File
@@ -108,6 +108,74 @@ forward OnGameFrame();
*/
native Handle:GetMyHandle();
/**
* Returns an iterator that can be used to search through plugins.
*
* @return Handle to iterate with. Must be closed via
* CloseHandle().
* @error Invalid Handle.
*/
native Handle:GetPluginIterator();
/**
* Returns whether there are more plugins available in the iterator.
*
* @param iter Handle to the plugin iterator.
* @return True on more plugins, false otherwise.
* @error Invalid Handle.
*/
native bool:MorePlugins(Handle:iter);
/**
* Returns the current plugin in the iterator and advances the iterator.
*
* @param iter Handle to the plugin iterator.
* @return Current plugin the iterator is at, before
* the iterator is advanced.
* @error Invalid Handle.
*/
native Handle:ReadPlugin(Handle:iter);
/**
* Returns a plugin's status.
*
* @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
* @return Status code for the plugin.
* @error Invalid Handle.
*/
native PluginStatus:GetPluginStatus(Handle:plugin);
/**
* Retrieves a plugin's file name relative to the plugins folder.
*
* @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
* @param buffer Buffer to the store the file name.
* @param maxlength Maximum length of the name buffer.
* @noreturn
* @error Invalid Handle.
*/
native GetPluginFilename(Handle:plugin, String:buffer[], maxlength);
/**
* Retrieves whether or not a plugin is being debugged.
*
* @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
* @return True if being debugged, false otherwise.
* @error Invalid Handle.
*/
native bool:IsPluginDebugging(Handle:hndl);
/**
* Retrieves a plugin's public info.
*
* @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
* @param info Plugin info property to retrieve.
* @param buffer Buffer to store info in.
* @param maxlength Maximum length of buffer.
* @return True on success, false if property is not available.
* @error Invalid Handle.
*/
native bool:GetPluginInfo(Handle:plugin, PluginInfo:info, String:buffer[], maxlength);
/**
* Aborts the current callback and throws an error. This function