summaryrefslogtreecommitdiff
path: root/src/lib/elua/elua.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-04-24 16:01:24 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:23 +0100
commite73f7f7a40ba3832d743ae4b893940440a38e3d4 (patch)
tree4e115a67920858cbd16f01dcaa37eec9a3153ccb /src/lib/elua/elua.c
parente9aadea402f2f533e6d9137171f5bff4eeb4bafc (diff)
elua lib: use Eina_Bool as return val in some utils
Diffstat (limited to 'src/lib/elua/elua.c')
-rw-r--r--src/lib/elua/elua.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index 9ad15d17f0..6cb2e13d71 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -468,11 +468,11 @@ _elua_getargs(Elua_State *es, int argc, char **argv, int n)
468 return narg; 468 return narg;
469} 469}
470 470
471EAPI int 471EAPI Eina_Bool
472elua_util_require(Elua_State *es, const char *libname) 472elua_util_require(Elua_State *es, const char *libname)
473{ 473{
474 EINA_SAFETY_ON_NULL_RETURN_VAL(es, -1); 474 EINA_SAFETY_ON_NULL_RETURN_VAL(es, EINA_FALSE);
475 EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, -1); 475 EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, EINA_FALSE);
476 if (!elua_state_require_ref_push(es)) 476 if (!elua_state_require_ref_push(es))
477 { 477 {
478 /* store stuff until things are correctly set up */ 478 /* store stuff until things are correctly set up */
@@ -480,26 +480,26 @@ elua_util_require(Elua_State *es, const char *libname)
480 return 0; 480 return 0;
481 } 481 }
482 lua_pushstring(es->luastate, libname); 482 lua_pushstring(es->luastate, libname);
483 return elua_util_error_report(es, lua_pcall(es->luastate, 1, 0, 0)); 483 return !elua_util_error_report(es, lua_pcall(es->luastate, 1, 0, 0));
484} 484}
485 485
486EAPI int 486EAPI Eina_Bool
487elua_util_file_run(Elua_State *es, const char *fname) 487elua_util_file_run(Elua_State *es, const char *fname)
488{ 488{
489 EINA_SAFETY_ON_NULL_RETURN_VAL(es, -1); 489 EINA_SAFETY_ON_NULL_RETURN_VAL(es, EINA_FALSE);
490 EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, -1); 490 EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, EINA_FALSE);
491 return elua_util_error_report(es, elua_io_loadfile(es, fname) 491 return !elua_util_error_report(es, elua_io_loadfile(es, fname)
492 || _elua_docall(es, 0, 1)); 492 || _elua_docall(es, 0, 1));
493} 493}
494 494
495EAPI int 495EAPI Eina_Bool
496elua_util_string_run(Elua_State *es, const char *chunk, const char *chname) 496elua_util_string_run(Elua_State *es, const char *chunk, const char *chname)
497{ 497{
498 EINA_SAFETY_ON_NULL_RETURN_VAL(es, -1); 498 EINA_SAFETY_ON_NULL_RETURN_VAL(es, EINA_FALSE);
499 EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, -1); 499 EINA_SAFETY_ON_NULL_RETURN_VAL(es->luastate, EINA_FALSE);
500 return elua_util_error_report(es, luaL_loadbuffer(es->luastate, chunk, 500 return !elua_util_error_report(es, luaL_loadbuffer(es->luastate, chunk,
501 strlen(chunk), chname) 501 strlen(chunk), chname)
502 || _elua_docall(es, 0, 0)); 502 || _elua_docall(es, 0, 0));
503} 503}
504 504
505EAPI Eina_Bool 505EAPI Eina_Bool
@@ -519,7 +519,7 @@ elua_util_app_load(Elua_State *es, const char *appname)
519 return EINA_TRUE; 519 return EINA_TRUE;
520} 520}
521 521
522EAPI int 522EAPI Eina_Bool
523elua_util_script_run(Elua_State *es, int argc, char **argv, int n, int *quit) 523elua_util_script_run(Elua_State *es, int argc, char **argv, int n, int *quit)
524{ 524{
525 int status, narg; 525 int status, narg;
@@ -555,7 +555,7 @@ elua_util_script_run(Elua_State *es, int argc, char **argv, int n, int *quit)
555 *quit = lua_toboolean(es->luastate, -1); 555 *quit = lua_toboolean(es->luastate, -1);
556 lua_pop(es->luastate, 1); 556 lua_pop(es->luastate, 1);
557 } 557 }
558 return elua_util_error_report(es, status); 558 return !elua_util_error_report(es, status);
559} 559}
560 560
561static void 561static void