]> jfr.im git - irc/quakenet/newserv.git/blobdiff - lua/luabot.h
CHANSERV: tell user when they can't attempts to auth any more, and drop max attempts...
[irc/quakenet/newserv.git] / lua / luabot.h
index 8c46e74cba745a63c23e75b7155e751337e27f20..d76a436aab63f604cf1c4218e59ce7de03644251 100644 (file)
@@ -8,13 +8,14 @@
 #include "../nick/nick.h"
 #include "../channel/channel.h"
 
-int lua_channelmessage(channel *cp, char *message, ...);
-int lua_message(nick *np, char *message, ...);
-int lua_notice(nick *np, char *message, ...);
+int lua_channelmessage(channel *cp, char *message, ...) __attribute__ ((format (printf, 2, 3)));
+int lua_message(nick *np, char *message, ...) __attribute__ ((format (printf, 2, 3)));
+int lua_notice(nick *np, char *message, ...) __attribute__ ((format (printf, 2, 3)));
 int _lua_vpcall(lua_State *l, void *function, int mode, const char *sig, ...);
 char *printallmodes(channel *cp);
 
-nick *lua_nick;
+extern nick *lua_nick;
+extern sstring *luabotnick;
 
 #define LUA_OK 0
 #define LUA_FAIL 1
@@ -26,7 +27,7 @@ nick *lua_nick;
 #define LUA_TPUSHNUMBER(l, param, value) { lua_pushstring(l, param); lua_pushnumber(l, value); lua_rawset(l, -3); }
 #define LUA_TPUSHBOOLEAN(l, param, value) { lua_pushstring(l, param); lua_pushboolean(l, value); lua_rawset(l, -3); }
 
-#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->p_ipaddr)); }
+#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_PUSHCHAN(l, cp) { 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)); }