forked from enlightenment/efl
elua lib: add APIs to retrieve refs to require/appload
This commit is contained in:
parent
6be9b662fb
commit
18da22a468
|
@ -80,6 +80,9 @@ EAPI Eina_Stringshare *elua_state_apps_dir_get(const Elua_State *es);
|
|||
|
||||
EAPI void elua_state_include_path_add(Elua_State *es, const char *path);
|
||||
|
||||
EAPI Eina_Bool elua_state_require_ref_push(Elua_State *es);
|
||||
EAPI Eina_Bool elua_state_appload_ref_push(Elua_State *es);
|
||||
|
||||
EAPI lua_State *elua_state_lua_state_get(const Elua_State *es);
|
||||
|
||||
EAPI int elua_report_error(const Elua_State *es, const char *pname, int status);
|
||||
|
|
|
@ -179,6 +179,26 @@ elua_state_include_path_add(Elua_State *es, const char *path)
|
|||
es->lincs = eina_list_append(es->lincs, eina_stringshare_add(path));
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elua_state_require_ref_push(Elua_State *es)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(es, EINA_FALSE);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, EINA_FALSE);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(es->requireref != LUA_REFNIL, EINA_FALSE);
|
||||
lua_rawgeti(es->luastate, LUA_REGISTRYINDEX, es->requireref);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elua_state_appload_ref_push(Elua_State *es)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(es, EINA_FALSE);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, EINA_FALSE);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(es->apploadref != LUA_REFNIL, EINA_FALSE);
|
||||
lua_rawgeti(es->luastate, LUA_REGISTRYINDEX, es->apploadref);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI lua_State *
|
||||
elua_state_lua_state_get(const Elua_State *es)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue