test Program

Uses

  • program~~test~~UsesGraph program~test test module~flu_binding flu_binding program~test->module~flu_binding 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~flu_kinds_module flu_kinds_module module~flu_binding->module~flu_kinds_module module~lua_fif lua_fif module~flu_binding->module~lua_fif module~lua_parameters lua_parameters module~flu_binding->module~lua_parameters 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

Calls

program~~test~~CallsGraph program~test test proc~flu_close flu_close program~test->proc~flu_close proc~flu_getglobal flu_getglobal program~test->proc~flu_getglobal proc~flu_pcall flu_pcall program~test->proc~flu_pcall proc~flu_tolstring flu_tolstring program~test->proc~flu_tolstring proc~flu_tonumber flu_tonumber program~test->proc~flu_tonumber proc~flul_loadfile fluL_loadfile program~test->proc~flul_loadfile proc~flul_newstate fluL_newstate program~test->proc~flul_newstate interface~lua_close lua_close proc~flu_close->interface~lua_close interface~lua_getglobal lua_getglobal proc~flu_getglobal->interface~lua_getglobal interface~lua_pcallk lua_pcallk proc~flu_pcall->interface~lua_pcallk interface~lua_tolstring lua_tolstring proc~flu_tolstring->interface~lua_tolstring interface~lua_tonumberx lua_tonumberx proc~flu_tonumber->interface~lua_tonumberx interface~lual_loadfilex luaL_loadfilex proc~flul_loadfile->interface~lual_loadfilex interface~lual_newstate luaL_newstate proc~flul_newstate->interface~lual_newstate

Variables

Type Attributes Name Initial
type(flu_State) :: L
character(len=89) :: filename
integer :: str_len
integer :: widthtype
integer :: heighttype

Source Code

program test
  use flu_binding

  implicit none

  type(flu_State) :: L
  character(len=89) :: filename
  integer :: str_len
  integer :: widthtype, heighttype

  L = fluL_newstate()

  filename = "config.test"
  if (fluL_loadfile(L, filename).ne.0) then
     write(*,*) "cannot load configuration file: ", flu_tolstring(L,-1, str_len)
     STOP
  endif
  if (flu_pcall(L, 0, 0, 0).ne.0) then
     write(*,*) "cannot run configuration file: ", flu_tolstring(L,-1, str_len)
     STOP
  endif

  widthtype = flu_getglobal(L, "width")
  heighttype = flu_getglobal(L, "height")

  if (widthtype == FLU_TNUMBER) then
    write(*,*) 'width=', flu_tonumber(L, -2)
  end if
  if (heighttype == FLU_TNUMBER) then
    write(*,*) 'height=', flu_tonumber(L, -1)
  end if

  call flu_close(L)

end program test