This module provides the Fortran Lua interface.
It defines a flu_state which encapsulates the Lua state and is used to reference a Lua script. The main content are then the wrapper implementations which ease the usage of the Lua functions declared in the lua_fif module.
Naming follows the Lua API, but replaces the lua_ prefix
by flu_.
Documentation of the actual C functions can be found by replacing
the flu_ prefix here by lua_ and refering to the
Lua API documentation.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | FLU_TNONE | = | int(LUA_TNONE) | |
| integer, | public, | parameter | :: | FLU_TNIL | = | int(LUA_TNIL) | |
| integer, | public, | parameter | :: | FLU_TBOOLEAN | = | int(LUA_TBOOLEAN) | |
| integer, | public, | parameter | :: | FLU_TLIGHTUSERDATA | = | int(LUA_TLIGHTUSERDATA) | |
| integer, | public, | parameter | :: | FLU_TNUMBER | = | int(LUA_TNUMBER) | |
| integer, | public, | parameter | :: | FLU_TSTRING | = | int(LUA_TSTRING) | |
| integer, | public, | parameter | :: | FLU_TTABLE | = | int(LUA_TTABLE) | |
| integer, | public, | parameter | :: | FLU_TFUNCTION | = | int(LUA_TFUNCTION) | |
| integer, | public, | parameter | :: | FLU_TUSERDATA | = | int(LUA_TUSERDATA) | |
| integer, | public, | parameter | :: | FLU_TTHREAD | = | int(LUA_TTHREAD) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| real | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| real(kind=c_double) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer(kind=int_k) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer(kind=long_k) | :: | n |
Dump to a buffer and return the pointer to the resulting string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| type(cbuf_type), | intent(out) | :: | buf | |||
| integer | :: | length | ||||
| integer | :: | iError |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | ptr |
Interoperable interface required for a function that is callable from Lua.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | s |
Encapsulation of the Lua state.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(c_ptr), | private | :: | state | = | c_null_ptr | ||
| logical, | private | :: | opened_libs | = | .false. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(c_ptr), | private | :: | ptr | = | c_null_ptr | ||
| character, | private, | pointer | :: | buffer(:) | => | NULL() |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index | ||||
| character(len=*) | :: | k |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| character(len=*) | :: | k |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
Only defined as a Macro, using lua_type:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer, | intent(in) | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | nargs | ||||
| integer | :: | nresults | ||||
| integer | :: | errfunc |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer, | intent(in) | :: | index | |||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index | ||||
| integer | :: | len |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| character(len=*) | :: | filename |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| character | :: | buffer(:) | ||||
| character(len=*), | optional | :: | bufName |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| character(len=*) | :: | string |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| character(len=*) | :: | tname |
Copy an existing Lua state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | lua_state |
Close a previously opened Lua script.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | Handle to the Lua state to close. |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | narr | ||||
| integer | :: | nrec |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
Wrapper for lua_pop that pops n elements from the Lua API stack.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | Handle to the Lua script |
|||
| integer, | intent(in), | optional | :: | n | Number of elements to pop from the Lua API stack, defaults to 1. |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| logical | :: | b |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| character(len=*), | intent(in) | :: | string |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| type(c_ptr) | :: | ptr |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer | :: | index | ||||
| character(len=*) | :: | k |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| character(len=*), | intent(in) | :: | k |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State), | value | :: | L | |||
| procedure(lua_Function) | :: | fn | ||||
| integer | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| character(len=*), | intent(in) | :: | fn_name | |||
| procedure(lua_Function) | :: | fn |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| character(len=*) | :: | tname |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer(kind=int_k) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| integer(kind=long_k) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| real | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flu_State) | :: | L | ||||
| real(kind=c_double) | :: | n |