summaryrefslogtreecommitdiff
path: root/src/lib/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2015-04-08 14:43:52 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:18 +0100
commitc1487c8b11ebcca01c28111ac5dcf742e0e61276 (patch)
tree6df2ffd54ea636b6759764163eb4fe96bca40b75 /src/lib/elua
parent357d902b87d0b0e74f3db400f77db985f8add19f (diff)
elua: elua_report_error now takes Elua_State*
Diffstat (limited to 'src/lib/elua')
-rw-r--r--src/lib/elua/Elua.h2
-rw-r--r--src/lib/elua/elua.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/elua/Elua.h b/src/lib/elua/Elua.h
index 2f1f41af68..623c9925b8 100644
--- a/src/lib/elua/Elua.h
+++ b/src/lib/elua/Elua.h
@@ -71,7 +71,7 @@ EAPI void elua_state_free(Elua_State *state);
71 71
72EAPI Elua_State *elua_state_from_lua_get(lua_State *L); 72EAPI Elua_State *elua_state_from_lua_get(lua_State *L);
73 73
74EAPI int elua_report_error(lua_State *L, const char *pname, int status); 74EAPI int elua_report_error(Elua_State *es, const char *pname, int status);
75 75
76EAPI void elua_state_setup_i18n(lua_State *L); 76EAPI void elua_state_setup_i18n(lua_State *L);
77 77
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index bdd5606fed..957d4e4bbe 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -106,13 +106,14 @@ _elua_errmsg(const char *pname, const char *msg)
106} 106}
107 107
108EAPI int 108EAPI int
109elua_report_error(lua_State *L, const char *pname, int status) 109elua_report_error(Elua_State *es, const char *pname, int status)
110{ 110{
111 if (status && !lua_isnil(L, -1)) 111 if (!es || !es->luastate) return status;
112 if (status && !lua_isnil(es->luastate, -1))
112 { 113 {
113 const char *msg = lua_tostring(L, -1); 114 const char *msg = lua_tostring(es->luastate, -1);
114 _elua_errmsg(pname, msg ? msg : "(non-string error)"); 115 _elua_errmsg(pname, msg ? msg : "(non-string error)");
115 lua_pop(L, 1); 116 lua_pop(es->luastate, 1);
116 } 117 }
117 return status; 118 return status;
118} 119}