summaryrefslogtreecommitdiff
path: root/lib/genloadlib.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/genloadlib.sh')
-rwxr-xr-xlib/genloadlib.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/genloadlib.sh b/lib/genloadlib.sh
index f3b8259..c7231b1 100755
--- a/lib/genloadlib.sh
+++ b/lib/genloadlib.sh
@@ -1,13 +1,21 @@
#!/bin/sh
+echo 'extern "C" {'
ls *.lua | while read f ; do
b=${f%%.*}
echo "extern unsigned int size_$b;"
echo "extern unsigned char $b[];"
echo
+done
+echo '}'
+echo
+echo
+echo 'void LoadLuaLibs(Lua * L) {'
+ls *.lua | while read f ; do
+ b=${f%%.*}
echo " Buffer ${b}_buff;"
echo " ${b}_buff.write($b, size_$b);"
echo " L->load(&${b}_buff);"
echo
- echo
done
+echo '}'