aotus_module Module

This module provides high level Fortran interfaces to retrieve values from a Lua script.

The central interface of the module is aot_get_val, which is a generic interface that allows access to scalars and vectors in global Lua variables as well as nested tables.

In the Overview there are some more general remarks and further pointers.


Uses

  • module~~aotus_module~~UsesGraph module~aotus_module aotus_module module~aot_top_module aot_top_module module~aotus_module->module~aot_top_module module~aot_vector_module aot_vector_module module~aotus_module->module~aot_vector_module module~flu_kinds_module flu_kinds_module module~aotus_module->module~flu_kinds_module module~aot_table_module aot_table_module module~aotus_module->module~aot_table_module module~flu_binding flu_binding module~aotus_module->module~flu_binding module~aot_top_module->module~flu_kinds_module module~aot_top_module->module~flu_binding module~aot_quadruple_top_module aot_quadruple_top_module module~aot_top_module->module~aot_quadruple_top_module module~aot_err_module aot_err_module module~aot_top_module->module~aot_err_module module~aot_extdouble_top_module aot_extdouble_top_module module~aot_top_module->module~aot_extdouble_top_module module~aot_vector_module->module~aot_top_module module~aot_vector_module->module~flu_kinds_module module~aot_vector_module->module~flu_binding module~aot_extdouble_vector_module aot_extdouble_vector_module module~aot_vector_module->module~aot_extdouble_vector_module module~aot_table_ops_module aot_table_ops_module module~aot_vector_module->module~aot_table_ops_module module~aot_quadruple_vector_module aot_quadruple_vector_module module~aot_vector_module->module~aot_quadruple_vector_module module~aot_table_module->module~aot_top_module module~aot_table_module->module~flu_kinds_module module~aot_table_module->module~flu_binding 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_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~flu_binding->module~flu_kinds_module module~lua_parameters lua_parameters module~flu_binding->module~lua_parameters 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~aot_quadruple_top_module->module~flu_binding module~aot_quadruple_top_module->module~aot_err_module module~aot_quadruple_table_module->module~aot_top_module module~aot_quadruple_table_module->module~flu_kinds_module module~aot_quadruple_table_module->module~flu_binding module~aot_quadruple_table_module->module~aot_quadruple_top_module module~aot_quadruple_table_module->module~aot_table_ops_module module~aot_quadruple_table_module->module~aot_err_module module~aot_extdouble_vector_module->module~aot_top_module module~aot_extdouble_vector_module->module~flu_binding module~aot_extdouble_vector_module->module~aot_table_ops_module module~aot_extdouble_vector_module->module~aot_extdouble_top_module module~aot_table_ops_module->module~aot_top_module module~aot_table_ops_module->module~flu_kinds_module module~aot_table_ops_module->module~flu_binding module~lua_parameters->iso_c_binding module~aot_err_module->module~flu_binding module~aot_quadruple_vector_module->module~aot_top_module module~aot_quadruple_vector_module->module~flu_binding module~aot_quadruple_vector_module->module~aot_quadruple_top_module module~aot_quadruple_vector_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_extdouble_table_module->module~aot_top_module module~aot_extdouble_table_module->module~flu_kinds_module module~aot_extdouble_table_module->module~flu_binding module~aot_extdouble_table_module->module~aot_table_ops_module module~aot_extdouble_table_module->module~aot_err_module module~aot_extdouble_table_module->module~aot_extdouble_top_module module~dump_lua_fif_module->iso_c_binding module~lua_fif->module~lua_parameters module~lua_fif->iso_c_binding

Used by

  • module~~aotus_module~~UsedByGraph module~aotus_module aotus_module module~aot_path_module aot_path_module module~aot_path_module->module~aotus_module

Contents


Subroutines

public subroutine open_config_file(L, filename, ErrCode, ErrString, buffer)

Subroutine to load and execute a script from a file.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(flu_State) :: L

Handle to the Lua script

character(len=*), intent(in) :: filename

Name of file to load the Lua code from

integer, intent(out), optional :: ErrCode

Error code returned by Lua during loading or executing the file.

This optional parameter might be used to react on errors in the calling side. If neither ErrCode nor ErrString are given, this subroutine will stop the program execution and print the error message from Lua to the stdout.

character(len=*), intent(out), optional :: ErrString

Obtained error description from the Lua stack.

This optional argument holds the Lua error message in case somehting went wrong. It can be used to provide some feedback to the user in the calling routine. If neither ErrCode nor ErrString are provided, open_config() will print the error message and stop program execution.

type(cbuf_type), intent(out), optional :: buffer

Optional argument to return the compiled script after loading it to the caller.

It might be handy to reuse the loaded script later on, this argument allows you to obtain the script in compiled form, before it is executed. The buffer will be allocated and filled with the Lua data. It contains the actual string in buffer%buffer which is a character pointer, and the original c_ptr to this

public subroutine open_config_chunk(L, chunk, ErrCode, ErrString)

Subroutine to load and execute a script given in a string.

Arguments

TypeIntentOptionalAttributesName
type(flu_State) :: L

Handle to the Lua script

character(len=*), intent(in) :: chunk

String with Lua code to load.

integer, intent(out), optional :: ErrCode

Error code returned by Lua during loading or executing the file.

This optional parameter might be used to react on errors in the calling side. If neither ErrCode nor ErrString are given, this subroutine will stop the program execution and print the error message from Lua to the stdout.

character(len=*), intent(out), optional :: ErrString

Obtained error description from the Lua stack.

This optional argument holds the Lua error message in case something went wrong. It can be used to provide some feedback to the user in the calling routine. If neither ErrCode nor ErrString are provided, open_config() will print the error message and stop program execution.

public subroutine open_config_buffer(L, buffer, bufName, ErrCode, ErrString)

Subroutine to load and execute a script given in a buffer (bytecode).

Arguments

TypeIntentOptionalAttributesName
type(flu_State) :: L

Handle to the Lua script

character, intent(in) :: buffer(:)

String with Lua code to load.

character(len=*), intent(in), optional :: bufName

Name for the buffer to use in debug messages.

integer, intent(out), optional :: ErrCode

Error code returned by Lua during loading or executing the file.

This optional parameter might be used to react on errors in the calling side. If neither ErrCode nor ErrString are given, this subroutine will stop the program execution and print the error message from Lua to the stdout.

character(len=*), intent(out), optional :: ErrString

Obtained error description from the Lua stack.

This optional argument holds the Lua error message in case somehting went wrong. It can be used to provide some feedback to the user in the calling routine. If neither ErrCode nor ErrString are provided, open_config() will print the error message and stop program execution.

public subroutine close_config(L)

Close an opened Lua script again.

Arguments

TypeIntentOptionalAttributesName
type(flu_State) :: L

Handle to the Lua script to close.

public subroutine aot_file_to_buffer(filename, buffer, ErrCode, ErrString)

Subroutine to load a script from a file and put it into a character buffer.

Read more…

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(in) :: filename

Name of file to load the Lua code from

type(cbuf_type), intent(out) :: buffer

Buffer to store the script in the given file in

integer, intent(out), optional :: ErrCode

Error code returned by Lua during loading or executing the file.

This optional parameter might be used to react on errors in the calling side. If neither ErrCode nor ErrString are given, this subroutine will stop the program execution and print the error message from Lua to the stdout.

character(len=*), intent(out), optional :: ErrString

Obtained error description from the Lua stack.

This optional argument holds the Lua error message in case somehting went wrong. It can be used to provide some feedback to the user in the calling routine. If neither ErrCode nor ErrString are provided, open_config() will print the error message and stop program execution.

public subroutine aot_require_buffer(L, buffer, modname)

Load and execute a given buffer and register it in the package table as the given module name.

Arguments

TypeIntentOptionalAttributesName
type(flu_State) :: L

Lua State to set load the buffer into.

character, intent(in) :: buffer(:)

Buffer to load.

character(len=*), intent(in) :: modname

Module name to set.