summaryrefslogtreecommitdiff
path: root/src/lib/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2015-04-09 13:56:08 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:19 +0100
commitf17e8025b8cbf36b4cf125ac32ed89c0f17627a3 (patch)
treebcd0c077e6bcdd8db1c13903a39e1b2f75326d51 /src/lib/elua
parent128aa3a1ea2fb392e03adeec0179aad4211394a7 (diff)
elua lib: more Elua_State usage
Diffstat (limited to 'src/lib/elua')
-rw-r--r--src/lib/elua/Elua.h2
-rw-r--r--src/lib/elua/cache.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/elua/Elua.h b/src/lib/elua/Elua.h
index 2010a5aa96..f782c414eb 100644
--- a/src/lib/elua/Elua.h
+++ b/src/lib/elua/Elua.h
@@ -85,7 +85,7 @@ EAPI void elua_state_setup_i18n(Elua_State *es);
85 85
86EAPI int elua_io_popen(lua_State *L); 86EAPI int elua_io_popen(lua_State *L);
87EAPI int elua_io_loadfile(Elua_State *es, const char *fname); 87EAPI int elua_io_loadfile(Elua_State *es, const char *fname);
88EAPI void elua_io_register(lua_State *L); 88EAPI void elua_io_register(Elua_State *es);
89 89
90#endif 90#endif
91 91
diff --git a/src/lib/elua/cache.c b/src/lib/elua/cache.c
index 2bc0cbef05..26ce948ead 100644
--- a/src/lib/elua/cache.c
+++ b/src/lib/elua/cache.c
@@ -209,8 +209,9 @@ loadfile(lua_State *L)
209} 209}
210 210
211EAPI void 211EAPI void
212elua_io_register(lua_State *L) 212elua_io_register(Elua_State *es)
213{ 213{
214 lua_pushcfunction(L, loadfile); 214 EINA_SAFETY_ON_FALSE_RETURN(es && es->luastate);
215 lua_setglobal(L, "loadfile"); 215 lua_pushcfunction(es->luastate, loadfile);
216 lua_setglobal(es->luastate, "loadfile");
216} 217}