4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 * Girishashok Joshi <girish.joshi@samsung.com>
8 * Chanyeol Park <chanyeol.park@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
25 #ifndef _BT_CORE_COMMON_H_
26 #define _BT_CORE_COMMON_H_
28 #include <sys/types.h>
35 #define LOG_TAG "BLUETOOTH_FRWK_CORE"
37 #define LOG_COLOR_RESET "\033[0m"
38 #define LOG_COLOR_RED "\033[31m"
39 #define LOG_COLOR_YELLOW "\033[33m"
40 #define LOG_COLOR_GREEN "\033[32m"
41 #define LOG_COLOR_BLUE "\033[36m"
42 #define LOG_COLOR_PURPLE "\033[35m"
44 #define BT_DBG(fmt, args...) \
46 #define BT_INFO(fmt, args...) \
48 #define BT_ERR(fmt, args...) \
51 #define BT_INFO_C(fmt, arg...) \
52 SLOGI_IF(TRUE, LOG_COLOR_GREEN" "fmt" "LOG_COLOR_RESET, ##arg)
53 #define BT_ERR_C(fmt, arg...) \
54 SLOGI_IF(TRUE, LOG_COLOR_RED" "fmt" "LOG_COLOR_RESET, ##arg)
56 #define DBG_SECURE(fmt, args...) SECURE_SLOGD(fmt, ##args)
57 #define ERR_SECURE(fmt, args...) SECURE_SLOGE(fmt, ##args)
59 #define ret_if(expr) \
62 BT_ERR("(%s) return", #expr); \
67 #define retv_if(expr, val) \
70 BT_ERR("(%s) return", #expr); \
75 #define BT_FREE_PARAMS(IP1,IP2,IP3,IP4,OP) \
78 g_array_free(IP1, TRUE); \
80 g_array_free(IP2, TRUE); \
82 g_array_free(IP3, TRUE); \
84 g_array_free(IP4, TRUE); \
86 g_array_free(OP, TRUE); \
89 #define BT_ALLOC_PARAMS(IP1,IP2,IP3,IP4,OP ) \
91 IP1 = g_array_new(TRUE, TRUE, sizeof(gchar)); \
92 IP2 = g_array_new(TRUE, TRUE, sizeof(gchar)); \
93 IP3 = g_array_new(TRUE, TRUE, sizeof(gchar)); \
94 IP4 = g_array_new(TRUE, TRUE, sizeof(gchar)); \
99 #endif /* __cplusplus */
100 #endif /*_BT_CORE_COMMON_H_*/