This module provides access to Lua functions
Intented usage:
Open a Lua function for evaluation.
After it is opened, arguments might be put into the function, and it might be executed. Execution might be repeated for an arbitrary number of iterations, to retrieve more than one evaluation of a single function, before closing it again with aot_fun_close.
Get a function defined as component of a table.
Functions in tables might be retrieved by position or key. If both optional parameters are provided, the key is attempted to be read first. Only when that fails, the position will be tested.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
integer, | intent(in), | optional | :: | parent |
Handle to the table to look in for the function. |
|
type(aot_fun_type), | intent(out) | :: | fun |
Returned handle, providing access to the function. |
||
character(len=*), | intent(in), | optional | :: | key |
Name of the function to look up in the table. |
|
integer, | intent(in), | optional | :: | pos |
Position of the function to look up in the table. |
Get a function from a previously defned Lua reference.
Use a previously (with aot_reference_for) defined reference to get a function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type), | intent(out) | :: | fun |
Returned handle, providing access to the function. |
||
integer, | intent(in) | :: | ref |
Lua reference to the function. |
Put an argument into the lua function.
Arguments have to be in order, first put the first argument then the second and so on. Currently only real number arguments are supported.
Put the top of the stack as argument into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
Put an argument of type double into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
|||
real(kind=double_k), | intent(in) | :: | arg |
Actual argument to hand over to the Lua function. |
Put an argument of type single into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
|||
real(kind=single_k), | intent(in) | :: | arg |
Actual argument to hand over to the Lua function. |
Put an array of doubles into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
|||
real(kind=double_k), | intent(in) | :: | arg(:) |
Actual argument to hand over to the Lua function. |
Put an array of singles into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
|||
real(kind=single_k), | intent(in) | :: | arg(:) |
Actual argument to hand over to the Lua function. |
Return the stack of the top as a function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
Handle to the function on the top of the stack.
A string identifying the function uniquely in the Lua script.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(aot_fun_type), | intent(in) | :: | fun |
Function to identify. |
Identification of the function as a string.
Close the function again (pop everything above from the stack).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle to the function to close. |
Execute a given function and put its results on the stack, where it is retrievable with aot_top_get_val.
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. |
Get a function defined as component of a table.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
integer, | intent(in), | optional | :: | parent |
Handle to the table to look in for the function. |
|
type(aot_fun_type), | intent(out) | :: | fun |
Returned handle, providing access to the function. |
||
character(len=*), | intent(in), | optional | :: | key |
Name of the function to look up in the table. |
|
integer, | intent(in), | optional | :: | pos |
Position of the function to look up in the table. |
Get a function from a previously defned Lua reference.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type), | intent(out) | :: | fun |
Returned handle, providing access to the function. |
||
integer, | intent(in) | :: | ref |
Lua reference to the function. |
Put the top of the stack as argument into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
Put an argument of type double into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
|||
real(kind=double_k), | intent(in) | :: | arg |
Actual argument to hand over to the Lua function. |
Put an argument of type single into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
|||
real(kind=single_k), | intent(in) | :: | arg |
Actual argument to hand over to the Lua function. |
Put an array of doubles into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
|||
real(kind=double_k), | intent(in) | :: | arg(:) |
Actual argument to hand over to the Lua function. |
Put an array of singles into the list of arguments for the function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
type(aot_fun_type) | :: | fun |
Handle of the function, this argument should be put into. |
|||
real(kind=single_k), | intent(in) | :: | arg(:) |
Actual argument to hand over to the Lua function. |