Execute a given function and put its results on the stack, where it is retrievable with aot_top_get_val.
The optional arguments ErrCode and ErrString provide some feedback on the success of the function execution. If none of them are in the argument list, the execution of the application will be stopped, and the error will be printed to the standard output. You have to provide the number of results to obtain in nresults. Keep in mind, that multiple results have to obtained in reverse order from the stack.
You might want to return multiple values as a single argument in a table instead of several single values.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_state) | :: | L | Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun | Handle to the function to execute. |
|||
integer, | intent(in) | :: | nresults | Number of resulting values the caller wants to obtain from the Lua function. |
||
integer, | intent(out), | optional | :: | ErrCode | Error code returned by Lua during execution of the function. |
|
character(len=*), | intent(out), | optional | :: | ErrString | Obtained error string from the Lua stack if an error occured. |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | err |