aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr
diff options
context:
space:
mode:
Diffstat (limited to 'ClientHamr')
-rw-r--r--ClientHamr/GuiLua/GuiLua.c15
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
588Lua's require() function will strip any stuff from the front of the name 588Lua's require() function will strip any stuff from the front of the name
589separated by a hyphen, so 'ClientHamr-GuiLua-test_c' -> 'test_c'. Then 589separated by a hyphen, so 'ClientHamr-GuiLua-widget' -> 'widget'. Then
590it will search through a path, and eventually find this test_c.so (or 590it will search through a path, and eventually find this widget.so (or
591test_c.dll or whatever), then call luaopen_test_c(), which should return 591widget.dll or whatever), then call luaopen_widget(), which should return
592a table. The argument (only thing on the stack) for this function will 592a table. The argument (only thing on the stack) for this function will
593be 'test_c'. 593be 'widget'.
594 594
595Normally luaL_register() creates a table of functions, that is the table 595Normally luaL_register() creates a table of functions, that is the table
596returned, but we want to do something different with skang. 596returned, 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
652void GuiLuaDo(int argc, char **argv) 652void 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)