summaryrefslogtreecommitdiff
path: root/src/lib/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2015-04-09 13:48:06 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:19 +0100
commit128aa3a1ea2fb392e03adeec0179aad4211394a7 (patch)
tree028ad639a20d752bd934e03e84dab09f4b3e4e05 /src/lib/elua
parente4baa1bc124b7706b2ccc04e01377075ab313a2e (diff)
elua lib: elua_io_loadfile now uses Elua_State
Diffstat (limited to 'src/lib/elua')
-rw-r--r--src/lib/elua/Elua.h2
-rw-r--r--src/lib/elua/cache.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/elua/Elua.h b/src/lib/elua/Elua.h
index e4df8afdb1..2010a5aa96 100644
--- a/src/lib/elua/Elua.h
+++ b/src/lib/elua/Elua.h
@@ -84,7 +84,7 @@ EAPI int elua_report_error(Elua_State *es, const char *pname, int status);
84EAPI void elua_state_setup_i18n(Elua_State *es); 84EAPI 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(lua_State *L, 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(lua_State *L);
89 89
90#endif 90#endif
diff --git a/src/lib/elua/cache.c b/src/lib/elua/cache.c
index e272843c69..2bc0cbef05 100644
--- a/src/lib/elua/cache.c
+++ b/src/lib/elua/cache.c
@@ -150,13 +150,16 @@ getf_map(lua_State *L EINA_UNUSED, void *ud, size_t *size)
150} 150}
151 151
152EAPI int 152EAPI int
153elua_io_loadfile(lua_State *L, const char *fname) 153elua_io_loadfile(Elua_State *es, const char *fname)
154{ 154{
155 Map_Stream s; 155 Map_Stream s;
156 int status; 156 int status;
157 Eina_File *f; 157 Eina_File *f;
158 const char *chname; 158 const char *chname;
159 Eina_Bool bcache = EINA_FALSE; 159 Eina_Bool bcache = EINA_FALSE;
160 lua_State *L;
161 if (!es || !es->luastate) return -1;
162 L = es->luastate;
160 if (!fname) 163 if (!fname)
161 { 164 {
162 return elua_loadstdin(L); 165 return elua_loadstdin(L);
@@ -187,8 +190,9 @@ elua_io_loadfile(lua_State *L, const char *fname)
187static int 190static int
188loadfile(lua_State *L) 191loadfile(lua_State *L)
189{ 192{
193 Elua_State *es = elua_state_from_lua_get(L);
190 const char *fname = luaL_optstring(L, 1, NULL); 194 const char *fname = luaL_optstring(L, 1, NULL);
191 int status = elua_io_loadfile(L, fname), 195 int status = elua_io_loadfile(es, fname),
192 hasenv = (lua_gettop(L) >= 3); 196 hasenv = (lua_gettop(L) >= 3);
193 if (!status) 197 if (!status)
194 { 198 {