#define LOG_TAG "CAPI_CONTENT_MEDIA_CONTENT"
-#define SAFE_STRLCPY(dst, src, n) ((g_strlcpy(dst, src, n) < n) ? TRUE : FALSE)
+#define SAFE_STRLCPY(dst, src, n) g_strlcpy(dst, src, n);
#define SAFE_STRLCAT(dst, src, n) g_strlcat(dst, src, n);
#define SAFE_FREE(src) {if (src) {free(src); src = NULL; } }
#define STRING_VALID(str) ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
#define MAX_QUERY_SIZE 4096
#define MAX_PATH_LEN 4096
#define DEFAULT_QUERY_SIZE 1024
-#define COLLATE_STR_SIZE 32
#define MEDIA_CONTENT_UUID_SIZE 36
#define BATCH_REQUEST_MAX 300
#define DB_FIELD_MEDIA_LATITUDE "media_latitude"
#define DB_FIELD_MEDIA_ALTITUDE "media_altitude"
-/* DB Query Keyword */
-#define QUERY_KEYWORD_AND "AND "
-#define QUERY_KEYWORD_OR "OR "
-#define QUERY_KEYWORD_ORDER_BY "ORDER BY "
-#define QUERY_KEYWORD_LIMIT "limit"
-#define QUERY_KEYWORD_DESC "DESC"
-#define QUERY_KEYWORD_SPACE " "
-#define QUERY_KEYWORD_OPEN_BRACKET "("
-#define QUERY_KEYWORD_BRACKET ")"
-#define QUERY_KEYWORD_COLLATE " COLLATE "
-
/* DB TABLE JOIN */
#define FOLDER_MEDIA_JOIN DB_TABLE_FOLDER" NATURAL LEFT OUTER JOIN "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
#define BOOKMARK_MEDIA_JOIN DB_TABLE_BOOKMARK" NATURAL JOIN "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
/*count(distinct x) count only non-null values, but select distinct X returns include null. so sync the result of count and list, don't use count(distinct x)*/
/* Get Media Count of Group */
-#define SELECT_MEDIA_COUNT_FROM_MEDIA "SELECT COUNT(*) FROM ("SELECT_MEDIA_ITEM /*to apply limit condition. "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity=1" */
+#define SELECT_MEDIA_COUNT_FROM_MEDIA "SELECT COUNT(*) FROM (SELECT media_id FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
+#define SELECT_MEDIA_COUNT_FROM_MEDIA_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_MEDIA"AND storage_uuid='%s' "
#define SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
#define SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE"AND storage_uuid='%s' "
#define SELECT_MEDIA_COUNT_FROM_ALBUM "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND album_id='%d' "
#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_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); \