]> jfr.im git - irc/quakenet/newserv.git/blobdiff - lua/luabot.h
lua: Export nickmatchban, nickistrusted, nickbanned to the lua module and use the...
[irc/quakenet/newserv.git] / lua / luabot.h
index 341891a654ed0568385729f252b3b3ea4955991c..4f5b412edb10e905efc45d686c90da6f4663c706 100644 (file)
@@ -27,6 +27,10 @@ extern sstring *luabotnick;
 #define LUA_TPUSHNUMBER(l, param, value) do { lua_pushstring(l, param); lua_pushnumber(l, value); lua_rawset(l, -3); } while (0)
 #define LUA_TPUSHBOOLEAN(l, param, value) do { lua_pushstring(l, param); lua_pushboolean(l, value); lua_rawset(l, -3); } while (0)
 
+#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)
+
 #define LUA_PUSHNICK(l, np) do { 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)); } while (0)
 
 #define LUA_PUSHCHAN(l, cp) do { lua_newtable(l); LUA_TPUSHNUMBER(l, "timestamp", cp->timestamp); LUA_TPUSHNUMBER(l, "totalusers", cp->users->totalusers); if(cp->topic) { LUA_TPUSHSTRING(l, "topic", cp->topic->content); }; LUA_TPUSHSTRING(l, "modes", printallmodes(cp)); } while (0)