X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fmedia_info_private.h;h=865af4bf1334dd745945076d7abc8a51f5f44989;hb=e8b091cc04a938fd171d3eec72b091150bbb18d7;hp=0a3242430dc9708adab580df941351ebab33c5b1;hpb=509e5ffcc96f4adc5278b3eaa15328e213d7f69b;p=platform%2Fcore%2Fapi%2Fmedia-content.git diff --git a/include/media_info_private.h b/include/media_info_private.h old mode 100755 new mode 100644 index 0a32424..865af4b --- a/include/media_info_private.h +++ b/include/media_info_private.h @@ -414,9 +414,9 @@ typedef struct _media_content_cb_data { #define SELECT_MEDIA_COUNT_FROM_GROUP_BY_STORAGE_ID "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_BY_STORAGE_ID /*to apply limit condition. */ #define SELECT_MEDIA_COUNT_FROM_GROUP_NULL "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_NULL /* to apply limit condition. */ #define SELECT_MEDIA_COUNT_FROM_GROUP_NULL_BY_STORAGE_ID "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_NULL_BY_STORAGE_ID /* to apply limit condition. */ -#define SELECT_MEDIA_COUNT_FROM_FOLDER "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND folder_id='%q'" +#define SELECT_MEDIA_COUNT_FROM_FOLDER "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND folder_id='%s'" #define SELECT_MEDIA_COUNT_FROM_FOLDER_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_FOLDER" AND storage_uuid='%s' " -#define SELECT_MEDIA_COUNT_FROM_STORAGE "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND storage_uuid='%q'" +#define SELECT_MEDIA_COUNT_FROM_STORAGE "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND storage_uuid='%s'" #define SELECT_MEDIA_COUNT_FROM_TAG "SELECT COUNT(*) FROM "DB_VIEW_TAG" WHERE (tag_id=%d AND tag_media_count>0) " #define SELECT_MEDIA_COUNT_FROM_PLAYLIST "SELECT COUNT(*) FROM "DB_VIEW_PLAYLIST" WHERE (playlist_id=%d and playlist_media_count>0) " @@ -552,54 +552,60 @@ int _media_filter_build_option(filter_h filter, char **result); #define media_content_gettid() syscall(__NR_gettid) -#define media_content_retv_if(expr, val) do { \ +#define content_retv_if(expr, val) do { \ if (expr) { \ LOGE(FONT_COLOR_RED"[%ld]"FONT_COLOR_RESET, media_content_gettid()); \ return (val); \ } \ } while (0) -#define media_content_retvm_if(expr, val, fmt, arg...) do { \ +#define content_retvm_if(expr, val, fmt, arg...) do { \ if (expr) { \ LOGE(FONT_COLOR_RED"[%ld]"fmt""FONT_COLOR_RESET, media_content_gettid(), ##arg); \ return (val); \ } \ } while (0) -#define media_content_warn(fmt, arg...) do { \ +#define content_retip_if_fail(expr) do { \ + if (!(expr)) { \ + LOGE(FONT_COLOR_RED"[%ld] Invalid [%s]"FONT_COLOR_RESET, media_content_gettid(), #expr); \ + return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; \ + } \ + } while (0) + +#define content_retipm_if_fail(expr, fmt, arg...) do { \ + if (!(expr)) { \ + LOGE(FONT_COLOR_RED"[%ld] Cond[%s] value["fmt"]"FONT_COLOR_RESET, media_content_gettid(), #expr, ##arg); \ + return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; \ + } \ + } while (0) + +#define content_warn(fmt, arg...) do { \ LOGW(FONT_COLOR_GREEN"[%ld]"fmt""FONT_COLOR_RESET, media_content_gettid(), ##arg); \ } while (0) -#define media_content_debug(fmt, arg...) do { \ +#define content_debug(fmt, arg...) do { \ LOGD(FONT_COLOR_RESET"[%ld]"fmt"", media_content_gettid(), ##arg); \ } while (0) -#define media_content_info(fmt, arg...) do { \ +#define content_info(fmt, arg...) do { \ LOGI(FONT_COLOR_GREEN"[%ld]"fmt""FONT_COLOR_RESET, media_content_gettid(), ##arg); \ } while (0) -#define media_content_error(fmt, arg...) do { \ +#define content_error(fmt, arg...) do { \ LOGE(FONT_COLOR_RED"[%ld]"fmt""FONT_COLOR_RESET, media_content_gettid(), ##arg); \ } while (0) -#define media_content_debug_func() do { \ - LOGD(FONT_COLOR_RESET"[%ld]", media_content_gettid()); \ - } while (0) - -#define media_content_sec_debug(fmt, arg...) do { \ +#define content_sec_debug(fmt, arg...) do { \ SECURE_LOGD(FONT_COLOR_CYAN"[%ld]"fmt""FONT_COLOR_RESET, media_content_gettid(), ##arg); \ } while (0) -#define media_content_sec_warn(fmt, arg...) do { \ - SECURE_LOGW(FONT_COLOR_RED"[%ld]"fmt""FONT_COLOR_RESET, media_content_gettid(), ##arg); \ - } while (0) - -#define media_content_sec_error(fmt, arg...) do { \ +#define content_sec_error(fmt, arg...) do { \ SECURE_LOGE(FONT_COLOR_RED"[%ld]"fmt""FONT_COLOR_RESET, media_content_gettid(), ##arg); \ } while (0) #define ERR_BUF_LENGTH 256 -#define media_content_stderror(fmt) do { \ +#define content_stderror(fmt) do { \ char media_content_stderror_buf[ERR_BUF_LENGTH] = {0, }; \ strerror_r(errno, media_content_stderror_buf, ERR_BUF_LENGTH); \ LOGE(FONT_COLOR_RED fmt" : STANDARD ERROR [%s]"FONT_COLOR_RESET, media_content_stderror_buf); \