void ShareSystem::OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives) { unsigned int i; NativeEntry *pEntry; CNativeOwner *pOwner; pOwner = g_Extensions.GetNativeOwner(myself); for (i = 0; natives[i].func != NULL && natives[i].name != NULL; i++) { if ((pEntry = FindNative(natives[i].name)) == NULL) { continue; } if (pEntry->owner != g_pCoreNatives) { continue; } if (pEntry->replacement.owner != NULL) { continue; } /* Now it's safe to add the override */ pEntry->replacement.func = natives[i].func; pEntry->replacement.owner = pOwner; pOwner->AddReplacedNative(pEntry); } }
void ShareSystem::AddNatives(IExtension *myself, const sp_nativeinfo_t *natives) { CNativeOwner *pOwner; pOwner = g_Extensions.GetNativeOwner(myself); pOwner->AddNatives(natives); }
static void AddNatives(sp_nativeinfo_t *natives) { g_CoreNatives.AddNatives(natives); }
void CoreNativesToAdd::OnSourceModAllInitialized() { g_CoreNatives.AddNatives(m_NativeList); }