3 * Copyright 2012 Samsung Electronics Co., Ltd
5 * Licensed under the Flora License, Version 1.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://floralicense.org/license/
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
24 /* use prefix 'P' means print */
25 #define PTAG LOGD("[%s : %d]\n", __FILE__, __LINE__)
26 #define PLOG(fmt, arg...) LOGD(" ## "fmt, ##arg)
27 #define PFUNC_ENTER LOGD("ENTER : %s\n", __func__)
28 #define PFUNC_LEAVE LOGD("LEAVE : %s\n", __func__)
30 #define ARRAY_SIZE(array) \
31 ((int)(sizeof(array) / sizeof(array[0])))
33 #define STR_EQUAL(str1, str2) \
34 (strcmp(str1, str2) == 0)
37 (str == NULL ? 0 : strlen(str))\
39 #define sncat(to, size, from) \
40 strncat(to, from, size-strlen(to)-1)
42 #define sncatprintf(s, size, fmt, args...) \
43 snprintf(s+strlen(s), size-strlen(s), fmt, ##args)
45 #define SMALLOC(Type)\
46 (Type *)calloc(1, sizeof(Type))\
54 #define RETIF(condition)\
57 #define RETVIF(condition, val)\
58 if (condition) return val
60 #endif /* __GRAVEL_H__ */