4 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 #ifndef _APP2EXT_UTILS_H
21 #define _APP2EXT_UTILS_H
31 #ifndef _DEFAULT_SOURCE
32 #define _DEFAULT_SOURCE
38 #include <tzplatform_config.h>
40 #define _E(fmt, arg...) LOGE(fmt, ##arg)
41 #define _D(fmt, arg...) LOGD(fmt, ##arg)
42 #define _W(fmt, arg...) LOGW(fmt, ##arg)
43 #define _I(fmt, arg...) LOGI(fmt, ##arg)
49 #define LOG_TAG "APP2EXT"
51 #define APP2EXT_SUCCESS 0
54 #define REGULAR_USER 5000
55 #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
56 #define EXTIMG_DIR "app2sd"
58 #define APP2SD_BUS_NAME "org.tizen.app2sd"
59 #define APP2SD_OBJECT_PATH "/org/tizen/app2sd"
60 #define APP2SD_INTERFACE_NAME "org.tizen.app2sd"
62 #define DIR_PERMS (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
64 int _is_global(uid_t uid);
66 char *_app2sd_get_encoded_name(const char *pkgid, uid_t uid);
68 int _app2sd_delete_directory(const char *dirname);