-#define LUA_PUSHNICK(l, np) { lua_newtable(l); LUA_TPUSHSTRING(l, "nick", np->nick); LUA_TPUSHSTRING(l, "ident", np->ident); LUA_TPUSHSTRING(l, "hostname", np->host->name->content); LUA_TPUSHSTRING(l, "realname", np->realname->name->content); LUA_TPUSHSTRING(l, "account", np->authname); LUA_TPUSHNUMBER(l, "numeric", np->numeric); LUA_TPUSHSTRING(l, "ip", IPtostr(np->ipaddress)); }
+#define LUA_APUSHSTRING(l, index, value) do { lua_pushinteger(l, index); lua_pushstring(l, value); lua_rawset(l, -3); } while (0)
+#define LUA_APUSHNUMBER(l, index, value) do { lua_pushinteger(l, index); lua_pushnumber(l, value); lua_rawset(l, -3); } while (0)
+#define LUA_APUSHBOOLEAN(l, index, value) do { lua_pushinteger(l, index); lua_pushboolean(l, value); lua_rawset(l, -3); } while (0)