3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "utility/sync_util.h"
19 #include "engine-controller/task_error.h"
20 #include "engine-controller/task_error_internal.h"
22 #ifndef SYNC_AGENT_LOG
24 #define LOG_TAG "AF_EC"
27 typedef struct ec_task_error_map_s ec_task_error_map_t;
28 struct ec_task_error_map_s {
29 sync_agent_ec_task_error_e err;
30 sync_agent_ec_char *str;
33 static ec_task_error_map_t ec_task_error_string_tbl[5] = {
34 {SYNC_AGENT_EC_TASK_ERROR_NOT_YET_RUN, "not yet run"},
35 {SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS, "success"},
36 {SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED, "failed"},
37 {SYNC_AGENT_EC_TASK_ERROR_CANCELED, "canceled"},
38 {SYNC_AGENT_EC_TASK_ERROR_INVALID_TASK, "invalid"}
41 sync_agent_ec_char *ec_task_error_string(sync_agent_ec_task_error_e error)
44 sync_agent_ec_char *str = ec_task_error_string_tbl[4].str;
45 sync_agent_ec_int i = 0;
46 for (i = 0; i < 5; i++) {
47 if (error == ec_task_error_string_tbl[i].err) {
48 str = ec_task_error_string_tbl[i].str;