dm_lua_read Interface

public interface dm_lua_read

Pushes global variable on stack and optionally returns value.


Module Procedures

private function lua_read_array_int32(lua, name, values) result(rc)

Returns the values of global variable as 4-byte integers.

The function returns the following error codes:

  • E_ALLOC if array allocation failed.
  • E_TYPE if variable is not an integer table.

Arguments

Type IntentOptional Attributes Name
type(lua_state_type), intent(inout) :: lua

Lua type.

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

Variable name.

integer(kind=i4), intent(out), allocatable :: values(:)

Variable values.

Return Value integer

private function lua_read_array_int64(lua, name, values) result(rc)

Returns the values of global variable as 8-byte integers.

The function returns the following error codes:

  • E_ALLOC if array allocation failed.
  • E_TYPE if variable is not an integer table.

Arguments

Type IntentOptional Attributes Name
type(lua_state_type), intent(inout) :: lua

Lua type.

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

Variable name.

integer(kind=i8), intent(out), allocatable :: values(:)

Variable values.

Return Value integer

private function lua_read_int32(lua, name, value) result(rc)

Returns the value of global variable as 4-byte integer. The function returns E_TYPE if the variable is not of type integer.

Arguments

Type IntentOptional Attributes Name
type(lua_state_type), intent(inout) :: lua

Lua type.

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

Variable name.

integer(kind=i4), intent(inout) :: value

Variable value.

Return Value integer

private function lua_read_int64(lua, name, value) result(rc)

Returns the value of global variable as 8-byte integer. The function returns E_TYPE if the variable is not of type integer.

Arguments

Type IntentOptional Attributes Name
type(lua_state_type), intent(inout) :: lua

Lua type.

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

Variable name.

integer(kind=i8), intent(inout) :: value

Variable value.

Return Value integer

private function lua_read_logical(lua, name, value) result(rc)

Returns the value of global variable as logical. The function returns E_TYPE if the variable is not of type boolean.

Arguments

Type IntentOptional Attributes Name
type(lua_state_type), intent(inout) :: lua

Lua type.

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

Variable name.

logical, intent(inout) :: value

Variable value.

Return Value integer

private function lua_read_real64(lua, name, value) result(rc)

Returns the value of global variable as 8-byte real. The function returns E_TYPE if the variable is not of type number.

Arguments

Type IntentOptional Attributes Name
type(lua_state_type), intent(inout) :: lua

Lua type.

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

Variable name.

real(kind=r8), intent(inout) :: value

Variable value.

Return Value integer

private function lua_read_stack(lua, name) result(rc)

Pushes global variable on stack. Returns E_EMPTY if the variable does not exist.

Arguments

Type IntentOptional Attributes Name
type(lua_state_type), intent(inout) :: lua

Lua type.

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

Variable name.

Return Value integer

private function lua_read_string(lua, name, value) result(rc)

Returns the value of global variable as allocatable string. The function returns E_TYPE if the variable is not of type string.

Arguments

Type IntentOptional Attributes Name
type(lua_state_type), intent(inout) :: lua

Lua type.

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

Variable name.

character(len=*), intent(inout) :: value

Variable value.

Return Value integer