Exemple #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);
}
Exemple #2
0
//wrapper for gchook
int gchook_wrapper(lua_State* L) 
{
	unsigned int* fid = clua_checkgofunction(L,-1); //TODO: this will error
	GoInterface* gi = clua_getgostate(L);
	if(fid != NULL)
		return golua_gchook(*gi,*fid);

	//TODO: try udata or whatever, after impl

	return 0;
}
Exemple #3
0
unsigned int clua_togofunction(lua_State* L, int index)
{
	return *(clua_checkgofunction(L,index));
}