Example #1
0
void set_functions( lua_State* L, const lua_cpp::Reg * l)
{
	luaL_checkversion(L);
	for (; l->name != NULL; l++) {  /* fill the table with given functions */
		push_function(L, l->func);
		lua_setfield(L, -2, l->name);
	}
}
Example #2
0
void set_functions( lua_State* L, const std::vector<lua_cpp::Reg>& functions)
{
	luaL_checkversion(L);
	for (const lua_cpp::Reg& l : functions) {  /* fill the table with given functions */
		if (l.name != nullptr) {
			push_function(L, l.func);
			lua_setfield(L, -2, l.name);
		}
	}
}
Example #3
0
static void op_push_function(int byte, struct thread *thread)
{
    push_function(thread, decode_arg(thread));
}
Example #4
0
static void op_push_function_immed(int byte, struct thread *thread)
{
    push_function(thread, byte & 0xf);
}
Example #5
0
void push_closure( lua_State* L, const lua_function & f, int nup)
{
	push_function(L, f);
	lua_insert(L, -(1+nup)); //move the function beneath the upvalues
	lua_pushcclosure(L, &intf_closure_dispatcher, 1+nup);
}