2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 #include "utc-stc-common.h"
20 const char *stc_get_error(int err)
25 case STC_ERROR_NOT_PERMITTED:
26 return "Operation not permitted";
27 case STC_ERROR_OUT_OF_MEMORY:
28 return "Out of memory";
29 case STC_ERROR_PERMISSION_DENIED:
30 return "Permission denied";
31 case STC_ERROR_RESOURCE_BUSY:
32 return "Device or resource busy";
33 case STC_ERROR_INVALID_OPERATION:
34 return "Invalid operation";
35 case STC_ERROR_INVALID_PARAMETER:
36 return "Invalid parameter";
37 case STC_ERROR_NOT_SUPPORTED:
38 return "Not supported";
39 case STC_ERROR_OPERATION_FAILED:
40 return "Operation failed";
41 case STC_ERROR_NOT_INITIALIZED:
42 return "Cgroup doen't mounted or daemon not started";
43 case STC_ERROR_ALREADY_INITIALIZED:
44 return "Already initialized";
45 case STC_ERROR_IN_PROGRESS:
52 bool stc_check_feature_supported(char *key)
55 int ret = system_info_get_platform_bool(key, &value);
57 if (ret != SYSTEM_INFO_ERROR_NONE)
63 time_t stc_make_time(int year, int mon, int day, int hour, int min)
65 struct tm curr = { 0, };
66 curr.tm_year = year - 1900;
67 curr.tm_mon = mon - 1;