]> jfr.im git - irc/quakenet/newserv.git/blobdiff - lua/lua.h
add serverlist command
[irc/quakenet/newserv.git] / lua / lua.h
index 8b56ffb0375f97cd40130e2923b21074eb17716d..80703272886df13b77301f5cc7fb05f6247cf051 100644 (file)
--- a/lua/lua.h
+++ b/lua/lua.h
 
 #include "../lib/sstring.h"
 
+#include "lualocal.h"
+
 /*** defines ************************************/
 
-#define LUA_BOTVERSION "1.41"
+#define LUA_BOTVERSION "1.72"
 #define LUA_CHANFIXBOT "Z"
 #define LUA_OPERCHAN "#twilightzone"
+
+#ifndef LUA_PUKECHAN
 #define LUA_PUKECHAN "#qnet.keepout"
+#endif
 
-#undef LUA_DEBUGSOCKET
 #define LUA_PROFILE
 
-#ifdef LUA_JITLIBNAME
-
-#define LUA_USEJIT
+#define LUA_DEBUGSOCKET_ADDRESS "127.0.0.1"
+#define LUA_DEBUGSOCKET_PORT 7733
 
+#ifdef LUA_USEJIT
+#include <luajit.h>
+#define LUA_AUXVERSION " + " LUAJIT_VERSION
+#else
+#define LUA_AUXVERSION ""
 #endif
 
-#define LUA_DEBUGSOCKET_ADDRESS "127.0.0.1"
-#define LUA_DEBUGSOCKET_PORT 7733
+#define LUA_FULLVERSION "Lua engine v" LUA_BOTVERSION " (" LUA_VERSION LUA_AUXVERSION ")"
 
 /*** end defines ************************************/
 
@@ -46,6 +53,7 @@ typedef struct lua_list {
   struct timeval ru_utime, ru_stime;
   struct lua_list *next;
   struct lua_list *prev;
+  lua_localnick *nicks;
 } lua_list;
 
 #define LUA_STARTLOOP(l) { lua_list *ll; for(ll=lua_head;ll;ll=ll->next) {  l = ll->l
@@ -61,6 +69,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_lineok(const char *data);
 
 #define lua_toint(l, n) (int)lua_tonumber(l, n)
 #define lua_isint(l, n) lua_isnumber(l, n)
@@ -86,28 +95,12 @@ extern struct rusage r_usagee;
 
 #define ACCOUNTING_STOP(l) getrusage(RUSAGE_SELF, &r_usagee); SET_TIMEDIFF(l, r_usages, r_usagee); }
 
-#else
-
-#define ACCOUNTING_START(l) ;
-#define ACCOUNTING_STOP(l) ;
-
 #endif
 
 #ifdef LUA_DEBUGSOCKET
 
 void lua_debugoutput(char *p, ...);
 #define DEBUGOUT(p, ...) lua_debugoutput(p , ##__VA_ARGS__)
-#define lua_debugpcall(l, message, ...) { lua_list *l2 = lua_listfromstate(l); DEBUGOUT("%s: %s\n", l2->name->content, message); ACCOUNTING_START(l2); lua_pcall(l , ##__VA_ARGS__); ACCOUNTING_STOP(l2); }
-
-#else
-
-#define DEBUGOUT(p, ...)
-
-#ifdef LUA_PROFILE
-#define lua_debugpcall(l, message, ...) { lua_list *l2 = lua_listfromstate(l); ACCOUNTING_START(l2); lua_pcall(l , ##__VA_ARGS__); ACCOUNTING_STOP(l2); }
-#else
-#define lua_debugpcall(l, message, ...) lua_pcall(l , ##__VA_ARGS__); ACCOUNTING_STOP(l2);
-#endif
 
 #endif
 
@@ -127,4 +120,6 @@ void lua_debugoutput(char *p, ...);
 
 #endif /* INLINE */
 
+INLINE int lua_debugpcall(lua_State *l, char *message, int a, int b, int c);
+
 #endif