Prepare unit test
[platform/core/appfw/aul-1.git] / src / 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 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
28
29 #undef LOG_TAG
30 #define LOG_TAG "AUL"
31
32 #define _E(fmt, arg...) LOGE(fmt, ##arg)
33 #define _D(fmt, arg...) LOGD(fmt, ##arg)
34 #define _W(fmt, arg...) LOGW(fmt, ##arg)
35 #define _I(fmt, arg...) LOGI(fmt, ##arg)
36
37 #define AUL_UTIL_PID -2
38 #define MAX_LOCAL_BUFSZ 128
39 #define MAX_PACKAGE_STR_SIZE 512
40 #define MAX_PID_STR_BUFSZ 20
41 #define MAX_UID_STR_BUFSZ 20
42 #define REGULAR_UID_MIN 5000
43 #define MAX_RUNNING_INSTANCE 10000
44
45 typedef enum {
46         TIZEN_PROFILE_UNKNOWN = 0,
47         TIZEN_PROFILE_MOBILE = 0x1,
48         TIZEN_PROFILE_WEARABLE = 0x2,
49         TIZEN_PROFILE_TV = 0x4,
50         TIZEN_PROFILE_IVI = 0x8,
51         TIZEN_PROFILE_COMMON = 0x10,
52 } tizen_profile_t;
53
54 tizen_profile_t _get_tizen_profile(void);
55
56 #define TIZEN_FEATURE_SOCKET_TIMEOUT (_get_tizen_profile() & TIZEN_PROFILE_TV)
57 #define TIZEN_FEATURE_SHARE_PANEL (_get_tizen_profile() & TIZEN_PROFILE_MOBILE)
58
59 #ifdef __cplusplus
60 }
61 #endif