summaryrefslogtreecommitdiff
path: root/src/lib/elua/elua.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2015-04-08 14:52:06 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:18 +0100
commitcf98f846e90f3c48da7514f3f612bf4e351db5c5 (patch)
treed01ce46c86ebfb593a5480a0ac261ee50360c626 /src/lib/elua/elua.c
parent17a54ff8e0b7c4430c510713ec636160175dbea8 (diff)
elua lib: Elua_State for elua_state_setup_i18n
Diffstat (limited to '')
-rw-r--r--src/lib/elua/elua.c22
1 files changed, 11 insertions, 11 deletions
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)
78} 78}
79 79
80EAPI void 80EAPI void
81elua_state_free(Elua_State *state) 81elua_state_free(Elua_State *es)
82{ 82{
83 if (!state) return; 83 if (!es) return;
84 if (state->luastate) lua_close(state->luastate); 84 if (es->luastate) lua_close(es->luastate);
85 free(state); 85 free(es);
86} 86}
87 87
88EAPI Elua_State * 88EAPI Elua_State *
@@ -153,19 +153,19 @@ const luaL_reg gettextlib[] =
153}; 153};
154 154
155EAPI void 155EAPI void
156elua_state_setup_i18n(lua_State *L) 156elua_state_setup_i18n(Elua_State *es)
157{ 157{
158#ifdef ENABLE_NLS 158#ifdef ENABLE_NLS
159 char *(*dgettextp)(const char*, const char*) = dgettext; 159 char *(*dgettextp)(const char*, const char*) = dgettext;
160 char *(*dngettextp)(const char*, const char*, const char*, unsigned long) 160 char *(*dngettextp)(const char*, const char*, const char*, unsigned long)
161 = dngettext; 161 = dngettext;
162#endif 162#endif
163 lua_createtable(L, 0, 0); 163 lua_createtable(es->luastate, 0, 0);
164 luaL_register(L, NULL, gettextlib); 164 luaL_register(es->luastate, NULL, gettextlib);
165#ifdef ENABLE_NLS 165#ifdef ENABLE_NLS
166 lua_pushlightuserdata(L, *((void**)&dgettextp)); 166 lua_pushlightuserdata(es->luastate, *((void**)&dgettextp));
167 lua_setfield(L, -2, "dgettext"); 167 lua_setfield(es->luastate, -2, "dgettext");
168 lua_pushlightuserdata(L, *((void**)&dngettextp)); 168 lua_pushlightuserdata(es->luastate, *((void**)&dngettextp));
169 lua_setfield(L, -2, "dngettext"); 169 lua_setfield(es->luastate, -2, "dngettext");
170#endif 170#endif
171} 171}