Example #1
0
TObject *luaT_gettagmethod(int32 t, const char *event) {
	int32 e = luaI_checkevent(event, luaT_eventname);
	checktag(t);
	if (validevent(t, e))
		return luaT_getim(t,e);
	else
		return &luaO_nilobject;
}
Example #2
0
File: ltm.c Project: jeske/hz
const TObject *luaT_gettagmethod (lua_State *L, int t, const char *event) {
  int e;
  e = luaI_checkevent(L, event, t);
  checktag(L, t);
  if (luaT_validevent(t, e))
    return luaT_getim(L, t,e);
  else
    return &luaO_nilobject;
}
Example #3
0
void luaT_settagmethod(int32 t, const char *event, TObject *func) {
	TObject temp = *func;
	int32 e = luaI_checkevent(event, luaT_eventname);
	checktag(t);
	if (!validevent(t, e))
		luaL_verror("settagmethod: cannot change tag method `%.20s' for tag %d",
		luaT_eventname[e], t);
	*func = *luaT_getim(t,e);
	*luaT_getim(t, e) = temp;
}
Example #4
0
File: ltm.c Project: jeske/hz
void luaT_settagmethod (lua_State *L, int t, const char *event, TObject *func) {
  TObject temp;
  int e;
  e = luaI_checkevent(L, event, t);
  checktag(L, t);
  if (!luaT_validevent(t, e))
    luaL_verror(L, "cannot change `%.20s' tag method for type `%.20s'%.20s",
                luaT_eventname[e], luaO_typenames[t],
                (t == TAG_TABLE || t == TAG_USERDATA) ? " with default tag"
                                                          : "");
  temp = *func;
  *func = *luaT_getim(L, t,e);
  *luaT_getim(L, t, e) = temp;
}