aot_fun_module Module

This module provides access to Lua functions

Intented usage:

  • First open a function with aot_fun_open.
  • Then put required parameters into it with aot_fun_put.
  • Execute the function with aot_fun_do.
  • Retrieve the possibly multiple results with aot_top_get_val. If there are multiple results to be retrieved from the function repeat calling aot_top_get_val for each of them. Keep in mind that they will be in reversed order on the stack!
  • Repeat putting and retrieving as needed (for multiple function evaluations).
  • Close the function finally with aot_fun_close.

Uses

  • module~~aot_fun_module~~UsesGraph module~aot_fun_module aot_fun_module module~aot_extdouble_fun_module aot_extdouble_fun_module module~aot_fun_module->module~aot_extdouble_fun_module module~aot_fun_declaration_module aot_fun_declaration_module module~aot_fun_module->module~aot_fun_declaration_module module~aot_quadruple_fun_module aot_quadruple_fun_module module~aot_fun_module->module~aot_quadruple_fun_module module~aot_references_module aot_references_module module~aot_fun_module->module~aot_references_module module~aot_table_module aot_table_module module~aot_fun_module->module~aot_table_module module~aot_top_module aot_top_module module~aot_fun_module->module~aot_top_module module~flu_binding flu_binding module~aot_fun_module->module~flu_binding module~flu_kinds_module flu_kinds_module module~aot_fun_module->module~flu_kinds_module module~aot_extdouble_fun_module->module~aot_fun_declaration_module module~aot_extdouble_fun_module->module~aot_table_module module~aot_extdouble_fun_module->module~flu_binding module~aot_extdouble_fun_module->module~flu_kinds_module module~aot_extdouble_top_module aot_extdouble_top_module module~aot_extdouble_fun_module->module~aot_extdouble_top_module module~aot_fun_declaration_module->module~flu_kinds_module module~aot_quadruple_fun_module->module~aot_fun_declaration_module module~aot_quadruple_fun_module->module~aot_table_module module~aot_quadruple_fun_module->module~flu_binding module~aot_quadruple_fun_module->module~flu_kinds_module module~aot_quadruple_top_module aot_quadruple_top_module module~aot_quadruple_fun_module->module~aot_quadruple_top_module module~aot_references_module->module~flu_binding module~aot_table_ops_module aot_table_ops_module module~aot_references_module->module~aot_table_ops_module module~lua_parameters lua_parameters module~aot_references_module->module~lua_parameters module~aot_table_module->module~aot_top_module module~aot_table_module->module~flu_binding module~aot_table_module->module~flu_kinds_module module~aot_err_module aot_err_module module~aot_table_module->module~aot_err_module module~aot_extdouble_table_module aot_extdouble_table_module module~aot_table_module->module~aot_extdouble_table_module module~aot_quadruple_table_module aot_quadruple_table_module module~aot_table_module->module~aot_quadruple_table_module module~aot_table_module->module~aot_table_ops_module module~aot_top_module->module~flu_binding module~aot_top_module->module~flu_kinds_module module~aot_top_module->module~aot_err_module module~aot_top_module->module~aot_extdouble_top_module module~aot_top_module->module~aot_quadruple_top_module module~flu_binding->module~flu_kinds_module iso_c_binding iso_c_binding module~flu_binding->iso_c_binding module~dump_lua_fif_module dump_lua_fif_module module~flu_binding->module~dump_lua_fif_module module~lua_fif lua_fif module~flu_binding->module~lua_fif module~flu_binding->module~lua_parameters module~aot_err_module->module~flu_binding module~aot_extdouble_table_module->module~aot_top_module module~aot_extdouble_table_module->module~flu_binding module~aot_extdouble_table_module->module~flu_kinds_module module~aot_extdouble_table_module->module~aot_err_module module~aot_extdouble_table_module->module~aot_extdouble_top_module module~aot_extdouble_table_module->module~aot_table_ops_module module~aot_extdouble_top_module->module~flu_binding module~aot_extdouble_top_module->module~aot_err_module module~aot_quadruple_table_module->module~aot_top_module module~aot_quadruple_table_module->module~flu_binding module~aot_quadruple_table_module->module~flu_kinds_module module~aot_quadruple_table_module->module~aot_err_module module~aot_quadruple_table_module->module~aot_quadruple_top_module module~aot_quadruple_table_module->module~aot_table_ops_module module~aot_quadruple_top_module->module~flu_binding module~aot_quadruple_top_module->module~aot_err_module module~aot_table_ops_module->module~aot_top_module module~aot_table_ops_module->module~flu_binding module~aot_table_ops_module->module~flu_kinds_module module~dump_lua_fif_module->iso_c_binding module~lua_fif->iso_c_binding module~lua_fif->module~lua_parameters module~lua_parameters->iso_c_binding

Used by

  • module~~aot_fun_module~~UsedByGraph module~aot_fun_module aot_fun_module module~aot_path_module aot_path_module module~aot_path_module->module~aot_fun_module

Interfaces

public interface aot_fun_open

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.

  • private subroutine aot_fun_table(L, parent, fun, key, pos)

    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.

    Arguments

    Type IntentOptional 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.

  • private subroutine aot_fun_ref(L, fun, ref)

    Get a function from a previously defned Lua reference.

    Use a previously (with aot_reference_for) defined reference to get a function.

    Arguments

    Type IntentOptional 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.

public interface aot_fun_put

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.

  • private subroutine aot_fun_put_top(L, fun)

    Put the top of the stack as argument into the list of arguments for the function.

    Arguments

    Type IntentOptional 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.

  • private subroutine aot_fun_put_double(L, fun, arg)

    Put an argument of type double into the list of arguments for the function.

    Arguments

    Type IntentOptional 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.

  • private subroutine aot_fun_put_single(L, fun, arg)

    Put an argument of type single into the list of arguments for the function.

    Arguments

    Type IntentOptional 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.

  • private subroutine aot_fun_put_double_v(L, fun, arg)

    Put an array of doubles into the list of arguments for the function.

    Arguments

    Type IntentOptional 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.

  • private subroutine aot_fun_put_single_v(L, fun, arg)

    Put an array of singles into the list of arguments for the function.

    Arguments

    Type IntentOptional 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.


Functions

public function aot_fun_top(L) result(fun)

Return the stack of the top as a function.

Read more…

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: L

Handle for the Lua script.

Return Value type(aot_fun_type)

Handle to the function on the top of the stack.

public function aot_fun_id(fun) result(id)

A string identifying the function uniquely in the Lua script.

Arguments

Type IntentOptional Attributes Name
type(aot_fun_type), intent(in) :: fun

Function to identify.

Return Value character(len=32)

Identification of the function as a string.


Subroutines

public subroutine aot_fun_close(L, fun)

Close the function again (pop everything above from the stack).

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: L

Handle for the Lua script.

type(aot_fun_type) :: fun

Handle to the function to close.

public subroutine aot_fun_do(L, fun, nresults, ErrCode, ErrString)

Execute a given function and put its results on the stack, where it is retrievable with aot_top_get_val.

Read more…

Arguments

Type IntentOptional 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.

private subroutine aot_fun_table(L, parent, fun, key, pos)

Get a function defined as component of a table.

Read more…

Arguments

Type IntentOptional 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.

private subroutine aot_fun_ref(L, fun, ref)

Get a function from a previously defned Lua reference.

Read more…

Arguments

Type IntentOptional 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.

private subroutine aot_fun_put_top(L, fun)

Put the top of the stack as argument into the list of arguments for the function.

Arguments

Type IntentOptional 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.

private subroutine aot_fun_put_double(L, fun, arg)

Put an argument of type double into the list of arguments for the function.

Arguments

Type IntentOptional 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.

private subroutine aot_fun_put_single(L, fun, arg)

Put an argument of type single into the list of arguments for the function.

Arguments

Type IntentOptional 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.

private subroutine aot_fun_put_double_v(L, fun, arg)

Put an array of doubles into the list of arguments for the function.

Arguments

Type IntentOptional 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.

private subroutine aot_fun_put_single_v(L, fun, arg)

Put an array of singles into the list of arguments for the function.

Arguments

Type IntentOptional 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.