Ejemplo n.º 1
0
//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);
}
Ejemplo n.º 2
0
//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);
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 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);
}