X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/acd438c7bc9790d6ab8b28fe917046e6983ccdd8..cb5aa4cdd6af4114b18db464f022ef99a44304d7:/lua/lua.h?ds=sidebyside diff --git a/lua/lua.h b/lua/lua.h index 36e862cc..ac33db31 100644 --- a/lua/lua.h +++ b/lua/lua.h @@ -17,13 +17,19 @@ #include #include "../lib/sstring.h" +#include "../core/nsmalloc.h" #include "lualocal.h" +#include "luasocket.h" + +#define luamalloc(x) nsmalloc(POOL_LUA, x) +#define luarealloc(x, y) nsrealloc(POOL_LUA, x, y) +#define luafree(x) nsfree(POOL_LUA, x) /*** defines ************************************/ -#define LUA_BOTVERSION "1.74" -#define LUA_CHANFIXBOT "Z" +#define LUA_BOTVERSION "1.87" +#define LUA_CHANFIXBOT "D" #define LUA_OPERCHAN "#twilightzone" #ifndef LUA_PUKECHAN @@ -54,6 +60,7 @@ typedef struct lua_list { struct lua_list *next; struct lua_list *prev; lua_localnick *nicks; + lua_socket *sockets; } lua_list; #define LUA_STARTLOOP(l) { lua_list *ll; for(ll=lua_head;ll;ll=ll->next) { l = ll->l @@ -69,6 +76,7 @@ lua_State *lua_loadscript(char *file); void lua_unloadscript(lua_list *l); lua_list *lua_scriptloaded(char *name); lua_list *lua_listfromstate(lua_State *l); +int lua_listexists(lua_list *l); int lua_lineok(const char *data); #define lua_toint(l, n) (int)lua_tonumber(l, n) @@ -78,6 +86,9 @@ int lua_lineok(const char *data); #define lua_tolong(l, n) (long)lua_tonumber(l, n) #define lua_islong(l, n) lua_isnumber(l, n) #define lua_pushlong(l, n) lua_pushnumber(l, n) +#define lua_pushnumeric(l, n) lua_pushlong(l, n) +#define lua_tonumeric(l, n) lua_tolong(l, n) +#define lua_isnumeric(l, n) lua_islong(l, n) extern struct rusage r_usages; extern struct rusage r_usagee;