summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2007-05-28 06:45:21 +0000
committerpixel <pixel>2007-05-28 06:45:21 +0000
commit47810e5679145af5d9b43047dafdff453e09683a (patch)
tree37b9e11e06935f0ec556587f30354263ef01fa47 /lib
parent696bff2dc0dfb92ea4ae664c1cfab43f1d3832f1 (diff)
Adding small helper function to mass-load the lua support libs.
Diffstat (limited to 'lib')
-rw-r--r--lib/loadlualibs.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/loadlualibs.cc b/lib/loadlualibs.cc
new file mode 100644
index 0000000..7c1fefa
--- /dev/null
+++ b/lib/loadlualibs.cc
@@ -0,0 +1,18 @@
+#include <loadlualibs.h>
+#include <Buffer.h>
+
+extern unsigned int size_supportlib;
+extern unsigned char supportlib[];
+
+extern unsigned int size_tasklib;
+extern unsigned char tasklib[];
+
+void LoadLuaLibs(Lua * L) {
+ Buffer supportlib_buff;
+ supportlib_buff.write(supportlib, size_supportlib);
+ L->load(&supportlib_buff);
+
+ Buffer tasklib_buff;
+ tasklib_buff.write(tasklib, size_tasklib);
+ L->load(&tasklib_buff);
+}