diff options
author | Daniel Kolesa <d.kolesa@samsung.com> | 2015-04-08 16:46:30 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2015-05-06 15:05:19 +0100 |
commit | 01aecbe273685f6afd459a3dabb249061b839d1a (patch) | |
tree | 1830b0ee84982b8ac26d7a0b77474a43c8d23281 /src/bin/elua | |
parent | ed3f24943f17dbc2459572ccdde34e62eaf945eb (diff) | |
download | efl-01aecbe273685f6afd459a3dabb249061b839d1a.tar.gz |
elua: use the dir paths from Elua_State
Diffstat (limited to 'src/bin/elua')
-rw-r--r-- | src/bin/elua/main.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/bin/elua/main.c b/src/bin/elua/main.c index 5869e2d9c9..7c0784069d 100644 --- a/src/bin/elua/main.c +++ b/src/bin/elua/main.c @@ -39,6 +39,7 @@ static int elua_require_ref = LUA_REFNIL; static int elua_appload_ref = LUA_REFNIL; static const char *elua_progname = NULL; static Eina_Prefix *elua_prefix = NULL; +static Elua_State *elua_state = NULL; static int _el_log_domain = -1; @@ -124,11 +125,11 @@ elua_init_module(lua_State *L) static int elua_register_require(lua_State *L) { - const char *corepath = lua_touserdata(L, lua_upvalueindex(1)); - const char *modpath = lua_touserdata(L, lua_upvalueindex(2)); - const char *appspath = lua_touserdata(L, lua_upvalueindex(3)); - Eina_List *largs = lua_touserdata(L, lua_upvalueindex(4)), *l = NULL; - Eina_Bool noenv = lua_toboolean (L, lua_upvalueindex(5)); + const char *corepath = elua_state->coredir; + const char *modpath = elua_state->moddir; + const char *appspath = elua_state->appsdir; + Eina_List *largs = lua_touserdata(L, lua_upvalueindex(1)), *l = NULL; + Eina_Bool noenv = lua_toboolean (L, lua_upvalueindex(2)); Arg_Data *data = NULL; char corepathbuf[PATH_MAX], modpathbuf[PATH_MAX], appspathbuf[PATH_MAX]; int n = 3; @@ -297,8 +298,6 @@ elua_bin_shutdown(Elua_State *es, int c) exit(c); } -static Elua_State *elua_state = NULL; - struct Main_Data { Elua_State *es; @@ -440,12 +439,9 @@ elua_main(lua_State *L) m->status = 1; return 0; } - lua_pushlightuserdata(L, coredir); - lua_pushlightuserdata(L, moddir); - lua_pushlightuserdata(L, appsdir); lua_pushlightuserdata(L, largs); lua_pushboolean (L, noenv); - lua_pushcclosure(L, elua_register_require, 5); + lua_pushcclosure(L, elua_register_require, 2); lua_createtable(L, 0, 0); luaL_register(L, NULL, cutillib); lua_call(L, 2, 0); |