4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef __CALENDAR_SVC_INTERNAL_H__
20 #define __CALENDAR_SVC_INTERNAL_H__
26 #define EVENT_UPDATE "calendar_event_update"
27 #define CALENDARBOOK_UPDATE "calendar_book_update"
28 #define TASK_UPDATE "task_update"
31 #define API __attribute__ ((visibility("default")))
34 #define SAFE_STRDUP(src) (src)?strdup((char *)src):NULL
36 #define CALS_DEBUGGING
38 #define LOG_TAG "CALENDAR_SVC"
40 #define DLOG(prio, fmt, arg...) \
41 do { SLOG(prio, LOG_TAG, fmt, ##arg); } while(0);
42 #define INFO(fmt, arg...) SLOGI(fmt, ##arg)
43 #define WARN(fmt, arg...) SLOGW("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg)
44 #define ERR(fmt, arg...) SLOGE("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg)
45 #define DBG(fmt, arg...) SLOGD("%s:" fmt, __FUNCTION__, ##arg)
47 //#define CALS_DEBUGGING
49 #define CALS_FN_CALL DBG(">>>>>>>>%s called", __FUNCTION__)
50 #define CALS_FN_END DBG("<<<<<<<<%s ended", __FUNCTION__)
51 #define CALS_DBG(fmt, arg...) DBG("%d " fmt, __LINE__, ##arg)
52 #else /* CALS_DEBUGGING */
55 #define CALS_DBG(fmt, arg...)
56 #endif /* CALS_DEBUGGING */
61 ERR("tm(%d/%d/%d %d:%d)",(_X_).tm_year+1900,(_X_).tm_mon+1,(_X_).tm_mday,(_X_).tm_hour,(_X_).tm_min);\
64 #define warn_if(expr, fmt, arg...) do { \
69 #define ret_if(expr) do { \
75 #define retv_if(expr, val) do { \
81 #define retm_if(expr, fmt, arg...) do { \
87 #define retvm_if(expr, val, fmt, arg...) do { \
94 #define retex_if(expr, val, fmt, arg...) do { \
104 #define CAL_PROFILE_GET_TIME() (clock() / (CLOCKS_PER_SEC / 1000));
105 #define CAL_PROFILE_PRINT(starttime,endtime) ERR("%ld ~ %ld : %ld(%d sec) msec",starttime,endtime,endtime-starttime,(endtime-starttime)/1000);
107 #define CAL_PROFILE_GET_TIME(input_time) 0
108 #define CAL_PROFILE_PRINT(starttime,endtime)
111 #define CAL_FREE(ptr) \
117 #endif /* __CALENDAR_SVC_INTERNAL_H__ */