Add new functions to handling running components
[platform/core/appfw/aul-1.git] / include / aul_util.h
1 /*
2  * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #pragma once
18
19 #include <unistd.h>
20 #include <dlog.h>
21 #include <tzplatform_config.h>
22
23 #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
24
25 #undef LOG_TAG
26 #define LOG_TAG "AUL"
27
28 #define _E(fmt, arg...) LOGE(fmt, ##arg)
29 #define _D(fmt, arg...) LOGD(fmt, ##arg)
30 #define _W(fmt, arg...) LOGW(fmt, ##arg)
31 #define _I(fmt, arg...) LOGI(fmt, ##arg)
32
33 #define AUL_UTIL_PID -2
34 #define MAX_LOCAL_BUFSZ 128
35 #define MAX_PACKAGE_STR_SIZE 512
36 #define MAX_PID_STR_BUFSZ 20
37 #define MAX_UID_STR_BUFSZ 20
38 #define REGULAR_UID_MIN 5000
39 #define MAX_RUNNING_INSTANCE 10000
40
41 typedef enum {
42         TIZEN_PROFILE_UNKNOWN = 0,
43         TIZEN_PROFILE_MOBILE = 0x1,
44         TIZEN_PROFILE_WEARABLE = 0x2,
45         TIZEN_PROFILE_TV = 0x4,
46         TIZEN_PROFILE_IVI = 0x8,
47         TIZEN_PROFILE_COMMON = 0x10,
48 } tizen_profile_t;
49
50 tizen_profile_t _get_tizen_profile(void);
51
52 #define TIZEN_FEATURE_SOCKET_TIMEOUT (_get_tizen_profile() & TIZEN_PROFILE_TV)
53 #define TIZEN_FEATURE_SHARE_PANEL (_get_tizen_profile() & TIZEN_PROFILE_MOBILE)