From 34c5ee4c2a489a506e93d5b303fbc80b263747f0 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 27 Feb 2020 11:18:47 +1000 Subject: The new sledjchisl binary, to replace the management scripts and web stuff. --- src/script.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/script.lua (limited to 'src/script.lua') diff --git a/src/script.lua b/src/script.lua new file mode 100644 index 0000000..1e4b909 --- /dev/null +++ b/src/script.lua @@ -0,0 +1,18 @@ +-- script.lua + +-- This works coz LuaJIT automatically loads the jit module. +if type(jit) == 'table' then + io.write('script.lua is being run by ' .. jit.version .. ' under ' .. jit.os .. ' on a ' .. jit.arch .. '\n') +else + io.write('script.lua is being run by Lua version ' .. _VERSION .. '\n') +end + +-- Receives a table, returns the sum of its components. +io.write("The table the script received has:\n"); +x = 0 +for i = 1, #foo do + print(i, foo[i]) + x = x + foo[i] +end +io.write("Returning data back to C\n"); +return x -- cgit v1.1