summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore/Ecore_Eo.h2
-rw-r--r--src/lib/ecore/ecore_main.c46
2 files changed, 48 insertions, 0 deletions
diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h
index ae04d6a671..f9b1428180 100644
--- a/src/lib/ecore/Ecore_Eo.h
+++ b/src/lib/ecore/Ecore_Eo.h
@@ -38,6 +38,8 @@ extern "C" {
38 38
39#include "efl_loop.eo.h" 39#include "efl_loop.eo.h"
40 40
41EAPI int efl_loop_exit_code_process(Eina_Value *value);
42
41#include "efl_loop_user.eo.h" 43#include "efl_loop_user.eo.h"
42 44
43EAPI Eina_Future_Scheduler *efl_loop_future_scheduler_get(Eo *obj); 45EAPI Eina_Future_Scheduler *efl_loop_future_scheduler_get(Eo *obj);
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 149df63006..932744ba9e 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -2880,6 +2880,52 @@ _efl_loop_efl_object_provider_find(Eo *obj, Efl_Loop_Data *pd, const Efl_Object
2880 return efl_provider_find(efl_super(obj, EFL_LOOP_CLASS), klass); 2880 return efl_provider_find(efl_super(obj, EFL_LOOP_CLASS), klass);
2881} 2881}
2882 2882
2883EAPI int
2884efl_loop_exit_code_process(Eina_Value *value)
2885{
2886 const Eina_Value_Type *t = eina_value_type_get(value);
2887 int r = 0;
2888
2889 if (t == EINA_VALUE_TYPE_UCHAR ||
2890 t == EINA_VALUE_TYPE_USHORT ||
2891 t == EINA_VALUE_TYPE_UINT ||
2892 t == EINA_VALUE_TYPE_ULONG ||
2893 t == EINA_VALUE_TYPE_UINT64 ||
2894 t == EINA_VALUE_TYPE_CHAR ||
2895 t == EINA_VALUE_TYPE_SHORT ||
2896 t == EINA_VALUE_TYPE_INT ||
2897 t == EINA_VALUE_TYPE_LONG ||
2898 t == EINA_VALUE_TYPE_INT64 ||
2899 t == EINA_VALUE_TYPE_FLOAT ||
2900 t == EINA_VALUE_TYPE_DOUBLE)
2901 {
2902 Eina_Value v = EINA_VALUE_EMPTY;
2903
2904 eina_value_setup(&v, EINA_VALUE_TYPE_INT);
2905 if (!eina_value_convert(&v, value))
2906 r = -1;
2907 else
2908 eina_value_get(&v, &v);
2909 }
2910 else
2911 {
2912 FILE *out = stdout;
2913 char *msg;
2914
2915 msg = eina_value_to_string(value);
2916
2917 if (t == EINA_VALUE_TYPE_ERROR)
2918 {
2919 r = -1;
2920 out = stderr;
2921 }
2922
2923 fprintf(out, "%s\n", msg);
2924 }
2925
2926 return r;
2927}
2928
2883static void 2929static void
2884_poll_trigger(void *data, const Efl_Event *event) 2930_poll_trigger(void *data, const Efl_Event *event)
2885{ 2931{