Пример #1
0
void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, const Ref<Native> &entry)
{
	if (!entry->owner)
		return;

	IPluginContext *pContext = pPlugin->GetBaseContext();

	uint32_t i;
	if (pContext->FindNativeByName(entry->name(), &i) != SP_ERROR_NONE)
		return;

	sp_native_t *native;
	if (pContext->GetNativeByIndex(i, &native) != SP_ERROR_NONE)
		return;

	if (native->status == SP_NATIVE_BOUND)
		return;

	BindNativeToPlugin(pPlugin, native, i, entry);
}
Пример #2
0
void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, NativeEntry *pEntry)
{
	uint32_t i;
	sp_native_t *native;
	IPluginContext *pContext;

	pContext = pPlugin->GetBaseContext();

	if (pContext->FindNativeByName(pEntry->name, &i) != SP_ERROR_NONE)
	{
		return;
	}
	if (pContext->GetNativeByIndex(i, &native) != SP_ERROR_NONE)
	{
		return;
	}

	if (native->status == SP_NATIVE_BOUND)
	{
		return;
	}

	BindNativeToPlugin(pPlugin, native, i, pEntry);
}