initial import of handle natives and a few minor API changes

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40252
This commit is contained in:
David Anderson
2007-01-01 10:33:51 +00:00
parent f8c88a75df
commit 9f7c852c77
6 changed files with 157 additions and 4 deletions
+1 -1
View File
@@ -465,7 +465,7 @@ HandleError HandleSystem::ReadHandle(Handle_t handle,
{
return HandleError_Type;
}
} else {
} else if (type) {
if (pHandle->type != type)
{
return HandleError_Type;
+18
View File
@@ -1141,3 +1141,21 @@ void CPluginManager::RegisterNativesFromCore(sp_nativeinfo_t *natives)
{
m_natives.push_back(natives);
}
IPlugin *CPluginManager::PluginFromHandle(Handle_t handle, HandleError *err)
{
IPlugin *pPlugin;
HandleError _err;
if ((_err=g_HandleSys.ReadHandle(handle, g_PluginType, m_MyIdent, (void **)&pPlugin)) != HandleError_None)
{
pPlugin = NULL;
}
if (err)
{
*err = _err;
}
return pPlugin;
}
+5
View File
@@ -236,6 +236,11 @@ public:
* Adds natives from core into the native pool.
*/
void RegisterNativesFromCore(sp_nativeinfo_t *natives);
/**
* Converts a Handle to an IPlugin if possible.
*/
IPlugin *PluginFromHandle(Handle_t handle, HandleError *err);
private:
/**
* Recursively loads all plugins in the given directory.