aot_path_open_fun Subroutine

private subroutine aot_path_open_fun(me, conf, fun, openLua)

This subroutine opens all the tables on the way to the final head node, which ought to be a function.

The given fun object is then filled by an aot_fun_open on the head of the given path. The handle can be either passed in, to be used for the look up of the path, or, when specifying the optional openLua argument as true, it will return the handle to the newly opened Lua script.

Arguments

Type IntentOptional AttributesName
type(aot_path_type), intent(inout) :: me

The path object to open as a function

type(flu_State) :: conf

The flu_state handle, which is either opened according to the path, or used to open the path in.

type(aot_fun_type), intent(out) :: fun

The opened function

logical, intent(in), optional :: openLua

A flag to indicate, wether to open the Lua script, default is false, in which case the conf argument has to link to an actual Lua state handle.


Calls

proc~~aot_path_open_fun~~CallsGraph proc~aot_path_open_fun aot_path_open_fun proc~aot_path_open_table aot_path_open_table proc~aot_path_open_fun->proc~aot_path_open_table interface~aot_fun_open aot_fun_open proc~aot_path_open_fun->interface~aot_fun_open proc~aot_table_open aot_table_open proc~aot_path_open_table->proc~aot_table_open proc~open_config_file open_config_file proc~aot_path_open_table->proc~open_config_file proc~aot_fun_ref aot_fun_ref interface~aot_fun_open->proc~aot_fun_ref proc~aot_fun_table aot_fun_table interface~aot_fun_open->proc~aot_fun_table proc~flu_gettop flu_gettop proc~aot_table_open->proc~flu_gettop proc~aot_table_top aot_table_top proc~aot_table_open->proc~aot_table_top proc~flu_createtable flu_createtable proc~aot_table_open->proc~flu_createtable proc~aot_table_push aot_table_push proc~aot_table_open->proc~aot_table_push proc~flu_getglobal flu_getglobal proc~aot_table_open->proc~flu_getglobal proc~aot_reference_to_top aot_reference_to_top proc~aot_fun_ref->proc~aot_reference_to_top proc~aot_fun_top aot_fun_top proc~aot_fun_ref->proc~aot_fun_top proc~aot_fun_table->proc~aot_table_push proc~aot_fun_table->proc~aot_fun_top proc~flul_loadfile fluL_loadfile proc~open_config_file->proc~flul_loadfile proc~flul_openlibs fluL_openlibs proc~open_config_file->proc~flul_openlibs proc~flu_pcall flu_pcall proc~open_config_file->proc~flu_pcall proc~aot_err_handler aot_err_handler proc~open_config_file->proc~aot_err_handler interface~flu_dump flu_dump proc~open_config_file->interface~flu_dump proc~flu_isopen flu_isopen proc~open_config_file->proc~flu_isopen proc~flul_newstate fluL_newstate proc~open_config_file->proc~flul_newstate interface~lual_loadfilex luaL_loadfilex proc~flul_loadfile->interface~lual_loadfilex interface~lua_gettop lua_gettop proc~flu_gettop->interface~lua_gettop proc~flu_rawgeti flu_rawgeti proc~aot_reference_to_top->proc~flu_rawgeti proc~aot_table_top->proc~flu_gettop proc~flu_istable flu_isTable proc~aot_table_top->proc~flu_istable proc~flu_pop flu_pop proc~aot_table_top->proc~flu_pop interface~lua_createtable lua_createtable proc~flu_createtable->interface~lua_createtable proc~aot_table_push->proc~flu_getglobal proc~flu_pushnil flu_pushnil proc~aot_table_push->proc~flu_pushnil proc~flu_getfield flu_getfield proc~aot_table_push->proc~flu_getfield proc~flu_type flu_type proc~aot_table_push->proc~flu_type interface~flu_pushinteger flu_pushinteger proc~aot_table_push->interface~flu_pushinteger proc~flu_gettable flu_gettable proc~aot_table_push->proc~flu_gettable proc~aot_table_push->proc~flu_pop proc~aot_fun_top->proc~flu_gettop proc~flu_pushvalue flu_pushvalue proc~aot_fun_top->proc~flu_pushvalue proc~flu_isfunction flu_isFunction proc~aot_fun_top->proc~flu_isfunction proc~flu_topointer flu_topointer proc~aot_fun_top->proc~flu_topointer interface~lual_openlibs luaL_openlibs proc~flul_openlibs->interface~lual_openlibs interface~lua_pcallk lua_pcallk proc~flu_pcall->interface~lua_pcallk proc~flu_tolstring flu_tolstring proc~aot_err_handler->proc~flu_tolstring proc~flu_dump_tobuf flu_dump_toBuf interface~flu_dump->proc~flu_dump_tobuf interface~lual_newstate luaL_newstate proc~flul_newstate->interface~lual_newstate interface~lua_getglobal lua_getglobal proc~flu_getglobal->interface~lua_getglobal interface~lua_pushnil lua_pushnil proc~flu_pushnil->interface~lua_pushnil interface~lua_type lua_type proc~flu_istable->interface~lua_type interface~lua_getfield lua_getfield proc~flu_getfield->interface~lua_getfield proc~flu_type->interface~lua_type interface~lua_rawgeti lua_rawgeti proc~flu_rawgeti->interface~lua_rawgeti proc~flu_pushint flu_pushint interface~flu_pushinteger->proc~flu_pushint proc~flu_pushlong flu_pushlong interface~flu_pushinteger->proc~flu_pushlong interface~lua_pushvalue lua_pushvalue proc~flu_pushvalue->interface~lua_pushvalue interface~lua_gettable lua_gettable proc~flu_gettable->interface~lua_gettable proc~flu_isfunction->interface~lua_type interface~lua_topointer lua_topointer proc~flu_topointer->interface~lua_topointer interface~lua_settop lua_settop proc~flu_pop->interface~lua_settop interface~dump_lua_tobuf dump_lua_toBuf proc~flu_dump_tobuf->interface~dump_lua_tobuf interface~lua_tolstring lua_tolstring proc~flu_tolstring->interface~lua_tolstring interface~lua_pushinteger lua_pushinteger proc~flu_pushint->interface~lua_pushinteger proc~flu_pushlong->interface~lua_pushinteger

Called by

proc~~aot_path_open_fun~~CalledByGraph proc~aot_path_open_fun aot_path_open_fun interface~aot_path_open aot_path_open interface~aot_path_open->proc~aot_path_open_fun

Contents

Source Code


Source Code

  subroutine aot_path_open_fun(me, conf, fun, openLua)
    !> The path object to open as a function
    type(aot_path_type), intent(inout) :: me
    !> The flu_state handle, which is either opened according to
    !! the path, or used to open the path in.
    type(flu_state) :: conf
    !> The opened function
    type(aot_fun_type), intent(out) :: fun
    !> A flag to indicate, wether to open the Lua script, default
    !! is false, in which case the conf argument has to link to
    !! an actual Lua state handle.
    logical, intent(in), optional :: openLua

    integer :: myHandle

    ! open the table untill it reaches the final head node
    call aot_path_open_table( me, conf, myHandle, openLua )

    if (me%head%NodeType == 'function') then
      select case(me%head%ID_kind)
      case('key')
        if (associated(me%head, me%GlobalNode)) then
          call aot_fun_open(L=conf, fun=fun, key=me%head%key)
        else
          call aot_fun_open(L=conf, parent=myHandle, fun=fun, key=me%head%key)
        end if
      case('position')
        call aot_fun_open(L=conf, parent=myHandle, fun=fun, pos=me%head%pos)
      end select
    end if

  end subroutine aot_path_open_fun