4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license/
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #include <linux/unistd.h>
21 #include <sys/utsname.h>
23 #include "pts_common.h"
24 #include "pts_debug.h"
26 void pts_util_show_error_popup(Evas_Object *parent, const char *msg)
28 //pts_appdata_t *ad = pts_get_appdata();
29 //PTS_RET_IF(ad == NULL, "ad is NULL");
30 //PTS_RET_IF(ad->win == NULL, "ad->win is NULL");
32 PTS_RET_IF(parent == NULL, "");
34 Evas_Object *error_popup = elm_popup_add(parent);
35 PTS_RET_IF(error_popup == NULL, "error_popup is NULL");
36 evas_object_size_hint_weight_set(error_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
37 elm_object_text_set(error_popup, msg);
38 evas_object_show(error_popup);
39 evas_object_show(parent);
43 Eina_Bool pts_util_supported_arch(void)
46 int ret = uname(&buf);
48 PTS_DEBUG("Failed to get uname");
49 } else if (strstr(buf.machine,"arm") == NULL) {
50 PTS_DEBUG("No supported : %s", buf.machine);
53 PTS_DEBUG("Supported : %s", buf.machine);
58 void pts_util_remove_tmp_files(const char *path)
61 PTS_RET_IF(path == NULL, "path is NULL");
68 cwd = get_current_dir_name();
74 while ((entry = readdir(dir)) != NULL) {
75 PTS_DEBUG("Remove %s", entry->d_name);
76 iret = remove(entry->d_name);
78 PTS_DEBUG("unable to remove %s",entry->d_name);
85 PTS_RET_IF(iret == -1, "unable to chdir");
88 if (errno == ENOENT) {
89 PTS_DEBUG("Not existed %s, just skip", path);