Fix and improve Server's privilege get/setters
[oweals/minetest.git] / src / script.h
index 5f3b3912bf6a0f3c1d7141c822bb791ebb1c0b35..3bf5342f5e29c7558fcb7e2123a71400fa4866d8 100644 (file)
@@ -20,11 +20,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef SCRIPT_HEADER
 #define SCRIPT_HEADER
 
+#include <exception>
+#include <string>
+
 typedef struct lua_State lua_State;
-//#include <string>
+
+class LuaError : public std::exception
+{
+public:
+       LuaError(lua_State *L, const std::string &s);
+
+       virtual ~LuaError() throw()
+       {}
+       virtual const char * what() const throw()
+       {
+               return m_s.c_str();
+       }
+       std::string m_s;
+};
 
 lua_State* script_init();
-lua_State* script_deinit(lua_State *L);
+void script_deinit(lua_State *L);
+std::string script_get_backtrace(lua_State *L);
 void script_error(lua_State *L, const char *fmt, ...);
 bool script_load(lua_State *L, const char *path);