summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2020-04-16 15:32:58 +0200
committerStefan Schmidt <s.schmidt@samsung.com>2020-04-17 10:42:59 +0200
commitd02bbe42b97a432e58649eba549f52486725a441 (patch)
tree76e6b130c659bacb8c0931520669ee47e1dfec30
parentbab13de794dc7d099569ae2a036405c0f2809246 (diff)
exactness: remove no longer used code since move to preload
This has been around for prg handling before we switched to preload. No need for it anymore. Found when looking for a Coverity issue, which also got fixed now by luck. :-) CID: 1421994 Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D11713
-rw-r--r--src/bin/exactness/common.c86
-rw-r--r--src/bin/exactness/common.h2
2 files changed, 0 insertions, 88 deletions
diff --git a/src/bin/exactness/common.c b/src/bin/exactness/common.c
index f957003117..e7ba55f155 100644
--- a/src/bin/exactness/common.c
+++ b/src/bin/exactness/common.c
@@ -35,92 +35,6 @@ ex_prepare_elm_overloay(void)
35 elm_theme_overlay_add(NULL, DATA_DIR"/exactness_play.edj"); 35 elm_theme_overlay_add(NULL, DATA_DIR"/exactness_play.edj");
36} 36}
37 37
38int
39ex_prg_invoke(const char *full_path, int argc, char **argv, Eina_Bool player)
40{
41 Eina_Value *ret__;
42 int real__;
43
44 void (*efl_main)(void *data, const Efl_Event *ev);
45 int (*elm_main)(int argc, char **argv);
46 int (*c_main)(int argc, char **argv);
47 Eina_Module *h = eina_module_new(full_path);
48 if (!h || !eina_module_load(h))
49 {
50 fprintf(stderr, "Failed loading %s.\n", full_path);
51 if (h) eina_module_free(h);
52 return 1;
53 }
54 efl_main = eina_module_symbol_get(h, "efl_main");
55 elm_main = eina_module_symbol_get(h, "elm_main");
56 c_main = eina_module_symbol_get(h, "main");
57 _evas_new = eina_module_symbol_get(h, "evas_new");
58 if (!_evas_new)
59 {
60 fprintf(stderr, "Failed loading symbol 'evas_new' from %s.\n", full_path);
61 eina_module_free(h);
62 return 1;
63 }
64 if (efl_main)
65 {
66 elm_init(argc, argv);
67 if (player) elm_theme_overlay_add(NULL, DATA_DIR"/exactness_play.edj");
68 efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL);
69 ret__ = efl_loop_begin(efl_main_loop_get());
70 real__ = efl_loop_exit_code_process(ret__);
71 elm_shutdown();
72 }
73 else if (elm_main)
74 {
75 elm_init(argc, argv);
76 if (player) elm_theme_overlay_add(NULL, DATA_DIR"/exactness_play.edj");
77 real__ = elm_main(argc, argv);
78 elm_shutdown();
79 }
80 else if (c_main)
81 {
82 real__ = c_main(argc, argv);
83 }
84 else
85 {
86 fprintf(stderr, "Failed loading symbol 'efl_main', 'elm_main' or 'main' from %s.\n", full_path);
87 eina_module_free(h);
88 real__ = 1;
89 }
90 return real__;
91}
92
93Eina_Stringshare *
94ex_prg_full_path_guess(const char *prg)
95{
96 char full_path[PATH_MAX];
97 if (strchr(prg, '/')) return eina_stringshare_add(prg);
98 char *env_path = eina_strdup(getenv("PATH"));
99 Eina_Stringshare *ret = NULL;
100 char *paths = env_path;
101
102 while (paths && *paths && !ret)
103 {
104 char *real_path;
105 char *colon = strchr(paths, ':');
106 if (colon) *colon = '\0';
107
108 sprintf(full_path, "%s/%s", paths, prg);
109 real_path = ecore_file_realpath(full_path);
110 if (*real_path)
111 {
112 ret = eina_stringshare_add(real_path);
113 // check if executable
114 }
115 free(real_path);
116
117 paths += strlen(paths);
118 if (colon) paths++;
119 }
120 free(env_path);
121 return ret;
122}
123
124typedef struct _Dummy 38typedef struct _Dummy
125{ 39{
126} _Dummy; 40} _Dummy;
diff --git a/src/bin/exactness/common.h b/src/bin/exactness/common.h
index acec924598..6bac048fa9 100644
--- a/src/bin/exactness/common.h
+++ b/src/bin/exactness/common.h
@@ -268,6 +268,4 @@ Exactness_Unit *exactness_unit_file_read(const char *filename);
268Eina_Bool exactness_unit_file_write(Exactness_Unit *unit, const char *filename); 268Eina_Bool exactness_unit_file_write(Exactness_Unit *unit, const char *filename);
269void exactness_image_free(Exactness_Image *img); 269void exactness_image_free(Exactness_Image *img);
270 270
271int ex_prg_invoke(const char *full_path, int argc, char **argv, Eina_Bool player);
272Eina_Stringshare *ex_prg_full_path_guess(const char *prg);
273void ex_prepare_elm_overloay(void); 271void ex_prepare_elm_overloay(void);