2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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.
22 /* use prefix 'P' means print */
23 #define PTAG LOGD("[%s : %d]\n", __FILE__, __LINE__)
24 #define PLOG(fmt, arg...) LOGD(" ## "fmt, ##arg)
25 #define PFUNC_ENTER LOGD("ENTER : %s\n", __func__)
26 #define PFUNC_LEAVE LOGD("LEAVE : %s\n", __func__)
28 #define ARRAY_SIZE(array) \
29 ((int)(sizeof(array) / sizeof(array[0])))
31 #define STR_EQUAL(str1, str2) \
32 (strcmp(str1, str2) == 0)
35 (str == NULL ? 0 : strlen(str))\
37 #define sncat(to, size, from) \
38 strncat(to, from, size-strlen(to)-1)
40 #define sncatprintf(s, size, fmt, args...) \
41 snprintf(s+strlen(s), size-strlen(s), fmt, ##args)
43 #define SMALLOC(Type)\
44 (Type *)calloc(1, sizeof(Type))\
52 #define RETIF(condition)\
55 #define RETVIF(condition, val)\
56 if (condition) return val
58 #endif /* __GRAVEL_H__ */