diff options
-rw-r--r-- | ClientHamr/GuiLua/GuiLua.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ClientHamr/GuiLua/GuiLua.c b/ClientHamr/GuiLua/GuiLua.c index 49c62b8..3cb886f 100644 --- a/ClientHamr/GuiLua/GuiLua.c +++ b/ClientHamr/GuiLua/GuiLua.c | |||
@@ -586,11 +586,11 @@ static int closeWindow(lua_State *L) | |||
586 | /* local widget = require 'widget' | 586 | /* local widget = require 'widget' |
587 | 587 | ||
588 | Lua's require() function will strip any stuff from the front of the name | 588 | Lua's require() function will strip any stuff from the front of the name |
589 | separated by a hyphen, so 'ClientHamr-GuiLua-test_c' -> 'test_c'. Then | 589 | separated by a hyphen, so 'ClientHamr-GuiLua-widget' -> 'widget'. Then |
590 | it will search through a path, and eventually find this test_c.so (or | 590 | it will search through a path, and eventually find this widget.so (or |
591 | test_c.dll or whatever), then call luaopen_test_c(), which should return | 591 | widget.dll or whatever), then call luaopen_widget(), which should return |
592 | a table. The argument (only thing on the stack) for this function will | 592 | a table. The argument (only thing on the stack) for this function will |
593 | be 'test_c'. | 593 | be 'widget'. |
594 | 594 | ||
595 | Normally luaL_register() creates a table of functions, that is the table | 595 | Normally luaL_register() creates a table of functions, that is the table |
596 | returned, but we want to do something different with skang. | 596 | returned, but we want to do something different with skang. |
@@ -609,7 +609,7 @@ int luaopen_widget(lua_State *L) | |||
609 | 609 | ||
610 | // pseudo-indices, special tables that can be accessed like the stack - | 610 | // pseudo-indices, special tables that can be accessed like the stack - |
611 | // LUA_GLOBALSINDEX - thread environment, where globals are | 611 | // LUA_GLOBALSINDEX - thread environment, where globals are |
612 | // LUA_ENVIRONINDEX - C function environment, in this case luaopen_test_c() is the C function | 612 | // LUA_ENVIRONINDEX - C function environment, in this case luaopen_widget() is the C function |
613 | // LUA_REGISTRYINDEX - C registry, global, for unique keys use the module name as a string, or a lightuserdata address to a C object in our module. | 613 | // LUA_REGISTRYINDEX - C registry, global, for unique keys use the module name as a string, or a lightuserdata address to a C object in our module. |
614 | // lua_upvalueindex(n) - C function upvalues | 614 | // lua_upvalueindex(n) - C function upvalues |
615 | 615 | ||
@@ -651,9 +651,8 @@ int luaopen_widget(lua_State *L) | |||
651 | 651 | ||
652 | void GuiLuaDo(int argc, char **argv) | 652 | void GuiLuaDo(int argc, char **argv) |
653 | { | 653 | { |
654 | lua_State *L; // Our Lua state. | 654 | lua_State *L; |
655 | lua_Number i; | 655 | lua_Number i; |
656 | |||
657 | 656 | ||
658 | L = luaL_newstate(); | 657 | L = luaL_newstate(); |
659 | if (L) | 658 | if (L) |