summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2007-05-29 15:45:45 +0000
committerpixel <pixel>2007-05-29 15:45:45 +0000
commit7afc045c94fdf9b4f8b0c6afee6ab98edb916e3f (patch)
treed77499af4824f6cee176f06772a665f0f7bb252f
parent32affee9d0854172d17563cb5d9a9a0c89162fec (diff)
Slightly changes of loadlualibs: now generating automatically the list of files.
-rwxr-xr-xlib/genloadlib.sh13
-rw-r--r--lib/loadlualibs.cc14
2 files changed, 15 insertions, 12 deletions
diff --git a/lib/genloadlib.sh b/lib/genloadlib.sh
new file mode 100755
index 0000000..f3b8259
--- /dev/null
+++ b/lib/genloadlib.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+ls *.lua | while read f ; do
+ b=${f%%.*}
+ echo "extern unsigned int size_$b;"
+ echo "extern unsigned char $b[];"
+ echo
+ echo " Buffer ${b}_buff;"
+ echo " ${b}_buff.write($b, size_$b);"
+ echo " L->load(&${b}_buff);"
+ echo
+ echo
+done
diff --git a/lib/loadlualibs.cc b/lib/loadlualibs.cc
index 7c1fefa..e8be95e 100644
--- a/lib/loadlualibs.cc
+++ b/lib/loadlualibs.cc
@@ -1,18 +1,8 @@
#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);
+#include "loadlualibs.ii"
+
}