Load and execute a given buffer and register it in the package table as the given module name.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L | Lua State to set load the buffer into. |
|||
character, | intent(in) | :: | buffer(:) | Buffer to load. |
||
character(len=*), | intent(in) | :: | modname | Module name to set. |
subroutine aot_require_buffer(L, buffer, modname)
type(flu_State) :: L !! Lua State to set load the buffer into.
character, intent(in) :: buffer(:) !! Buffer to load.
character(len=*), intent(in) :: modname !! Module name to set.
integer :: pac_handle
integer :: ld_handle
call open_config_buffer(L = L, buffer = buffer, bufName = trim(modname))
call aot_table_open(L, thandle = pac_handle, key = "package")
call aot_table_open(L, parent = pac_handle, &
& thandle = ld_handle, key = "loaded")
call aot_table_set_val(val = .true., L = L, thandle = ld_handle, &
& key = trim(modname))
call aot_table_close(L, ld_handle)
call aot_table_close(L, pac_handle)
end subroutine aot_require_buffer