예제 #1
0
파일: lua.go 프로젝트: matthewtidd/golua
//NOTE: lua_newstate becomes NewStateAlloc whereas
//		luaL_newstate becomes NewState
func NewStateAlloc(f Alloc) *State {
	//TODO: implement a newState function which will initialize a State
	//		call with result from C.lua_newstate for the s initializer
	//ls := lua_newstate(
	ls := C.clua_newstate(unsafe.Pointer(&f))
	//ls := clua_newstate(
	return newState(ls)
}
예제 #2
0
파일: lua.go 프로젝트: szll/golua
// Creates a new lua interpreter state with the given allocation function
func NewStateAlloc(f Alloc) *State {
	ls := C.clua_newstate(unsafe.Pointer(&f))
	return newState(ls)
}