rewrite of the native and dependency binding/interaction code. this will ease the transition for native overrides, and greatly simplifies most of the logic. all native binding code now takes place almost entirely in ShareSys, and PluginSys supplements this logic where appropriate. extensionsys has been cleaned up

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402198
This commit is contained in:
David Anderson
2008-05-26 07:51:11 +00:00
parent c824afc61e
commit c93d05f622
14 changed files with 461 additions and 523 deletions
+6 -8
View File
@@ -202,18 +202,16 @@ namespace SourceMod
virtual void RegisterLibrary(IExtension *myself, const char *name) =0;
/**
* @brief Adds a list of natives to the global native pool, to be
* bound on plugin load.
*
* Unlike AddNatives(), this function implements natives that are
* ALWAYS bound, regardless of whether a previous function is bound.
* That means extensions can override Core natives.
* @brief Adds natives that will override Core natives when called.
*
* A Core version of each native must exist. If one does not, then
* Core will simply ignore that entry.
* Core will simply ignore that entry. No more than one override
* can exist on a given native.
*
* Override natives represent a weak coupling. If the extension is
* unloaded, the native will be re-bound to the Core version.
* unloaded, the native will be re-bound to the Core version. If
* the extension is loaded after plugins are loaded, the override
* will not take effect until those plugins are reloaded.
*
* @param myself Identity token of parent object.
* @param natives Array of natives to add. The last entry in
+10 -14
View File
@@ -44,7 +44,7 @@
#define SOURCEPAWN_ENGINE_API_VERSION 3
/** SourcePawn VM API Version */
#define SOURCEPAWN_VM_API_VERSION 6
#define SOURCEPAWN_VM_API_VERSION 7
#if !defined SOURCEMOD_BUILD
#define SOURCEMOD_BUILD
@@ -500,22 +500,18 @@ namespace SourcePawn
virtual int PushCellsFromArray(cell_t array[], unsigned int numcells) =0;
/**
* @brief Binds a list of native names and their function pointers to a context.
* If num is 0, the list is read until an entry with a NULL name is reached.
* If overwrite is non-zero, already registered natives will be overwritten.
* @brief Deprecated; do not use.
*
* @param natives Array of natives.
* @param num Number of natives in array.
* @param overwrite Toggles overwrite.
* @param natives Deprecated; do not use.
* @param num Deprecated; do not use.
* @param overwrite Deprecated; do not use.
*/
virtual int BindNatives(const sp_nativeinfo_t *natives, unsigned int num, int overwrite) =0;
/**
* @brief Binds a single native. Overwrites any existing bind.
* If the context does not contain the native that will be binded the function will return
* with a SP_ERROR_NOT_FOUND error.
* @brief Deprecated; do not use.
*
* @param native Pointer to native.
* @param native Deprecated; do not use.
*/
virtual int BindNative(const sp_nativeinfo_t *native) =0;
@@ -599,10 +595,10 @@ namespace SourcePawn
#endif
/**
* @brief Binds a single native to a given native index.
* @brief Deprecated; do not use.
*
* @param index Index to bind at.
* @param native Native function to bind.
* @param index Deprecated; do not use.
* @param native Deprecated; do not use.
*/
virtual int BindNativeToIndex(uint32_t index, SPVM_NATIVE_FUNC native) =0;
+1
View File
@@ -203,6 +203,7 @@ typedef struct sp_native_s
const char * name; /**< Name of function */
uint32_t status; /**< Status flags */
uint32_t flags; /**< Native flags */
void * user; /**< Host-specific data */
} sp_native_t;
/**