summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-11-08 07:37:18 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-11-08 07:37:18 +0100
commit988d955f5ff8f2b8ac9cadcc477a9aaa3e708f91 (patch)
treed68c5d5efa3de9e5c3abdf45ef54a1d246a9c091
parent90d611a5f1af7d88393067a97330796feadbff5f (diff)
Adding jit and bit opens to the Lua class.
-rw-r--r--include/BLua.h2
-rw-r--r--lib/BLua.cc11
2 files changed, 13 insertions, 0 deletions
diff --git a/include/BLua.h b/include/BLua.h
index 4d53191..2afcdef 100644
--- a/include/BLua.h
+++ b/include/BLua.h
@@ -79,6 +79,8 @@ class Lua : public Base {
void open_math();
void open_debug();
void open_dir();
+ void open_bit();
+ void open_jit();
int wrap_open(openlualib_t);
void declarefunc(const String &, lua_CFunction, int = LUA_GLOBALSINDEX);
void call(const String &, int = LUA_GLOBALSINDEX, int = 0, int = 0);
diff --git a/lib/BLua.cc b/lib/BLua.cc
index 7dbf6c1..8771406 100644
--- a/lib/BLua.cc
+++ b/lib/BLua.cc
@@ -21,6 +21,7 @@
#include "BLua.h"
#include "Buffer.h"
#include <lualib.h>
+#include <luajit.h"
#ifndef BUFFERSIZE
#define BUFFERSIZE 2048
@@ -644,6 +645,16 @@ void Lua::open_dir() {
lua_pop(L, 1);
}
+void Lua::open_jit() {
+ luaopen_jit(L);
+ lua_pop(L, 1);
+}
+
+void Lua::open_bit() {
+ luaopen_bit(L);
+ lua_pop(L, 1);
+}
+
int Lua::wrap_open(openlualib_t open) {
return open(L);
}