fix missing encoded_id related change & code clearing.
[platform/core/appfw/app2sd.git] / common / inc / app2ext_utils.h
1 /*
2  * app2ext
3  *
4  * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  *
18  */
19
20 #ifndef _APP2EXT_UTILS_H
21 #define _APP2EXT_UTILS_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #ifndef _GNU_SOURCE
28 #define _GNU_SOURCE
29 #endif
30
31 #ifndef _DEFAULT_SOURCE
32 #define _DEFAULT_SOURCE
33 #endif
34
35 #include <dlog.h>
36 #include <glib.h>
37 #include <tzplatform_config.h>
38
39 #define _E(fmt, arg...) LOGE(fmt, ##arg)
40 #define _D(fmt, arg...) LOGD(fmt, ##arg)
41 #define _W(fmt, arg...) LOGW(fmt, ##arg)
42 #define _I(fmt, arg...) LOGI(fmt, ##arg)
43
44 #ifdef LOG_TAG
45 #undef LOG_TAG
46 #endif
47
48 #define LOG_TAG "APP2EXT"
49
50 #define APP2EXT_SUCCESS 0
51
52 #define OWNER_ROOT 0
53 #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
54 #define MMC_PATH tzplatform_mkpath(TZ_SYS_MEDIA, "SDCardA1")
55 #define APP2SD_PATH tzplatform_mkpath(TZ_SYS_MEDIA, "SDCardA1/app2sd")
56
57 #define APP2SD_BUS_NAME "org.tizen.app2sd"
58 #define APP2SD_OBJECT_PATH "/org/tizen/app2sd"
59 #define APP2SD_INTERFACE_NAME "org.tizen.app2sd"
60
61 int _is_global(uid_t uid);
62 char *_app2sd_get_encoded_name(const char *pkgid, uid_t uid);
63
64 #ifdef __cplusplus
65 }
66 #endif
67 #endif