flu_register Subroutine

public subroutine flu_register(L, fn_name, fn)

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: L
character(len=*), intent(in) :: fn_name
procedure(lua_Function) :: fn

Calls

proc~~flu_register~~CallsGraph proc~flu_register flu_register proc~flu_pushcclosure flu_pushcclosure proc~flu_register->proc~flu_pushcclosure proc~flu_setglobal flu_setglobal proc~flu_register->proc~flu_setglobal interface~lua_pushcclosure lua_pushcclosure proc~flu_pushcclosure->interface~lua_pushcclosure interface~lua_setglobal lua_setglobal proc~flu_setglobal->interface~lua_setglobal

Source Code

  subroutine flu_register(L, fn_name, fn)

    ! lua_register is defined as a macro in lua.h and isn't accessible from
    ! Fortran.
    ! Re-implement macro explicitly.

    type(flu_State) :: L
    character(len=*), intent(in) :: fn_name
    procedure(lua_Function) :: fn

    call flu_pushcclosure(L, fn, 0)
    call flu_setglobal(L, fn_name)

  end subroutine flu_register