Harald Klimach avatar Harald Klimach committed db088f8

Interface Consolidation (BEWARE! major API change)

With this redefinition of the interfaces, the API hopefully gets less cluttered
and less surprising in most places.
We are now using "L" for the handle to the Lua script everywhere, instead of
conf in some places. Names are referred to as "key" now everywhere instead of
var in some places.
Global variables are obtained with aot_get_val, and the order of the arguments
is more consistent with the other retrieving routines. In a next step the
aot_get_val generic interface should cover also values in tables.

Comments (0)

Files changed (9)

source/aot_fun_module.f90

 module aot_fun_module
   use flu_binding
   use aot_kinds_module, only: double_k, single_k
-  use aot_table_module
+  use aot_table_module, only: aot_table_push
 
   implicit none
 
     character(len=*), intent(in), optional :: key
     integer, intent(in), optional :: pos
 
-    call aot_table_getval(L, parent, key, pos)
+    call aot_table_push(L, parent, key, pos)
     fun = aot_fun_top(L)
   end subroutine aot_fun_table
 

source/aot_table_module.f90

 !! on lua tables.
 module aot_table_module
   use flu_binding
+  use aot_kinds_module, only: double_k, single_k, long_k
+  use aot_top_module, only: aot_top_get_val
 
   implicit none
 
+  private
+
+  public :: aot_table_top, aot_table_length, aot_table_first, aot_table_push
+  public :: aot_table_open, aot_table_close, aot_table_get_val
+
   !> This routine provides a way to open a table
   !! either as a globally defined one, are as a
   !! table within another table.
     module procedure aot_table_table
   end interface
 
+  !> Get a value from a table.
+  !!
+  !! First the given !! key is looked up, if this fails, the value
+  !! at the given position is looked up, and if this also fails,
+  !! the default value is returned.
+  !! Positional addressing is only valid, as long,
+  !! as no value was provided by an explicit key
+  !! in the list before the entry in question.
+  interface aot_table_get_val
+    module procedure get_table_real
+    module procedure get_table_double
+    module procedure get_table_integer
+    module procedure get_table_long
+    module procedure get_table_string
+    module procedure get_table_logical
+  end interface
+
+
 contains
 
   !> Return the position at the top of the stack as a
     character(len=*), intent(in), optional :: key
     integer, intent(in), optional :: pos
 
-    call aot_table_getval(L, parent, key, pos)
+    call aot_table_push(L, parent, key, pos)
     thandle = aot_table_top(L)
   end subroutine aot_table_table
 
   !! the lua stack, or if this fails, the entry at position pos
   !! of the table. If no corresponding value is found, a nil
   !! value is pushed to the stack.
-  subroutine aot_table_getval(L, thandle, key, pos)
+  subroutine aot_table_push(L, thandle, key, pos)
     type(flu_state) :: L
     integer :: thandle
     character(len=*), intent(in), optional :: key
 
     end if
 
-  end subroutine aot_table_getval
+  end subroutine aot_table_push
 
 
   !> Load the first key-value pair of table thandle on the
     end if
   end function aot_table_length
 
+
+  subroutine get_table_real(L, thandle, val, ErrCode, key, pos, default)
+    type(flu_State) :: L
+    integer, intent(in) :: thandle
+    real(kind=single_k), intent(out) :: val
+    integer, intent(out) :: ErrCode
+
+    character(len=*), intent(in), optional :: key
+    integer, intent(in), optional :: pos
+    real(kind=single_k), intent(in), optional :: default
+
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
+    call aot_top_get_val(L, val, ErrCode, default)
+
+  end subroutine get_table_real
+
+
+  subroutine get_table_double(L, thandle, val, ErrCode, key, pos, &
+    &                         default)
+    type(flu_State) :: L
+    integer, intent(in) :: thandle
+    real(kind=double_k), intent(out) :: val
+    integer, intent(out) :: ErrCode
+
+    character(len=*), intent(in), optional :: key
+    integer, intent(in), optional :: pos
+    real(kind=double_k), intent(in), optional :: default
+
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
+    call aot_top_get_val(L, val, ErrCode, default)
+
+  end subroutine get_table_double
+
+
+  subroutine get_table_integer(L, thandle, val, ErrCode, key, pos, &
+    &                          default)
+    type(flu_State) :: L
+    integer, intent(in) :: thandle
+    integer, intent(out) :: val
+    integer, intent(out) :: ErrCode
+
+    character(len=*), intent(in), optional :: key
+    integer, intent(in), optional :: pos
+    integer, intent(in), optional :: default
+
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
+    call aot_top_get_val(L, val, ErrCode, default)
+
+  end subroutine get_table_integer
+
+  subroutine get_table_long(L, thandle, val, ErrCode, key, pos, default)
+    type(flu_State) :: L
+    integer, intent(in) :: thandle
+    integer(kind=long_k), intent(out) :: val
+    integer, intent(out) :: ErrCode
+
+    character(len=*), intent(in), optional :: key
+    integer, intent(in), optional :: pos
+    integer(kind=long_k), intent(in), optional :: default
+
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
+    call aot_top_get_val(L, val, ErrCode, default)
+
+  end subroutine get_table_long
+
+  subroutine get_table_logical(L, thandle, val, ErrCode, key, pos, &
+    &                          default)
+    type(flu_State) :: L
+    integer, intent(in) :: thandle
+    logical, intent(out) :: val
+    integer, intent(out) :: ErrCode
+
+    character(len=*), intent(in), optional :: key
+    integer, intent(in), optional :: pos
+    logical, intent(in), optional :: default
+
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
+    call aot_top_get_val(L, val, ErrCode, default)
+
+  end subroutine get_table_logical
+
+
+  subroutine get_table_string(L, thandle, val, ErrCode, key, pos, &
+    &                         default)
+    type(flu_State) :: L
+    integer, intent(in) :: thandle
+    character(len=*) :: val
+    integer, intent(out) :: ErrCode
+
+    character(len=*), intent(in), optional :: key
+    integer, intent(in), optional :: pos
+    character(len=*), intent(in), optional :: default
+
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
+    call aot_top_get_val(L, val, ErrCode, default)
+
+  end subroutine get_table_string
+
+
 end module aot_table_module

source/aot_top_module.f90

+!> Module for interaction with topmost element of Luas stack.
+module aot_top_module
+  use flu_binding
+  use aot_kinds_module, only: double_k, single_k, long_k
+
+  implicit none
+
+  private
+
+  public :: aoterr_Fatal, aoterr_NonExistent, aoterr_WrongType
+  public :: aot_top_get_val
+
+  !> Some parameters for the error handling.
+  !!
+  !! They indicate the bits to set in case of
+  !! the corresponding error, to allow appropiate
+  !! reactions of the calling application.
+  integer, parameter :: aoterr_Fatal = 0
+  integer, parameter :: aoterr_NonExistent = 1
+  integer, parameter :: aoterr_WrongType = 2
+
+  !> Get the value on top of the stack
+  !!
+  !! This is the most basic operation to
+  !! retrieve a value.
+  !! It is also most flexible in the sense,
+  !! that it does not matter how the value
+  !! actually gets on top of the stack by
+  !! previous Lua operations.
+  interface aot_top_get_val
+    module procedure aot_top_get_real
+    module procedure aot_top_get_double
+    module procedure aot_top_get_integer
+    module procedure aot_top_get_long
+    module procedure aot_top_get_string
+    module procedure aot_top_get_logical
+  end interface
+
+
+contains
+
+
+  subroutine aot_top_get_real(L, val, ErrCode, default)
+    type(flu_State) :: L
+    real(kind=single_k), intent(out) :: val
+    integer, intent(out) :: ErrCode
+    real(kind=single_k), optional, intent(in) :: default
+
+    logical :: not_retrievable
+
+    ErrCode = 0
+    not_retrievable = .false.
+
+    if (flu_isNoneOrNil(L, -1)) then
+      ErrCode = ibSet(ErrCode, aoterr_NonExistent)
+      not_retrievable = .true.
+    else
+      if (flu_isNumber(L, -1)) then
+        val = flu_toNumber(L, -1)
+      else
+        ErrCode = ibSet(ErrCode, aoterr_WrongType)
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+        not_retrievable = .true.
+      end if
+    end if
+
+    if (not_retrievable) then
+      if (present(default)) then
+        val = default
+      else
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      end if
+    end if
+    call flu_pop(L)
+
+  end subroutine aot_top_get_real
+
+
+  subroutine aot_top_get_double(L, val, ErrCode, default)
+    type(flu_State) :: L
+    real(kind=double_k), intent(out) :: val
+    integer, intent(out) :: ErrCode
+    real(kind=double_k), optional, intent(in) :: default
+
+    logical :: not_retrievable
+
+    ErrCode = 0
+    not_retrievable = .false.
+
+    if (flu_isNoneOrNil(L, -1)) then
+      ErrCode = ibSet(ErrCode, aoterr_NonExistent)
+      not_retrievable = .true.
+    else
+      if (flu_isNumber(L, -1)) then
+        val = flu_toDouble(L, -1)
+      else
+        ErrCode = ibSet(ErrCode, aoterr_WrongType)
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+        not_retrievable = .true.
+      end if
+    end if
+
+    if (not_retrievable) then
+      if (present(default)) then
+        val = default
+      else
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      end if
+    end if
+    call flu_pop(L)
+
+  end subroutine aot_top_get_double
+
+
+  subroutine aot_top_get_integer(L, val, ErrCode, default)
+    type(flu_State) :: L
+    integer, intent(out) :: val
+    integer, intent(out) :: ErrCode
+    integer, optional, intent(in) :: default
+
+    logical :: not_retrievable
+
+    ErrCode = 0
+    not_retrievable = .false.
+
+    if (flu_isNoneOrNil(L, -1)) then
+      ErrCode = ibSet(ErrCode, aoterr_NonExistent)
+      not_retrievable = .true.
+    else
+      if (flu_isNumber(L, -1)) then
+        val = int(flu_toDouble(L, -1))
+      else
+        ErrCode = ibSet(ErrCode, aoterr_WrongType)
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+        not_retrievable = .true.
+      end if
+    end if
+
+    if (not_retrievable) then
+      if (present(default)) then
+        val = default
+      else
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      end if
+    end if
+    call flu_pop(L)
+
+  end subroutine aot_top_get_integer
+
+  subroutine aot_top_get_long(L, val, ErrCode, default)
+    type(flu_State) :: L
+    integer(kind=long_k), intent(out) :: val
+    integer, intent(out) :: ErrCode
+    integer(kind=long_k), optional, intent(in) :: default
+
+    logical :: not_retrievable
+
+    ErrCode = 0
+    not_retrievable = .false.
+
+    if (flu_isNoneOrNil(L, -1)) then
+      ErrCode = ibSet(ErrCode, aoterr_NonExistent)
+      not_retrievable = .true.
+    else
+      if (flu_isNumber(L, -1)) then
+        val = int(flu_toDouble(L, -1),kind=long_k)
+      else
+        ErrCode = ibSet(ErrCode, aoterr_WrongType)
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+        not_retrievable = .true.
+      end if
+    end if
+
+    if (not_retrievable) then
+      if (present(default)) then
+        val = default
+      else
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      end if
+    end if
+    call flu_pop(L)
+
+  end subroutine aot_top_get_long
+
+  subroutine aot_top_get_logical(L, val, ErrCode, default)
+    type(flu_State) :: L
+    logical, intent(out) :: val
+    integer, intent(out) :: ErrCode
+    logical, optional, intent(in) :: default
+
+    logical :: not_retrievable
+
+    ErrCode = 0
+    not_retrievable = .false.
+
+    if (flu_isNoneOrNil(L, -1)) then
+      ErrCode = ibSet(ErrCode, aoterr_NonExistent)
+      not_retrievable = .true.
+    else
+      if (flu_isBoolean(L, -1)) then
+        val = flu_toBoolean(L, -1)
+      else
+        ErrCode = ibSet(ErrCode, aoterr_WrongType)
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+        not_retrievable = .true.
+      end if
+    end if
+
+    if (not_retrievable) then
+      if (present(default)) then
+        val = default
+      else
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      end if
+    end if
+    call flu_pop(L)
+
+  end subroutine aot_top_get_logical
+
+
+  subroutine aot_top_get_string(L, val, ErrCode, default)
+    type(flu_State) :: L
+    character(len=*) :: val
+    integer, intent(out) :: ErrCode
+    character(len=*), optional, intent(in) :: default
+
+    logical :: not_retrievable
+    character, pointer :: cstring(:)
+    integer :: i, StrLen, StrLimit
+
+    ErrCode = 0
+    not_retrievable = .false.
+
+    if (flu_isNoneOrNil(L, -1)) then
+      ErrCode = ibSet(ErrCode, aoterr_NonExistent)
+      not_retrievable = .true.
+    else
+      cstring => flu_toLString(L, -1, StrLen)
+      StrLimit = min(StrLen, len(val))
+      val = ''
+      do i=1,StrLimit
+        val(i:i) = cstring(i)
+      end do
+    end if
+
+    if (not_retrievable) then
+      if (present(default)) then
+        val = default
+      else
+        ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      end if
+    end if
+    call flu_pop(L)
+
+  end subroutine aot_top_get_string
+
+
+end module aot_top_module

source/aot_vector_module.f90

 !! Otherwise the interfaces correspond to the scalar retrieval operations.
 module aot_vector_module
   use flu_binding
-  use aotus_module, only: get_top_val, aoterr_NonExistent, aoterr_Fatal
   use aot_kinds_module, only: double_k, single_k, long_k
   use aot_table_module, only: aot_table_close, aot_table_top, &
-    &                         aot_table_length, aot_table_getval, &
+    &                         aot_table_length, aot_table_push, &
     &                         aot_table_first
+  use aot_top_module, only: aot_top_get_val, aoterr_NonExistent, aoterr_Fatal
 
   implicit none
 
-  public :: get_table_val, get_config_val, get_top_val
+  public :: aot_table_get_val, aot_get_val, aot_top_get_val
 
   !> Use these routines to obtain a vector whose length is unknown.
   !!
   !! Arrays will be allocated as needed to read the data from the
-  !! Lua script with thes routines. A maximal length has to be
+  !! Lua script with these routines. A maximal length has to be
   !! specified to limit the allocated memory by this loading.
-  interface get_table_val
+  interface aot_table_get_val
     module procedure get_table_real_vvect
     module procedure get_table_double_vvect
     module procedure get_table_integer_vvect
     module procedure get_table_long_vvect
     module procedure get_table_logical_vvect
-  end interface get_table_val
+  end interface
 
-  interface get_config_val
+  interface aot_get_val
     module procedure get_config_real_vvect
     module procedure get_config_double_vvect
     module procedure get_config_integer_vvect
     module procedure get_config_logical_vvect
   end interface
 
-  interface get_top_val
+  interface aot_top_get_val
     module procedure get_top_real_vvect
     module procedure get_top_double_vvect
     module procedure get_top_integer_vvect
     module procedure get_top_long_vvect
     module procedure get_top_logical_vvect
-  end interface get_top_val
+  end interface
 
 
   !> Use these routines to obtain a vector of known length.
   !!
   !! The given vector has to exist already and will be filled by
   !! values from the Lua table, as far as they exist.
-  interface get_table_val
+  interface aot_table_get_val
     module procedure get_table_real_v
     module procedure get_table_double_v
     module procedure get_table_integer_v
     module procedure get_table_long_v
     module procedure get_table_logical_v
-  end interface get_table_val
+  end interface
 
-  interface get_config_val
+  interface aot_get_val
     module procedure get_config_real_v
     module procedure get_config_double_v
     module procedure get_config_integer_v
     module procedure get_config_logical_v
   end interface
 
-  interface get_top_val
+  interface aot_top_get_val
     module procedure get_top_real_v
     module procedure get_top_double_v
     module procedure get_top_integer_v
     module procedure get_top_long_v
     module procedure get_top_logical_v
-  end interface get_top_val
+  end interface
 
 
   private
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_table_real_vvect(conf, thandle, tab_val, ErrCode, &
-    &                             maxlength, var, pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_table_real_vvect(L, thandle, val, ErrCode, &
+    &                             maxlength, key, pos, default)
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    real(kind=single_k), intent(out), allocatable :: tab_val(:)
+    real(kind=single_k), intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     real(kind=single_k), intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_table_real_vvect
 
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_table_double_vvect(conf, thandle, tab_val, ErrCode, &
-    &                             maxlength, var, pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_table_double_vvect(L, thandle, val, ErrCode, &
+    &                             maxlength, key, pos, default)
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    real(kind=double_k), intent(out), allocatable :: tab_val(:)
+    real(kind=double_k), intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     real(kind=double_k), intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_table_double_vvect
 
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_table_integer_vvect(conf, thandle, tab_val, ErrCode, &
-    &                             maxlength, var, pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_table_integer_vvect(L, thandle, val, ErrCode, &
+    &                             maxlength, key, pos, default)
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    integer, intent(out), allocatable :: tab_val(:)
+    integer, intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     integer, intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_table_integer_vvect
 
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_table_long_vvect(conf, thandle, tab_val, ErrCode, &
-    &                             maxlength, var, pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_table_long_vvect(L, thandle, val, ErrCode, &
+    &                             maxlength, key, pos, default)
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    integer(kind=long_k), intent(out), allocatable :: tab_val(:)
+    integer(kind=long_k), intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     integer(kind=long_k), intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_table_long_vvect
 
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_table_logical_vvect(conf, thandle, tab_val, ErrCode, &
-    &                             maxlength, var, pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_table_logical_vvect(L, thandle, val, ErrCode, &
+    &                             maxlength, key, pos, default)
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    logical, intent(out), allocatable :: tab_val(:)
+    logical, intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     logical, intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_table_logical_vvect
 
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_config_real_vvect(conf, var, conf_val, ErrCode, &
-    &                             maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_real_vvect(L, val, ErrCode, maxlength, &
+    &                              key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    real(kind=single_k), intent(out), allocatable :: conf_val(:)
+    real(kind=single_k), intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     real(kind=single_k), intent(in), optional :: default(:)
 
     ! Get the requeseted global variable
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_config_real_vvect
 
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_config_double_vvect(conf, var, conf_val, ErrCode, &
-    &                             maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_double_vvect(L, val, ErrCode, maxlength, &
+    &                                key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    real(kind=double_k), intent(out), allocatable :: conf_val(:)
+    real(kind=double_k), intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     real(kind=double_k), intent(in), optional :: default(:)
 
     ! Get the requeseted global variable
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_config_double_vvect
 
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_config_integer_vvect(conf, var, conf_val, ErrCode, &
-    &                             maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_integer_vvect(L, val, ErrCode, maxlength, &
+    &                                 key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    integer, intent(out), allocatable :: conf_val(:)
+    integer, intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     integer, intent(in), optional :: default(:)
 
     ! Get the requeseted global variable
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_config_integer_vvect
 
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_config_long_vvect(conf, var, conf_val, ErrCode, &
-    &                             maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_long_vvect(L, val, ErrCode, maxlength, &
+    &                              key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    integer(kind=long_k), intent(out), allocatable :: conf_val(:)
+    integer(kind=long_k), intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     integer(kind=long_k), intent(in), optional :: default(:)
 
     ! Get the requeseted global variable
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_config_long_vvect
 
   !! capsulating the parsing of the Lua table internally.
   !! For the dynamically sized array, which will be allocated, a upper limit
   !! to allocate has to be specified.
-  subroutine get_config_logical_vvect(conf, var, conf_val, ErrCode, &
-    &                             maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_logical_vvect(L, val, ErrCode, maxlength, &
+    &                                 key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    logical, intent(out), allocatable :: conf_val(:)
+    logical, intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     logical, intent(in), optional :: default(:)
 
     ! Get the requeseted global variable
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, maxlength, default)
+    call aot_top_get_val(L, val, ErrCode, maxlength, default)
 
   end subroutine get_config_logical_vvect
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_table_real_v(conf, thandle, tab_val, ErrCode, var, &
+  subroutine get_table_real_v(L, thandle, val, ErrCode, key, &
     &                         pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table.
-    real(kind=single_k), intent(out) :: tab_val(:)
+    real(kind=single_k), intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     real(kind=single_k), intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_table_real_v
 
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_table_double_v(conf, thandle, tab_val, ErrCode, var, &
+  subroutine get_table_double_v(L, thandle, val, ErrCode, key, &
     &                         pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table.
-    real(kind=double_k), intent(out) :: tab_val(:)
+    real(kind=double_k), intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     real(kind=double_k), intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_table_double_v
 
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_table_integer_v(conf, thandle, tab_val, ErrCode, var, &
+  subroutine get_table_integer_v(L, thandle, val, ErrCode, key, &
     &                         pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table.
-    integer, intent(out) :: tab_val(:)
+    integer, intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     integer, intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_table_integer_v
 
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_table_long_v(conf, thandle, tab_val, ErrCode, var, &
+  subroutine get_table_long_v(L, thandle, val, ErrCode, key, &
     &                         pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table.
-    integer(kind=long_k), intent(out) :: tab_val(:)
+    integer(kind=long_k), intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     integer(kind=long_k), intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_table_long_v
 
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_table_logical_v(conf, thandle, tab_val, ErrCode, var, &
+  subroutine get_table_logical_v(L, thandle, val, ErrCode, key, &
     &                         pos, default)
-    type(flu_State) :: conf !< Handle to the lua script
+    type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     !> Vector read from the Lua table.
-    logical, intent(out) :: tab_val(:)
+    logical, intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> Position of the (vector) to read.
     integer, intent(in), optional :: pos
     logical, intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call aot_table_getval(L=conf, thandle=thandle, &
-      &                   key=var, pos=pos)
+    call aot_table_push(L=L, thandle=thandle, &
+      &                   key=key, pos=pos)
 
-    call get_top_val(conf, tab_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_table_logical_v
 
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_config_real_v(conf, var, conf_val, ErrCode, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_real_v(L, val, ErrCode, key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    real(kind=single_k), intent(out) :: conf_val(:)
+    real(kind=single_k), intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     real(kind=single_k), intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_config_real_v
 
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_config_double_v(conf, var, conf_val, ErrCode, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_double_v(L, val, ErrCode, key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    real(kind=double_k), intent(out) :: conf_val(:)
+    real(kind=double_k), intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     real(kind=double_k), intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_config_double_v
 
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_config_integer_v(conf, var, conf_val, ErrCode, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_integer_v(L, val, ErrCode, key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    integer, intent(out) :: conf_val(:)
+    integer, intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     integer, intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_config_integer_v
 
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_config_long_v(conf, var, conf_val, ErrCode, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_long_v(L, val, ErrCode, key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    integer(kind=long_k), intent(out) :: conf_val(:)
+    integer(kind=long_k), intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     integer(kind=long_k), intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_config_long_v
 
 
   !! as non-existent.
   !! Components, which are neither defined in the Lua script, nor in the
   !! default will be marked with the aoterr_Fatal flag.
-  subroutine get_config_logical_v(conf, var, conf_val, ErrCode, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_config_logical_v(L, val, ErrCode, key, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    logical, intent(out) :: conf_val(:)
+    logical, intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as tab_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: var
+    character(len=*), intent(in), optional :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     logical, intent(in), optional :: default(:)
 
     ! Get the requeseted value from the provided table
-    call flu_getglobal(conf, var)
+    call flu_getglobal(L, key)
 
-    call get_top_val(conf, conf_val, ErrCode, default)
+    call aot_top_get_val(L, val, ErrCode, default)
   end subroutine get_config_logical_v
 
 
 
 
 
-  subroutine get_top_real_vvect(conf, top_val, ErrCode, maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_real_vvect(L, val, ErrCode, maxlength, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    real(kind=single_k), intent(out), allocatable :: top_val(:)
+    real(kind=single_k), intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer :: iComp
 
     ! Try to interpret the top entry on the stack as a table
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
     ! The size of the vector is limited by maxlength.
     vect_len = min(maxlength, table_len)
     if (present(default)) def_len = size(default)
 
     ! Now parse the table with the vector entries.
-    if (aot_table_first(conf, vect_handle)) then
-      allocate(top_val(vect_len))
+    if (aot_table_first(L, vect_handle)) then
+      allocate(val(vect_len))
       allocate(errCode(vect_len))
 
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
-        call get_top_val(conf, top_val(1), ErrCode(1), default(1))
+        call aot_top_get_val(L, val(1), ErrCode(1), default(1))
       else
-        call get_top_val(conf, top_val(1), ErrCode(1))
+        call aot_top_get_val(L, val(1), ErrCode(1))
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp), default(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+          &                  default(iComp))
       end do
 
       vect_lb = max(2, def_len+1)
       ! After def_len entries no default values for the components are
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
       end do
     else
       ! No vector definition found in the Lua script, use the default.
       if (present(default)) then
-        allocate(top_val(def_len))
+        allocate(val(def_len))
         allocate(errCode(vect_len))
-        top_val = default
+        val = default
         ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       else
         ! No vector definition in the Lua script and no default provided,
         ! return an empty array.
-        allocate(top_val(0))
+        allocate(val(0))
         allocate(errCode(0))
       end if
     end if
-    call aot_table_close(conf, vect_handle)
+    call aot_table_close(L, vect_handle)
 
   end subroutine get_top_real_vvect
 
 
 
-  subroutine get_top_double_vvect(conf, top_val, ErrCode, maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_double_vvect(L, val, ErrCode, maxlength, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    real(kind=double_k), intent(out), allocatable :: top_val(:)
+    real(kind=double_k), intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer :: iComp
 
     ! Try to interpret the top entry on the stack as a table
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
     ! The size of the vector is limited by maxlength.
     vect_len = min(maxlength, table_len)
     if (present(default)) def_len = size(default)
 
     ! Now parse the table with the vector entries.
-    if (aot_table_first(conf, vect_handle)) then
-      allocate(top_val(vect_len))
+    if (aot_table_first(L, vect_handle)) then
+      allocate(val(vect_len))
       allocate(errCode(vect_len))
 
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
-        call get_top_val(conf, top_val(1), ErrCode(1), default(1))
+        call aot_top_get_val(L, val(1), ErrCode(1), default(1))
       else
-        call get_top_val(conf, top_val(1), ErrCode(1))
+        call aot_top_get_val(L, val(1), ErrCode(1))
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp), default(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+          &                  default(iComp))
       end do
 
       vect_lb = max(2, def_len+1)
       ! After def_len entries no default values for the components are
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
       end do
     else
       ! No vector definition found in the Lua script, use the default.
       if (present(default)) then
-        allocate(top_val(def_len))
+        allocate(val(def_len))
         allocate(errCode(vect_len))
-        top_val = default
+        val = default
         ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       else
         ! No vector definition in the Lua script and no default provided,
         ! return an empty array.
-        allocate(top_val(0))
+        allocate(val(0))
         allocate(errCode(0))
       end if
     end if
-    call aot_table_close(conf, vect_handle)
+    call aot_table_close(L, vect_handle)
 
   end subroutine get_top_double_vvect
 
 
-  subroutine get_top_integer_vvect(conf, top_val, ErrCode, maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_integer_vvect(L, val, ErrCode, maxlength, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    integer, intent(out), allocatable :: top_val(:)
+    integer, intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer :: iComp
 
     ! Try to interpret the top entry on the stack as a table
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
     ! The size of the vector is limited by maxlength.
     vect_len = min(maxlength, table_len)
     if (present(default)) def_len = size(default)
 
     ! Now parse the table with the vector entries.
-    if (aot_table_first(conf, vect_handle)) then
-      allocate(top_val(vect_len))
+    if (aot_table_first(L, vect_handle)) then
+      allocate(val(vect_len))
       allocate(errCode(vect_len))
 
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
-        call get_top_val(conf, top_val(1), ErrCode(1), default(1))
+        call aot_top_get_val(L, val(1), ErrCode(1), default(1))
       else
-        call get_top_val(conf, top_val(1), ErrCode(1))
+        call aot_top_get_val(L, val(1), ErrCode(1))
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp), default(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+          &                  default(iComp))
       end do
 
       vect_lb = max(2, def_len+1)
       ! After def_len entries no default values for the components are
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
       end do
     else
       ! No vector definition found in the Lua script, use the default.
       if (present(default)) then
-        allocate(top_val(def_len))
+        allocate(val(def_len))
         allocate(errCode(vect_len))
-        top_val = default
+        val = default
         ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       else
         ! No vector definition in the Lua script and no default provided,
         ! return an empty array.
-        allocate(top_val(0))
+        allocate(val(0))
         allocate(errCode(0))
       end if
     end if
-    call aot_table_close(conf, vect_handle)
+    call aot_table_close(L, vect_handle)
 
   end subroutine get_top_integer_vvect
 
 
-  subroutine get_top_long_vvect(conf, top_val, ErrCode, maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_long_vvect(L, val, ErrCode, maxlength, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    integer(kind=long_k), intent(out), allocatable :: top_val(:)
+    integer(kind=long_k), intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer :: iComp
 
     ! Try to interpret the top entry on the stack as a table
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
     ! The size of the vector is limited by maxlength.
     vect_len = min(maxlength, table_len)
     if (present(default)) def_len = size(default)
 
     ! Now parse the table with the vector entries.
-    if (aot_table_first(conf, vect_handle)) then
-      allocate(top_val(vect_len))
+    if (aot_table_first(L, vect_handle)) then
+      allocate(val(vect_len))
       allocate(errCode(vect_len))
 
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
-        call get_top_val(conf, top_val(1), ErrCode(1), default(1))
+        call aot_top_get_val(L, val(1), ErrCode(1), default(1))
       else
-        call get_top_val(conf, top_val(1), ErrCode(1))
+        call aot_top_get_val(L, val(1), ErrCode(1))
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp), default(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+          &                  default(iComp))
       end do
 
       vect_lb = max(2, def_len+1)
       ! After def_len entries no default values for the components are
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
       end do
     else
       ! No vector definition found in the Lua script, use the default.
       if (present(default)) then
-        allocate(top_val(def_len))
+        allocate(val(def_len))
         allocate(errCode(vect_len))
-        top_val = default
+        val = default
         ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       else
         ! No vector definition in the Lua script and no default provided,
         ! return an empty array.
-        allocate(top_val(0))
+        allocate(val(0))
         allocate(errCode(0))
       end if
     end if
-    call aot_table_close(conf, vect_handle)
+    call aot_table_close(L, vect_handle)
 
   end subroutine get_top_long_vvect
 
 
-  subroutine get_top_logical_vvect(conf, top_val, ErrCode, maxlength, default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_logical_vvect(L, val, ErrCode, maxlength, default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
     !! but not exceed maxlength, if provided.
-    logical, intent(out), allocatable :: top_val(:)
+    logical, intent(out), allocatable :: val(:)
 
     !> Error code describing problems encountered in each of the components.
     !! Will be allocated with the same length as the returned vector.
     integer :: iComp
 
     ! Try to interpret the top entry on the stack as a table
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
     ! The size of the vector is limited by maxlength.
     vect_len = min(maxlength, table_len)
     if (present(default)) def_len = size(default)
 
     ! Now parse the table with the vector entries.
-    if (aot_table_first(conf, vect_handle)) then
-      allocate(top_val(vect_len))
+    if (aot_table_first(L, vect_handle)) then
+      allocate(val(vect_len))
       allocate(errCode(vect_len))
 
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
-        call get_top_val(conf, top_val(1), ErrCode(1), default(1))
+        call aot_top_get_val(L, val(1), ErrCode(1), default(1))
       else
-        call get_top_val(conf, top_val(1), ErrCode(1))
+        call aot_top_get_val(L, val(1), ErrCode(1))
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp), default(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+          &                  default(iComp))
       end do
 
       vect_lb = max(2, def_len+1)
       ! After def_len entries no default values for the components are
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
       end do
     else
       ! No vector definition found in the Lua script, use the default.
       if (present(default)) then
-        allocate(top_val(def_len))
+        allocate(val(def_len))
         allocate(errCode(vect_len))
-        top_val = default
+        val = default
         ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       else
         ! No vector definition in the Lua script and no default provided,
         ! return an empty array.
-        allocate(top_val(0))
+        allocate(val(0))
         allocate(errCode(0))
       end if
     end if
-    call aot_table_close(conf, vect_handle)
+    call aot_table_close(L, vect_handle)
 
   end subroutine get_top_logical_vvect
 
 
 
-  subroutine get_top_real_v(conf, top_val, ErrCode,  default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_real_v(L, val, ErrCode,  default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    real(kind=single_k), intent(out) :: top_val(:)
+    real(kind=single_k), intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as top_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> A default vector to use, if no proper definition is found.
     integer :: iComp
 
     ! Try to interpret it as table.
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
-    vect_len = min(table_len, size(top_val))
+    vect_len = min(table_len, size(val))
 
     ! Find the length of the default value, if it is not provided, its 0.
     def_len = 0
     if (present(default)) def_len = size(default)
 
     ! Now parse the table with the vector entries.
-    if (aot_table_first(conf, vect_handle).and.(vect_len > 0)) then
+    if (aot_table_first(L, vect_handle).and.(vect_len > 0)) then
 
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
-        call get_top_val(conf, top_val(1), ErrCode(1), default(1))
+        call aot_top_get_val(L, val(1), ErrCode(1), default(1))
       else
-        call get_top_val(conf, top_val(1), ErrCode(1))
+        call aot_top_get_val(L, val(1), ErrCode(1))
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp), default(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+          &                  default(iComp))
       end do
 
       vect_lb = max(2, def_len+1)
       ! After def_len entries no default values for the components are
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
       end do
 
       ! If the table in the Lua script is not long enough, fill the remaining
       ! components with the default components, as far as they are defined.
       do iComp=vect_len+1,def_len
         ErrCode(iComp) = ibSet(ErrCode(iComp), aoterr_NonExistent)
-        top_val(iComp) = default(iComp)
+        val(iComp) = default(iComp)
       end do
       vect_lb = max(vect_len+1, def_len)
       do iComp=vect_lb,vect_len
       ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       if (present(default)) then
         minub = min(vect_len, def_len)
-        top_val(:minub) = default(:minub)
+        val(:minub) = default(:minub)
         if (minub < vect_len) then
           ErrCode(minub+1:) = ibSet(ErrCode(minub+1:), aoterr_Fatal)
         end if
         ErrCode = ibSet(ErrCode, aoterr_Fatal)
       end if
     end if
-    call aot_table_close(conf, vect_handle)
+    call aot_table_close(L, vect_handle)
 
   end subroutine get_top_real_v
 
 
-  subroutine get_top_double_v(conf, top_val, ErrCode,  default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_double_v(L, val, ErrCode,  default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    real(kind=double_k), intent(out) :: top_val(:)
+    real(kind=double_k), intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as top_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> A default vector to use, if no proper definition is found.
     integer :: iComp
 
     ! Try to interpret it as table.
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
-    vect_len = min(table_len, size(top_val))
+    vect_len = min(table_len, size(val))
 
     ! Find the length of the default value, if it is not provided, its 0.
     def_len = 0
     if (present(default)) def_len = size(default)
 
     ! Now parse the table with the vector entries.
-    if (aot_table_first(conf, vect_handle).and.(vect_len > 0)) then
+    if (aot_table_first(L, vect_handle).and.(vect_len > 0)) then
 
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
-        call get_top_val(conf, top_val(1), ErrCode(1), default(1))
+        call aot_top_get_val(L, val(1), ErrCode(1), default(1))
       else
-        call get_top_val(conf, top_val(1), ErrCode(1))
+        call aot_top_get_val(L, val(1), ErrCode(1))
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp), default(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+          &                  default(iComp))
       end do
 
       vect_lb = max(2, def_len+1)
       ! After def_len entries no default values for the components are
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
       end do
 
       ! If the table in the Lua script is not long enough, fill the remaining
       ! components with the default components, as far as they are defined.
       do iComp=vect_len+1,def_len
         ErrCode(iComp) = ibSet(ErrCode(iComp), aoterr_NonExistent)
-        top_val(iComp) = default(iComp)
+        val(iComp) = default(iComp)
       end do
       vect_lb = max(vect_len+1, def_len)
       do iComp=vect_lb,vect_len
       ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       if (present(default)) then
         minub = min(vect_len, def_len)
-        top_val(:minub) = default(:minub)
+        val(:minub) = default(:minub)
         if (minub < vect_len) then
           ErrCode(minub+1:) = ibSet(ErrCode(minub+1:), aoterr_Fatal)
         end if
         ErrCode = ibSet(ErrCode, aoterr_Fatal)
       end if
     end if
-    call aot_table_close(conf, vect_handle)
+    call aot_table_close(L, vect_handle)
 
   end subroutine get_top_double_v
 
 
-  subroutine get_top_integer_v(conf, top_val, ErrCode,  default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_integer_v(L, val, ErrCode,  default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    integer, intent(out) :: top_val(:)
+    integer, intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as top_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> A default vector to use, if no proper definition is found.
     integer :: iComp
 
     ! Try to interpret it as table.
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
-    vect_len = min(table_len, size(top_val))
+    vect_len = min(table_len, size(val))
 
     ! Find the length of the default value, if it is not provided, its 0.
     def_len = 0
     if (present(default)) def_len = size(default)
 
     ! Now parse the table with the vector entries.
-    if (aot_table_first(conf, vect_handle).and.(vect_len > 0)) then
+    if (aot_table_first(L, vect_handle).and.(vect_len > 0)) then
 
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
-        call get_top_val(conf, top_val(1), ErrCode(1), default(1))
+        call aot_top_get_val(L, val(1), ErrCode(1), default(1))
       else
-        call get_top_val(conf, top_val(1), ErrCode(1))
+        call aot_top_get_val(L, val(1), ErrCode(1))
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp), default(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+          &                  default(iComp))
       end do
 
       vect_lb = max(2, def_len+1)
       ! After def_len entries no default values for the components are
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
       end do
 
       ! If the table in the Lua script is not long enough, fill the remaining
       ! components with the default components, as far as they are defined.
       do iComp=vect_len+1,def_len
         ErrCode(iComp) = ibSet(ErrCode(iComp), aoterr_NonExistent)
-        top_val(iComp) = default(iComp)
+        val(iComp) = default(iComp)
       end do
       vect_lb = max(vect_len+1, def_len)
       do iComp=vect_lb,vect_len
       ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       if (present(default)) then
         minub = min(vect_len, def_len)
-        top_val(:minub) = default(:minub)
+        val(:minub) = default(:minub)
         if (minub < vect_len) then
           ErrCode(minub+1:) = ibSet(ErrCode(minub+1:), aoterr_Fatal)
         end if
         ErrCode = ibSet(ErrCode, aoterr_Fatal)
       end if
     end if
-    call aot_table_close(conf, vect_handle)
+    call aot_table_close(L, vect_handle)
 
   end subroutine get_top_integer_v
 
 
-  subroutine get_top_long_v(conf, top_val, ErrCode,  default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_long_v(L, val, ErrCode,  default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    integer(kind=long_k), intent(out) :: top_val(:)
+    integer(kind=long_k), intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as top_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> A default vector to use, if no proper definition is found.
     integer :: iComp
 
     ! Try to interpret it as table.
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
-    vect_len = min(table_len, size(top_val))
+    vect_len = min(table_len, size(val))
 
     ! Find the length of the default value, if it is not provided, its 0.
     def_len = 0
     if (present(default)) def_len = size(default)
 
     ! Now parse the table with the vector entries.
-    if (aot_table_first(conf, vect_handle).and.(vect_len > 0)) then
+    if (aot_table_first(L, vect_handle).and.(vect_len > 0)) then
 
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
-        call get_top_val(conf, top_val(1), ErrCode(1), default(1))
+        call aot_top_get_val(L, val(1), ErrCode(1), default(1))
       else
-        call get_top_val(conf, top_val(1), ErrCode(1))
+        call aot_top_get_val(L, val(1), ErrCode(1))
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp), default(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+          &                  default(iComp))
       end do
 
       vect_lb = max(2, def_len+1)
       ! After def_len entries no default values for the components are
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
-        if (.not. flu_next(conf, vect_handle)) exit
-        call get_top_val(conf, top_val(iComp), ErrCode(iComp))
+        if (.not. flu_next(L, vect_handle)) exit
+        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
       end do
 
       ! If the table in the Lua script is not long enough, fill the remaining
       ! components with the default components, as far as they are defined.
       do iComp=vect_len+1,def_len
         ErrCode(iComp) = ibSet(ErrCode(iComp), aoterr_NonExistent)
-        top_val(iComp) = default(iComp)
+        val(iComp) = default(iComp)
       end do
       vect_lb = max(vect_len+1, def_len)
       do iComp=vect_lb,vect_len
       ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       if (present(default)) then
         minub = min(vect_len, def_len)
-        top_val(:minub) = default(:minub)
+        val(:minub) = default(:minub)
         if (minub < vect_len) then
           ErrCode(minub+1:) = ibSet(ErrCode(minub+1:), aoterr_Fatal)
         end if
         ErrCode = ibSet(ErrCode, aoterr_Fatal)
       end if
     end if
-    call aot_table_close(conf, vect_handle)
+    call aot_table_close(L, vect_handle)
 
   end subroutine get_top_long_v
 
 
-  subroutine get_top_logical_v(conf, top_val, ErrCode,  default)
-    type(flu_State) :: conf !< Handle to the lua script
+  subroutine get_top_logical_v(L, val, ErrCode,  default)
+    type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
-    logical, intent(out) :: top_val(:)
+    logical, intent(out) :: val(:)
 
     !> Error code describing problems encountered in each of the components.
-    !! This array has to have the same length as top_val.
+    !! This array has to have the same length as val.
     integer, intent(out) :: ErrCode(:)
 
     !> A default vector to use, if no proper definition is found.
     integer :: iComp
 
     ! Try to interpret it as table.
-    vect_handle = aot_table_top(L=conf)
-    table_len = aot_table_length(L=conf, thandle=vect_handle)
+    vect_handle = aot_table_top(L=L)
+    table_len = aot_table_length(L=L, thandle=vect_handle)
 
-    vect_len = min(table_len, size(top_val))
+    vect_len = min(table_len, size(val))
 
     ! Find the length of the default value, if it is not provided, its 0.
     def_len = 0
     if (present(default)) def_len = size(default)