diff options
author | Daniel Kolesa <d.kolesa@samsung.com> | 2015-04-10 14:36:26 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2015-05-06 15:05:20 +0100 |
commit | 13bd7ba6533a54759df079467f9842ccb6ae4e24 (patch) | |
tree | 030f2a28de83bee2c12a26ac342eff3af5706c91 /src/lib/elua/elua.c | |
parent | 865e2e3364e7e1506909a525ecd4c936c2f8a6f9 (diff) |
elua lib: add progname to state
Diffstat (limited to '')
-rw-r--r-- | src/lib/elua/elua.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c index 9299b8ff6e..fb85901ec2 100644 --- a/src/lib/elua/elua.c +++ b/src/lib/elua/elua.c | |||
@@ -63,7 +63,7 @@ elua_shutdown(void) | |||
63 | } | 63 | } |
64 | 64 | ||
65 | EAPI Elua_State * | 65 | EAPI Elua_State * |
66 | elua_state_new(void) | 66 | elua_state_new(const char *progname) |
67 | { | 67 | { |
68 | Elua_State *ret = NULL; | 68 | Elua_State *ret = NULL; |
69 | lua_State *L = luaL_newstate(); | 69 | lua_State *L = luaL_newstate(); |
@@ -71,6 +71,7 @@ elua_state_new(void) | |||
71 | return NULL; | 71 | return NULL; |
72 | ret = calloc(1, sizeof(Elua_State)); | 72 | ret = calloc(1, sizeof(Elua_State)); |
73 | ret->luastate = L; | 73 | ret->luastate = L; |
74 | if (progname) ret->progname = eina_stringshare_add(progname); | ||
74 | luaL_openlibs(L); | 75 | luaL_openlibs(L); |
75 | lua_pushlightuserdata(L, ret); | 76 | lua_pushlightuserdata(L, ret); |
76 | lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr"); | 77 | lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr"); |
@@ -95,6 +96,7 @@ elua_state_free(Elua_State *es) | |||
95 | eina_list_free(es->cmods); | 96 | eina_list_free(es->cmods); |
96 | EINA_LIST_FREE(es->lincs, data) | 97 | EINA_LIST_FREE(es->lincs, data) |
97 | eina_stringshare_del(data); | 98 | eina_stringshare_del(data); |
99 | eina_stringshare_del(es->progname); | ||
98 | eina_stringshare_del(es->coredir); | 100 | eina_stringshare_del(es->coredir); |
99 | eina_stringshare_del(es->moddir); | 101 | eina_stringshare_del(es->moddir); |
100 | eina_stringshare_del(es->appsdir); | 102 | eina_stringshare_del(es->appsdir); |