{
int status = bp_common_adaptor_event_manager(arg,
&g_adaptor_noti_cb, &g_adaptor_noti_user_data);
-
+ /* LCOV_EXCL_START */
pthread_mutex_lock(&g_adaptor_mutex);
g_adaptor_event_thread_pid = 0; // set 0 to not call pthread_cancel
if (status >= 0) {
}
}
TRACE_DEBUG("callback thread is end by deinit");
+ /* LCOV_EXCL_STOP */
return 0;
}
if (bp_common_adaptor_connect_to_provider(&g_adaptorinfo,
client_type) < 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CHECK connection]");
return -1;
+ /* LCOV_EXCL_STOP */
}
}
g_bp_command.cmd = BP_CMD_NONE;
if (g_adaptorinfo != NULL)
g_bp_command.cid = g_adaptorinfo->cid;
else
- g_bp_command.cid = 0;
+ g_bp_command.cid = 0; //LCOV_EXCL_LINE
if (callback == 1 && g_adaptor_event_thread_pid <= 0) {
// create thread here ( getting event_socket )
if (pthread_create(&g_adaptor_event_thread_pid, NULL,
__bookmark_adaptor_event_manager, g_adaptorinfo) != 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CRITICAL] pthread_create");
return -1;
+ /* LCOV_EXCL_STOP */
}
pthread_detach(g_adaptor_event_thread_pid);
TRACE_DEBUG("pthread:%0x", (int)g_adaptor_event_thread_pid);
}
return 0;
}
-
+/* LCOV_EXCL_START */
static int __bp_bookmark_adaptor_get_ids_p(int id, int **ids,
int *count, bp_command_defs cmd)
{
*count = ids_count;
return 0;
}
-
+/* LCOV_EXCL_STOP */
static int __bp_bookmark_adaptor_get_string(const int id,
bp_command_defs cmd, char **value)
{
g_bp_command.id = id;
int ret = bp_common_adaptor_get_string(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
g_bp_command.id = id;
int ret = bp_common_adaptor_get_int(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
g_bp_command.id = id;
int ret = bp_common_adaptor_set_string(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
g_bp_command.id = id;
int ret = bp_common_adaptor_set_int(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
return -1;
+ /* LCOV_EXCL_STOP */
}
return 0;
}
{
pthread_mutex_lock(&g_adaptor_mutex);
if (__browser_adaptor_connect(0) < 0) {
+ /* LCOV_EXCL_START */
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
int sock = BP_CHECK_IPC_SOCK;
}
// caller should free ids fully
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_full_ids_p(int **ids, int *count)
{
return __bp_bookmark_adaptor_get_ids_p
(-1, BP_CMD_COMMON_CLEAR_DELETED_IDS);
}
+int bp_bookmark_adaptor_set_sync(const int id, const char *value)
+{
+ return __bp_bookmark_adaptor_set_string
+ (id, BP_CMD_COMMON_SET_SYNC, value);
+}
+
+int bp_bookmark_adaptor_get_sync(const int id, char **value)
+{
+ return __bp_bookmark_adaptor_get_string
+ (id, BP_CMD_COMMON_GET_SYNC, value);
+}
+/* LCOV_EXCL_STOP */
+
int bp_bookmark_adaptor_set_data_changed_cb(
bp_bookmark_adaptor_data_changed_cb callback, void *user_data)
{
return -1;
}
if (g_adaptor_event_thread_pid <= 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CRITICAL] callback is setted, but event manager not work");
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;
}
bookmark_id = bp_adaptor_ipc_read_int(sock);
if (bookmark_id < 0) {
+ /* LCOV_EXCL_START */
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(*id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (*id == bookmark_id) {
- TRACE_INFO("created a bookmark:%d", *id);
+ TRACE_INFO("created a bookmark:%d", *id); //LCOV_EXCL_LINE
} else {
*id = bookmark_id;
TRACE_INFO("created new bookmark:%d", *id);
{
switch (errorcode) {
case BP_ERROR_INVALID_PARAMETER:
- return BP_BOOKMARK_ERROR_INVALID_PARAMETER;
+ return BP_BOOKMARK_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
case BP_ERROR_OUT_OF_MEMORY:
- return BP_BOOKMARK_ERROR_OUT_OF_MEMORY;
+ return BP_BOOKMARK_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
case BP_ERROR_IO_EINTR:
case BP_ERROR_IO_EAGAIN:
case BP_ERROR_IO_ERROR:
- return BP_BOOKMARK_ERROR_IO_ERROR;
+ return BP_BOOKMARK_ERROR_IO_ERROR; //LCOV_EXCL_LINE
case BP_ERROR_NO_DATA:
- return BP_BOOKMARK_ERROR_NO_DATA;
+ return BP_BOOKMARK_ERROR_NO_DATA; //LCOV_EXCL_LINE
case BP_ERROR_ID_NOT_FOUND:
- return BP_BOOKMARK_ERROR_ID_NOT_FOUND;
+ return BP_BOOKMARK_ERROR_ID_NOT_FOUND; //LCOV_EXCL_LINE
case BP_ERROR_DUPLICATED_ID:
- return BP_BOOKMARK_ERROR_DUPLICATED_ID;
+ return BP_BOOKMARK_ERROR_DUPLICATED_ID; //LCOV_EXCL_LINE
case BP_ERROR_PERMISSION_DENY:
- return BP_BOOKMARK_ERROR_PERMISSION_DENY;
+ return BP_BOOKMARK_ERROR_PERMISSION_DENY; //LCOV_EXCL_LINE
case BP_ERROR_DISK_FULL:
- return BP_BOOKMARK_ERROR_DISK_FULL;
+ return BP_BOOKMARK_ERROR_DISK_FULL; //LCOV_EXCL_LINE
case BP_ERROR_DISK_BUSY:
- return BP_BOOKMARK_ERROR_DISK_BUSY;
+ return BP_BOOKMARK_ERROR_DISK_BUSY; //LCOV_EXCL_LINE
case BP_ERROR_TOO_BIG_DATA:
- return BP_BOOKMARK_ERROR_TOO_BIG_DATA;
+ return BP_BOOKMARK_ERROR_TOO_BIG_DATA; //LCOV_EXCL_LINE
case BP_ERROR_UNKNOWN:
- return BP_BOOKMARK_ERROR_UNKNOWN;
+ return BP_BOOKMARK_ERROR_UNKNOWN; //LCOV_EXCL_LINE
default:
break;
}
return __bp_bookmark_adaptor_get_int
(id, BP_CMD_BOOKMARK_GET_TYPE, value);
}
-
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_parent_id(const int id, int *value)
{
return __bp_bookmark_adaptor_get_int
(id, BP_CMD_BOOKMARK_GET_PARENT, value);
}
+/* LCOV_EXCL_STOP */
int bp_bookmark_adaptor_get_url(const int id, char **value)
{
(id, BP_CMD_COMMON_GET_URL, value);
}
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_title(const int id, char **value)
{
return __bp_bookmark_adaptor_get_string
return __bp_bookmark_adaptor_get_int
(id, BP_CMD_BOOKMARK_GET_IS_OPERATOR, value);
}
+/* LCOV_EXCL_STOP */
int bp_bookmark_adaptor_get_access_count(const int id, int *value)
{
(id, BP_CMD_COMMON_GET_DEVICE_ID, value);
}
-int bp_bookmark_adaptor_get_sync(const int id, char **value)
-{
- return __bp_bookmark_adaptor_get_string
- (id, BP_CMD_COMMON_GET_SYNC, value);
-}
-
int bp_bookmark_adaptor_set_type(const int id, const int value)
{
return __bp_bookmark_adaptor_set_int
(id, BP_CMD_COMMON_SET_DEVICE_ID, value);
}
-int bp_bookmark_adaptor_set_sync(const int id, const char *value)
-{
- return __bp_bookmark_adaptor_set_string
- (id, BP_CMD_COMMON_SET_SYNC, value);
-}
-
int bp_bookmark_adaptor_easy_create(int *id, bp_bookmark_info_fmt *info)
{
if (id == NULL || info == NULL)
return -1;
}
if (*id <= 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[failed to create new bookmark]");
return -1;
+ /* LCOV_EXCL_STOP */
}
}
// send command without waiting return value
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(*id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 1. send bp_bookmark_base_fmt structure
if (bp_ipc_send_custom_type(sock, &new_base_info,
sizeof(bp_bookmark_base_fmt)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(*id, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 2. wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (info->device_id != NULL)
bp_bookmark_adaptor_set_device_id(*id, info->device_id);
if (info->sync != NULL)
- bp_bookmark_adaptor_set_sync(*id, info->sync);
+ bp_bookmark_adaptor_set_sync(*id, info->sync); //LCOV_EXCL_LINE
if (info->favicon_length > 0 && info->favicon != NULL) {
bp_bookmark_adaptor_set_icon(*id, info->favicon_width,
bp_bookmark_offset oflags = offset;
if (bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_bookmark_offset)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(id, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 2. wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
bp_bookmark_base_fmt bookmark;
memset(&bookmark, 0x00, sizeof(bp_bookmark_base_fmt));
// getting bp_tab_base_fmt from provider.
if (bp_ipc_read_custom_type(sock, &bookmark,
sizeof(bp_bookmark_base_fmt)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
memset(info, 0x00, sizeof(bp_bookmark_info_fmt));
// get strings . keep the order with provider
if (offset & BP_BOOKMARK_O_URL) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->url = bp_ipc_read_string(sock);
+ info->url = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_TITLE) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->title = bp_ipc_read_string(sock);
+ info->title = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_ACCOUNT_NAME) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->account_name = bp_ipc_read_string(sock);
+ info->account_name = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_ACCOUNT_TYPE) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->account_type = bp_ipc_read_string(sock);
+ info->account_type = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_DEVICE_NAME) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->device_name = bp_ipc_read_string(sock);
+ info->device_name = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_DEVICE_ID) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->device_id = bp_ipc_read_string(sock);
+ info->device_id = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_SYNC) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->sync = bp_ipc_read_string(sock);
+ info->sync = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_ICON) {
info->favicon_length = 0;
info->favicon_width = bookmark.favicon_width;
info->favicon_height = bookmark.favicon_height;
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
unsigned char *blob_data = NULL;
if ((info->favicon_length =
bp_common_adaptor_get_info_blob(sock, &blob_data,
&g_adaptorinfo->shm)) > 0 && blob_data != NULL)
info->favicon = blob_data;
+ /* LCOV_EXCL_STOP */
}
}
if (offset & BP_BOOKMARK_O_SNAPSHOT) {
info->thumbnail_width = bookmark.thumbnail_width;
info->thumbnail_height = bookmark.thumbnail_height;
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
unsigned char *blob_data = NULL;
if ((info->thumbnail_length =
bp_common_adaptor_get_info_blob(sock, &blob_data,
&g_adaptorinfo->shm)) > 0 && blob_data != NULL)
info->thumbnail = blob_data;
+ /* LCOV_EXCL_STOP */
}
}
if (offset & BP_BOOKMARK_O_WEBICON) {
info->webicon_width = bookmark.webicon_width;
info->webicon_height = bookmark.webicon_height;
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
unsigned char *blob_data = NULL;
if ((info->webicon_length =
bp_common_adaptor_get_info_blob(sock, &blob_data,
&g_adaptorinfo->shm)) > 0 && blob_data != NULL)
info->webicon = blob_data;
+ /* LCOV_EXCL_STOP */
}
}
sizeof(bp_bookmark_rows_cond_fmt)) < 0 ||
bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_bookmark_offset)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (oflags > 0) {
if (bp_adaptor_ipc_send_int(sock, is_like) < 0 ||
bp_ipc_send_string(sock, keyword) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
return 0;
}
return -1;
+ /* LCOV_EXCL_STOP */
}
// int count.
int ids_count = bp_adaptor_ipc_read_int(sock);
if (ids_count < BP_MAX_IDS_COUNT && ids_count > 0) {
int *idlist = (int *)calloc(ids_count, sizeof(int));
if (idlist == NULL) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_OUT_OF_MEMORY;
BP_PRINT_ERROR(-1, errorcode);
if (bp_common_adaptor_clear_read_buffer(sock,
}
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// getting ids array from provider
if (bp_ipc_read_blob(sock, idlist,
(sizeof(int) * ids_count)) < 0) {
+ /* LCOV_EXCL_START */
free(idlist);
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
*ids = idlist;
*count = ids_count;
} else {
+ /* LCOV_EXCL_START */
*ids = NULL;
*count = 0;
+ /* LCOV_EXCL_STOP */
}
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;
}
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_timestamp_ids_p(
int **ids, int *count,
const bp_bookmark_property_cond_fmt *properties, //if NULL, ignore
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;
}
+/* LCOV_EXCL_STOP */
int bp_bookmark_adaptor_backup(char *value)
{
return __bp_bookmark_adaptor_set_string
(-1, BP_CMD_BOOKMARK_RESTORE, value);
}
-
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_ids_p(
int **ids, int *count, const int limit, const int offset,
const int parent, const int type,
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;
}
+/* LCOV_EXCL_STOP */
int bp_bookmark_adaptor_get_cond_ids_p(
int **ids, int *count,
BP_CMD_COMMON_GET_CONDS_DATE_IDS, ids, count, properties,
conds, check_offset, keyword, is_like);
}
-
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_raw_retrieved_ids_p(
int **ids, int *count,
bp_bookmark_property_cond_fmt *properties,
BP_CMD_COMMON_GET_CONDS_RAW_IDS, ids, count, properties,
conds, check_offset, keyword, is_like);
}
+/* LCOV_EXCL_STOP */
//////////////// internet_bookmark_xxx APIs
static void *__history_adaptor_event_manager(void *arg)
{
int status = bp_common_adaptor_event_manager(arg, NULL, NULL);
-
+ /* LCOV_EXCL_START */
pthread_mutex_lock(&g_adaptor_mutex);
g_adaptor_event_thread_pid = 0; // set 0 to not call pthread_cancel
if (status >= 0) {
}
}
pthread_mutex_unlock(&g_adaptor_mutex);
-
+ /* LCOV_EXCL_STOP */
// Todo : the codes for cloud
TRACE_DEBUG("callback thread is end by deinit");
if (bp_common_adaptor_connect_to_provider(&g_adaptorinfo,
client_type) < 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CHECK connection]");
return -1;
+ /* LCOV_EXCL_STOP */
}
}
g_bp_command.cmd = BP_CMD_NONE;
if (g_adaptorinfo != NULL)
g_bp_command.cid = g_adaptorinfo->cid;
else
- g_bp_command.cid = 0;
+ g_bp_command.cid = 0; //LCOV_EXCL_LINE
if (callback == 1 && g_adaptor_event_thread_pid <= 0) {
// create thread here ( getting event_socket )
if (pthread_create(&g_adaptor_event_thread_pid, NULL,
__history_adaptor_event_manager, g_adaptorinfo) != 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CRITICAL] pthread_create");
return -1;
+ /* LCOV_EXCL_STOP */
}
pthread_detach(g_adaptor_event_thread_pid);
TRACE_DEBUG("pthread:%0x", (int)g_adaptor_event_thread_pid);
g_bp_command.id = id;
int ret = bp_common_adaptor_get_string(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
g_bp_command.id = id;
int ret = bp_common_adaptor_get_int(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
g_bp_command.id = id;
int ret = bp_common_adaptor_set_string(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
g_bp_command.id = id;
int ret = bp_common_adaptor_set_int(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
g_bp_command.id = id;
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
return -1;
+ /* LCOV_EXCL_STOP */
}
return 0;
}
-
+/* LCOV_EXCL_START */
static int __bp_history_adaptor_get_blob_shm(const int id,
bp_command_defs cmd, int *width, int *height, unsigned char **value,
int *length)
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
-
+/* LCOV_EXCL_STOP */
static int __bp_history_adaptor_set_blob_shm(const int id,
bp_command_defs cmd, const int width, const int height,
const unsigned char *value, const int length)
int ret = bp_common_adaptor_set_blob_shm(sock, &g_bp_command, width,
height, value, length, &errorcode, &g_adaptorinfo->shm);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(*id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
history_id = bp_adaptor_ipc_read_int(sock);
if (history_id < 0) {
+ /* LCOV_EXCL_START */
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(*id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (*id == history_id) {
TRACE_INFO("created a history:%d", *id);
{
if (id < 0)
return -1;
- return __bp_history_adaptor_send_cmd(id, BP_CMD_COMMON_DELETE);
+ return __bp_history_adaptor_send_cmd(id, BP_CMD_COMMON_DELETE); //LCOV_EXCL_LINE
}
int bp_history_adaptor_get_errorcode(void)
{
switch (errorcode) {
case BP_ERROR_INVALID_PARAMETER:
- return BP_HISTORY_ERROR_INVALID_PARAMETER;
+ return BP_HISTORY_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
case BP_ERROR_OUT_OF_MEMORY:
- return BP_HISTORY_ERROR_OUT_OF_MEMORY;
+ return BP_HISTORY_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
case BP_ERROR_IO_EINTR:
case BP_ERROR_IO_EAGAIN:
case BP_ERROR_IO_ERROR:
- return BP_HISTORY_ERROR_IO_ERROR;
+ return BP_HISTORY_ERROR_IO_ERROR; //LCOV_EXCL_LINE
case BP_ERROR_NO_DATA:
- return BP_HISTORY_ERROR_NO_DATA;
+ return BP_HISTORY_ERROR_NO_DATA; //LCOV_EXCL_LINE
case BP_ERROR_ID_NOT_FOUND:
- return BP_HISTORY_ERROR_ID_NOT_FOUND;
+ return BP_HISTORY_ERROR_ID_NOT_FOUND; //LCOV_EXCL_LINE
case BP_ERROR_DUPLICATED_ID:
- return BP_HISTORY_ERROR_DUPLICATED_ID;
+ return BP_HISTORY_ERROR_DUPLICATED_ID; //LCOV_EXCL_LINE
case BP_ERROR_PERMISSION_DENY:
- return BP_HISTORY_ERROR_PERMISSION_DENY;
+ return BP_HISTORY_ERROR_PERMISSION_DENY; //LCOV_EXCL_LINE
case BP_ERROR_DISK_FULL:
- return BP_HISTORY_ERROR_DISK_FULL;
+ return BP_HISTORY_ERROR_DISK_FULL; //LCOV_EXCL_LINE
case BP_ERROR_DISK_BUSY:
- return BP_HISTORY_ERROR_DISK_BUSY;
+ return BP_HISTORY_ERROR_DISK_BUSY; //LCOV_EXCL_LINE
case BP_ERROR_TOO_BIG_DATA:
- return BP_HISTORY_ERROR_TOO_BIG_DATA;
+ return BP_HISTORY_ERROR_TOO_BIG_DATA; //LCOV_EXCL_LINE
case BP_ERROR_UNKNOWN:
- return BP_HISTORY_ERROR_UNKNOWN;
+ return BP_HISTORY_ERROR_UNKNOWN; //LCOV_EXCL_LINE
default:
break;
}
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (bp_ipc_send_custom_type(sock, &conds,
sizeof(bp_db_base_conds_fmt)) < 0 ||
bp_adaptor_ipc_send_int(sock, size) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
return -1;
+ /* LCOV_EXCL_STOP */
}
return 0;
}
if (*id <= 0) { // new history
if (bp_history_adaptor_create(id) < 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[failed to create new history]");
return -1;
+ /* LCOV_EXCL_STOP */
}
if (*id <= 0) {
TRACE_ERROR("[failed to create new history]");
// send command without waiting return value
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 1. oflags
unsigned int oflags = offset;
if (bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_history_offset)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(id, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 2. wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
bp_history_info_fmt history;
memset(&history, 0x00, sizeof(bp_history_info_fmt));
// getting bp_tab_base_fmt from provider.
if (bp_ipc_read_custom_type(sock, &history,
sizeof(bp_history_info_fmt)) < 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CHECK IO] (%d)", id);
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(id, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
memset(info, 0x00, sizeof(bp_history_info_fmt));
errorcode = bp_ipc_simple_response(sock, cmd);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
bp_history_offset oflags = date_column_offset;
if (bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_history_offset)) < 0 ||
bp_adaptor_ipc_send_int(sock, date_type) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
return 0;
}
return -1;
+ /* LCOV_EXCL_STOP */
}
int recv_int = bp_adaptor_ipc_read_int(sock);
TRACE_DEBUG("response ids count:%d", recv_int);
if (recv_int < 0) {
+ /* LCOV_EXCL_START */
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
pthread_mutex_unlock(&g_adaptor_mutex);
*count = recv_int;
if (conds != NULL)
memcpy(&t_conds, conds, sizeof(bp_history_rows_cond_fmt));
else
- t_conds.limit = -1;
+ t_conds.limit = -1; //LCOV_EXCL_LINE
errorcode = bp_ipc_simple_response(sock, cmd);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
bp_history_offset oflags = check_offset;
if (keyword == NULL)
- oflags = 0;
+ oflags = 0; //LCOV_EXCL_LINE
if (bp_ipc_send_custom_type(sock, &t_conds,
sizeof(bp_history_rows_cond_fmt)) < 0 ||
bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_history_offset)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (oflags > 0) {
if (bp_adaptor_ipc_send_int(sock, is_like) < 0 ||
bp_ipc_send_string(sock, keyword) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
return 0;
}
return -1;
+ /* LCOV_EXCL_STOP */
}
// int count.
int ids_count = bp_adaptor_ipc_read_int(sock);
if (ids_count < BP_MAX_IDS_COUNT && ids_count > 0) {
int *idlist = (int *)calloc(ids_count, sizeof(int));
if (idlist == NULL) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_OUT_OF_MEMORY;
BP_PRINT_ERROR(-1, errorcode);
if (bp_common_adaptor_clear_read_buffer(sock,
}
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// getting ids array from provider
if (bp_ipc_read_blob(sock, idlist,
(sizeof(int) * ids_count)) < 0) {
+ /* LCOV_EXCL_START */
free(idlist);
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
*ids = idlist;
*count = ids_count;
if (limits != NULL)
memcpy(&t_limits, limits, sizeof(bp_history_rows_fmt));
else
- t_limits.limit = -1;
+ t_limits.limit = -1; //LCOV_EXCL_LINE
errorcode = bp_ipc_simple_response(sock, cmd);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (bp_ipc_send_custom_type(sock, &t_limits,
sizeof(bp_history_rows_fmt)) < 0 ||
bp_adaptor_ipc_send_int(sock, times_count) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (times_count > 0) {
int i = 0;
(bp_history_timestamp_fmt *)(times + i);
if (bp_ipc_send_custom_type(sock, timestamps,
sizeof(bp_history_timestamp_fmt)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
}
}
unsigned int oflags = check_offset;
if (keyword == NULL)
- oflags = 0;
+ oflags = 0; //LCOV_EXCL_LINE
if (bp_ipc_send_custom_type(sock, &oflags,
sizeof(unsigned int)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (oflags > 0) {
if (bp_adaptor_ipc_send_int(sock, is_like) < 0 ||
bp_ipc_send_string(sock, keyword) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
return 0;
}
return -1;
+ /* LCOV_EXCL_STOP */
}
// int count.
int ids_count = bp_adaptor_ipc_read_int(sock);
if (ids_count < BP_MAX_IDS_COUNT && ids_count > 0) {
int *idlist = (int *)calloc(ids_count, sizeof(int));
if (idlist == NULL) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_OUT_OF_MEMORY;
BP_PRINT_ERROR(-1, errorcode);
if (bp_common_adaptor_clear_read_buffer(sock,
}
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// getting ids array from provider
if (bp_ipc_read_blob(sock, idlist,
(sizeof(int) * ids_count)) < 0) {
+ /* LCOV_EXCL_START */
free(idlist);
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
*ids = idlist;
*count = ids_count;
} else {
+ /* LCOV_EXCL_START */
*ids = NULL;
*count = 0;
+ /* LCOV_EXCL_STOP */
}
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;