diff options
-rw-r--r-- | src/bin/elua/main.c | 2 | ||||
-rw-r--r-- | src/lib/elua/Elua.h | 4 | ||||
-rw-r--r-- | src/lib/elua/elua.c | 22 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/bin/elua/main.c b/src/bin/elua/main.c index 9750325ef8..e184734784 100644 --- a/src/bin/elua/main.c +++ b/src/bin/elua/main.c @@ -476,7 +476,7 @@ elua_main(lua_State *L) m->status = 1; return 0; } - elua_state_setup_i18n(L); + elua_state_setup_i18n(elua_state); lua_call(L, 1, 0); elua_io_register(L); diff --git a/src/lib/elua/Elua.h b/src/lib/elua/Elua.h index 623c9925b8..2b06a805c0 100644 --- a/src/lib/elua/Elua.h +++ b/src/lib/elua/Elua.h @@ -67,13 +67,13 @@ EAPI int elua_init(void); EAPI int elua_shutdown(void); EAPI Elua_State *elua_state_new(void); -EAPI void elua_state_free(Elua_State *state); +EAPI void elua_state_free(Elua_State *es); EAPI Elua_State *elua_state_from_lua_get(lua_State *L); EAPI int elua_report_error(Elua_State *es, const char *pname, int status); -EAPI void elua_state_setup_i18n(lua_State *L); +EAPI void elua_state_setup_i18n(Elua_State *es); EAPI int elua_io_popen(lua_State *L); EAPI int elua_io_loadfile(lua_State *L, const char *fname); diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c index 957d4e4bbe..6601953f27 100644 --- a/src/lib/elua/elua.c +++ b/src/lib/elua/elua.c @@ -78,11 +78,11 @@ elua_state_new(void) } EAPI void -elua_state_free(Elua_State *state) +elua_state_free(Elua_State *es) { - if (!state) return; - if (state->luastate) lua_close(state->luastate); - free(state); + if (!es) return; + if (es->luastate) lua_close(es->luastate); + free(es); } EAPI Elua_State * @@ -153,19 +153,19 @@ const luaL_reg gettextlib[] = }; EAPI void -elua_state_setup_i18n(lua_State *L) +elua_state_setup_i18n(Elua_State *es) { #ifdef ENABLE_NLS char *(*dgettextp)(const char*, const char*) = dgettext; char *(*dngettextp)(const char*, const char*, const char*, unsigned long) = dngettext; #endif - lua_createtable(L, 0, 0); - luaL_register(L, NULL, gettextlib); + lua_createtable(es->luastate, 0, 0); + luaL_register(es->luastate, NULL, gettextlib); #ifdef ENABLE_NLS - lua_pushlightuserdata(L, *((void**)&dgettextp)); - lua_setfield(L, -2, "dgettext"); - lua_pushlightuserdata(L, *((void**)&dngettextp)); - lua_setfield(L, -2, "dngettext"); + lua_pushlightuserdata(es->luastate, *((void**)&dgettextp)); + lua_setfield(es->luastate, -2, "dgettext"); + lua_pushlightuserdata(es->luastate, *((void**)&dngettextp)); + lua_setfield(es->luastate, -2, "dngettext"); #endif } |