예제 #1
0
파일: golua.c 프로젝트: matthewtidd/golua
//wrapper for callgofunction
int callback_function(lua_State* L)
{
	unsigned int *fid = clua_checkgofunction(L,1);
	GoInterface* gi = clua_getgostate(L);
	//remove the go function from the stack (to present same behavior as lua_CFunctions)
	lua_remove(L,1);
	return golua_callgofunction(*gi,*fid);
}
예제 #2
0
파일: c-golua.c 프로젝트: Archs/golua
//wrapper for callgofunction
int callback_function(lua_State* L)
{
	int r;
	unsigned int *fid = clua_checkgosomething(L, 1, MT_GOFUNCTION);
	GoInterface* gi = clua_getgostate(L);
	//remove the go function from the stack (to present same behavior as lua_CFunctions)
	lua_remove(L,1);
	return golua_callgofunction(*gi, fid!=NULL ? *fid : -1);
}
예제 #3
0
파일: c-golua.c 프로젝트: Archs/golua
static int callback_c (lua_State* L)
{
	int fid = clua_togofunction(L,lua_upvalueindex(1));
	GoInterface *gi = clua_getgostate(L);
	return golua_callgofunction(*gi,fid);
}
예제 #4
0
static int callback_c (lua_State* L)
{
	int fid = clua_togofunction(L,lua_upvalueindex(1));
	int gostateindex = clua_getgostate(L);
	return golua_callgofunction(gostateindex,fid);
}