class CrystalLuaExample::LuaState

Defined in:

crystal_lua_example/lua_state.cr

Constant Summary

ALLOC = ->(ud : ::Pointer(Void), ptr : ::Pointer(Void), osize : LibC::Int, nsize : LibC::Int) do if nsize > 0 GC.realloc(ptr, nsize) else GC.free(ptr) Pointer(Void).null end end
BUFFER_READER = ->(state : LibLua::LuaState, data : ::Pointer(Void), size : ::Pointer(LibC::Int)) do buffer = (data.as(::Pointer(Buffer))).value str = buffer.gets if str.nil? size.value = 0 Pointer(LibC::Char).null else size.value = str.bytesize str.to_unsafe end end

Constructors

Instance Method Summary

Constructor Detail

def self.new(exising_state : LibLua::LuaState) #

[View source]
def self.new #

[View source]

Instance Method Detail

def call(nargs : LibC::Int = 0, nresults : LibC::Int = 0) #

[View source]
def getglobal(name : String) #

[View source]
def load_string(source : String) #

[View source]
def pushcfunction(cfun : LibLua::Cfunction) #

[View source]
def register(name : String, cfun : LibLua::Cfunction) #

[View source]
def setglobal(name : String) #

[View source]
def to_unsafe : LibLua::LuaState #

[View source]
def tostring(idx : LibC::Int) #

[View source]
def version #

[View source]