Clean up repository
[platform/core/appfw/app2sd.git] / plugin / app2sd / common / inc / app2sd_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 <sys/stat.h>
38 #include <tzplatform_config.h>
39
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)
44
45 #ifdef LOG_TAG
46 #undef LOG_TAG
47 #endif
48
49 #define LOG_TAG "APP2EXT"
50
51 #define APP2EXT_SUCCESS 0
52
53 #define OWNER_ROOT 0
54 #define REGULAR_USER 5000
55 #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
56 #define EXTIMG_DIR "app2sd"
57
58 #define APP2SD_BUS_NAME "org.tizen.app2sd"
59 #define APP2SD_OBJECT_PATH "/org/tizen/app2sd"
60 #define APP2SD_INTERFACE_NAME "org.tizen.app2sd"
61
62 #define DIR_PERMS (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
63
64 int _is_global(uid_t uid);
65
66 char *_app2sd_get_encoded_name(const char *pkgid, uid_t uid);
67
68 int _app2sd_delete_directory(const char *dirname);
69
70 #ifdef __cplusplus
71 }
72 #endif
73 #endif