diff options
author | Daniel Kolesa <d.kolesa@samsung.com> | 2015-04-09 13:48:06 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2015-05-06 15:05:19 +0100 |
commit | 128aa3a1ea2fb392e03adeec0179aad4211394a7 (patch) | |
tree | 028ad639a20d752bd934e03e84dab09f4b3e4e05 /src/lib/elua | |
parent | e4baa1bc124b7706b2ccc04e01377075ab313a2e (diff) |
elua lib: elua_io_loadfile now uses Elua_State
Diffstat (limited to 'src/lib/elua')
-rw-r--r-- | src/lib/elua/Elua.h | 2 | ||||
-rw-r--r-- | src/lib/elua/cache.c | 8 |
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); | |||
84 | EAPI void elua_state_setup_i18n(Elua_State *es); | 84 | EAPI void elua_state_setup_i18n(Elua_State *es); |
85 | 85 | ||
86 | EAPI int elua_io_popen(lua_State *L); | 86 | EAPI int elua_io_popen(lua_State *L); |
87 | EAPI int elua_io_loadfile(lua_State *L, const char *fname); | 87 | EAPI int elua_io_loadfile(Elua_State *es, const char *fname); |
88 | EAPI void elua_io_register(lua_State *L); | 88 | EAPI 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 | ||
152 | EAPI int | 152 | EAPI int |
153 | elua_io_loadfile(lua_State *L, const char *fname) | 153 | elua_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) | |||
187 | static int | 190 | static int |
188 | loadfile(lua_State *L) | 191 | loadfile(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 | { |