summaryrefslogtreecommitdiff
path: root/scripting.h
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-05-20 14:11:40 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-05-20 14:11:40 +0200
commit3bb33734a92e86024488adf88dc2a368c8c952b2 (patch)
treeaee8ab7832b7fef021668d94cbaf7d21d6c9c839 /scripting.h
parent7b22d822f9871222fbbe401c9c79d6a624d21331 (diff)
Basic lua implementation.
Diffstat (limited to 'scripting.h')
-rw-r--r--scripting.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripting.h b/scripting.h
new file mode 100644
index 0000000..d14aa3c
--- /dev/null
+++ b/scripting.h
@@ -0,0 +1,30 @@
+#ifndef SCRIPTING_H
+#define SCRIPTING_H
+
+#include <lua.hpp>
+#include <boost/function.hpp>
+
+#include <string>
+#include <stdexcept>
+
+class LuaError : public std::runtime_error {
+ public:
+ LuaError(const std::string& s) : std::runtime_error(s) {};
+};
+
+class Lua {
+ protected:
+ lua_State *L;
+ boost::function<void (const char*)> log_func;
+
+ public:
+ Lua();
+ virtual ~Lua();
+
+ void set_log_func(boost::function<void (const char*)> log_func);
+ void print(const char *s);
+
+ void dostring(std::string s);
+};
+
+#endif