greatly optimized the process of mapping plugin natives from Core
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401388
This commit is contained in:
@@ -642,6 +642,22 @@ int BaseContext::BindNative(const sp_nativeinfo_t *native)
|
||||
return SP_ERROR_NONE;
|
||||
}
|
||||
|
||||
int BaseContext::BindNativeToIndex(uint32_t index, SPVM_NATIVE_FUNC native)
|
||||
{
|
||||
int err;
|
||||
sp_native_t *native;
|
||||
|
||||
if ((err = GetNativeByIndex(index, &native)) != SP_ERROR_NONE)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
|
||||
ctx->natives[index].pfn = native;
|
||||
ctx->natives[index].status = SP_NATIVE_BOUND;
|
||||
|
||||
return SP_ERROR_NONE;
|
||||
}
|
||||
|
||||
int BaseContext::BindNativeToAny(SPVM_NATIVE_FUNC native)
|
||||
{
|
||||
uint32_t nativesnum, i;
|
||||
|
||||
@@ -89,6 +89,7 @@ namespace SourcePawn
|
||||
cell_t *GetNullRef(SP_NULL_TYPE type);
|
||||
int LocalToStringNULL(cell_t local_addr, char **addr);
|
||||
#endif
|
||||
int BindNativeToIndex(uint32_t index, SPVM_NATIVE_FUNC native);
|
||||
public: //IPluginDebugInfo
|
||||
int LookupFile(ucell_t addr, const char **filename);
|
||||
int LookupFunction(ucell_t addr, const char **name);
|
||||
|
||||
Reference in New Issue
Block a user