diff --git a/src/Foreign/Lua/Api.hs b/src/Foreign/Lua/Api.hs index c3e34a03..0ded4e1e 100644 --- a/src/Foreign/Lua/Api.hs +++ b/src/Foreign/Lua/Api.hs @@ -132,7 +132,6 @@ module Foreign.Lua.Api ( , setmetatable -- ** load and call functions (load and run Lua code) , call - , cpcall , pcall , loadfile , loadstring @@ -301,25 +300,6 @@ copy fromidx toidx = do insert toidx #endif -{-# DEPRECATED cpcall "You can simply push the function with lua_pushcfunction\ - and call it with pcall." #-} --- | Calls the C function func in protected mode. func starts with only one --- element in its stack, a light userdata containing ud. In case of errors, --- lua_cpcall returns the same error codes as lua_pcall, plus the error object --- on the top of the stack; otherwise, it returns zero, and does not change the --- stack. All values returned by func are discarded. --- --- See . -cpcall :: FunPtr LuaCFunction -> Ptr a -> Lua LuaStatus -#if LUA_VERSION_NUMBER >= 502 -cpcall a c = do - pushcfunction a - pushlightuserdata c - pcall 1 0 Nothing -#else -cpcall a c = liftLua $ \l -> fmap toLuaStatus (lua_cpcall l a c) -#endif - -- | Creates a new empty table and pushes it onto the stack. Parameter narr is a -- hint for how many elements the table will have as a sequence; parameter nrec -- is a hint for how many other elements the table will have. Lua may use these