X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fscript.h;h=3bf5342f5e29c7558fcb7e2123a71400fa4866d8;hb=92ae11bd3b5e95ff837f98463931e7772c455ad3;hp=ce697bc50ba931b07d96e760e9bcd4df74980331;hpb=dcedfdacd1ba77591cdc0aa2b8c123c6a5ef2f5d;p=oweals%2Fminetest.git diff --git a/src/script.h b/src/script.h index ce697bc50..3bf5342f5 100644 --- a/src/script.h +++ b/src/script.h @@ -20,11 +20,28 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef SCRIPT_HEADER #define SCRIPT_HEADER +#include +#include + typedef struct lua_State lua_State; -//#include + +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(); 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);