Commits

Harald Klimach  committed 5acaf00

Added wrapper for lua_createtable in LuaFortran

  • Participants
  • Parent commits 5fb4e47

Comments (0)

Files changed (2)

File LuaFortran/flu_binding.f90

   end subroutine flu_close
 
 
+  subroutine flu_createtable(L, narr, nrec)
+    type(flu_State) :: L
+    integer :: narr
+    integer :: nrec
+
+    integer(kind=c_int) :: c_narr
+    integer(kind=c_int) :: c_nrec
+
+    c_narr = narr
+    c_nrec = nrec
+
+    call lua_createtable(L%state, c_narr, c_nrec)
+  end subroutine flu_createtable
+
+
   subroutine flu_getfield(L, index, k)
     type(flu_State)  :: L
     integer          :: index

File LuaFortran/lua_fif.f90

   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   interface
 
+    subroutine lua_close(L) bind(c, name="lua_close")
+      use, intrinsic :: iso_c_binding
+      type(c_ptr), value :: L
+    end subroutine lua_close
+
+    subroutine lua_createtable(L, narr, nrec) bind(c, name="lua_createtable")
+      use, intrinsic :: iso_c_binding
+      type(c_ptr), value :: L
+      integer(kind=c_int), value :: narr
+      integer(kind=c_int), value :: nrec
+    end subroutine lua_createtable
+
     subroutine lua_getglobal(L, k) bind(c, name="lua_getglobal")
       use, intrinsic :: iso_c_binding
       type(c_ptr), value :: L
       integer(kind=c_int) :: lua_gettop
     end function lua_gettop
 
-    subroutine lua_close(L) bind(c, name="lua_close")
-      use, intrinsic :: iso_c_binding
-      type(c_ptr), value :: L
-    end subroutine lua_close
-
     function lua_isNumber(L, index) bind(c, name="lua_isnumber")
       use, intrinsic :: iso_c_binding
       type(c_ptr), value :: L