Harald Klimach avatar Harald Klimach committed 398dff1

Added pushboolean to the flu_binding

Comments (0)

Files changed (2)

LuaFortran/flu_binding.f90

   public :: flu_todouble
   public :: flu_tolstring, flu_tonumber, flu_toboolean
   public :: flu_pop
-  public :: flu_pushinteger, flu_pushnil, flu_pushnumber
+  public :: flu_pushinteger, flu_pushnil, flu_pushnumber, flu_pushboolean
   public :: flu_pushvalue
 
-  public :: fluL_loadfile, fluL_newstate, fluL_openlibs, fluL_loadstring
-  public :: fluL_loadbuffer
   public :: flu_copyptr
   public :: flu_register
 
   public :: flu_dump
 
+  public :: fluL_loadfile, fluL_newstate, fluL_openlibs, fluL_loadstring
+  public :: fluL_loadbuffer
+
   interface flu_pushnumber
     module procedure flu_pushreal
     module procedure flu_pushdouble
     call lua_pushinteger(L%state, n_c)
   end subroutine flu_pushinteger
 
+  subroutine flu_pushboolean(L, b)
+    type(flu_State) :: L
+    logical :: b
+
+    integer(kind=lua_int) :: n_c
+
+    if (b) then
+      n_c = 1_lua_int
+    else
+      n_c = 0_lua_int
+    end if
+    call lua_pushboolean(L%state, n_c)
+  end subroutine flu_pushboolean
+
   subroutine flu_pushreal(L, n)
     type(flu_State) :: L
     real :: n

LuaFortran/lua_fif.f90

       integer(kind=lua_int), value :: n
     end subroutine lua_pushinteger
 
+    subroutine lua_pushboolean(L, n) bind(c, name="lua_pushboolean")
+      use, intrinsic :: iso_c_binding
+      use lua_parameters, only: lua_int
+      type(c_ptr), value :: L
+      integer(kind=lua_int), value :: n
+    end subroutine lua_pushboolean
+
     subroutine lua_pushnil(L) bind(c, name="lua_pushnil")
       use, intrinsic :: iso_c_binding
       type(c_ptr), value :: L
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.