Harald Klimach avatar Harald Klimach committed 90b1951

Reorderd arguments in the get_val routines to obtain the intent(out) arguments
first. Gather the get_vals for table and config into a single generic interface.

Comments (0)

Files changed (5)

source/aot_table_module.f90

 
   public :: aot_table_top, aot_table_length, aot_table_first, aot_table_push
   public :: aot_table_open, aot_table_close, aot_table_get_val
+  public :: aot_get_val
 
   !> This routine provides a way to open a table
   !! either as a globally defined one, are as a
     module procedure get_table_logical
   end interface
 
+  interface aot_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
 
   end function aot_table_length
 
 
-  subroutine get_table_real(L, thandle, val, ErrCode, key, pos, default)
+  subroutine get_table_real(val, ErrCode, L, thandle, key, pos, default)
     type(flu_State) :: L
     integer, intent(in) :: thandle
     real(kind=single_k), intent(out) :: val
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_table_real
 
 
-  subroutine get_table_double(L, thandle, val, ErrCode, key, pos, &
+  subroutine get_table_double(val, ErrCode, L, thandle, key, pos, &
     &                         default)
     type(flu_State) :: L
     integer, intent(in) :: thandle
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_table_double
 
 
-  subroutine get_table_integer(L, thandle, val, ErrCode, key, pos, &
+  subroutine get_table_integer(val, ErrCode, L, thandle, key, pos, &
     &                          default)
     type(flu_State) :: L
     integer, intent(in) :: thandle
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_table_integer
 
-  subroutine get_table_long(L, thandle, val, ErrCode, key, pos, default)
+  subroutine get_table_long(val, ErrCode, L, thandle, key, pos, default)
     type(flu_State) :: L
     integer, intent(in) :: thandle
     integer(kind=long_k), intent(out) :: val
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_table_long
 
-  subroutine get_table_logical(L, thandle, val, ErrCode, key, pos, &
+  subroutine get_table_logical(val, ErrCode, L, thandle, key, pos, &
     &                          default)
     type(flu_State) :: L
     integer, intent(in) :: thandle
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_table_logical
 
 
-  subroutine get_table_string(L, thandle, val, ErrCode, key, pos, &
+  subroutine get_table_string(val, ErrCode, L, thandle, key, pos, &
     &                         default)
     type(flu_State) :: L
     integer, intent(in) :: thandle
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_table_string
 

source/aot_top_module.f90

     module procedure aot_top_get_logical
   end interface
 
+  interface aot_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)
+  subroutine aot_top_get_real(val, ErrCode, L, default)
     type(flu_State) :: L
     real(kind=single_k), intent(out) :: val
     integer, intent(out) :: ErrCode
   end subroutine aot_top_get_real
 
 
-  subroutine aot_top_get_double(L, val, ErrCode, default)
+  subroutine aot_top_get_double(val, ErrCode, L, default)
     type(flu_State) :: L
     real(kind=double_k), intent(out) :: val
     integer, intent(out) :: ErrCode
   end subroutine aot_top_get_double
 
 
-  subroutine aot_top_get_integer(L, val, ErrCode, default)
+  subroutine aot_top_get_integer(val, ErrCode, L, default)
     type(flu_State) :: L
     integer, intent(out) :: val
     integer, intent(out) :: ErrCode
 
   end subroutine aot_top_get_integer
 
-  subroutine aot_top_get_long(L, val, ErrCode, default)
+  subroutine aot_top_get_long(val, ErrCode, L, default)
     type(flu_State) :: L
     integer(kind=long_k), intent(out) :: val
     integer, intent(out) :: ErrCode
 
   end subroutine aot_top_get_long
 
-  subroutine aot_top_get_logical(L, val, ErrCode, default)
+  subroutine aot_top_get_logical(val, ErrCode, L, default)
     type(flu_State) :: L
     logical, intent(out) :: val
     integer, intent(out) :: ErrCode
   end subroutine aot_top_get_logical
 
 
-  subroutine aot_top_get_string(L, val, ErrCode, default)
+  subroutine aot_top_get_string(val, ErrCode, L, default)
     type(flu_State) :: L
     character(len=*) :: val
     integer, intent(out) :: ErrCode

source/aot_vector_module.f90

   !! Arrays will be allocated as needed to read the data from the
   !! Lua script with these routines. A maximal length has to be
   !! specified to limit the allocated memory by this loading.
-  interface aot_table_get_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_long_vvect
+    module procedure get_config_logical_vvect
+
     module procedure get_table_real_vvect
     module procedure get_table_double_vvect
     module procedure get_table_integer_vvect
     module procedure get_table_logical_vvect
   end interface
 
-  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_long_vvect
-    module procedure get_config_logical_vvect
+  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
 
   interface aot_top_get_val
   !!
   !! The given vector has to exist already and will be filled by
   !! values from the Lua table, as far as they exist.
-  interface aot_table_get_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_long_v
+    module procedure get_config_logical_v
+
     module procedure get_table_real_v
     module procedure get_table_double_v
     module procedure get_table_integer_v
     module procedure get_table_logical_v
   end interface
 
-  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_long_v
-    module procedure get_config_logical_v
+  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
 
   interface aot_top_get_val
   !! 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(L, thandle, val, ErrCode, &
-    &                             maxlength, key, pos, default)
+  subroutine get_table_real_vvect(val, ErrCode, maxlength, L, thandle, &
+    &                             key, pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, thandle, val, ErrCode, &
-    &                             maxlength, key, pos, default)
+  subroutine get_table_double_vvect(val, ErrCode, maxlength, L, thandle, &
+    &                               key, pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, thandle, val, ErrCode, &
-    &                             maxlength, key, pos, default)
+  subroutine get_table_integer_vvect(val, ErrCode, maxlength, L, thandle, &
+    &                                key, pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, thandle, val, ErrCode, &
-    &                             maxlength, key, pos, default)
+  subroutine get_table_long_vvect(val, ErrCode, maxlength, L, thandle, &
+    &                             key, pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, thandle, val, ErrCode, &
-    &                             maxlength, key, pos, default)
+  subroutine get_table_logical_vvect(val, ErrCode, maxlength, L, thandle, &
+    &                                key, pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
 
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, val, ErrCode, maxlength, &
+  subroutine get_config_real_vvect(val, ErrCode, maxlength, L, &
     &                              key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted global variable
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, val, ErrCode, maxlength, &
+  subroutine get_config_double_vvect(val, ErrCode, maxlength, L, &
     &                                key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted global variable
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, val, ErrCode, maxlength, &
+  subroutine get_config_integer_vvect(val, ErrCode, maxlength, L, &
     &                                 key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted global variable
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, val, ErrCode, maxlength, &
+  subroutine get_config_long_vvect(val, ErrCode, maxlength, L, &
     &                              key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted global variable
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, val, ErrCode, maxlength, &
+  subroutine get_config_logical_vvect(val, ErrCode, maxlength, L, &
     &                                 key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     integer, intent(in) :: maxlength
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted global variable
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, maxlength, default)
+    call aot_top_get_val(val, ErrCode, maxlength, L, 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(L, thandle, val, ErrCode, key, &
+  subroutine get_table_real_v(val, ErrCode, L, thandle, key, &
     &                         pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, 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(L, thandle, val, ErrCode, key, &
+  subroutine get_table_double_v(val, ErrCode, L, thandle, key, &
     &                         pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, 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(L, thandle, val, ErrCode, key, &
+  subroutine get_table_integer_v(val, ErrCode, L, thandle, key, &
     &                         pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, 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(L, thandle, val, ErrCode, key, &
+  subroutine get_table_long_v(val, ErrCode, L, thandle, key, &
     &                         pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, 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(L, thandle, val, ErrCode, key, &
+  subroutine get_table_logical_v(val, ErrCode, L, thandle, key, &
     &                         pos, default)
     type(flu_State) :: L !< Handle to the lua script
     integer, intent(in) :: thandle !< Handle of the parent table
     call aot_table_push(L=L, thandle=thandle, &
       &                   key=key, pos=pos)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, 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(L, val, ErrCode, key, default)
+  subroutine get_config_real_v(val, ErrCode, L, key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted value from the provided table
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, 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(L, val, ErrCode, key, default)
+  subroutine get_config_double_v(val, ErrCode, L, key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted value from the provided table
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, 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(L, val, ErrCode, key, default)
+  subroutine get_config_integer_v(val, ErrCode, L, key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted value from the provided table
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, 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(L, val, ErrCode, key, default)
+  subroutine get_config_long_v(val, ErrCode, L, key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted value from the provided table
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, 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(L, val, ErrCode, key, default)
+  subroutine get_config_logical_v(val, ErrCode, L, key, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
     integer, intent(out) :: ErrCode(:)
 
     !> Name of the variable (vector) to read.
-    character(len=*), intent(in), optional :: key
+    character(len=*), intent(in) :: key
 
     !> A default vector to use, if no proper definition is found.
     !! Components will be filled with the help of this default definition.
     ! Get the requeseted value from the provided table
     call flu_getglobal(L, key)
 
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
   end subroutine get_config_logical_v
 
 
 
 
 
-  subroutine get_top_real_vvect(L, val, ErrCode, maxlength, default)
+  subroutine get_top_real_vvect(val, ErrCode, maxlength, L, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
     else
       ! No vector definition found in the Lua script, use the default.
 
 
 
-  subroutine get_top_double_vvect(L, val, ErrCode, maxlength, default)
+  subroutine get_top_double_vvect(val, ErrCode, maxlength, L, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
     else
       ! No vector definition found in the Lua script, use the default.
   end subroutine get_top_double_vvect
 
 
-  subroutine get_top_integer_vvect(L, val, ErrCode, maxlength, default)
+  subroutine get_top_integer_vvect(val, ErrCode, maxlength, L, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
     else
       ! No vector definition found in the Lua script, use the default.
   end subroutine get_top_integer_vvect
 
 
-  subroutine get_top_long_vvect(L, val, ErrCode, maxlength, default)
+  subroutine get_top_long_vvect(val, ErrCode, maxlength, L, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
     else
       ! No vector definition found in the Lua script, use the default.
   end subroutine get_top_long_vvect
 
 
-  subroutine get_top_logical_vvect(L, val, ErrCode, maxlength, default)
+  subroutine get_top_logical_vvect(val, ErrCode, maxlength, L, default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table, will have the same length as the table
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
     else
       ! No vector definition found in the Lua script, use the default.
 
 
 
-  subroutine get_top_real_v(L, val, ErrCode,  default)
+  subroutine get_top_real_v(val, ErrCode, L,  default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
 
       ! If the table in the Lua script is not long enough, fill the remaining
   end subroutine get_top_real_v
 
 
-  subroutine get_top_double_v(L, val, ErrCode,  default)
+  subroutine get_top_double_v(val, ErrCode, L,  default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
 
       ! If the table in the Lua script is not long enough, fill the remaining
   end subroutine get_top_double_v
 
 
-  subroutine get_top_integer_v(L, val, ErrCode,  default)
+  subroutine get_top_integer_v(val, ErrCode, L,  default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
 
       ! If the table in the Lua script is not long enough, fill the remaining
   end subroutine get_top_integer_v
 
 
-  subroutine get_top_long_v(L, val, ErrCode,  default)
+  subroutine get_top_long_v(val, ErrCode, L,  default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
 
       ! If the table in the Lua script is not long enough, fill the remaining
   end subroutine get_top_long_v
 
 
-  subroutine get_top_logical_v(L, val, ErrCode,  default)
+  subroutine get_top_logical_v(val, ErrCode, L,  default)
     type(flu_State) :: L !< Handle to the lua script
 
     !> Vector read from the Lua table.
       ! 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 aot_top_get_val(L, val(1), ErrCode(1), default(1))
+        call aot_top_get_val(val(1), ErrCode(1), L, default(1))
       else
-        call aot_top_get_val(L, val(1), ErrCode(1))
+        call aot_top_get_val(val(1), ErrCode(1), L)
       end if
 
       ! Up to the length of the default value, provide the default settings.
       do iComp=2,def_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp), &
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L, &
           &                  default(iComp))
       end do
 
       ! available anymore, proceed without a default setting for the rest.
       do iComp=vect_lb,vect_len
         if (.not. flu_next(L, vect_handle)) exit
-        call aot_top_get_val(L, val(iComp), ErrCode(iComp))
+        call aot_top_get_val(val(iComp), ErrCode(iComp), L)
       end do
 
       ! If the table in the Lua script is not long enough, fill the remaining

source/aotus_module.f90

 module aotus_module
   use flu_binding
   use aot_kinds_module, only: double_k, single_k, long_k
-  use aot_top_module, only: aot_top_get_val
+  use aot_top_module, only: aot_top_get_val, aoterr_Fatal, aoterr_NonExistent, &
+    &                       aoterr_WrongType
+  use aot_table_module, only: aot_get_val
+  use aot_vector_module, only: aot_get_val, aot_top_get_val
 
   implicit none
 
   private
 
-  public :: aot_get_val, open_config, close_config
+  public :: aot_get_val
+  public :: open_config, close_config
+
+  ! Entities inherited from aot_top_module, published here to
+  ! allow most functionality by "use aotus_module".
+  public :: aoterr_Fatal, aoterr_NonExistent, aoterr_WrongType
+  public :: aot_top_get_val
+
+  ! Inherited from the flu_binding module, publish for convenience.
+  public :: flu_State
 
   !> Get a global configuration value from the script.
   !!
   end subroutine close_config
 
 
-  subroutine get_config_real(L, val, ErrCode, key, default)
+  subroutine get_config_real(val, ErrCode, L, key, default)
     type(flu_State) :: L
     character(len=*), intent(in) :: key
     real(kind=single_k), intent(out) :: val
     real(kind=single_k), optional, intent(in) :: default
 
     call flu_getglobal(L, key)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_config_real
 
 
-  subroutine get_config_double(L, val, ErrCode, key, default)
+  subroutine get_config_double(val, ErrCode, L, key, default)
     type(flu_State) :: L
     character(len=*), intent(in) :: key
     real(kind=double_k), intent(out) :: val
     real(kind=double_k), optional, intent(in) :: default
 
     call flu_getglobal(L, key)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_config_double
 
 
-  subroutine get_config_integer(L, val, ErrCode, key, default)
+  subroutine get_config_integer(val, ErrCode, L, key, default)
     type(flu_State) :: L
     character(len=*), intent(in) :: key
     integer, intent(out) :: val
     integer, optional, intent(in) :: default
 
     call flu_getglobal(L, key)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_config_integer
 
 
-  subroutine get_config_long(L, val, ErrCode, key, default)
+  subroutine get_config_long(val, ErrCode, L, key, default)
     type(flu_State) :: L
     character(len=*), intent(in) :: key
     integer(kind=long_k), intent(out) :: val
     integer(kind=long_k), optional, intent(in) :: default
 
     call flu_getglobal(L, key)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_config_long
 
 
-  subroutine get_config_logical(L, val, ErrCode, key, default)
+  subroutine get_config_logical(val, ErrCode, L, key, default)
     type(flu_State) :: L
     character(len=*), intent(in) :: key
     logical, intent(out) :: val
     logical, optional, intent(in) :: default
 
     call flu_getglobal(L, key)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_config_logical
 
 
-  subroutine get_config_string(L, val, ErrCode, key, default)
+  subroutine get_config_string(val, ErrCode, L, key, default)
     type(flu_State) :: L
     character(len=*), intent(in) :: key
     character(len=*) :: val
     character(len=*), optional, intent(in) :: default
 
     call flu_getglobal(L, key)
-    call aot_top_get_val(L, val, ErrCode, default)
+    call aot_top_get_val(val, ErrCode, L, default)
 
   end subroutine get_config_string
 

test/aotus_test.f90

 program aotus_test
-  use flu_binding, only: flu_State
   use aot_kinds_module, only: double_k
-  use aotus_module
-  use aot_table_module
-  use aot_top_module
-  use aot_fun_module
-  use aot_vector_module
-  use aot_out_module
+  use aotus_module, only: flu_State, open_config, close_config, aot_get_val, &
+    &                     aot_top_get_val, &
+    &                     aoterr_Fatal, aoterr_WrongType, aoterr_NonExistent
+  use aot_table_module, only: aot_table_open, aot_table_close, aot_table_length
+  use aot_fun_module, only: aot_fun_type, aot_fun_open, aot_fun_put, &
+    &                       aot_fun_do, aot_fun_close
+  use aot_out_module, only: aot_out_type, aot_out_open, aot_out_close, &
+    &                       aot_out_open_table, aot_out_close_table, &
+    &                       aot_out_val
 
   implicit none
 
         &                 pos=stl)
       stl_tab_len = aot_table_length(L=conf, thandle=desc_table)
       do i=1,min(3, stl_tab_len)
-        call aot_table_get_val(L = conf, thandle = desc_table, &
-          &                val = buffer, ErrCode = iError, &
-          &                key = trim(keys(i)), pos = i)
+        call aot_get_val(L = conf, thandle = desc_table, &
+          &              val = buffer, ErrCode = iError, &
+          &              key = trim(keys(i)), pos = i)
         if (btest(iError, aoterr_Fatal)) then
           write(*,*) 'FATAL Error occured, while retrieving'//trim(keys(i))
           if (btest(iError, aoterr_NonExistent)) write(*,*) 'Variable not existent!'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.