aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--ClientHamr/GuiLua/README9
-rw-r--r--ClientHamr/GuiLua/skang.lua3
-rw-r--r--ClientHamr/GuiLua/test_c.c3
3 files changed, 15 insertions, 0 deletions
diff --git a/ClientHamr/GuiLua/README b/ClientHamr/GuiLua/README
index 4198025..72c1069 100644
--- a/ClientHamr/GuiLua/README
+++ b/ClientHamr/GuiLua/README
@@ -388,6 +388,15 @@ that has hard coded mappings between some basic "label", "button", etc.
388and ordinary elementary widgets. Proper introspection can come later. 388and ordinary elementary widgets. Proper introspection can come later.
389 389
390 390
391LuaJIT FFI notes
392----------------
393
394LuaJIT 2.0 FFI needs to have cleaned up versions of C header files
395included in the Lua scripts that use it. This is messy. Version 2.1
396(or perhaps 3.0) has on it's road map to include a C pre processor,
397which should help that problem.
398
399
391EO notes 400EO notes
392-------- 401--------
393 402
diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua
index 6f06131..2b21cb9 100644
--- a/ClientHamr/GuiLua/skang.lua
+++ b/ClientHamr/GuiLua/skang.lua
@@ -157,6 +157,8 @@ end
157 157
158-- Call this now so that from now on, this is like any other module. 158-- Call this now so that from now on, this is like any other module.
159local _M = moduleBegin('skang', 'David Seikel', 'Copyright 2014 David Seikel', '0.1', '2014-03-27 02:57:00') 159local _M = moduleBegin('skang', 'David Seikel', 'Copyright 2014 David Seikel', '0.1', '2014-03-27 02:57:00')
160-- TODO - While it is possible to get LuaJIT version info, need to load the 'jit' module, which wont work so well if we are not in LuaJIT.
161-- local jit = require 'jit'; jit.version; jit.version_num; jit.os; jit.arch
160print('Skang is running under Lua version ' .. _VERSION) 162print('Skang is running under Lua version ' .. _VERSION)
161 163
162 164
@@ -685,3 +687,4 @@ access to the module.
685-- Gotta check out this _ENV thing, 5.2 only. Seems to replace the need for setfenv(). Seems like setfenv should do what we want, and is more backward compatible. 687-- Gotta check out this _ENV thing, 5.2 only. Seems to replace the need for setfenv(). Seems like setfenv should do what we want, and is more backward compatible.
686-- "_ENV is not supported directly in 5.1, so its use can prevent a module from remaining compatible with 5.1. 688-- "_ENV is not supported directly in 5.1, so its use can prevent a module from remaining compatible with 5.1.
687-- Maybe you can simulate _ENV with setfenv and trapping gets/sets to it via __index/__newindex metamethods, or just avoid _ENV." 689-- Maybe you can simulate _ENV with setfenv and trapping gets/sets to it via __index/__newindex metamethods, or just avoid _ENV."
690-- LuaJIT doesn't support _ENV anyway.
diff --git a/ClientHamr/GuiLua/test_c.c b/ClientHamr/GuiLua/test_c.c
index e3fd801..e8c2bfd 100644
--- a/ClientHamr/GuiLua/test_c.c
+++ b/ClientHamr/GuiLua/test_c.c
@@ -114,6 +114,9 @@ int luaopen_test_c(lua_State *L)
114 // Save this module in the C registry. 114 // Save this module in the C registry.
115 lua_setfield(L, LUA_REGISTRYINDEX, ourName); 115 lua_setfield(L, LUA_REGISTRYINDEX, ourName);
116 116
117// TODO - This is too verbose. I've had an idea for writing some sort of generic wrapper, though others have done the same.
118// http://www.lua.org/pil/25.3.html seems the most reasonable of the examples I've found.
119
117// skang.thing('cfooble,c', 'Help text goes here', 1, 'number', \"'edit', 'The fooble:', 1, 1, 10, 50\", true) 120// skang.thing('cfooble,c', 'Help text goes here', 1, 'number', \"'edit', 'The fooble:', 1, 1, 10, 50\", true)
118 lua_getfield(L, skang, "thing"); 121 lua_getfield(L, skang, "thing");
119 lua_pushstring(L, "cfooble,c"); 122 lua_pushstring(L, "cfooble,c");