Extend function calling API for natives and allow catching exceptions.

Change sourcepawn url.
This commit is contained in:
BotoX
2019-12-05 18:56:24 +01:00
committed by BotoX
parent 182da464cd
commit 2e0beed7c9
7 changed files with 490 additions and 2 deletions
+25
View File
@@ -293,6 +293,17 @@ native void Call_StartForward(Handle fwd);
*/
native void Call_StartFunction(Handle plugin, Function func);
/**
* Starts a call to a native.
*
* @note Cannot be used during an incomplete call.
*
* @param name Name of the native.
* @return True on success, false otherwise.
* @error Invalid function, or called before another call has completed.
*/
native bool Call_StartNative(const char[] name);
/**
* Pushes a cell onto the current call.
*
@@ -416,6 +427,20 @@ native void Call_PushNullString();
*/
native int Call_Finish(any &result=0);
/**
* Completes a call to a function or forward's call list.
* Catches exceptions thrown by the native.
*
* @note Cannot be used before a call has been started.
*
* @param result Return value of function or forward's call list.
* @param exception Buffer to store the exception in.
* @param maxlength Maximum length of the buffer.
* @return SP_ERROR_NONE on success, any other integer on failure.
* @error Called before a call has been started.
*/
native int Call_FinishEx(any &result=0, char[] exception, int maxlength);
/**
* Cancels a call to a function or forward's call list.
*