| 1 |
#ifndef HEADER_DEF_SCRIPT_H |
| 2 |
#define HEADER_DEF_SCRIPT_H |
| 3 |
|
| 4 |
class Scripter; |
| 5 |
|
| 6 |
#include "Log.h" |
| 7 |
|
| 8 |
#include <stdexcept> |
| 9 |
|
| 10 |
extern "C" { |
| 11 |
#include "lua.h" |
| 12 |
#include "lauxlib.h" |
| 13 |
} |
| 14 |
|
| 15 |
|
| 16 |
//NOTE: no one exception can be passed to "C" lua code |
| 17 |
#define BEGIN_NOEXCEPTION try { |
| 18 |
#define END_NOEXCEPTION \ |
| 19 |
} \ |
| 20 |
catch (std::exception &e) { \ |
| 21 |
luaL_error(L, e.what()); \ |
| 22 |
} \ |
| 23 |
catch (...) { \ |
| 24 |
luaL_error(L, "unknown exception"); \ |
| 25 |
} |
| 26 |
|
| 27 |
inline const char *script_getLeaderName() { return "script_leader"; } |
| 28 |
extern Scripter *script_getLeader(lua_State *L); |
| 29 |
extern int script_debugStack(lua_State *L); |
| 30 |
|
| 31 |
extern int script_file_include(lua_State *L) throw(); |
| 32 |
extern int script_file_exists(lua_State *L) throw(); |
| 33 |
|
| 34 |
|
| 35 |
#endif |