tem_pop_from_track_rq Subroutine

public subroutine tem_pop_from_track_rq(L, modname, buffer)

Subroutine to pop the code from the tracked required files.

This routine reads the given module from the previously stored list of required codes into the buffer and removes it from the table in Lua.

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: L
character(len=*), intent(in) :: modname

Name of the module to pop.

type(cbuf_type) :: buffer

Buffer to hold the code.


Source Code

  subroutine tem_pop_from_track_rq(L, modname, buffer)
    ! ---------------------------------------------------------------------------
    !>
    type(flu_State) :: L
    !> Name of the module to pop.
    character(len=*), intent(in) :: modname
    !> Buffer to hold the code.
    type(cbuf_type) :: buffer
    ! ---------------------------------------------------------------------------
    integer :: track_handle
    integer :: code_handle
    integer :: buflen
    integer :: iError
    ! ---------------------------------------------------------------------------

    call aot_table_open( L       = L,                                          &
      &                  thandle = track_handle,                               &
      &                  key     = 'track_rq' )
    call aot_table_open( L       = L,                                          &
      &                  parent  = track_handle,                               &
      &                  thandle = code_handle,                                &
      &                  key     = 'code' )

    ! Get field track_rq.code[modname].
    call aot_table_push(L, thandle = code_handle, key=trim(modname))
    ! Dump to buffer
    call flu_dump(L, buffer, buflen, iError)
    ! Pop it from the stack again.
    call flu_pop(L)
    ! Set field track_rq.code[modname] to nil.
    call flu_pushNil(L)
    call aot_table_set_top(L, code_handle, key=trim(modname))

    call aot_table_close(L, code_handle)
    call aot_table_close(L, track_handle)

  end subroutine tem_pop_from_track_rq