2 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #define LOG_TAG "APP_CORE_BASE"
26 TIZEN_PROFILE_UNKNOWN = 0,
27 TIZEN_PROFILE_MOBILE = 0x1,
28 TIZEN_PROFILE_WEARABLE = 0x2,
29 TIZEN_PROFILE_TV = 0x4,
30 TIZEN_PROFILE_IVI = 0x8,
31 TIZEN_PROFILE_COMMON = 0x10,
32 } appcore_base_tizen_profile_t;
35 # define EXPORT_API __attribute__ ((visibility("default")))
39 # define _ERR(fmt, arg...) \
40 do { fprintf(stderr, "appcore: "fmt"\n", ##arg); } while (0)
42 # define _INFO(fmt, arg...) \
43 do { fprintf(stdout, fmt"\n", ##arg); } while (0)
45 # define _DBG(fmt, arg...) \
47 if (getenv("APPCORE_DEBUG")) { \
48 fprintf(stdout, fmt"\n", ##arg); \
52 # define _ERR(fmt, arg...) \
54 fprintf(stderr, "appcore: "fmt"\n", ##arg); \
57 # define _INFO(...) LOGI(__VA_ARGS__)
58 # define _DBG(...) LOGD(__VA_ARGS__)
61 #define _warn_if(expr, fmt, arg...) do { \
67 #define _ret_if(expr) do { \
73 #define _retv_if(expr, val) do { \
79 #define _retm_if(expr, fmt, arg...) do { \
86 #define _retvm_if(expr, val, fmt, arg...) do { \
93 appcore_base_tizen_profile_t appcore_base_get_tizen_profile(void);
95 #define TIZEN_FEATURE_BACKGROUND_MANAGEMENT \
96 (!(appcore_base_get_tizen_profile() & TIZEN_PROFILE_TV))
97 #define TIZEN_FEATURE_CHARGER_STATUS \
98 (appcore_base_get_tizen_profile() & TIZEN_PROFILE_WEARABLE)
100 extern void aul_finalize();