apply Tizen coding style 91/162991/3 accepted/tizen/unified/20171212.171943 submit/tizen/20171212.055942
authorYoungjae Shin <yj99.shin@samsung.com>
Wed, 6 Dec 2017 23:35:11 +0000 (08:35 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Thu, 7 Dec 2017 01:29:32 +0000 (10:29 +0900)
Change-Id: Ia232b204abeff0b8b17ee2336520a842887854e6

30 files changed:
bookmark-adaptor/CMakeLists.txt
bookmark-adaptor/bookmark-adaptor.c
bookmark-adaptor/include/web_bookmark.h
bookmark-adaptor/include/web_bookmark_product.h
bookmark-csc-adaptor/CMakeLists.txt
bookmark-csc-adaptor/bookmark-csc-adaptor.c
bookmark-csc-adaptor/include/web_bookmark_csc.h
common-adaptor/common-adaptor-png.c
common-adaptor/common-adaptor.c
common-adaptor/include/common-adaptor.h
doc/web_bookmark_doc.h
doc_prod/web_bookmark_csc_doc.h
history-adaptor/CMakeLists.txt
history-adaptor/history-adaptor.c
history-adaptor/include/web_history.h
provider/CMakeLists.txt
provider/browser-provider-bookmarks.c
provider/browser-provider-db.c
provider/browser-provider-history.c
provider/browser-provider-main.c
provider/browser-provider-notify.c
provider/browser-provider-requests-manager.c
provider/browser-provider-requests.c
provider/browser-provider-socket.c
provider/browser-provider-tabs.c
provider/include/browser-provider-log.h
provider/include/browser-provider-socket.h
tab-adaptor/CMakeLists.txt
tab-adaptor/include/web_tab.h
tab-adaptor/tab-adaptor.c

index a21d39c696ec3b9d4da877bf756a0849dd705c2a..a2687772149daa3efe7e36675ac26db575933e40 100755 (executable)
@@ -39,7 +39,7 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED
        ${CMAKE_SOURCE_DIR}/provider/browser-provider-socket.c
        ${CMAKE_SOURCE_DIR}/provider/browser-provider-shm.c
        ${CMAKE_CURRENT_SOURCE_DIR}/bookmark-adaptor-image.c
-       ${CMAKE_CURRENT_SOURCE_DIR}/bookmark-adaptor.c )
+       ${CMAKE_CURRENT_SOURCE_DIR}/bookmark-adaptor.c)
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bookmark_adaptor_pkgs_LDFLAGS} ${BOOKMARK_LINK_LIBRARIES})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${PKG_VERSION})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0)
index e642d14c4dc9eca49e732bb9f10f0bf7c6a855d9..2a2e3786394b1e1453a3c55f9f75ecc221eb078a 100755 (executable)
@@ -74,7 +74,7 @@ int __browser_adaptor_disconnect(void)
 {
        TRACE_DEBUG("pthread:%0x", (int)g_adaptor_event_thread_pid);
        return bp_common_adaptor_disconnect(&g_adaptorinfo,
-               &g_adaptor_event_thread_pid);
+                       &g_adaptor_event_thread_pid);
 }
 
 int __browser_adaptor_connect(int callback)
@@ -95,11 +95,11 @@ int __browser_adaptor_connect(int callback)
        }
        g_bp_command.cmd = BP_CMD_NONE;
        g_bp_command.id = -1;
-       if(g_adaptorinfo != NULL) {
-           g_bp_command.cid = g_adaptorinfo->cid;
-       } else {
-           g_bp_command.cid = 0;
-       }
+       if (g_adaptorinfo != NULL)
+               g_bp_command.cid = g_adaptorinfo->cid;
+       else
+               g_bp_command.cid = 0;
+
        if (callback == 1 && g_adaptor_event_thread_pid <= 0) {
                // create thread here ( getting event_socket )
                if (pthread_create(&g_adaptor_event_thread_pid, NULL,
@@ -324,8 +324,8 @@ int bp_bookmark_adaptor_clear_deleted_ids(void)
                (-1, BP_CMD_COMMON_CLEAR_DELETED_IDS);
 }
 
-int bp_bookmark_adaptor_set_data_changed_cb
-       (bp_bookmark_adaptor_data_changed_cb callback, void *user_data)
+int bp_bookmark_adaptor_set_data_changed_cb(
+       bp_bookmark_adaptor_data_changed_cb callback, void *user_data)
 {
        if (callback == NULL) {
                TRACE_ERROR("check callback address:%p", callback);
@@ -337,8 +337,8 @@ int bp_bookmark_adaptor_set_data_changed_cb
        return __bp_bookmark_adaptor_send_cmd(-1, BP_CMD_SET_NOTI_CB);
 }
 
-int bp_bookmark_adaptor_unset_data_changed_cb
-       (bp_bookmark_adaptor_data_changed_cb callback)
+int bp_bookmark_adaptor_unset_data_changed_cb(
+       bp_bookmark_adaptor_data_changed_cb callback)
 {
        if (callback != NULL && callback == g_adaptor_noti_cb) {
                g_adaptor_noti_cb = NULL;
@@ -440,7 +440,7 @@ int bp_bookmark_adaptor_delete(const int id)
 
 int bp_bookmark_adaptor_get_errorcode(void)
 {
-       switch(errorcode) {
+       switch (errorcode) {
        case BP_ERROR_INVALID_PARAMETER:
                return BP_BOOKMARK_ERROR_INVALID_PARAMETER;
        case BP_ERROR_OUT_OF_MEMORY:
@@ -808,33 +808,33 @@ int bp_bookmark_adaptor_get_info(const int id,
        memset(info, 0x00, sizeof(bp_bookmark_info_fmt));
 
        // fill info
-       if (offset & BP_BOOKMARK_O_TYPE) {
+       if (offset & BP_BOOKMARK_O_TYPE)
                info->type = bookmark.type;
-       }
-       if (offset & BP_BOOKMARK_O_PARENT) {
+
+       if (offset & BP_BOOKMARK_O_PARENT)
                info->parent = bookmark.parent;
-       }
-       if (offset & BP_BOOKMARK_O_SEQUENCE) {
+
+       if (offset & BP_BOOKMARK_O_SEQUENCE)
                info->sequence = bookmark.sequence;
-       }
-       if (offset & BP_BOOKMARK_O_IS_EDITABLE) {
+
+       if (offset & BP_BOOKMARK_O_IS_EDITABLE)
                info->editable = bookmark.editable;
-       }
-       if (offset & BP_BOOKMARK_O_IS_OPERATOR) {
+
+       if (offset & BP_BOOKMARK_O_IS_OPERATOR)
                info->is_operator = bookmark.is_operator;
-       }
-       if (offset & BP_BOOKMARK_O_ACCESS_COUNT) {
+
+       if (offset & BP_BOOKMARK_O_ACCESS_COUNT)
                info->access_count = bookmark.access_count;
-       }
-       if (offset & BP_BOOKMARK_O_DATE_CREATED) {
+
+       if (offset & BP_BOOKMARK_O_DATE_CREATED)
                info->date_created = bookmark.date_created;
-       }
-       if (offset & BP_BOOKMARK_O_DATE_MODIFIED) {
+
+       if (offset & BP_BOOKMARK_O_DATE_MODIFIED)
                info->date_modified = bookmark.date_modified;
-       }
-       if (offset & BP_BOOKMARK_O_DATE_VISITED) {
+
+       if (offset & BP_BOOKMARK_O_DATE_VISITED)
                info->date_visited = bookmark.date_visited;
-       }
+
        // get strings . keep the order with provider
        if (offset & BP_BOOKMARK_O_URL) {
                if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
@@ -924,8 +924,8 @@ int bp_bookmark_adaptor_easy_free(bp_bookmark_info_fmt *info)
        return 0;
 }
 
-static int __bp_bookmark_adaptor_get_cond_ids_p
-       (bp_command_defs pcommand, int **ids, int *count,
+static int __bp_bookmark_adaptor_get_cond_ids_p(
+       bp_command_defs pcommand, int **ids, int *count,
        bp_bookmark_property_cond_fmt *properties,
        bp_bookmark_rows_cond_fmt *conds,
        const bp_bookmark_offset check_offset,
@@ -974,11 +974,11 @@ static int __bp_bookmark_adaptor_get_cond_ids_p
        if (keyword == NULL)
                oflags = 0;
        if (bp_ipc_send_custom_type(sock, &t_properties,
-                       sizeof(bp_bookmark_property_cond_fmt)) < 0 ||
+                               sizeof(bp_bookmark_property_cond_fmt)) < 0 ||
                        bp_ipc_send_custom_type(sock, &t_conds,
-                       sizeof(bp_bookmark_rows_cond_fmt)) < 0 ||
+                               sizeof(bp_bookmark_rows_cond_fmt)) < 0 ||
                        bp_ipc_send_custom_type(sock, &oflags,
-                       sizeof(bp_bookmark_offset)) < 0) {
+                               sizeof(bp_bookmark_offset)) < 0) {
                errorcode = BP_ERROR_IO_ERROR;
                BP_PRINT_ERROR(-1, errorcode);
                __browser_adaptor_disconnect();
@@ -1044,8 +1044,8 @@ static int __bp_bookmark_adaptor_get_cond_ids_p
        return 0;
 }
 
-int bp_bookmark_adaptor_get_timestamp_ids_p
-       (int **ids, int *count,
+int bp_bookmark_adaptor_get_timestamp_ids_p(
+       int **ids, int *count,
        const bp_bookmark_property_cond_fmt *properties, //if NULL, ignore
        const bp_bookmark_rows_fmt *limits,//if NULL, ignore
        const bp_bookmark_timestamp_fmt times[], const int times_count,
@@ -1093,9 +1093,9 @@ int bp_bookmark_adaptor_get_timestamp_ids_p
        }
 
        if (bp_ipc_send_custom_type(sock, &t_properties,
-                       sizeof(bp_bookmark_property_cond_fmt)) < 0 ||
+                               sizeof(bp_bookmark_property_cond_fmt)) < 0 ||
                        bp_ipc_send_custom_type(sock, &t_limits,
-                       sizeof(bp_bookmark_rows_fmt)) < 0 ||
+                               sizeof(bp_bookmark_rows_fmt)) < 0 ||
                        bp_adaptor_ipc_send_int(sock, times_count) < 0) {
                errorcode = BP_ERROR_IO_ERROR;
                BP_PRINT_ERROR(-1, errorcode);
@@ -1201,8 +1201,8 @@ int bp_bookmark_adaptor_restore(char *value)
                (-1, BP_CMD_BOOKMARK_RESTORE, value);
 }
 
-int bp_bookmark_adaptor_get_ids_p
-       (int **ids, int *count, const int limit, const int offset,
+int bp_bookmark_adaptor_get_ids_p(
+       int **ids, int *count, const int limit, const int offset,
        const int parent, const int type,
        const int is_operator, const int is_editable,
        const bp_bookmark_offset order_offset, const int ordering)
@@ -1234,7 +1234,7 @@ int bp_bookmark_adaptor_get_ids_p
        }
 
        if (bp_ipc_send_custom_type(sock, &conds,
-                       sizeof(bp_db_base_conds_fmt)) < 0 ||
+                               sizeof(bp_db_base_conds_fmt)) < 0 ||
                        bp_adaptor_ipc_send_int(sock, parent) < 0 ||
                        bp_adaptor_ipc_send_int(sock, type) < 0 ||
                        bp_adaptor_ipc_send_int(sock, is_operator) < 0 ||
@@ -1294,34 +1294,34 @@ int bp_bookmark_adaptor_get_ids_p
        return 0;
 }
 
-int bp_bookmark_adaptor_get_cond_ids_p
-       (int **ids, int *count,
+int bp_bookmark_adaptor_get_cond_ids_p(
+       int **ids, int *count,
        bp_bookmark_property_cond_fmt *properties,
        bp_bookmark_rows_cond_fmt *conds,
        const bp_bookmark_offset check_offset,
        const char *keyword, const int is_like)
 {
-       return __bp_bookmark_adaptor_get_cond_ids_p
-               (BP_CMD_COMMON_GET_CONDS_DATE_IDS, ids, count, properties,
+       return __bp_bookmark_adaptor_get_cond_ids_p(
+               BP_CMD_COMMON_GET_CONDS_DATE_IDS, ids, count, properties,
                conds, check_offset, keyword, is_like);
 }
 
-int bp_bookmark_adaptor_get_raw_retrieved_ids_p
-       (int **ids, int *count,
+int bp_bookmark_adaptor_get_raw_retrieved_ids_p(
+       int **ids, int *count,
        bp_bookmark_property_cond_fmt *properties,
        bp_bookmark_rows_cond_fmt *conds,
        const bp_bookmark_offset check_offset,
        const char *keyword, const int is_like)
 {
-       return __bp_bookmark_adaptor_get_cond_ids_p
-               (BP_CMD_COMMON_GET_CONDS_RAW_IDS, ids, count, properties,
+       return __bp_bookmark_adaptor_get_cond_ids_p(
+               BP_CMD_COMMON_GET_CONDS_RAW_IDS, ids, count, properties,
                conds, check_offset, keyword, is_like);
 }
 
 //////////////// internet_bookmark_xxx APIs
 
 // removing an item without corresponding sub items. remain this code just for reference.
-/*
+#if 0
 int bp_bookmark_adaptor_remove(const int id, const int remove_flag)
 {
        // workaround API for WEBAPI TC(favorite api)
@@ -1351,7 +1351,7 @@ int bp_bookmark_adaptor_remove(const int id, const int remove_flag)
        }
        return bp_bookmark_adaptor_delete(id);
 }
-*/
+#endif
 
 int bp_bookmark_adaptor_reset(void)
 {
index d6983a8aa1616a6f796a6d201209e85a028d6bc7..c0aabd66c89657a3625169ea6e6395028c08b553 100755 (executable)
@@ -234,8 +234,8 @@ typedef enum {
  * @brief The structure type that includes the variables for all properties.
  * @since_tizen 2.3
  * @remarks The caller only has to access the variables that are related to the bookmark_offset. \n
- *                     The caller has to initialize the structure before using it.\n
- *                     The caller has to free the memory of the structure allocated by bp_bookmark_adaptor_get_info().
+ *                     The caller has to initialize the structure before using it.\n
+ *                     The caller has to free the memory of the structure allocated by bp_bookmark_adaptor_get_info().
  */
 typedef struct {
        int type;                               /**< Type @c 0: bookmark @c 1: folder */
@@ -263,7 +263,7 @@ typedef struct {
        char *device_name;      /**< Device name of cloud sync from which the bookmark originated */
        char *device_id;        /**< Device ID of cloud sync from which the bookmark originated */
        unsigned char *favicon;         /**< Raw data of the icon ( favorites icon ) */
-       unsigned char *thumbnail;       /**< Raw data of the snapshot */
+       unsigned char *thumbnail;       /**< Raw data of the snapshot */
        unsigned char *webicon;         /**< Raw data of the webicon */
        int tag_count;                          /**< Deprecated */
        void *tags;                                     /**< Deprecated */
@@ -313,15 +313,15 @@ typedef void (*bp_bookmark_adaptor_data_changed_cb)(void *user_data);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] callback  The function address of the callback function to be called
- * @param[in] user_data  The user data to be passed to the callback function
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] callback The function address of the callback function to be called
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_is_setted_data_changed_cb()
  * @see bp_bookmark_adaptor_unset_data_changed_cb()
  */
-EXPORT_API int bp_bookmark_adaptor_set_data_changed_cb
-       (bp_bookmark_adaptor_data_changed_cb callback, void *user_data);
+EXPORT_API int bp_bookmark_adaptor_set_data_changed_cb(
+       bp_bookmark_adaptor_data_changed_cb callback, void *user_data);
 
 
 /**
@@ -329,14 +329,14 @@ EXPORT_API int bp_bookmark_adaptor_set_data_changed_cb
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] callback  The function address of the callback function to be called
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] callback The function address of the callback function to be called
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_is_setted_data_changed_cb()
  * @see bp_bookmark_adaptor_set_data_changed_cb()
  */
-EXPORT_API int bp_bookmark_adaptor_unset_data_changed_cb
-       (bp_bookmark_adaptor_data_changed_cb callback);
+EXPORT_API int bp_bookmark_adaptor_unset_data_changed_cb(
+       bp_bookmark_adaptor_data_changed_cb callback);
 
 
 /**
@@ -344,8 +344,8 @@ EXPORT_API int bp_bookmark_adaptor_unset_data_changed_cb
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_set_data_changed_cb()
  * @see bp_bookmark_adaptor_unset_data_changed_cb()
  */
@@ -357,8 +357,8 @@ EXPORT_API int bp_bookmark_adaptor_is_setted_data_changed_cb(void);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @return @c 0 on success,
+ *             otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_initialize(void);
 
@@ -368,8 +368,8 @@ EXPORT_API int bp_bookmark_adaptor_initialize(void);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_initialize()
  */
 EXPORT_API int bp_bookmark_adaptor_deinitialize(void);
@@ -378,9 +378,9 @@ EXPORT_API int bp_bookmark_adaptor_deinitialize(void);
 /**
  * @brief Gets the ID of the root level folder.
  * @since_tizen 2.3
- * @param[out] id  The integer ID value of the root level folder
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned if the address of the parameter is @c NULL
+ * @param[out] id The integer ID value of the root level folder
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned if the address of the parameter is @c NULL
  */
 EXPORT_API int bp_bookmark_adaptor_get_root(int *id);
 
@@ -390,9 +390,9 @@ EXPORT_API int bp_bookmark_adaptor_get_root(int *id);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[out] id  The ID of the item
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[out] id The ID of the item
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_dirty(const int id);
 
@@ -403,8 +403,8 @@ EXPORT_API int bp_bookmark_adaptor_set_dirty(const int id);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @details The callback function is invoked if already registered.
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned
  * @see bp_bookmark_adaptor_set_data_changed_cb()
  */
 EXPORT_API int bp_bookmark_adaptor_publish_notification(void);
@@ -414,11 +414,11 @@ EXPORT_API int bp_bookmark_adaptor_publish_notification(void);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[out] value If @c 0 it means bookmark, 
- *                   otherwise @c 1 means folder
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value If @c 0 it means bookmark,
+ *          otherwise @c 1 means folder
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_type(const int id, int *value);
 
@@ -428,10 +428,10 @@ EXPORT_API int bp_bookmark_adaptor_get_type(const int id, int *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[out] value  The integer ID of the parent folder
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The integer ID of the parent folder
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_parent_id(const int id, int *value);
 
@@ -441,10 +441,10 @@ EXPORT_API int bp_bookmark_adaptor_get_parent_id(const int id, int *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[out] value  The string array
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The string array
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_url(const int id, char **value);
 
@@ -454,10 +454,10 @@ EXPORT_API int bp_bookmark_adaptor_get_url(const int id, char **value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
+ * @param[in] id The ID of the item
  * @param[out] value The string array
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_title(const int id, char **value);
 
@@ -467,10 +467,10 @@ EXPORT_API int bp_bookmark_adaptor_get_title(const int id, char **value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[out] value  The integer pointer
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The integer pointer
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_sequence(const int id, int *value);
 
@@ -480,11 +480,11 @@ EXPORT_API int bp_bookmark_adaptor_get_sequence(const int id, int *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[out] value  @c 0 means editable, 
- *                    otherwise @c 1 means read only
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value @c 0 means editable,
+ *          otherwise @c 1 means read only
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_is_editable(const int id, int *value);
 
@@ -494,11 +494,11 @@ EXPORT_API int bp_bookmark_adaptor_get_is_editable(const int id, int *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[out] value  @c 0 means it is made by the user, 
- *                    otherwise @c 1 means it is made by the operator
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value @c 0 means it is made by the user,
+ *     otherwise @c 1 means it is made by the operator
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_is_operator(const int id, int *value);
 
@@ -508,10 +508,10 @@ EXPORT_API int bp_bookmark_adaptor_get_is_operator(const int id, int *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[out] value  The integer, frequency of use
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The integer, frequency of use
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_access_count(const int id, int *value);
 
@@ -521,10 +521,10 @@ EXPORT_API int bp_bookmark_adaptor_get_access_count(const int id, int *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[out] value  The time stamp, integer
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The time stamp, integer
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_date_created(const int id, int *value);
 
@@ -534,10 +534,10 @@ EXPORT_API int bp_bookmark_adaptor_get_date_created(const int id, int *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[out] value  The time stamp, integer
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The time stamp, integer
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_date_modified(const int id, int *value);
 
@@ -548,9 +548,9 @@ EXPORT_API int bp_bookmark_adaptor_get_date_modified(const int id, int *value);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @param[in] id The ID of the item
- * @param[out] value  The time stamp, integer
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[out] value The time stamp, integer
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_date_visited(const int id, int *value);
 
@@ -561,10 +561,10 @@ EXPORT_API int bp_bookmark_adaptor_get_date_visited(const int id, int *value);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated string memory has to be released by the caller.
- * @param[in] id  The ID of the item
- * @param[out] value  The string
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The string
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_account_name(const int id, char **value);
 
@@ -575,10 +575,10 @@ EXPORT_API int bp_bookmark_adaptor_get_account_name(const int id, char **value);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated string memory has to be released by the caller.
- * @param[in] id  The ID of the item
- * @param[out] value  The string
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The string
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_account_type(const int id, char **value);
 
@@ -589,10 +589,10 @@ EXPORT_API int bp_bookmark_adaptor_get_account_type(const int id, char **value);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated string memory has to be released by the caller.
- * @param[in] id  The ID of the item
- * @param[out] value  The string
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The string
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_device_name(const int id, char **value);
 
@@ -603,10 +603,10 @@ EXPORT_API int bp_bookmark_adaptor_get_device_name(const int id, char **value);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated string memory has to be released by the caller.
- * @param[in] id  The ID of the item
- * @param[out] value  The string
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The string
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_device_id(const int id, char **value);
 
@@ -618,16 +618,16 @@ EXPORT_API int bp_bookmark_adaptor_get_device_id(const int id, char **value);
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @details The color space of the image is ARGB8888.
  * @remarks The image data value will be stored in the shared memory allocated by the browser-provider.
- *          Therefore, if this API is called multiple times, image contents may be changed, but the pointer will be the same.
- *          PLEASE DO NOT free the 'value' parameter directly after it is assigned.
- *          If you want to use the image data permanently, allocate memory and make a deep copy of the data.
- * @param[in] id  The ID of the item
- * @param[out] width  The width of the image
- * @param[out] height  The height of the image
+ *     Therefore, if this API is called multiple times, image contents may be changed, but the pointer will be the same.
+ *     PLEASE DO NOT free the 'value' parameter directly after it is assigned.
+ *     If you want to use the image data permanently, allocate memory and make a deep copy of the data.
+ * @param[in] id The ID of the item
+ * @param[out] width The width of the image
+ * @param[out] height The height of the image
  * @param[out] value A pointer to the raw image data; this memory will be released automatically when the browser provider is deinitialized
- * @param[out] length  The size of the raw data
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[out] length The size of the raw data
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_get_icon_png()
  */
 EXPORT_API int bp_bookmark_adaptor_get_icon(const int id, int *width, int *height, unsigned char **value, int *length);
@@ -640,16 +640,16 @@ EXPORT_API int bp_bookmark_adaptor_get_icon(const int id, int *width, int *heigh
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @details The color space of the image is ARGB8888.
  * @remarks The image data value will be stored in the shared memory allocated by the browser-provider.
- *          Therefore, if this API is called multiple times, image contents may be changed, but the pointer will be the same.
- *          PLEASE DO NOT free the 'value' parameter directly after it is assigned.
- *          If you want to use the image data permanently, allocate memory and make a deep copy of the data.
- * @param[in] id  The ID of the item
- * @param[out] width  The width of the image
- * @param[out] height  The height of the image
+ *     Therefore, if this API is called multiple times, image contents may be changed, but the pointer will be the same.
+ *     PLEASE DO NOT free the 'value' parameter directly after it is assigned.
+ *     If you want to use the image data permanently, allocate memory and make a deep copy of the data.
+ * @param[in] id The ID of the item
+ * @param[out] width The width of the image
+ * @param[out] height The height of the image
  * @param[out] value A pointer to the raw image data; this memory will be released automatically when the browser provider is deinitialized
- * @param[out] length  The size of the raw data
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[out] length The size of the raw data
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_snapshot(const int id, int *width, int *height, unsigned char **value, int *length);
 
@@ -661,16 +661,16 @@ EXPORT_API int bp_bookmark_adaptor_get_snapshot(const int id, int *width, int *h
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @details The color space of the image is ARGB8888.
  * @remarks The image data value will be stored in the shared memory allocated by the browser-provider.
- *          Therefore, if this API is called multiple times, image contents may be changed, but the pointer will be the same.
- *          PLEASE DO NOT free the 'value' parameter directly after it is assigned.
- *          If you want to use the image data permanently, allocate memory and make a deep copy of the data.
- * @param[in] id  The ID of the item
- * @param[out] width  The width of the image
- * @param[out] height  The height of the image
+ *     Therefore, if this API is called multiple times, image contents may be changed, but the pointer will be the same.
+ *     PLEASE DO NOT free the 'value' parameter directly after it is assigned.
+ *     If you want to use the image data permanently, allocate memory and make a deep copy of the data.
+ * @param[in] id The ID of the item
+ * @param[out] width The width of the image
+ * @param[out] height The height of the image
  * @param[out] value A pointer to the raw image data; this memory will be released automatically when the browser-provider is deinitialized
- * @param[out] length  The size of the raw data
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[out] length The size of the raw data
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_webicon(const int id, int *width, int *height, unsigned char **value, int *length);
 
@@ -682,11 +682,11 @@ EXPORT_API int bp_bookmark_adaptor_get_webicon(const int id, int *width, int *he
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @details The color space of the image is 32bit RGBA.
  * @remarks The allocated memory for rows data has to be released by the caller.
- * @param[in] id  The ID of the item
- * @param[out] value  The binary of the image
- * @param[out] length  The size of the binary
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[out] value The binary of the image
+ * @param[out] length The size of the binary
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_get_icon_png()
  */
 EXPORT_API int bp_bookmark_adaptor_get_icon_png(const int id, unsigned char **value, int *length);
@@ -697,11 +697,11 @@ EXPORT_API int bp_bookmark_adaptor_get_icon_png(const int id, unsigned char **va
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  If @c 0 it means bookmark, 
- *                   otherwise @c 1 means folder
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value If @c 0 it means bookmark,
+ *     otherwise @c 1 means folder
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_type(const int id, const int value);
 
@@ -711,10 +711,10 @@ EXPORT_API int bp_bookmark_adaptor_set_type(const int id, const int value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The integer ID of the parent folder
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The integer ID of the parent folder
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_parent_id(const int id, const int value);
 
@@ -724,10 +724,10 @@ EXPORT_API int bp_bookmark_adaptor_set_parent_id(const int id, const int value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The URI address
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The URI address
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_url(const int id, const char *value);
 
@@ -737,10 +737,10 @@ EXPORT_API int bp_bookmark_adaptor_set_url(const int id, const char *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The title string
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The title string
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_title(const int id, const char *value);
 
@@ -750,11 +750,11 @@ EXPORT_API int bp_bookmark_adaptor_set_title(const int id, const char *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The index of ordering, 
- *                   otherwise if negative, update to max index automatically
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The index of ordering,
+ *     otherwise if negative, update to max index automatically
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_sequence(const int id, const int value);
 
@@ -764,10 +764,10 @@ EXPORT_API int bp_bookmark_adaptor_set_sequence(const int id, const int value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The integer, frequency of use
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The integer, frequency of use
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_access_count(const int id, const int value);
 
@@ -777,11 +777,11 @@ EXPORT_API int bp_bookmark_adaptor_set_access_count(const int id, const int valu
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The time stamp, 
- *                   otherwise if less than or equal to @c 0, update to present time automatically
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The time stamp,
+ *     otherwise if less than or equal to @c 0, update to present time automatically
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_date_created(const int id, const int value);
 
@@ -791,11 +791,11 @@ EXPORT_API int bp_bookmark_adaptor_set_date_created(const int id, const int valu
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The time stamp, 
- *                   otherwise if less than or equal to @c 0, update to present time automatically
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The time stamp,
+ *     otherwise if less than or equal to @c 0, update to present time automatically
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_date_modified(const int id, const int value);
 
@@ -805,11 +805,11 @@ EXPORT_API int bp_bookmark_adaptor_set_date_modified(const int id, const int val
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The time stamp, 
- *                   otherwise if less than or equal to @c 0, update to present time automatically
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The time stamp,
+ *     otherwise if less than or equal to @c 0, update to present time automatically
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_date_visited(const int id, const int value);
 
@@ -819,10 +819,10 @@ EXPORT_API int bp_bookmark_adaptor_set_date_visited(const int id, const int valu
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The account name, string
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The account name, string
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_account_name(const int id, const char *value);
 
@@ -832,10 +832,10 @@ EXPORT_API int bp_bookmark_adaptor_set_account_name(const int id, const char *va
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The account type, string
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The account type, string
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_account_type(const int id, const char *value);
 
@@ -845,10 +845,10 @@ EXPORT_API int bp_bookmark_adaptor_set_account_type(const int id, const char *va
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The device name, string
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The device name, string
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_device_name(const int id, const char *value);
 
@@ -858,10 +858,10 @@ EXPORT_API int bp_bookmark_adaptor_set_device_name(const int id, const char *val
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
+ * @param[in] id The ID of the item
  * @param[in] value The device ID, string
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_device_id(const int id, const char *value);
 
@@ -870,14 +870,14 @@ EXPORT_API int bp_bookmark_adaptor_set_device_id(const int id, const char *value
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @details The color space of the image is ARGB8888. 
- * @param[in] id  The ID of the item
- * @param[in] width  The width of the image
- * @param[in] height  The height of the image
- * @param[in] value  The raw data of the image
- * @param[in] length  The size of the raw data
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @details The color space of the image is ARGB8888.
+ * @param[in] id The ID of the item
+ * @param[in] width The width of the image
+ * @param[in] height The height of the image
+ * @param[in] value The raw data of the image
+ * @param[in] length The size of the raw data
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_set_icon_png()
  */
 EXPORT_API int bp_bookmark_adaptor_set_icon(const int id, const int width, const int height, const unsigned char *value, const int length);
@@ -888,14 +888,14 @@ EXPORT_API int bp_bookmark_adaptor_set_icon(const int id, const int width, const
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @details The color space of the image is ARGB8888. 
- * @param[in] id  The ID of the item
- * @param[in] width  The width of the image
+ * @details The color space of the image is ARGB8888.
+ * @param[in] id The ID of the item
+ * @param[in] width The width of the image
  * @param[in] height The height of the image
- * @param[in] value  The raw data of the image
- * @param[in] length  The size of the raw data
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] value The raw data of the image
+ * @param[in] length The size of the raw data
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_snapshot(const int id, const int width, const int height, const unsigned char *value, const int length);
 
@@ -905,14 +905,14 @@ EXPORT_API int bp_bookmark_adaptor_set_snapshot(const int id, const int width, c
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @details The color space of the image is ARGB8888. 
- * @param[in] id  The ID of the item
- * @param[in] width  The width of the image
- * @param[in] height  The height of the image
- * @param[in] value  The raw data of the image
- * @param[in] length  The size of the raw data
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @details The color space of the image is ARGB8888.
+ * @param[in] id The ID of the item
+ * @param[in] width The width of the image
+ * @param[in] height The height of the image
+ * @param[in] value The raw data of the image
+ * @param[in] length The size of the raw data
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_set_webicon(const int id, const int width, const int height, const unsigned char *value, const int length);
 
@@ -922,10 +922,10 @@ EXPORT_API int bp_bookmark_adaptor_set_webicon(const int id, const int width, co
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  The ID of the item
- * @param[in] value  The binary of the image
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] value The binary of the image
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_set_icon()
  */
 EXPORT_API int bp_bookmark_adaptor_set_icon_png(const int id, const unsigned char *value);
@@ -936,11 +936,11 @@ EXPORT_API int bp_bookmark_adaptor_set_icon_png(const int id, const unsigned cha
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @details The creation time is set to the present time automatically. 
- * @param[out] id  The ID before calling returns the ID of an item created newly if the ID is initialized to @c -1,
- *                                otherwise a new item is created with the ID if the ID is a positive unique value
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @details The creation time is set to the present time automatically.
+ * @param[out] id The ID before calling returns the ID of an item created newly if the ID is initialized to @c -1,
+ *     otherwise a new item is created with the ID if the ID is a positive unique value
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_easy_create()
  */
 EXPORT_API int bp_bookmark_adaptor_create(int *id);
@@ -952,12 +952,12 @@ EXPORT_API int bp_bookmark_adaptor_create(int *id);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @details If cloud is on, the item is not deleted, but the is_deleted property is set.
- *                     However, the caller may think it has been deleted because all getting IDs functions will ignore it.
- *                     It will be deleted from the storage later by calling bp_bookmark_adaptor_clear_deleted_ids() in the cloud module. 
+ *                     However, the caller may think it has been deleted because all getting IDs functions will ignore it.
+ *                     It will be deleted from the storage later by calling bp_bookmark_adaptor_clear_deleted_ids() in the cloud module.
  * @remarks If this item is a folder, all child items are deleted too.
- * @param[in] id  The ID of the item
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_clear_deleted_ids()
  */
 EXPORT_API int bp_bookmark_adaptor_delete(const int id);
@@ -976,11 +976,11 @@ EXPORT_API int bp_bookmark_adaptor_get_errorcode(void);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[out] id  The ID before calling returns the ID of an item created newly if the ID is initialized to @c -1,
- *                                otherwise a new item is created with the ID if the ID is a positive unique value
- * @param[in] info  The structure includes all the properties to set
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[out] id The ID before calling returns the ID of an item created newly if the ID is initialized to @c -1,
+ *     otherwise a new item is created with the ID if the ID is a positive unique value
+ * @param[in] info The structure includes all the properties to set
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_bookmark_info_fmt
  * @see bp_bookmark_adaptor_create()
@@ -994,10 +994,10 @@ EXPORT_API int bp_bookmark_adaptor_easy_create(int *id, bp_bookmark_info_fmt *in
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated memory of strings in the structure has to be released by the caller.
- * @param[in] id  The ID of the item
- * @param[in] info  The structure including all the properties
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] info The structure including all the properties
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see #bp_bookmark_info_fmt
  * @see bp_bookmark_adaptor_get_info()
  */
@@ -1010,11 +1010,11 @@ EXPORT_API int bp_bookmark_adaptor_get_easy_all(int id, bp_bookmark_info_fmt *in
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated memory of strings in the structure has to be released by the caller.
- * @param[in] id  The ID of the item
- * @param[in] offset  The value that indicates one or more properties by '|' bit masking
- * @param[in] info  The structure that includes all properties
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] id The ID of the item
+ * @param[in] offset The value that indicates one or more properties by '|' bit masking
+ * @param[in] info The structure that includes all properties
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_bookmark_info_fmt
  * @see bp_bookmark_adaptor_get_easy_all()
@@ -1025,7 +1025,7 @@ EXPORT_API int bp_bookmark_adaptor_get_info(const int id, const bp_bookmark_offs
 /**
  * @brief Clears the allocated memory in the structure.
  * @since_tizen 2.3
- * @param[in] info  The structure to clear
+ * @param[in] info The structure to clear
  * @return @c 0 on success
  * @see #bp_bookmark_info_fmt
  * @see bp_bookmark_adaptor_get_info()
@@ -1038,9 +1038,9 @@ EXPORT_API int bp_bookmark_adaptor_easy_free(bp_bookmark_info_fmt *info);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] value  The absolute path to store
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] value The absolute path to store
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_restore()
  */
 EXPORT_API int bp_bookmark_adaptor_backup(char *value);
@@ -1051,9 +1051,9 @@ EXPORT_API int bp_bookmark_adaptor_backup(char *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] value  The absolute path to restore
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] value The absolute path to restore
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_bookmark_adaptor_backup()
  */
 EXPORT_API int bp_bookmark_adaptor_restore(char *value);
@@ -1065,23 +1065,23 @@ EXPORT_API int bp_bookmark_adaptor_restore(char *value);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated memory (IDs) has to be released by the caller.
- * @param[out] ids  The ID array
- * @param[out] count  The size of the array
- * @param[in] limit  The maximum number of rows to get, negative means no limitation
- * @param[in] offset  The starting index to get among entire rows
- * @param[in] parent  The ID of the parent folder, negative means searching all folders
- * @param[in] type  The kind of items to be searched, @c 0 means bookmark, @c 1 means folder, and negative means both
- * @param[in] is_operator  @c 0: made by the user @c 1: by the operator, negative means both
- * @param[in] is_editable  @c 0 means read only, @c 1 means editable, negative means both
- * @param[in] order_offset  A property to be sorted, default is #BP_BOOKMARK_O_DATE_CREATED
- * @param[in] ordering  The way of ordering, @c 0: ASC(default) @c 1: DESC
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[out] ids The ID array
+ * @param[out] count The size of the array
+ * @param[in] limit The maximum number of rows to get, negative means no limitation
+ * @param[in] offset The starting index to get among entire rows
+ * @param[in] parent The ID of the parent folder, negative means searching all folders
+ * @param[in] type The kind of items to be searched, @c 0 means bookmark, @c 1 means folder, and negative means both
+ * @param[in] is_operator @c 0: made by the user @c 1: by the operator, negative means both
+ * @param[in] is_editable @c 0 means read only, @c 1 means editable, negative means both
+ * @param[in] order_offset A property to be sorted, default is #BP_BOOKMARK_O_DATE_CREATED
+ * @param[in] ordering The way of ordering, @c 0: ASC(default) @c 1: DESC
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @see #bp_bookmark_offset
  * @see bp_bookmark_adaptor_get_cond_ids_p()
  */
-EXPORT_API int bp_bookmark_adaptor_get_ids_p
-       (int **ids, int *count, const int limit, const int offset,
+EXPORT_API int bp_bookmark_adaptor_get_ids_p(
+       int **ids, int *count, const int limit, const int offset,
        const int parent, const int type,
        const int is_operator, const int is_editable,
        const bp_bookmark_offset order_offset, const int ordering);
@@ -1092,17 +1092,17 @@ EXPORT_API int bp_bookmark_adaptor_get_ids_p
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated memory (IDs) has to be released by the caller.\n
- *                     If the caller wants to do LIKE searching, the keyword has to have some wild card like _aa, a_a, %aa, aa%, or %aa%.
- * @param[out] ids  The ID array
- * @param[out] count  The size of the array
- * @param[in] properties  The structure including basic conditions of the bookmark
+ *                     If the caller wants to do LIKE searching, the keyword has to have some wild card like _aa, a_a, %aa, aa%, or %aa%.
+ * @param[out] ids The ID array
+ * @param[out] count The size of the array
+ * @param[in] properties The structure including basic conditions of the bookmark
  * @param[in] conds The structure including some conditions that are related to the period, the ordering, and the number of searched rows
- * @param[in] check_offset  A property to be searched by keywords, #BP_BOOKMARK_O_TITLE, #BP_BOOKMARK_O_URL, or (#BP_BOOKMARK_O_TITLE | #BP_BOOKMARK_O_URL)
- * @param[in] keyword  The string to search, 
- *                     otherwise @c NULL to ignore searching by keyword
- * @param[in] is_like  The way of searching, @c 1 means LIKE, @c 0 means EQUAL, and negative means NOT EQUAL
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ * @param[in] check_offset A property to be searched by keywords, #BP_BOOKMARK_O_TITLE, #BP_BOOKMARK_O_URL, or (#BP_BOOKMARK_O_TITLE | #BP_BOOKMARK_O_URL)
+ * @param[in] keyword The string to search,
+ *     otherwise @c NULL to ignore searching by keyword
+ * @param[in] is_like The way of searching, @c 1 means LIKE, @c 0 means EQUAL, and negative means NOT EQUAL
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_bookmark_property_cond_fmt
  * @see #bp_bookmark_rows_cond_fmt
@@ -1110,8 +1110,8 @@ EXPORT_API int bp_bookmark_adaptor_get_ids_p
  * @see bp_bookmark_adaptor_get_ids_p()
  * @see bp_bookmark_adaptor_get_timestamp_ids_p()
  */
-EXPORT_API int bp_bookmark_adaptor_get_cond_ids_p
-       (int **ids, int *count,
+EXPORT_API int bp_bookmark_adaptor_get_cond_ids_p(
+       int **ids, int *count,
        bp_bookmark_property_cond_fmt *properties,
        bp_bookmark_rows_cond_fmt *conds,
        const bp_bookmark_offset check_offset,
@@ -1125,19 +1125,19 @@ EXPORT_API int bp_bookmark_adaptor_get_cond_ids_p
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated memory (IDs) has to be released by the caller.\n
- *                     If the caller wants to do LIKE searching, the keyword has to have some wild card like _aa, a_a, %aa, aa%, or %aa%.
- * @param[out] ids  The ID array
- * @param[out] count  The size of the array
- * @param[in] properties  The structure including basic conditions of the bookmark
- * @param[in] limits  The structure including some conditions that are related to the period, the ordering, and the number of searched rows
- * @param[in] times  The structure including some conditions for searching by time stamp
- * @param[in] times_count  The size of the times array
- * @param[in] check_offset  A property to be searched by keywords, #BP_BOOKMARK_O_TITLE, #BP_BOOKMARK_O_URL or (#BP_BOOKMARK_O_TITLE | #BP_BOOKMARK_O_URL)
- * @param[in] keyword  The string to search, 
- *                     otherwise @c NULL to ignore searching by keyword
- * @param[in] is_like  The way of searching, @c 1 means LIKE, @c 0 means EQUAL, and negative means NOT EQUAL
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ *                     If the caller wants to do LIKE searching, the keyword has to have some wild card like _aa, a_a, %aa, aa%, or %aa%.
+ * @param[out] ids The ID array
+ * @param[out] count The size of the array
+ * @param[in] properties The structure including basic conditions of the bookmark
+ * @param[in] limits The structure including some conditions that are related to the period, the ordering, and the number of searched rows
+ * @param[in] times The structure including some conditions for searching by time stamp
+ * @param[in] times_count The size of the times array
+ * @param[in] check_offset A property to be searched by keywords, #BP_BOOKMARK_O_TITLE, #BP_BOOKMARK_O_URL or (#BP_BOOKMARK_O_TITLE | #BP_BOOKMARK_O_URL)
+ * @param[in] keyword The string to search,
+ *     otherwise @c NULL to ignore searching by keyword
+ * @param[in] is_like The way of searching, @c 1 means LIKE, @c 0 means EQUAL, and negative means NOT EQUAL
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_bookmark_property_cond_fmt
  * @see #bp_bookmark_rows_cond_fmt
@@ -1146,8 +1146,8 @@ EXPORT_API int bp_bookmark_adaptor_get_cond_ids_p
  * @see bp_bookmark_adaptor_get_ids_p()
  * @see bp_bookmark_adaptor_get_cond_ids_p()
  */
-EXPORT_API int bp_bookmark_adaptor_get_timestamp_ids_p
-       (int **ids, int *count,
+EXPORT_API int bp_bookmark_adaptor_get_timestamp_ids_p(
+       int **ids, int *count,
        const bp_bookmark_property_cond_fmt *properties,
        const bp_bookmark_rows_fmt *limits,
        const bp_bookmark_timestamp_fmt times[], const int times_count,
@@ -1161,25 +1161,25 @@ EXPORT_API int bp_bookmark_adaptor_get_timestamp_ids_p
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks The allocated memory (IDs) has to be released by the caller.\n
- *                     If the caller wants to do LIKE searching, the keyword has to have some wild card like _aa, a_a, %aa, aa%, or %aa%.\n
- *                     Although URI addresses have a protocol or the www prefix, search engines does not exclude it.
- * @param[out] ids  The ID array
- * @param[out] count  The size of the array
- * @param[in] properties  The structure including basic conditions of the bookmark
- * @param[in] conds  The structure including some conditions that are related to the period, the ordering, and the number of searched rows
- * @param[in] check_offset  A property to be searched by keywords, #BP_BOOKMARK_O_TITLE, #BP_BOOKMARK_O_URL or (#BP_BOOKMARK_O_TITLE | #BP_BOOKMARK_O_URL)
- * @param[in] keyword  The string to search, 
- *                     otherwise @c NULL to ignore searching by keyword
- * @param[in] is_like  The way of searching, @c 1 means LIKE, @c 0 means EQUAL, and negative means NOT EQUAL
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
+ *                     If the caller wants to do LIKE searching, the keyword has to have some wild card like _aa, a_a, %aa, aa%, or %aa%.\n
+ *                     Although URI addresses have a protocol or the www prefix, search engines does not exclude it.
+ * @param[out] ids The ID array
+ * @param[out] count The size of the array
+ * @param[in] properties The structure including basic conditions of the bookmark
+ * @param[in] conds The structure including some conditions that are related to the period, the ordering, and the number of searched rows
+ * @param[in] check_offset A property to be searched by keywords, #BP_BOOKMARK_O_TITLE, #BP_BOOKMARK_O_URL or (#BP_BOOKMARK_O_TITLE | #BP_BOOKMARK_O_URL)
+ * @param[in] keyword The string to search,
+ *     otherwise @c NULL to ignore searching by keyword
+ * @param[in] is_like The way of searching, @c 1 means LIKE, @c 0 means EQUAL, and negative means NOT EQUAL
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_bookmark_property_cond_fmt
  * @see #bp_bookmark_rows_cond_fmt
  * @see #bp_bookmark_offset
  */
-EXPORT_API int bp_bookmark_adaptor_get_raw_retrieved_ids_p
-       (int **ids, int *count,
+EXPORT_API int bp_bookmark_adaptor_get_raw_retrieved_ids_p(
+       int **ids, int *count,
        bp_bookmark_property_cond_fmt *properties,
        bp_bookmark_rows_cond_fmt *conds,
        const bp_bookmark_offset check_offset,
@@ -1191,9 +1191,9 @@ EXPORT_API int bp_bookmark_adaptor_get_raw_retrieved_ids_p
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @return @c 0 on success, 
- *         otherwise @c -1 is returned and the error code is set to indicate the error
-*/
+ * @return @c 0 on success,
+ *     otherwise @c -1 is returned and the error code is set to indicate the error
+ */
 EXPORT_API int bp_bookmark_adaptor_reset(void);
 
 /**
index fbc43142173defc50eaecd5cce52fb77ae4a505c..6a0617866b5dfe3cbf9c2c7cd7ed90be3f0b43b7 100755 (executable)
@@ -48,8 +48,8 @@ typedef struct {
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks Allocated memory (ids) has to be released by caller.
- * @param[out] ids  Id array
- * @param[out] count  The size of array
+ * @param[out] ids Id array
+ * @param[out] count The size of array
  * @return 0 on success, otherwise, -1 is returned and error code is set to indicate the error
  * @exception BP_BOOKMARK_ERROR_PERMISSION_DENY Permission denied by insufficient privilege
  */
@@ -61,8 +61,8 @@ EXPORT_API int bp_bookmark_adaptor_get_full_with_deleted_ids_p(int **ids, int *c
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks Allocated memory (ids) has to be released by caller.
- * @param[out] ids  Id array
- * @param[out] count  The size of array
+ * @param[out] ids Id array
+ * @param[out] count The size of array
  * @return 0 on success, otherwise, -1 is returned and error code is set to indicate the error
  * @exception BP_BOOKMARK_ERROR_PERMISSION_DENY Permission denied by insufficient privilege
  */
@@ -74,8 +74,8 @@ EXPORT_API int bp_bookmark_adaptor_get_dirty_ids_p(int **ids, int *count);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks Allocated memory (ids) has to be released by caller.
- * @param[out] ids  Id array
- * @param[out] count  The size of array
+ * @param[out] ids Id array
+ * @param[out] count The size of array
  * @return 0 on success, otherwise, -1 is returned and error code is set to indicate the error
  * @exception BP_BOOKMARK_ERROR_PERMISSION_DENY Permission denied by insufficient privilege
  */
@@ -98,7 +98,7 @@ EXPORT_API int bp_bookmark_adaptor_clear_dirty_ids(void);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @details If cloud is on, "is_dirty" property is off by calling delete function \n
- *                     if cloud is off, a bookmark is deleted really from storage whenever calling delete function.
+ *                     if cloud is off, a bookmark is deleted really from storage whenever calling delete function.
  * @return 0 on success, otherwise, -1 is returned and error code is set to indicate the error
  * @exception BP_BOOKMARK_ERROR_PERMISSION_DENY Permission denied by insufficient privilege
  */
@@ -110,8 +110,8 @@ EXPORT_API int bp_bookmark_adaptor_clear_deleted_ids(void);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks Allocated string memory has to be released by caller.
- * @param[in] id  Id of an item
- * @param[out] value  String
+ * @param[in] id Id of an item
+ * @param[out] value String
  * @return 0 on success, otherwise, -1 is returned and error code is set to indicate the error
  * @exception BP_BOOKMARK_ERROR_PERMISSION_DENY Permission denied by insufficient privilege
  * @see bp_bookmark_adaptor_set_sync()
@@ -123,8 +123,8 @@ EXPORT_API int bp_bookmark_adaptor_get_sync(const int id, char **value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
- * @param[in] id  Id of an item
- * @param[in] value  String
+ * @param[in] id Id of an item
+ * @param[in] value String
  * @return 0 on success, otherwise, -1 is returned and error code is set to indicate the error
  * @exception BP_BOOKMARK_ERROR_PERMISSION_DENY Permission denied by insufficient privilege
  * @see bp_bookmark_adaptor_get_sync()
@@ -137,8 +137,8 @@ EXPORT_API int bp_bookmark_adaptor_set_sync(const int id, const char *value);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/bookmark.admin
  * @remarks Allocated memory (ids) have to be released by caller.
- * @param[out] ids  Id array
- * @param[out] count  The size of array
+ * @param[out] ids Id array
+ * @param[out] count The size of array
  * @return 0 on success, otherwise, -1 is returned and error code is set to indicate the error
  */
 EXPORT_API int bp_bookmark_adaptor_get_full_ids_p(int **ids, int *count);
index 2983ca2b6e6c9c70e6158283aced2ad684195a94..64d8c08c4028bd7e2eb152106be6e48072ea3528 100755 (executable)
@@ -45,7 +45,7 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED
        ${CMAKE_SOURCE_DIR}/common-adaptor/common-adaptor.c
        ${CMAKE_SOURCE_DIR}/provider/browser-provider-shm.c
        ${CMAKE_SOURCE_DIR}/provider/browser-provider-socket.c
-       ${CMAKE_CURRENT_SOURCE_DIR}/bookmark-csc-adaptor.c )
+       ${CMAKE_CURRENT_SOURCE_DIR}/bookmark-csc-adaptor.c)
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bookmark_csc_adaptor_pkgs_LDFLAGS} ${BOOKMARK_LINK_LIBRARIES})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${PKG_VERSION})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0)
index 0f1b5c1030a8bc388396dc4b8a25e0baea9c612e..7d56dc2c416840449edf7c8ecae87fc8ccc24b12 100755 (executable)
@@ -39,8 +39,8 @@
        if (bookmark_csc_initialize() < 0) {\
                TRACE_ERROR("[CHECK connection]");\
                return -1;\
-       }\
-} while(0)
+       } \
+} while (0)
 
 static bp_adaptor_defs *g_adaptorinfo = NULL;
 static pthread_mutex_t g_adaptor_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -99,8 +99,8 @@ static int __bookmark_csc_set_string(const int id,
        return ret;
 }
 
-static int __bp_bookmark_csc_get_ids_p
-       (int **ids, int *count, const int limit, const int offset,
+static int __bp_bookmark_csc_get_ids_p(
+       int **ids, int *count, const int limit, const int offset,
        const int parent, const int type,
        const int is_operator, const int is_editable,
        const bp_bookmark_offset order_offset, const int ordering)
@@ -134,7 +134,7 @@ static int __bp_bookmark_csc_get_ids_p
        }
 
        if (bp_ipc_send_custom_type(sock, &conds,
-                       sizeof(bp_db_base_conds_fmt)) < 0 ||
+                               sizeof(bp_db_base_conds_fmt)) < 0 ||
                        bp_adaptor_ipc_send_int(sock, parent) < 0 ||
                        bp_adaptor_ipc_send_int(sock, type) < 0 ||
                        bp_adaptor_ipc_send_int(sock, is_operator) < 0 ||
@@ -161,9 +161,9 @@ static int __bp_bookmark_csc_get_ids_p
        // int count.
        int ids_count = bp_adaptor_ipc_read_int(sock);
        TRACE_DEBUG("response ids count:%d", ids_count);
-       if(ids_count >= BP_MAX_IDS_COUNT || ids_count <= 0) {
-           pthread_mutex_unlock(&g_adaptor_mutex);
-           return -1;
+       if (ids_count >= BP_MAX_IDS_COUNT || ids_count <= 0) {
+               pthread_mutex_unlock(&g_adaptor_mutex);
+               return -1;
        } else {
                int *idlist = (int *)calloc(ids_count, sizeof(int));
                if (idlist == NULL) {
@@ -194,8 +194,8 @@ static int __bp_bookmark_csc_get_ids_p
        return 0;
 }
 
-int __bp_bookmark_csc_get_retrieved_ids_p
-       (int **ids, int *count, const int limit, const int offset,
+int __bp_bookmark_csc_get_retrieved_ids_p(
+       int **ids, int *count, const int limit, const int offset,
        const int parent, const int type,
        const int is_operator, const int is_editable,
        const bp_bookmark_offset order_column_offset, const int ordering,
@@ -232,7 +232,7 @@ int __bp_bookmark_csc_get_retrieved_ids_p
 
        bp_bookmark_offset oflags = check_column_offset;
        if (bp_ipc_send_custom_type(sock, &conds,
-                       sizeof(bp_db_base_conds_fmt)) < 0 ||
+                               sizeof(bp_db_base_conds_fmt)) < 0 ||
                        bp_adaptor_ipc_send_int(sock, parent) < 0 ||
                        bp_adaptor_ipc_send_int(sock, type) < 0 ||
                        bp_adaptor_ipc_send_int(sock, is_operator) < 0 ||
@@ -315,11 +315,10 @@ int bookmark_csc_initialize(void)
                }
                g_bp_command.cmd = BP_CMD_NONE;
                g_bp_command.id = -1;
-               if(g_adaptorinfo != NULL) {
-                   g_bp_command.cid = g_adaptorinfo->cid;
-               } else {
-                   g_bp_command.cid = 0;
-               }
+               if (g_adaptorinfo != NULL)
+                       g_bp_command.cid = g_adaptorinfo->cid;
+               else
+                       g_bp_command.cid = 0;
        }
        pthread_mutex_unlock(&g_adaptor_mutex);
        return 0;
@@ -379,7 +378,7 @@ int bookmark_csc_delete(const int id)
 
 int bookmark_csc_get_errorcode(void)
 {
-       switch(errorcode) {
+       switch (errorcode) {
        case BP_ERROR_INVALID_PARAMETER:
                return BOOKMARK_CSC_ERROR_INVALID_PARAMETER;
        case BP_ERROR_OUT_OF_MEMORY:
@@ -544,16 +543,16 @@ int bookmark_csc_get_info(const int id, bookmark_csc_info_fmt *info)
        pthread_mutex_unlock(&g_adaptor_mutex);
        __bookmark_csc_get_string(id, BP_CMD_COMMON_GET_TITLE,
                &info->title);
-       if(info->type == BOOKMARK_CSC_TYPE_BOOKMARK)
-               __bookmark_csc_get_string(id, BP_CMD_COMMON_GET_URL,
-                       &info->url);
+       if (info->type == BOOKMARK_CSC_TYPE_BOOKMARK)
+               __bookmark_csc_get_string(id, BP_CMD_COMMON_GET_URL, &info->url);
+
        return 0;
 }
 
 int bookmark_csc_get_full_ids_p(bookmark_csc_type_defs type, int **ids, int *count)
 {
-       return __bp_bookmark_csc_get_ids_p
-               (ids, count, -1, 0, -1, type, 1, -1,
+       return __bp_bookmark_csc_get_ids_p(
+               ids, count, -1, 0, -1, type, 1, -1,
                BP_BOOKMARK_O_DATE_CREATED, 0);
 }
 
@@ -561,8 +560,8 @@ int bookmark_csc_get_ids_p(int parent, int **ids, int *count)
 {
        if (parent < 0)
                return -1;
-       return __bp_bookmark_csc_get_ids_p
-               (ids, count, -1, 0, parent, -1, 1, -1,
+       return __bp_bookmark_csc_get_ids_p(
+               ids, count, -1, 0, parent, -1, 1, -1,
                BP_BOOKMARK_O_DATE_CREATED, 0);
 }
 
@@ -594,15 +593,15 @@ int bookmark_csc_reset(void)
        return 0;
 }
 
-int bookmark_csc_get_duplicated_title_ids_p
-       (int **ids, int *count, const int limit, const int offset,
+int bookmark_csc_get_duplicated_title_ids_p(
+       int **ids, int *count, const int limit, const int offset,
        const int parent, const int type,
        const int is_operator, const int is_editable,
        const int ordering,
        const char *title, const int is_like)
 {
-       return __bp_bookmark_csc_get_retrieved_ids_p
-               (ids, count, limit, offset, parent, type, -1, -1,
+       return __bp_bookmark_csc_get_retrieved_ids_p(
+               ids, count, limit, offset, parent, type, -1, -1,
                BP_BOOKMARK_O_DATE_CREATED, ordering,
                BP_BOOKMARK_O_TITLE,
                title, is_like);
index f54515382e9a2c8e2f03ef3d811744168bbc16a4..20504e7675b3320f9b186ac0321345bfceeb94c9 100755 (executable)
@@ -60,7 +60,7 @@ typedef enum {
  * @brief Enumeration for the kinds of item.
  */
 typedef enum {
-       BOOKMARK_CSC_TYPE_BOOKMARK = 0, /**< Bookmark type data for embedded  */
+       BOOKMARK_CSC_TYPE_BOOKMARK = 0, /**< Bookmark type data for embedded */
        BOOKMARK_CSC_TYPE_FOLDER = 1    /**< Folder type data */
 } bookmark_csc_type_defs;
 
@@ -68,7 +68,7 @@ typedef enum {
 /**
  * @brief The structure including the variables for all properties.
  * @remarks Caller has to initialize the structure before using it.\n
- *                     Caller has to free the memory allocated for the structure by bookmark_csc_get_info().
+ *                     Caller has to free the memory allocated for the structure by bookmark_csc_get_info().
  */
 typedef struct {
        bookmark_csc_type_defs type;    /**< Type 0:bookmark, 1:folder */
@@ -109,7 +109,7 @@ EXPORT_API int bookmark_csc_get_root(int *id);
  * @brief Creates or updates item using the structure.
  * @remarks If type in the info structure is 1 (folder), ignore URL.
  * @param[out] id before calling, returned id of an item created newly if id is initialized to -1
- *                             otherwise, new item is created with id if id is positive unique value
+ *                             otherwise, new item is created with id if id is positive unique value
  * @param[in] info The structure that includes all properties that caller want to set
  * @return 0 on success, otherwise, -1 is returned and error code is set to indicate the error
  * @pre The structure have to be initialized to 0, then use the variables that caller want to change.
@@ -188,7 +188,7 @@ EXPORT_API int bookmark_csc_get_errorcode(void);
 /**
  * @brief Gets an id array and the number of rows of items searched by title from the storage.
  * @remarks Allocated memory (ids) have to be released by caller.
- *                     If caller want to do LIKE searching, keyword have to have some wild card like _aa, a_a, %aa, aa% or %aa%.
+ *                     If caller want to do LIKE searching, keyword have to have some wild card like _aa, a_a, %aa, aa% or %aa%.
  * @param[out] ids Id array
  * @param[out] count The size of array
  * @param[in] limit The maximum number of rows wanted to be returned, negative means no limitation
@@ -202,8 +202,8 @@ EXPORT_API int bookmark_csc_get_errorcode(void);
  * @param[in] is_like Ordering the way of searching, 1 means LIKE, 0 means EQUAL and negative means NOT EQUAL
  * @return 0 on success, otherwise, -1 is returned and error code is set to indicate the error
  */
-EXPORT_API int bookmark_csc_get_duplicated_title_ids_p
-       (int **ids, int *count, const int limit, const int offset,
+EXPORT_API int bookmark_csc_get_duplicated_title_ids_p(
+       int **ids, int *count, const int limit, const int offset,
        const int parent, const int type,
        const int is_operator, const int is_editable,
        const int ordering,
index 8eee306cf913ccb2523d68ca8648f752554a4f92..b27d7d244c4a05c7b233648f05df8dd77d17a587 100755 (executable)
@@ -28,7 +28,8 @@ typedef struct {
 } bp_image_fmt;
 
 static void __read_png_data_callback(png_structp png_ptr,
-       png_byte *raw_data, png_size_t read_length) {
+       png_byte *raw_data, png_size_t read_length)
+{
        bp_image_fmt *handle = png_get_io_ptr(png_ptr);
        const png_byte *ptr = handle->data + handle->size;
        memcpy(raw_data, ptr, read_length);
@@ -84,14 +85,14 @@ int bp_common_raw_to_png(const unsigned char *raw_data, int width,
                        PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
                png_set_bgr(png_ptr);
                png_bytep *row_pointers = malloc((size_t)(height * sizeof(png_bytep)));
-               if (row_pointers == NULL){
+               if (row_pointers == NULL) {
                        TRACE_ERROR("malloc failed");
                        png_destroy_write_struct(&png_ptr, &info_ptr);
                        free(png_buffer);
                        return -1;
                }
                int j = 0;
-               for (j = 0;j < height; j++)
+               for (j = 0; j < height; j++)
                        row_pointers[j] = (png_bytep)(raw_data + (j * width * 4));
                png_set_rows(png_ptr, info_ptr, (png_bytepp)row_pointers);
                png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
@@ -160,8 +161,8 @@ int bp_common_png_to_raw(const unsigned char *png_data,
        if (color_type == PNG_COLOR_TYPE_PALETTE)
                png_set_palette_to_rgb(png_ptr);
        // Add alpha channel, if there is none.
-    // Rationale: GL_RGBA is faster than GL_RGB on many GPUs)
-    if (color_type == PNG_COLOR_TYPE_PALETTE ||
+       // Rationale: GL_RGBA is faster than GL_RGB on many GPUs)
+       if (color_type == PNG_COLOR_TYPE_PALETTE ||
                        color_type == PNG_COLOR_TYPE_RGB) {
                png_set_add_alpha(png_ptr, 0xff, PNG_FILLER_AFTER);
                png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
@@ -193,7 +194,7 @@ int bp_common_png_to_raw(const unsigned char *png_data,
                        ret = 0;
                }
        }
-       png_destroy_read_struct(&png_ptr, &info_ptr,(png_infopp)0);
+       png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)0);
 
        return ret;
 }
index 080c5420464de8f93e7945ea82f1318d0b700fdd..613ebfae918438b48929208e8d38db23502756a2 100755 (executable)
@@ -51,7 +51,7 @@ static int __adaptor_create_socket()
 
        struct timeval tv_timeo = { 3, 500000 }; //3.5 second
        if (setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv_timeo,
-                       sizeof( tv_timeo ) ) < 0) {
+                       sizeof(tv_timeo)) < 0) {
                TRACE_ERROR("[CRITICAL] setsockopt SO_RCVTIMEO");
                close(sockfd);
                return -1;
@@ -59,11 +59,10 @@ static int __adaptor_create_socket()
 
        bzero(&clientaddr, sizeof(clientaddr));
        clientaddr.sun_family = AF_UNIX;
-       memset(clientaddr.sun_path, 0x00, sizeof(clientaddr.sun_path));
-       strncpy(clientaddr.sun_path, IPC_SOCKET, strlen(IPC_SOCKET));
+       strncpy(clientaddr.sun_path, IPC_SOCKET, sizeof(clientaddr.sun_path));
        clientaddr.sun_path[strlen(IPC_SOCKET)] = '\0';
-       if (connect(sockfd,
-               (struct sockaddr *)&clientaddr, sizeof(clientaddr)) < 0) {
+       if (connect(sockfd, (struct sockaddr*)&clientaddr,
+                       sizeof(clientaddr)) < 0) {
                close(sockfd);
                return -1;
        }
@@ -79,7 +78,7 @@ int bp_common_precheck_string(const char *str)
                int length = strlen(str);
                if (length < 1)
                        TRACE_ERROR("not null, but length is 0");
-               else if(length > BP_MAX_STR_LEN)
+               else if (length > BP_MAX_STR_LEN)
                        TRACE_ERROR("length is more long than %d", BP_MAX_STR_LEN);
                else
                        return length;
@@ -140,10 +139,10 @@ void bp_common_adaptor_close_all(bp_adaptor_defs *adaptorinfo)
 {
        if (adaptorinfo != NULL) {
                close(adaptorinfo->cmd_socket);
-               adaptorinfo->cmd_socket= -1;
+               adaptorinfo->cmd_socket = -1;
                if (adaptorinfo->notify > 0) {
                        close(adaptorinfo->notify);
-                       adaptorinfo->notify= -1;
+                       adaptorinfo->notify = -1;
                }
        }
        bp_shm_free(&adaptorinfo->shm);
@@ -158,9 +157,9 @@ int bp_common_adaptor_connect_to_provider(bp_adaptor_defs **adaptorinfo,
        if (ipcinfo != NULL) {
                int connect_retry = 10;
                ipcinfo->cmd_socket = -1;
-               while(ipcinfo->cmd_socket < 0 && connect_retry-- > 0) {
+               while (ipcinfo->cmd_socket < 0 && connect_retry-- > 0)
                        ipcinfo->cmd_socket = __adaptor_create_socket();
-               }
+
                if (ipcinfo->cmd_socket < 0) {
                        TRACE_ERROR("[CRITICAL] connect system error");
                        free(ipcinfo);
@@ -172,9 +171,9 @@ int bp_common_adaptor_connect_to_provider(bp_adaptor_defs **adaptorinfo,
                bp_error_defs errorcode = BP_ERROR_NONE;
                bp_command_defs cmd = BP_CMD_INITIALIZE;
                if (bp_ipc_send_custom_type(ipcinfo->cmd_socket, &cmd,
-                               sizeof(bp_command_defs)) < 0 ||
+                                       sizeof(bp_command_defs)) < 0 ||
                                bp_ipc_send_custom_type(ipcinfo->cmd_socket, &client_type,
-                               sizeof(bp_client_type_defs)) < 0) {
+                                       sizeof(bp_client_type_defs)) < 0) {
                        TRACE_ERROR("[CRITICAL] failed to send data to provider");
                        close(ipcinfo->cmd_socket);
                        free(ipcinfo);
@@ -184,7 +183,7 @@ int bp_common_adaptor_connect_to_provider(bp_adaptor_defs **adaptorinfo,
                }
                errorcode = bp_ipc_read_errorcode(ipcinfo->cmd_socket);
                int retry_count = BP_MAX_RETRY_COUNT;
-               while((errorcode == BP_ERROR_IO_ERROR) && (errno == EINTR || errno == EAGAIN || errno == EINPROGRESS) && retry_count > 0) {
+               while ((errorcode == BP_ERROR_IO_ERROR) && (errno == EINTR || errno == EAGAIN || errno == EINPROGRESS) && retry_count > 0) {
                        TRACE_ERROR("provider not alive, retry count [%d]", retry_count);
                        retry_count--;
                        struct timespec ts;
@@ -226,13 +225,13 @@ int bp_adaptor_ipc_send_int(int fd, int value)
        }
 
        if (fd >= 0 && write(fd, &value, sizeof(int)) < 0) {
-               if (errno == EPIPE) {
+               if (errno == EPIPE)
                        TRACE_ERROR("[EPIPE] Broken Pipe errno [%d]", errno);
-               } else if (errno == EAGAIN) {
+               else if (errno == EAGAIN)
                        TRACE_ERROR("[EAGAIN] Resource temporarily unavailable errno [%d]", errno);
-               } else {
+               else
                        TRACE_ERROR("errno [%d]", errno);
-               }
+
                return -1;
        }
        return 0;
@@ -293,13 +292,12 @@ int bp_common_adaptor_get_ids_p(const int sock, bp_command_fmt *cmd,
                        return -1;
                }
                *ids = idlist;
-                    return ids_count;
+               return ids_count;
+       } else if (ids_count >= BP_MAX_IDS_COUNT) {
+               TRACE_DEBUG("Count exceeded [%d]", ids_count);
+               return -1;
        }
-        else if (ids_count >= BP_MAX_IDS_COUNT) {
-            TRACE_DEBUG("Count exceeded [%d]", ids_count);
-            return -1;
-        }
-         return -1;
+       return -1;
 }
 
 int bp_common_adaptor_get_string(const int sock, bp_command_fmt *cmd,
@@ -543,7 +541,7 @@ int bp_common_adaptor_get_info_blob(int sock, unsigned char **value,
 {
        int length = 0;
        if ((bp_ipc_read_custom_type(sock, &length,
-                       sizeof(int)) == 0) && (length > 0) &&(length < BP_MAX_INT_COUNT)) {
+                       sizeof(int)) == 0) && (length > 0) && (length < BP_MAX_INT_COUNT)) {
 
                int trans_way = 0; // 0:socket 1:shm
                if (bp_ipc_read_custom_type(sock, &trans_way,
@@ -565,9 +563,8 @@ int bp_common_adaptor_get_info_blob(int sock, unsigned char **value,
                        }
                        *value = buffer;
                } else {
-                       if (bp_shm_read_copy(shm, value, length) < 0) {
+                       if (bp_shm_read_copy(shm, value, length) < 0)
                                return -1;
-                       }
                }
        }
        return length;
@@ -632,13 +629,13 @@ int bp_common_adaptor_get_blob_shm(const int sock,
                                *value = shm->mem;
                }
        }
-         blob_width = bp_adaptor_ipc_read_int(sock);
-         blob_height = bp_adaptor_ipc_read_int(sock);
-       if (blob_width  < 0 || blob_width > BP_MAX_INT_COUNT
-           || blob_height  < 0 || blob_height > BP_MAX_INT_COUNT ) {
-           *errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
-           BP_PRINT_ERROR(cmd->id, *errorcode);
-           return -1;
+       blob_width = bp_adaptor_ipc_read_int(sock);
+       blob_height = bp_adaptor_ipc_read_int(sock);
+       if (blob_width < 0 || blob_width > BP_MAX_INT_COUNT
+                       || blob_height < 0 || blob_height > BP_MAX_INT_COUNT) {
+               *errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
+               BP_PRINT_ERROR(cmd->id, *errorcode);
+               return -1;
        }
        *length = blob_length;
        *width = blob_width;
@@ -666,7 +663,7 @@ int bp_common_adaptor_set_blob_shm(const int sock,
                unsigned char *buffer =
                        (unsigned char *)calloc(byte_length, sizeof(unsigned char));
 
-               if (buffer == NULL){
+               if (buffer == NULL) {
                        *errorcode = BP_ERROR_INVALID_PARAMETER;
                        return -1;
                }
@@ -807,9 +804,9 @@ int bp_common_adaptor_is_sync_adaptor()
 int bp_common_adaptor_disconnect(bp_adaptor_defs **info, pthread_t *tid)
 {
        if (tid != NULL && (*tid > 0 && pthread_kill(*tid, 0) != ESRCH)) {
-               if (pthread_cancel(*tid) != 0) {
+               if (pthread_cancel(*tid) != 0)
                        TRACE_ERROR("pthread:%0x", (int)*tid);
-               }
+
                pthread_join(*tid, NULL);
                *tid = 0;
        }
@@ -861,7 +858,7 @@ int bp_common_adaptor_event_manager(bp_adaptor_defs *adaptorinfo,
        pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
        TRACE_DEBUG("Noti Listening [%d]", sock);
 
-       while(adaptorinfo != NULL && adaptorinfo->notify >= 0) {
+       while (adaptorinfo != NULL && adaptorinfo->notify >= 0) {
 
                // blocking fifo.
                bp_command_defs provider_cmd = BP_CMD_NONE;
@@ -883,7 +880,7 @@ int bp_common_adaptor_event_manager(bp_adaptor_defs *adaptorinfo,
                                (*notify_cb)(*data);
                }
                // end protect callback sections
-               pthread_setcancelstate (PTHREAD_CANCEL_ENABLE,  NULL);
+               pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
 
        } // while
 
index f87bd3e3bd65a621b9877f571de526df18044d6a..899d34296f256be73bff9312c8a6e55b3c32af82 100755 (executable)
@@ -96,14 +96,14 @@ int bp_common_adaptor_disconnect(bp_adaptor_defs **info, pthread_t *tid);
 int bp_common_adaptor_clear_read_buffer(int sock, size_t length);
 
 // Statement Macro
-#define BP_CHECK_PROVIDER_STATUS do {\
-       pthread_mutex_lock(&g_adaptor_mutex);\
-       if (__browser_adaptor_connect(1) < 0) {\
-               TRACE_ERROR("[CHECK connection]");\
-               pthread_mutex_unlock(&g_adaptor_mutex);\
-               return -1;\
-       }\
-} while(0)
+#define BP_CHECK_PROVIDER_STATUS do { \
+       pthread_mutex_lock(&g_adaptor_mutex); \
+       if (__browser_adaptor_connect(1) < 0) { \
+               TRACE_ERROR("[CHECK connection]"); \
+               pthread_mutex_unlock(&g_adaptor_mutex); \
+               return -1; \
+       } \
+} while (0)
 
 #define BP_MAX_IDS_COUNT 512
 #define BP_MAX_INT_COUNT 2147483646
index 1126bf9d4163a1bbb19365d71bbfefe2a1ab9ccc..33374ed409237254284c53c32b6f464e22105803 100644 (file)
  * @ingroup CAPI_BROWSER_PROVIDER_MODULE
  * @internal
  * @defgroup CAPI_WEB_BOOKMARK_MODULE Bookmark
- * @brief  The Bookmark API provides access to the storage for bookmarks managed by the browser-provider process.
+ * @brief The Bookmark API provides access to the storage for bookmarks managed by the browser-provider process.
  *
  * @section CAPI_WEB_BOOKMARK_MODULE_HEADER Required Header
- *   \#include <web_bookmark.h>
+ *  \#include <web_bookmark.h>
  *
  * @section CAPI_WEB_BOOKMARK_MODULE_OVERVIEW Overview
  * The Bookmark API provides access to the storage for bookmarks managed by the browser-provider process.
index 93e18fc9dc4b8ae32c8a38dbc550aa11393dbbd1..c55adef53160b3df0da56da705588b2a88fe734f 100644 (file)
@@ -24,7 +24,7 @@
  * @brief The Bookmark_CSC API provides functions to create and manage one or more bookmarks.
  *
  * @section CAPI_WEB_BOOKMARK_CSC_MODULE_HEADER Required Header
- *   \#include <web_bookmark_csc.h>
+ *  \#include <web_bookmark_csc.h>
  *
  * @section CAPI_WEB_BOOKMARK_CSC_MODULE_OVERVIEW Overview
  * The Bookmark_CSC API provides functions to create and manage one or more bookmarks.
index 198c55c54f467badc4663e31182fd6d9950dfe6a..1c70cc83f0221e0fae4992ecd6b51fce5ad158e7 100755 (executable)
@@ -37,7 +37,7 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED
        ${CMAKE_SOURCE_DIR}/common-adaptor/common-adaptor.c
        ${CMAKE_SOURCE_DIR}/provider/browser-provider-socket.c
        ${CMAKE_SOURCE_DIR}/provider/browser-provider-shm.c
-       ${CMAKE_CURRENT_SOURCE_DIR}/history-adaptor.c )
+       ${CMAKE_CURRENT_SOURCE_DIR}/history-adaptor.c)
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${history_adaptor_pkgs_LDFLAGS} ${BOOKMARK_LINK_LIBRARIES})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${PKG_VERSION})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0)
index c184cbf9f676e43c0f5a12ff1a7e613b1e99fcfc..076d87db96a50d8a540e03550050b5b11fa9a6e0 100755 (executable)
@@ -88,11 +88,11 @@ static int __browser_adaptor_connect(int callback)
        }
        g_bp_command.cmd = BP_CMD_NONE;
        g_bp_command.id = -1;
-       if(g_adaptorinfo != NULL) {
-           g_bp_command.cid = g_adaptorinfo->cid;
-       } else {
-           g_bp_command.cid = 0;
-       }
+       if (g_adaptorinfo != NULL)
+               g_bp_command.cid = g_adaptorinfo->cid;
+       else
+               g_bp_command.cid = 0;
+
        if (callback == 1 && g_adaptor_event_thread_pid <= 0) {
                // create thread here ( getting event_socket )
                if (pthread_create(&g_adaptor_event_thread_pid, NULL,
@@ -355,7 +355,7 @@ int bp_history_adaptor_delete(const int id)
 
 int bp_history_adaptor_get_errorcode(void)
 {
-       switch(errorcode) {
+       switch (errorcode) {
        case BP_ERROR_INVALID_PARAMETER:
                return BP_HISTORY_ERROR_INVALID_PARAMETER;
        case BP_ERROR_OUT_OF_MEMORY:
@@ -507,8 +507,8 @@ int bp_history_adaptor_visit(const int id)
        return __bp_history_adaptor_send_cmd(id, BP_CMD_HISTORY_SET_VISIT);
 }
 
-int bp_history_adaptor_limit_size
-       (const int size, const bp_history_offset order_column_offset, const int ordering)
+int bp_history_adaptor_limit_size(
+       const int size, const bp_history_offset order_column_offset, const int ordering)
 {
        if (size < 0)
                return -1;
@@ -535,7 +535,7 @@ int bp_history_adaptor_limit_size
                return -1;
        }
        if (bp_ipc_send_custom_type(sock, &conds,
-                       sizeof(bp_db_base_conds_fmt)) < 0 ||
+                               sizeof(bp_db_base_conds_fmt)) < 0 ||
                        bp_adaptor_ipc_send_int(sock, size) < 0) {
                errorcode = BP_ERROR_IO_ERROR;
                BP_PRINT_ERROR(-1, errorcode);
@@ -656,26 +656,26 @@ int bp_history_adaptor_get_info(const int id,
        memset(info, 0x00, sizeof(bp_history_info_fmt));
 
        // fill info
-       if (offset & BP_HISTORY_O_FREQUENCY) {
+       if (offset & BP_HISTORY_O_FREQUENCY)
                info->frequency = history.frequency;
-       }
-       if (offset & BP_HISTORY_O_DATE_CREATED) {
+
+       if (offset & BP_HISTORY_O_DATE_CREATED)
                info->date_created = history.date_created;
-       }
-       if (offset & BP_HISTORY_O_DATE_MODIFIED) {
+
+       if (offset & BP_HISTORY_O_DATE_MODIFIED)
                info->date_modified = history.date_modified;
-       }
-       if (offset & BP_HISTORY_O_DATE_VISITED) {
+
+       if (offset & BP_HISTORY_O_DATE_VISITED)
                info->date_visited = history.date_visited;
-       }
+
        // get strings . keep the order with provider
        if (offset & BP_HISTORY_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);
        }
        if (offset & BP_HISTORY_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);
        }
        if (offset & BP_HISTORY_O_ICON) {
                info->favicon_length = 0;
@@ -735,8 +735,8 @@ int bp_history_adaptor_easy_free(bp_history_info_fmt *info)
        return 0;
 }
 
-int bp_history_adaptor_get_date_count
-       (int *count, const bp_history_offset date_column_offset,
+int bp_history_adaptor_get_date_count(
+       int *count, const bp_history_offset date_column_offset,
        const bp_history_date_defs date_type)
 {
        if (count == NULL)
@@ -759,7 +759,7 @@ int bp_history_adaptor_get_date_count
        }
        bp_history_offset oflags = date_column_offset;
        if (bp_ipc_send_custom_type(sock, &oflags,
-                       sizeof(bp_history_offset)) < 0 ||
+                               sizeof(bp_history_offset)) < 0 ||
                        bp_adaptor_ipc_send_int(sock, date_type) < 0) {
                errorcode = BP_ERROR_IO_ERROR;
                BP_PRINT_ERROR(-1, errorcode);
@@ -795,8 +795,8 @@ int bp_history_adaptor_get_date_count
        return 0;
 }
 
-static int __bp_history_adaptor_get_cond_ids_p
-       (bp_command_defs pcommand, int **ids, int *count,
+static int __bp_history_adaptor_get_cond_ids_p(
+       bp_command_defs pcommand, int **ids, int *count,
        bp_history_rows_cond_fmt *conds,
        const bp_history_offset check_offset,
        const char *keyword, const int is_like)
@@ -832,9 +832,9 @@ static int __bp_history_adaptor_get_cond_ids_p
        if (keyword == NULL)
                oflags = 0;
        if (bp_ipc_send_custom_type(sock, &t_conds,
-                       sizeof(bp_history_rows_cond_fmt)) < 0 ||
+                               sizeof(bp_history_rows_cond_fmt)) < 0 ||
                        bp_ipc_send_custom_type(sock, &oflags,
-                       sizeof(bp_history_offset)) < 0) {
+                               sizeof(bp_history_offset)) < 0) {
                errorcode = BP_ERROR_IO_ERROR;
                BP_PRINT_ERROR(-1, errorcode);
                __browser_adaptor_disconnect();
@@ -900,8 +900,8 @@ static int __bp_history_adaptor_get_cond_ids_p
        return 0;
 }
 
-int bp_history_adaptor_get_timestamp_ids_p
-       (int **ids, int *count,
+int bp_history_adaptor_get_timestamp_ids_p(
+       int **ids, int *count,
        const bp_history_rows_fmt *limits,//if NULL, ignore
        const bp_history_timestamp_fmt times[], const int times_count,
        const bp_history_offset check_offset, //if zero, ignore keyword search
@@ -937,7 +937,7 @@ int bp_history_adaptor_get_timestamp_ids_p
        }
 
        if (bp_ipc_send_custom_type(sock, &t_limits,
-                       sizeof(bp_history_rows_fmt)) < 0 ||
+                               sizeof(bp_history_rows_fmt)) < 0 ||
                        bp_adaptor_ipc_send_int(sock, times_count) < 0) {
                errorcode = BP_ERROR_IO_ERROR;
                BP_PRINT_ERROR(-1, errorcode);
@@ -1031,8 +1031,8 @@ int bp_history_adaptor_get_timestamp_ids_p
        return 0;
 }
 
-int bp_history_adaptor_get_cond_ids_p
-       (int **ids, int *count,
+int bp_history_adaptor_get_cond_ids_p(
+       int **ids, int *count,
        bp_history_rows_cond_fmt *conds,
        const bp_history_offset check_offset,
        const char *keyword, const int is_like)
@@ -1042,8 +1042,8 @@ int bp_history_adaptor_get_cond_ids_p
                check_offset, keyword, is_like);
 }
 
-int bp_history_adaptor_get_raw_retrieved_ids_p
-       (int **ids, int *count,
+int bp_history_adaptor_get_raw_retrieved_ids_p(
+       int **ids, int *count,
        bp_history_rows_cond_fmt *conds,
        const bp_history_offset check_offset,
        const char *keyword,
@@ -1059,8 +1059,8 @@ int bp_history_adaptor_reset(void)
        return __bp_history_adaptor_send_cmd(-1, BP_CMD_COMMON_RESET);
 }
 
-int bp_history_adaptor_set_data_changed_cb
-       (bp_history_adaptor_data_changed_cb callback, void *user_data)
+int bp_history_adaptor_set_data_changed_cb(
+       bp_history_adaptor_data_changed_cb callback, void *user_data)
 {
        if (callback == NULL) {
                TRACE_ERROR("check callback address:%p", callback);
@@ -1072,8 +1072,8 @@ int bp_history_adaptor_set_data_changed_cb
        return __bp_history_adaptor_send_cmd(-1, BP_CMD_SET_NOTI_CB);
 }
 
-int bp_history_adaptor_unset_data_changed_cb
-       (bp_history_adaptor_data_changed_cb callback)
+int bp_history_adaptor_unset_data_changed_cb(
+       bp_history_adaptor_data_changed_cb callback)
 {
        if (callback != NULL && callback == g_adaptor_noti_cb) {
                g_adaptor_noti_cb = NULL;
index db62ff47378caab3628e3527c8c1db96034aa5fa..a0d3f47103655cfbcc735ddbcc0f3ab5127a09cd 100755 (executable)
@@ -198,8 +198,8 @@ typedef enum {
  * @brief The structure type containing variables for all properties.
  * @since_tizen 2.3
  * @remarks The caller only has access to the variables which are associated with #bp_history_offset. \n
- *                     The caller has to initialize the structure before using it.\n
- *                     The caller has to free the memory of the structure allocated by bp_history_adaptor_get_info().
+ *                     The caller has to initialize the structure before using it.\n
+ *                     The caller has to free the memory of the structure allocated by bp_history_adaptor_get_info().
  */
 typedef struct {
        int frequency;                      /**< Frequency of use */
@@ -218,7 +218,7 @@ typedef struct {
        char *url;                      /**< Address of the visited site */
        char *title;                /**< Title of the visited site */
        unsigned char *favicon;         /**< Row data of the icon ( favorites icon ) */
-       unsigned char *thumbnail;       /**< Row data of the snapshot */
+       unsigned char *thumbnail;       /**< Row data of the snapshot */
        unsigned char *webicon;         /**< Row data of the webicon */
        char *sync;                             /**< Extra property to sync */
 } bp_history_info_fmt;
@@ -238,7 +238,7 @@ typedef void (*bp_history_adaptor_data_changed_cb)(void *user_data);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_initialize(void);
@@ -249,7 +249,7 @@ EXPORT_API int bp_history_adaptor_initialize(void);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  * @see bp_history_adaptor_initialize()
  */
@@ -263,7 +263,7 @@ EXPORT_API int bp_history_adaptor_deinitialize(void);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[out] value The array containing the URI string value
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_get_url(const int id, char **value);
@@ -276,7 +276,7 @@ EXPORT_API int bp_history_adaptor_get_url(const int id, char **value);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The id of the item
  * @param[out] value The array containing the title string value
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_get_title(const int id, char **value);
@@ -289,7 +289,7 @@ EXPORT_API int bp_history_adaptor_get_title(const int id, char **value);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[out] value The frequency of use
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_get_frequency(const int id, int *value);
@@ -302,7 +302,7 @@ EXPORT_API int bp_history_adaptor_get_frequency(const int id, int *value);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[out] value The timestamp value
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_get_date_created(const int id, int *value);
@@ -315,7 +315,7 @@ EXPORT_API int bp_history_adaptor_get_date_created(const int id, int *value);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[out] value The timestamp value
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_get_date_modified(const int id, int *value);
@@ -328,7 +328,7 @@ EXPORT_API int bp_history_adaptor_get_date_modified(const int id, int *value);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[out] value The timestamp value
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_get_date_visited(const int id, int *value);
@@ -340,7 +340,7 @@ EXPORT_API int bp_history_adaptor_get_date_visited(const int id, int *value);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
-* @remarks The image data value will be stored in the shared memory allocated by the browser-provider.
+ * @remarks The image data value will be stored in the shared memory allocated by the browser-provider.
  *          Therefore, if this API is called multiple times, image contents may be changed, but the pointer will be the same.
  *          PLEASE DO NOT free the 'value' parameter directly after it is assigned.
  *          If you want to use the image data permanently, allocate memory and make a deep copy of the data.
@@ -349,7 +349,7 @@ EXPORT_API int bp_history_adaptor_get_date_visited(const int id, int *value);
  * @param[out] height The height of the image
  * @param[out] value A pointer to the raw image data; this memory will be released automatically when the browser-provider is deinitialized
  * @param[out] length The size of the raw data
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_get_icon(const int id, int *width, int *height, unsigned char **value, int *length);
@@ -370,7 +370,7 @@ EXPORT_API int bp_history_adaptor_get_icon(const int id, int *width, int *height
  * @param[out] height The height of the image
  * @param[out] value A pointer to the raw image data; this memory will be released automatically when the browser provider is deinitialized
  * @param[out] length The size of the raw data
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_get_snapshot(const int id, int *width, int *height, unsigned char **value, int *length);
@@ -391,7 +391,7 @@ EXPORT_API int bp_history_adaptor_get_snapshot(const int id, int *width, int *he
  * @param[out] height The height of the image
  * @param[out] value A pointer to the raw image data; this memory will be released automatically when the browser-provider is deinitialized
  * @param[out] length The size of the raw data
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_get_webicon(const int id, int *width, int *height, unsigned char **value, int *length);
@@ -404,7 +404,7 @@ EXPORT_API int bp_history_adaptor_get_webicon(const int id, int *width, int *hei
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[in] value The URI value
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_set_url(const int id, const char *value);
@@ -417,7 +417,7 @@ EXPORT_API int bp_history_adaptor_set_url(const int id, const char *value);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[in] value The title value
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_set_title(const int id, const char *value);
@@ -430,7 +430,7 @@ EXPORT_API int bp_history_adaptor_set_title(const int id, const char *value);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[in] value The frequency of use
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_set_frequency(const int id, const int value);
@@ -443,7 +443,7 @@ EXPORT_API int bp_history_adaptor_set_frequency(const int id, const int value);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[in] value The timestamp (if less than or equal to @c 0, update to current time automatically)
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_set_date_created(const int id, const int value);
@@ -456,7 +456,7 @@ EXPORT_API int bp_history_adaptor_set_date_created(const int id, const int value
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[in] value The timestamp (if less than or equal to @c 0, update to current time automatically)
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_set_date_modified(const int id, const int value);
@@ -469,7 +469,7 @@ EXPORT_API int bp_history_adaptor_set_date_modified(const int id, const int valu
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
  * @param[in] value The timestamp (if less than or equal to @c 0, update to current time automatically)
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_set_date_visited(const int id, const int value);
@@ -486,7 +486,7 @@ EXPORT_API int bp_history_adaptor_set_date_visited(const int id, const int value
  * @param[in] height The height of the image
  * @param[in] value The raw data of the image
  * @param[in] length The size of the raw data
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_set_icon(const int id, const int width, const int height, const unsigned char *value, const int length);
@@ -503,7 +503,7 @@ EXPORT_API int bp_history_adaptor_set_icon(const int id, const int width, const
  * @param[in] height The height of the image
  * @param[in] value The raw data of the image
  * @param[in] length The size of the raw data
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_set_snapshot(const int id, const int width, const int height, const unsigned char *value, const int length);
@@ -520,7 +520,7 @@ EXPORT_API int bp_history_adaptor_set_snapshot(const int id, const int width, co
  * @param[in] height The height of the image
  * @param[in] value The raw data of the image
  * @param[in] length The size of the raw data
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *          otherwise @c -1
  */
 EXPORT_API int bp_history_adaptor_set_webicon(const int id, const int width, const int height, const unsigned char *value, const int length);
@@ -534,7 +534,7 @@ EXPORT_API int bp_history_adaptor_set_webicon(const int id, const int width, con
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[out] id The ID of the new item (should be a positive unique value)
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  * @see bp_history_adaptor_delete()
  */
@@ -560,7 +560,7 @@ EXPORT_API int bp_history_adaptor_delete(const int id);
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[in] id The ID of the item
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  * @see bp_history_adaptor_set_frequency()
  * @see bp_history_adaptor_set_date_visited()
@@ -576,7 +576,7 @@ EXPORT_API int bp_history_adaptor_visit(const int id);
  * @param [in] size The size
  * @param [in] order_offset A property to be sorted, default is #BP_HISTORY_O_DATE_CREATED
  * @param [in] ordering The way of ordering, @c 0: ASC(default) @c 1: DESC
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1 is returned and the error code is set to indicate the error
  * @see #bp_history_offset
  */
@@ -598,7 +598,7 @@ EXPORT_API int bp_history_adaptor_get_errorcode(void);
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @param[out] id The ID of the new item (should be a positive unique value)
  * @param[in] info The structure contains all properties to set
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_history_info_fmt
@@ -616,7 +616,7 @@ EXPORT_API int bp_history_adaptor_easy_create(int *id, bp_history_info_fmt *info
  * @param[in] id The ID of the item
  * @param[in] offset The value that indicates one or more properties by '|' bit masking
  * @param[in] info The structure containing all properties
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_history_offset
@@ -641,9 +641,9 @@ EXPORT_API int bp_history_adaptor_easy_free(bp_history_info_fmt *info);
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
-*/
+ */
 EXPORT_API int bp_history_adaptor_reset(void);
 
 
@@ -661,7 +661,7 @@ EXPORT_API int bp_history_adaptor_reset(void);
  * @see #bp_history_date_defs
  */
 EXPORT_API int bp_history_adaptor_get_date_count
-       (int *count, const bp_history_offset date_column_offset, const bp_history_date_defs date_type);
+(int *count, const bp_history_offset date_column_offset, const bp_history_date_defs date_type);
 
 /**
  * @brief Gets an ID array and the number of rows of items searched by the given keyword and structure.
@@ -669,22 +669,22 @@ EXPORT_API int bp_history_adaptor_get_date_count
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @remarks The allocated memory (IDs) has to be released by the caller.\n
- *                 If a caller would like to do LIKE searching, the keyword has to have a wild card like _aa, a_a, %aa, aa%, or %aa%.
+ *                 If a caller would like to do LIKE searching, the keyword has to have a wild card like _aa, a_a, %aa, aa%, or %aa%.
  * @param[out] ids The ID array
  * @param[out] count The size of the array
  * @param[in] conds The structure containing conditions bound with the period, the ordering, and the number of searched rows
  * @param[in] check_offset The property to search by keyword (#BP_HISTORY_O_TITLE, #BP_HISTORY_O_URL, or (#BP_HISTORY_O_TITLE | #BP_HISTORY_O_URL))
  * @param[in] keyword The string to search (@c NULL value ignores searching by the keyword)
  * @param[in] is_like The way of searching (@c 1 means LIKE, @c 0 means EQUAL, and negative means NOT EQUAL)
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_history_offset
  * @see #bp_history_rows_cond_fmt
  * @see bp_history_adaptor_get_timestamp_ids_p()
  */
-EXPORT_API int bp_history_adaptor_get_cond_ids_p
-       (int **ids, int *count,
+EXPORT_API int bp_history_adaptor_get_cond_ids_p(
+       int **ids, int *count,
        bp_history_rows_cond_fmt *conds,
        const bp_history_offset check_offset,
        const char *keyword,
@@ -697,7 +697,7 @@ EXPORT_API int bp_history_adaptor_get_cond_ids_p
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @remarks The allocated memory (IDs) has to be released by the caller.
- *                 If a caller would like to do LIKE searching, the keyword has to have a wild card like _aa, a_a, %aa, aa%, or %aa%.
+ *                 If a caller would like to do LIKE searching, the keyword has to have a wild card like _aa, a_a, %aa, aa%, or %aa%.
  * @param[out] ids The ID array
  * @param[out] count The size of the array
  * @param[in] limits The structure containing conditions bound with the period, the ordering, and the number of searched rows
@@ -706,7 +706,7 @@ EXPORT_API int bp_history_adaptor_get_cond_ids_p
  * @param[in] check_offset The property to search by the given keyword (#BP_HISTORY_O_TITLE, #BP_HISTORY_O_URL, or (#BP_HISTORY_O_TITLE | #BP_HISTORY_O_URL))
  * @param[in] keyword The string to search (@c NULL value ignores searching by the keyword)
  * @param[in] is_like The way of searching (@c 1 means LIKE, @c 0 means EQUAL, and negative means NOT EQUAL)
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_history_offset
@@ -714,8 +714,8 @@ EXPORT_API int bp_history_adaptor_get_cond_ids_p
  * @see #bp_history_timestamp_fmt
  * @see bp_history_adaptor_get_cond_ids_p()
  */
-EXPORT_API int bp_history_adaptor_get_timestamp_ids_p
-       (int **ids, int *count,
+EXPORT_API int bp_history_adaptor_get_timestamp_ids_p(
+       int **ids, int *count,
        const bp_history_rows_fmt *limits,
        const bp_history_timestamp_fmt times[], const int times_count,
        const bp_history_offset check_offset,
@@ -729,21 +729,21 @@ EXPORT_API int bp_history_adaptor_get_timestamp_ids_p
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
  * @remarks The allocated memory (IDs) has to be released by the caller.\n
- *                 If a caller would like to do LIKE searching, the keyword has to have a wild card like _aa, a_a, %aa, aa%, or %aa%.
+ *                 If a caller would like to do LIKE searching, the keyword has to have a wild card like _aa, a_a, %aa, aa%, or %aa%.
  * @param[out] ids The ID array
  * @param[out] count The size of the array
  * @param[in] conds The structure containing conditions bound with the period, the ordering, and the number of searched rows
  * @param[in] check_offset The property to search by the given keyword (#BP_BOOKMARK_O_TITLE, #BP_BOOKMARK_O_URL or (#BP_BOOKMARK_O_TITLE | #BP_BOOKMARK_O_URL))
  * @param[in] keyword The string to search (@c NULL value ignores searching by the keyword)
  * @param[in] is_like The way of searching (@c 1 means LIKE, @c 0 means EQUAL, and negative means NOT EQUAL)
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise @c -1
  * @pre First the structure has to be initialized to @c 0, then set the variables to change.
  * @see #bp_history_offset
  * @see #bp_history_rows_cond_fmt
  */
-EXPORT_API int bp_history_adaptor_get_raw_retrieved_ids_p
-       (int **ids, int *count,
+EXPORT_API int bp_history_adaptor_get_raw_retrieved_ids_p(
+       int **ids, int *count,
        bp_history_rows_cond_fmt *conds,
        const bp_history_offset check_offset,
        const char *keyword,
@@ -755,15 +755,15 @@ EXPORT_API int bp_history_adaptor_get_raw_retrieved_ids_p
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
- * @param[in] callback  The function address of the callback function to be called
- * @param[in] user_data  The user data to be passed to the callback function
+ * @param[in] callback The function address of the callback function to be called
+ * @param[in] user_data The user data to be passed to the callback function
  * @return @c 0 on success,
  *         otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_history_adaptor_is_setted_data_changed_cb()
  * @see bp_history_adaptor_unset_data_changed_cb()
  */
-EXPORT_API int bp_history_adaptor_set_data_changed_cb
-       (bp_history_adaptor_data_changed_cb callback, void *user_data);
+EXPORT_API int bp_history_adaptor_set_data_changed_cb(
+       bp_history_adaptor_data_changed_cb callback, void *user_data);
 
 
 /**
@@ -771,14 +771,14 @@ EXPORT_API int bp_history_adaptor_set_data_changed_cb
  * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/web-history.admin
- * @param[in] callback  The function address of the callback function to be called
+ * @param[in] callback The function address of the callback function to be called
  * @return @c 0 on success,
  *         otherwise @c -1 is returned and the error code is set to indicate the error
  * @see bp_history_adaptor_is_setted_data_changed_cb()
  * @see bp_history_adaptor_set_data_changed_cb()
  */
-EXPORT_API int bp_history_adaptor_unset_data_changed_cb
-       (bp_history_adaptor_data_changed_cb callback);
+EXPORT_API int bp_history_adaptor_unset_data_changed_cb(
+       bp_history_adaptor_data_changed_cb callback);
 
 
 /**
index c2382e701ff601749c5b67f7b8427801eb8c817d..81271a959d262473fc66290b555dca65dc959458 100755 (executable)
@@ -80,7 +80,7 @@ ADD_EXECUTABLE(${PROJECT_NAME}
        ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-bookmarks.c
        ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-history.c
        ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-requests-manager.c
-       ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-main.c )
+       ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-main.c)
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${browser_provider_pkgs_LDFLAGS} ${browser_provider_booting_done_pkgs_LDFLAGS} ${BP_LINK_LIBRARIES})
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BIN_INSTALL_DIR})
 
index 91d700bd234a8e2528261e02741fe272dbac6bc3..c25d124ba1b2a2eae5973bedb10dda3105ff96c7 100755 (executable)
@@ -78,8 +78,7 @@ static char *__bp_bookmark_get_date_query(int is_deleted, bp_bookmark_date_defs
        char *date_cond = NULL;
        char *delete_cond = NULL;
        if (is_deleted >= 0)
-               delete_cond = sqlite3_mprintf("%s IS %d", BP_DB_COMMON_COL_IS_DELETED,
-                       is_deleted);
+               delete_cond = sqlite3_mprintf("%s IS %d", BP_DB_COMMON_COL_IS_DELETED, is_deleted);
        if (date_type == BP_BOOKMARK_DATE_TODAY) {
                date_cond =
                        sqlite3_mprintf("DATE(%s) = DATE('now')", checkcolumn);
@@ -96,8 +95,7 @@ static char *__bp_bookmark_get_date_query(int is_deleted, bp_bookmark_date_defs
                                checkcolumn, checkcolumn);
        } else if (date_type == BP_BOOKMARK_DATE_OLDER) {
                date_cond =
-                       sqlite3_mprintf("DATE(%s) <= DATE('now', '-2 months')",
-                               checkcolumn);
+                       sqlite3_mprintf("DATE(%s) <= DATE('now', '-2 months')", checkcolumn);
        }
 
        if (delete_cond != NULL && date_cond != NULL)
@@ -131,7 +129,7 @@ static char *__get_column_by_offset(bp_bookmark_offset offset)
 
 static char *__get_operator(bp_bookmark_timestamp_op_defs op)
 {
-       switch(op) {
+       switch (op) {
        case BP_BOOKMARK_OP_NOT_EQUAL: // !=
                return "IS NOT";
        case BP_BOOKMARK_OP_GREATER: // >
@@ -247,32 +245,32 @@ static bp_error_defs __bp_bookmark_get_cond_ids(int sock, const int raw_search)
                } else {
                        if (raw_search == 0 && (check_offset & BP_BOOKMARK_O_URL)) {
                                errorcode = bp_common_get_duplicated_url_ids(g_db_handle,
-                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
-                               conds.limit, conds.offset,
-                               order_column, conds.ordering, is_like, keyword, conditions);
+                                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
+                                               conds.limit, conds.offset,
+                                               order_column, conds.ordering, is_like, keyword, conditions);
                        } else {
                                char *checkcolumn = NULL;
-                               if (check_offset & BP_BOOKMARK_O_TITLE) {
+                               if (check_offset & BP_BOOKMARK_O_TITLE)
                                        checkcolumn = BP_DB_COMMON_COL_TITLE;
-                               } else if (check_offset & BP_BOOKMARK_O_URL) {
+                               else if (check_offset & BP_BOOKMARK_O_URL)
                                        checkcolumn = BP_DB_COMMON_COL_URL;
-                               } else {
+                               else
                                        errorcode = BP_ERROR_INVALID_PARAMETER;
-                               }
+
                                if (checkcolumn != NULL) {
                                        errorcode = bp_common_get_duplicated_ids(g_db_handle,
-                                       &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
-                                       conds.limit, conds.offset, checkcolumn,
-                                       order_column, conds.ordering, is_like, keyword, conditions);
+                                                       &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
+                                                       conds.limit, conds.offset, checkcolumn,
+                                                       order_column, conds.ordering, is_like, keyword, conditions);
                                }
                        }
                }
 
        } else {
                errorcode = bp_common_get_ids(g_db_handle, &g_db_mutex,
-                       BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
-                       conds.limit, conds.offset,
-                       order_column, conds.ordering, conditions);
+                               BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
+                               conds.limit, conds.offset,
+                               order_column, conds.ordering, conditions);
        }
 
        bp_ipc_send_errorcode(sock, errorcode);
@@ -281,7 +279,7 @@ static bp_error_defs __bp_bookmark_get_cond_ids(int sock, const int raw_search)
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-           free(ids);
+               free(ids);
        free(keyword);
        if (conditions != NULL)
                sqlite3_free(conditions);
@@ -329,23 +327,23 @@ static bp_error_defs __bp_bookmark_get_cond_timestamp_ids(int sock)
                int i = 0;
                for (; i < timestamp_count; i++) {
                        if (bp_ipc_read_custom_type(sock, &t_timestamps[i],
-                               sizeof(bp_bookmark_timestamp_fmt)) < 0) {
+                                       sizeof(bp_bookmark_timestamp_fmt)) < 0) {
                                TRACE_ERROR("[ERROR] TIMESTAMPs [BP_ERROR_IO_ERROR]");
                                bp_ipc_send_errorcode(sock, BP_ERROR_IO_ERROR);
                                return BP_ERROR_IO_ERROR;
                        }
                        if (i == 0) {
                                conditions = sqlite3_mprintf("%s %s datetime(%ld, 'unixepoch')",
-                               __get_column_by_offset(t_timestamps[i].offset),
-                               __get_operator(t_timestamps[i].cmp_operator),
-                               t_timestamps[i].timestamp);
-                       } else {
-                               char *tmp_cond = sqlite3_mprintf
-                                               (" %s (%s %s datetime(%ld, 'unixepoch'))",
-                                               (t_timestamps[i].conds_operator == 0 ? "AND":"OR"),
                                                __get_column_by_offset(t_timestamps[i].offset),
                                                __get_operator(t_timestamps[i].cmp_operator),
                                                t_timestamps[i].timestamp);
+                       } else {
+                               char *tmp_cond = sqlite3_mprintf
+                                       (" %s (%s %s datetime(%ld, 'unixepoch'))",
+                                        (t_timestamps[i].conds_operator == 0 ? "AND" : "OR"),
+                                        __get_column_by_offset(t_timestamps[i].offset),
+                                        __get_operator(t_timestamps[i].cmp_operator),
+                                        t_timestamps[i].timestamp);
                                if (tmp_cond != NULL) {
                                        conditions = bp_merge_strings(conditions, tmp_cond);
                                        sqlite3_free(tmp_cond);
@@ -400,9 +398,9 @@ static bp_error_defs __bp_bookmark_get_cond_timestamp_ids(int sock)
                                (check_offset & BP_BOOKMARK_O_URL)) {
                        // inquired
                        errorcode = bp_common_get_inquired_ids(g_db_handle,
-                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids,
-                               &ids_count, limits.limit, limits.offset, order_column,
-                               limits.ordering, is_like, keyword, conditions, 0);
+                                       &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids,
+                                       &ids_count, limits.limit, limits.offset, order_column,
+                                       limits.ordering, is_like, keyword, conditions, 0);
                } else {
                        if (check_offset & BP_BOOKMARK_O_URL) {
                                errorcode =
@@ -424,9 +422,9 @@ static bp_error_defs __bp_bookmark_get_cond_timestamp_ids(int sock)
 
        } else {
                errorcode = bp_common_get_ids(g_db_handle, &g_db_mutex,
-                       BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
-                       limits.limit, limits.offset,
-                       order_column, limits.ordering, conditions);
+                               BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
+                               limits.limit, limits.offset,
+                               order_column, limits.ordering, conditions);
        }
 
        bp_ipc_send_errorcode(sock, errorcode);
@@ -435,7 +433,7 @@ static bp_error_defs __bp_bookmark_get_cond_timestamp_ids(int sock)
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-           free(ids);
+               free(ids);
        free(keyword);
        if (conditions != NULL)
                sqlite3_free(conditions);
@@ -461,8 +459,8 @@ static bp_error_defs __bp_bookmark_get_duplicated_ids(int sock)
 
        bp_ipc_send_errorcode(sock, BP_ERROR_NONE);
        memset(&conds, 0x00, sizeof(bp_db_base_conds_fmt));
-       if (bp_ipc_read_custom_type
-               (sock, &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
+       if (bp_ipc_read_custom_type(sock,
+                       &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
                TRACE_ERROR("[ERROR] CONDs [BP_ERROR_IO_ERROR]");
                bp_ipc_send_errorcode(sock, BP_ERROR_IO_ERROR);
                return BP_ERROR_IO_ERROR;
@@ -528,28 +526,28 @@ static bp_error_defs __bp_bookmark_get_duplicated_ids(int sock)
        if ((offset & BP_BOOKMARK_O_TITLE) && (offset & BP_BOOKMARK_O_URL)) {
                // inquired
                errorcode = bp_common_get_inquired_ids(g_db_handle,
-                       &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids,
-                       &ids_count, conds.limit, conds.offset, ordercolumn,
-                       conds.ordering, is_like, keyword, conditions, 0);
+                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids,
+                               &ids_count, conds.limit, conds.offset, ordercolumn,
+                               conds.ordering, is_like, keyword, conditions, 0);
        } else {
 
                if (offset & BP_BOOKMARK_O_URL) {
                        errorcode = bp_common_get_duplicated_url_ids(g_db_handle,
-                       &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
-                       conds.limit, conds.offset,
-                       ordercolumn, conds.ordering, is_like, keyword, conditions);
+                                       &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
+                                       conds.limit, conds.offset,
+                                       ordercolumn, conds.ordering, is_like, keyword, conditions);
                } else {
                        if (offset & BP_BOOKMARK_O_TITLE)
                                checkcolumn = BP_DB_COMMON_COL_TITLE;
-                       else if(offset & BP_BOOKMARK_O_SYNC)
+                       else if (offset & BP_BOOKMARK_O_SYNC)
                                checkcolumn = BP_DB_COMMON_COL_SYNC;
                        else
                                errorcode = BP_ERROR_INVALID_PARAMETER;
                        if (checkcolumn != NULL) {
                                errorcode = bp_common_get_duplicated_ids(g_db_handle,
-                                       &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
-                                       conds.limit, conds.offset, checkcolumn, ordercolumn,
-                                       conds.ordering, is_like, keyword, conditions);
+                                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids, &ids_count,
+                                               conds.limit, conds.offset, checkcolumn, ordercolumn,
+                                               conds.ordering, is_like, keyword, conditions);
                        }
                }
 
@@ -585,7 +583,7 @@ static bp_error_defs __bp_bookmark_get_ids(int sock)
        bp_ipc_send_errorcode(sock, BP_ERROR_NONE);
        memset(&conds, 0x00, sizeof(bp_db_base_conds_fmt));
        if (bp_ipc_read_custom_type
-               (sock, &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
+                       (sock, &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
                TRACE_ERROR("[ERROR] CONDs [BP_ERROR_IO_ERROR]");
                bp_ipc_send_errorcode(sock, BP_ERROR_IO_ERROR);
                return BP_ERROR_IO_ERROR;
@@ -630,11 +628,11 @@ static bp_error_defs __bp_bookmark_get_ids(int sock)
                        type, is_operator, is_editable);
 
        char *is_deleted = NULL;
-       if (conditions == NULL) {
+       if (conditions == NULL)
                is_deleted = sqlite3_mprintf("(%s IS 0)", BP_DB_COMMON_COL_IS_DELETED);
-       } else {
+       else
                is_deleted = sqlite3_mprintf(" AND (%s IS 0)", BP_DB_COMMON_COL_IS_DELETED);
-       }
+
        if (is_deleted != NULL) {
                conditions = bp_merge_strings(conditions, is_deleted);
                sqlite3_free(is_deleted);
@@ -651,7 +649,7 @@ static bp_error_defs __bp_bookmark_get_ids(int sock)
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-               free(ids);
+               free(ids);
        if (conditions != NULL)
                sqlite3_free(conditions);
        return errorcode;
@@ -666,7 +664,7 @@ static bp_error_defs __bp_sync_bookmark_get_full_with_deleted_ids(int sock)
        BP_PRE_CHECK;
 
        char *conditions =
-                       sqlite3_mprintf("(%s IS 0)", BP_DB_BOOKMARK_COL_IS_OPERATOR);
+               sqlite3_mprintf("(%s IS 0)", BP_DB_BOOKMARK_COL_IS_OPERATOR);
 
        bp_error_defs errorcode = bp_common_get_ids(g_db_handle,
                        &g_db_mutex, BP_DB_TABLE_BOOKMARK, &ids, &ids_count, -1, 0,
@@ -678,7 +676,7 @@ static bp_error_defs __bp_sync_bookmark_get_full_with_deleted_ids(int sock)
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-               free(ids);
+               free(ids);
        if (conditions != NULL)
                sqlite3_free(conditions);
        return errorcode;
@@ -686,9 +684,8 @@ static bp_error_defs __bp_sync_bookmark_get_full_with_deleted_ids(int sock)
 
 static bp_error_defs __check_write_permission(int id, int ctype)
 {
-       if (id == WEB_BOOKMARK_ROOT_ID) {
+       if (id == WEB_BOOKMARK_ROOT_ID)
                return BP_ERROR_PERMISSION_DENY;
-       }
 
        bp_error_defs errorcode = BP_ERROR_NONE;
        if (ctype == BP_CLIENT_BOOKMARK_SYNC) { // check is_operator
@@ -740,7 +737,7 @@ static bp_error_defs __bp_sync_bookmark_get_dirty_ids(int sock)
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-               free(ids);
+               free(ids);
        if (conditions != NULL)
                sqlite3_free(conditions);
        return errorcode;
@@ -769,7 +766,7 @@ static bp_error_defs __bp_sync_bookmark_get_deleted_ids(int sock)
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-               free(ids);
+               free(ids);
        if (conditions != NULL)
                sqlite3_free(conditions);
        return errorcode;
@@ -874,7 +871,7 @@ static bp_error_defs __bp_bookmark_set_easy_all(int sock, int id, int ctype)
                columns_count = 1; // default dirty
 
        // check the number of the columns to update
-       if (info.type >= 0)  // if negative, ignore
+       if (info.type >= 0) // if negative, ignore
                columns_count++;
        if (info.parent >= 0)
                columns_count++;
@@ -1094,37 +1091,31 @@ static bp_error_defs __bp_bookmark_get_info_offset(int sock, int id, bp_shm_defs
        }
 
        if (offset & BP_BOOKMARK_O_ICON) {
-               int recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_FAVICONS,
+               int recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, &errorcode);
                if (recvint > 0)
                        info.favicon_width = recvint;
-               recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_FAVICONS,
+               recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, &errorcode);
                if (recvint > 0)
                        info.favicon_height = recvint;
        }
        if (offset & BP_BOOKMARK_O_SNAPSHOT) {
-               int recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
+               int recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, &errorcode);
                if (recvint > 0)
                        info.thumbnail_width = recvint;
-               recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
+               recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, &errorcode);
                if (recvint > 0)
                        info.thumbnail_height = recvint;
        }
        if (offset & BP_BOOKMARK_O_WEBICON) {
-               int recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_WEBICONS,
+               int recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_WEBICONS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, &errorcode);
                if (recvint > 0)
                        info.webicon_width = recvint;
-               recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_WEBICONS,
+               recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_WEBICONS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, &errorcode);
                if (recvint > 0)
                        info.webicon_height = recvint;
@@ -1200,8 +1191,7 @@ static bp_error_defs __bp_bookmark_get_info_offset(int sock, int id, bp_shm_defs
                if (sqlite3_column_bytes(g_db_basic_get_info_stmt, 6) <= 0) {
                        bp_ipc_send_errorcode(sock, BP_ERROR_NO_DATA);
                } else {
-                       char *recvstr = (char *)sqlite3_column_text
-                                       (g_db_basic_get_info_stmt, 6);
+                       char *recvstr = (char*)sqlite3_column_text(g_db_basic_get_info_stmt, 6);
                        bp_ipc_send_errorcode(sock, BP_ERROR_NONE);
                        bp_ipc_send_string(sock, recvstr);
                }
@@ -1298,9 +1288,9 @@ static bp_error_defs __bp_bookmark_csc_set_all(int sock, int id)
                        TRACE_ERROR("[ERROR][SQL][%d] SET_DATE_MODIFIED", id);
                }
                int max_sequence = bp_db_get_cond2_int_column(g_db_handle,
-                       BP_DB_TABLE_BOOKMARK, BP_DB_BOOKMARK_COL_SEQUENCE_MAX,
-                       BP_DB_BOOKMARK_COL_PARENT, BP_DB_COL_TYPE_INT, &info.parent,
-                       NULL, BP_DB_COL_TYPE_NONE, NULL, &errorcode);
+                               BP_DB_TABLE_BOOKMARK, BP_DB_BOOKMARK_COL_SEQUENCE_MAX,
+                               BP_DB_BOOKMARK_COL_PARENT, BP_DB_COL_TYPE_INT, &info.parent,
+                               NULL, BP_DB_COL_TYPE_NONE, NULL, &errorcode);
                if (max_sequence > 0) {
                        if (bp_db_set_column(g_db_handle, id, BP_DB_TABLE_BOOKMARK,
                                        BP_DB_BOOKMARK_COL_SEQUENCE,
@@ -1395,8 +1385,8 @@ static bp_error_defs __bp_bookmark_delete_all_childs(int parent, int remove)
                        return BP_ERROR_OUT_OF_MEMORY;
                }
                ids_count = bp_db_get_custom_conds_ids(g_db_handle,
-                       BP_DB_TABLE_BOOKMARK, ids, BP_DB_COMMON_COL_ID,
-                       check_ids_count, 0, NULL, "ASC", conditions, &errorcode);
+                               BP_DB_TABLE_BOOKMARK, ids, BP_DB_COMMON_COL_ID,
+                               check_ids_count, 0, NULL, "ASC", conditions, &errorcode);
        }
        pthread_mutex_unlock(&g_db_mutex);
        if (conditions != NULL)
@@ -1462,9 +1452,9 @@ static bp_error_defs __bp_bookmark_set_is_deleted(int sock, int id)
                type = bp_db_get_int_column(g_db_handle, id,
                        BP_DB_TABLE_BOOKMARK, BP_DB_BOOKMARK_COL_TYPE, &errorcode);
        pthread_mutex_unlock(&g_db_mutex);
-       if (type == 1) {  // set deleted flag of all child
+       if (type == 1) // set deleted flag of all child
                errorcode = __bp_bookmark_delete_all_childs(id, 0);
-       }
+
        if (errorcode == BP_ERROR_NONE) {
                if (id != WEB_BOOKMARK_ROOT_ID) {
                        pthread_mutex_lock(&g_db_mutex);
@@ -1492,9 +1482,9 @@ static bp_error_defs __bp_bookmark_delete(int sock, int id)
        int type = bp_db_get_int_column(g_db_handle, id,
                        BP_DB_TABLE_BOOKMARK, BP_DB_BOOKMARK_COL_TYPE, &errorcode);
        pthread_mutex_unlock(&g_db_mutex);
-       if (type == 1) {  // delete all child
+       if (type == 1) // delete all child
                errorcode = __bp_bookmark_delete_all_childs(id, 1);
-       }
+
        if (errorcode == BP_ERROR_NONE) {
                pthread_mutex_lock(&g_db_mutex);
                if (bp_db_remove_cond(g_db_handle, BP_DB_TABLE_BOOKMARK,
@@ -1710,13 +1700,13 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                errorcode = __bp_bookmark_get_cond_ids(sock, 1);
                break;
        case BP_CMD_COMMON_GET_FULL_IDS:
-               errorcode = bp_common_get_full_ids
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
+               errorcode = bp_common_get_full_ids(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
                break;
        case BP_CMD_COMMON_GET_FULL_WITH_DELETED_IDS:
                if (client->type != BP_CLIENT_BOOKMARK_SYNC) {
-                       errorcode = bp_common_get_full_with_deleted_ids
-                                       (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
+                       errorcode = bp_common_get_full_with_deleted_ids(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
                        break;
                }
                errorcode = __bp_sync_bookmark_get_full_with_deleted_ids(sock);
@@ -1724,16 +1714,16 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
        case BP_CMD_COMMON_GET_DIRTY_IDS:
                if (client->type != BP_CLIENT_BOOKMARK_SYNC) {
                        // include operator's bookmarks
-                       errorcode = bp_common_get_dirty_ids
-                                       (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
+                       errorcode = bp_common_get_dirty_ids(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
                        break;
                }
                errorcode = __bp_sync_bookmark_get_dirty_ids(sock);
                break;
        case BP_CMD_COMMON_GET_DELETED_IDS:
                if (client->type != BP_CLIENT_BOOKMARK_SYNC) {
-                       errorcode = bp_common_get_deleted_ids
-                                       (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
+                       errorcode = bp_common_get_deleted_ids(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
                        break;
                }
                errorcode = __bp_sync_bookmark_get_deleted_ids(sock);
@@ -1745,8 +1735,8 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                errorcode = __bp_bookmark_get_ids(sock);
                break;
        case BP_CMD_COMMON_CLEAR_DIRTY_IDS:
-               errorcode = bp_common_clear_dirty_ids
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
+               errorcode = bp_common_clear_dirty_ids(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock);
                break;
        case BP_CMD_COMMON_CLEAR_DELETED_IDS:
                if (client->type != BP_CLIENT_BOOKMARK_SYNC) {
@@ -1758,73 +1748,59 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                bp_ipc_send_errorcode(sock, errorcode);
                break;
        case BP_CMD_BOOKMARK_GET_TYPE:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_BOOKMARK_COL_TYPE, sock, id);
                break;
        case BP_CMD_BOOKMARK_GET_PARENT:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_BOOKMARK_COL_PARENT, sock, id);
                break;
        case BP_CMD_COMMON_GET_URL:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_URL, sock, id);
                break;
        case BP_CMD_COMMON_GET_TITLE:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_TITLE, sock, id);
                break;
        case BP_CMD_BOOKMARK_GET_SEQUENCE:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_BOOKMARK_COL_SEQUENCE, sock, id);
                break;
        case BP_CMD_BOOKMARK_GET_IS_EDITABLE:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_BOOKMARK_COL_IS_EDITABLE, sock, id);
                break;
        case BP_CMD_BOOKMARK_GET_IS_OPERATOR:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_BOOKMARK_COL_IS_OPERATOR, sock, id);
                break;
        case BP_CMD_BOOKMARK_GET_ACCESS_COUNT:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_BOOKMARK_COL_ACCESS_COUNT, sock, id);
                break;
        case BP_CMD_COMMON_GET_FAVICON:
-               errorcode = bp_common_get_blob
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
+               errorcode = bp_common_get_blob(g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB, sock, id);
                break;
        case BP_CMD_COMMON_GET_FAVICON_WIDTH:
-               errorcode = bp_common_get_blob_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
+               errorcode = bp_common_get_blob_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, sock, id);
                break;
        case BP_CMD_COMMON_GET_FAVICON_HEIGHT:
-               errorcode = bp_common_get_blob_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
+               errorcode = bp_common_get_blob_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, sock, id);
                break;
        case BP_CMD_COMMON_GET_THUMBNAIL:
-               errorcode = bp_common_get_blob
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_get_blob(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB, sock, id);
                break;
        case BP_CMD_COMMON_GET_THUMBNAIL_WIDTH:
-               errorcode = bp_common_get_blob_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_get_blob_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, sock, id);
                break;
        case BP_CMD_COMMON_GET_THUMBNAIL_HEIGHT:
-               errorcode = bp_common_get_blob_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_get_blob_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, sock, id);
                break;
        case BP_CMD_COMMON_GET_ICON:
@@ -1840,52 +1816,43 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                                &g_db_mutex, BP_DB_TABLE_WEBICONS, sock, id, &client->shm);
                break;
        case BP_CMD_COMMON_GET_DATE_CREATED:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DATETIME_CREATED, sock, id);
                break;
        case BP_CMD_COMMON_GET_DATE_MODIFIED:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DATETIME_MODIFIED, sock, id);
                break;
        case BP_CMD_COMMON_GET_DATE_VISITED:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DATETIME_VISITED, sock, id);
                break;
        case BP_CMD_COMMON_GET_ACCOUNT_NAME:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_ACCOUNT_NAME, sock, id);
                break;
        case BP_CMD_COMMON_GET_ACCOUNT_TYPE:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_ACCOUNT_TYPE, sock, id);
                break;
        case BP_CMD_COMMON_GET_DEVICE_NAME:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DEVICE_NAME, sock, id);
                break;
        case BP_CMD_COMMON_GET_DEVICE_ID:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DEVICE_ID, sock, id);
                break;
        case BP_CMD_COMMON_GET_SYNC:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_SYNC, sock, id);
                break;
        case BP_CMD_COMMON_GET_TAG:
-               errorcode = bp_common_get_tag
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TAGS, sock, id);
+               errorcode = bp_common_get_tag(g_db_handle, &g_db_mutex, BP_DB_TABLE_TAGS, sock, id);
                break;
        case BP_CMD_COMMON_GET_TAG_IDS:
-               errorcode = bp_common_get_tag_ids
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TAGS, sock, id);
+               errorcode = bp_common_get_tag_ids(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_TAGS, sock, id);
                break;
        case BP_CMD_COMMON_GET_INFO_OFFSET:
                errorcode = __bp_bookmark_get_info_offset(sock, id, &client->shm);
@@ -1896,8 +1863,7 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                        bp_ipc_send_errorcode(sock, errorcode);
                        break;
                }
-               errorcode = bp_common_set_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_BOOKMARK_COL_TYPE, sock, id);
                break;
        case BP_CMD_BOOKMARK_SET_PARENT:
@@ -1906,8 +1872,7 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                        bp_ipc_send_errorcode(sock, errorcode);
                        break;
                }
-               errorcode = bp_common_set_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_BOOKMARK_COL_PARENT, sock, id);
                break;
        case BP_CMD_COMMON_SET_URL:
@@ -1916,8 +1881,7 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                        bp_ipc_send_errorcode(sock, errorcode);
                        break;
                }
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_URL, sock, id);
                break;
        case BP_CMD_COMMON_SET_TITLE:
@@ -1926,21 +1890,18 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                        bp_ipc_send_errorcode(sock, errorcode);
                        break;
                }
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_TITLE, sock, id);
                break;
        case BP_CMD_BOOKMARK_SET_SEQUENCE:
                errorcode = __bp_bookmark_set_sequence(sock, id);
                break;
        case BP_CMD_BOOKMARK_SET_ACCESS_COUNT:
-               errorcode = bp_common_set_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_BOOKMARK_COL_ACCESS_COUNT, sock, id);
                break;
        case BP_CMD_COMMON_SET_FAVICON:
-               errorcode = bp_common_set_blob
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
+               errorcode = bp_common_set_blob(g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB, sock, id);
                break;
        case BP_CMD_COMMON_SET_FAVICON_WIDTH:
@@ -1954,18 +1915,15 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, sock, id);
                break;
        case BP_CMD_COMMON_SET_THUMBNAIL:
-               errorcode = bp_common_set_blob
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_set_blob(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB, sock, id);
                break;
        case BP_CMD_COMMON_SET_THUMBNAIL_WIDTH:
-               errorcode = bp_common_replace_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_replace_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, sock, id);
                break;
        case BP_CMD_COMMON_SET_THUMBNAIL_HEIGHT:
-               errorcode = bp_common_replace_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_replace_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, sock, id);
                break;
        case BP_CMD_COMMON_SET_ICON:
@@ -1986,64 +1944,53 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                        bp_ipc_send_errorcode(sock, errorcode);
                        break;
                }
-               errorcode = bp_common_set_is_deleted
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock, id);
+               errorcode = bp_common_set_is_deleted(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock, id);
                break;
        case BP_CMD_COMMON_SET_DATE_CREATED:
-               errorcode = bp_common_set_date
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_date(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DATE_CREATED, sock, id);
                break;
        case BP_CMD_COMMON_SET_DATE_MODIFIED:
-               errorcode = bp_common_set_date
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_date(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DATE_MODIFIED, sock, id);
                break;
        case BP_CMD_COMMON_SET_DATE_VISITED:
-               errorcode = bp_common_set_date
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_date(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DATE_VISITED, sock, id);
                break;
        case BP_CMD_COMMON_SET_ACCOUNT_NAME:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_ACCOUNT_NAME, sock, id);
                break;
        case BP_CMD_COMMON_SET_ACCOUNT_TYPE:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_ACCOUNT_TYPE, sock, id);
                break;
        case BP_CMD_COMMON_SET_DEVICE_NAME:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DEVICE_NAME, sock, id);
                break;
        case BP_CMD_COMMON_SET_DEVICE_ID:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_DEVICE_ID, sock, id);
                break;
        case BP_CMD_COMMON_SET_SYNC:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK,
                                BP_DB_COMMON_COL_SYNC, sock, id);
                break;
        case BP_CMD_COMMON_SET_TAG:
-               errorcode = bp_common_set_tag
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TAGS, sock, id);
+               errorcode = bp_common_set_tag(g_db_handle, &g_db_mutex, BP_DB_TABLE_TAGS, sock, id);
                break;
        case BP_CMD_COMMON_UNSET_TAG:
-               errorcode = bp_common_unset_tag
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TAGS, sock, id);
+               errorcode = bp_common_unset_tag(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_TAGS, sock, id);
                break;
        case BP_CMD_COMMON_CREATE:
-               errorcode = bp_common_create
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock, id);
-               if (errorcode == BP_ERROR_NONE &&
-                       client->type == BP_CLIENT_BOOKMARK_SYNC) {
+               errorcode = bp_common_create(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, sock, id);
+               if (errorcode == BP_ERROR_NONE && client->type == BP_CLIENT_BOOKMARK_SYNC)
                        __bp_bookmark_set_max_sequence(id);
-               }
                break;
        case BP_CMD_BOOKMARK_DELETE_NO_CARE_CHILD:
                // workaround API for WEBAPI TC(favorite api)
@@ -2054,8 +2001,7 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                }
 #ifdef SUPPORT_CLOUD_SYSTEM
                if (client->type == BP_CLIENT_BOOKMARK &&
-                               bp_common_is_connected_my_sync_adaptor(slots,
-                                       client->type) == 0) {
+                               bp_common_is_connected_my_sync_adaptor(slots, client->type) == 0) {
                        errorcode = __bp_bookmark_set_is_deleted_no_care_child(sock, id);
                        break;
                }
@@ -2097,8 +2043,8 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                        bp_ipc_send_errorcode(sock, errorcode);
                        break;
                }
-               errorcode = bp_common_set_dirty
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_BOOKMARK, id);
+               errorcode = bp_common_set_dirty(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_BOOKMARK, id);
                break;
        case BP_CMD_BOOKMARK_BACKUP:
                errorcode = __bp_bookmark_backup(sock);
@@ -2126,8 +2072,7 @@ bp_error_defs bp_bookmark_handle_requests(bp_client_slots_defs *slots,
                        if (client->type == BP_CLIENT_BOOKMARK &&
                                        bp_common_is_connected_my_sync_adaptor(slots,
                                                client->type) == 0) { // set is_deleted
-                               errorcode = __bp_bookmark_delete_all_childs
-                                               (WEB_BOOKMARK_ROOT_ID, 0);
+                               errorcode = __bp_bookmark_delete_all_childs(WEB_BOOKMARK_ROOT_ID, 0);
                                bp_ipc_send_errorcode(sock, errorcode);
                                break;
                        }
index abc76ce8e1eeb77d6d7f125a2957b209c1f3ee9f..b303e684999907e61f5476a3cbda07f74da1fafb 100755 (executable)
        if (handle == 0) {\
                TRACE_ERROR("[HANDLE] null");\
                return -1;\
-       }\
+       } \
        if (table == NULL) {\
                TRACE_ERROR("[TABLE] null");\
                return -1;\
-       }\
-} while(0)
+       } \
+} while (0)
 
 #define BP_DB_BASIC_PREPARE do {\
        errorcode = sqlite3_prepare_v2(handle, query, -1, &stmt, NULL);\
                *error = __get_sql_errorcode(errorcode);\
                if (*error == BP_ERROR_NONE)\
                        *error = BP_ERROR_INVALID_PARAMETER;\
-               TRACE_ERROR("[PREPARE] %d:%s", errorcode,\
-                       sqlite3_errmsg(handle));\
+               TRACE_ERROR("[PREPARE] %d:%s", errorcode, sqlite3_errmsg(handle));\
                __bp_finalize(stmt);\
                return -1;\
-       }\
-} while(0)
+       } \
+} while (0)
 
 #define BP_DB_BASIC_BIND_EXCEPTION do {\
        if (errorcode != SQLITE_OK) {\
                *error = __get_sql_errorcode(errorcode);\
                if (*error == BP_ERROR_NONE)\
                        *error = BP_ERROR_INVALID_PARAMETER;\
-               TRACE_ERROR("[BIND] %d:%s", errorcode,\
-                       sqlite3_errmsg(handle));\
+               TRACE_ERROR("[BIND] %d:%s", errorcode, sqlite3_errmsg(handle));\
                __bp_finalize(stmt);\
                return -1;\
-       }\
-} while(0)
+       } \
+} while (0)
 
 static bp_error_defs __get_sql_errorcode(int errorcode)
 {
@@ -88,8 +86,7 @@ static void __bp_finalize(sqlite3_stmt *stmt)
        if (stmt != 0) {
                if (sqlite3_finalize(stmt) != SQLITE_OK) {
                        sqlite3 *handle = sqlite3_db_handle(stmt);
-                       TRACE_ERROR("failed sqlite3_finalize [%s]",
-                               sqlite3_errmsg(handle));
+                       TRACE_ERROR("failed sqlite3_finalize [%s]", sqlite3_errmsg(handle));
                }
        }
 }
@@ -131,47 +128,54 @@ static int __bp_dp_rebuild_tables(sqlite3 *handle, bp_client_type_defs adaptor_t
        if (adaptor_type == BP_CLIENT_BOOKMARK) {
                if (__check_table(handle, BP_DB_TABLE_BOOKMARK) < 0) {
                        ret = sqlite3_exec(handle, BP_SCHEMA_BOOKMARKS, 0, 0, 0);
-                       if (ret == SQLITE_OK) {
+                       if (ret == SQLITE_OK)
                                ret = sqlite3_exec(handle, BP_SCHEMA_BOOKMARKS_INDEX, 0, 0, 0);
-                       }
                }
                if (ret == SQLITE_OK && __check_table(handle, BP_DB_TABLE_FAVICONS) < 0) {
-                       ret = sqlite3_exec(handle, BP_SCHEMA_IMAGE(BP_DB_TABLE_FAVICONS, BP_DB_TABLE_BOOKMARK), 0, 0, 0);
+                       ret = sqlite3_exec(handle,
+                               BP_SCHEMA_IMAGE(BP_DB_TABLE_FAVICONS, BP_DB_TABLE_BOOKMARK), 0, 0, 0);
                }
                if (ret == SQLITE_OK && __check_table(handle, BP_DB_TABLE_THUMBNAILS) < 0) {
-                       ret = sqlite3_exec(handle, BP_SCHEMA_IMAGE(BP_DB_TABLE_THUMBNAILS, BP_DB_TABLE_BOOKMARK), 0, 0, 0);
+                       ret = sqlite3_exec(handle,
+                               BP_SCHEMA_IMAGE(BP_DB_TABLE_THUMBNAILS, BP_DB_TABLE_BOOKMARK), 0, 0, 0);
                }
                if (ret == SQLITE_OK && __check_table(handle, BP_DB_TABLE_WEBICONS) < 0) {
-                       ret = sqlite3_exec(handle, BP_SCHEMA_IMAGE(BP_DB_TABLE_WEBICONS, BP_DB_TABLE_BOOKMARK), 0, 0, 0);
+                       ret = sqlite3_exec(handle,
+                               BP_SCHEMA_IMAGE(BP_DB_TABLE_WEBICONS, BP_DB_TABLE_BOOKMARK), 0, 0, 0);
                }
                if (ret == SQLITE_OK && __check_table(handle, BP_DB_TABLE_TAGS) < 0) {
-                       ret = sqlite3_exec(handle, BP_SCHEMA_TAGS(BP_DB_TABLE_TAGS, BP_DB_TABLE_BOOKMARK), 0, 0, 0);
+                       ret = sqlite3_exec(handle,
+                               BP_SCHEMA_TAGS(BP_DB_TABLE_TAGS, BP_DB_TABLE_BOOKMARK), 0, 0, 0);
                }
        } else if (adaptor_type == BP_CLIENT_HISTORY) {
                if (__check_table(handle, BP_DB_TABLE_HISTORY) < 0) {
                        ret = sqlite3_exec(handle, BP_SCHEMA_HISTORY, 0, 0, 0);
-                       if (ret == SQLITE_OK) {
+                       if (ret == SQLITE_OK)
                                ret = sqlite3_exec(handle, BP_SCHEMA_HISTORY_INDEX, 0, 0, 0);
-                       }
                }
                if (ret == SQLITE_OK && __check_table(handle, BP_DB_TABLE_FAVICONS) < 0) {
-                       ret = sqlite3_exec(handle, BP_SCHEMA_IMAGE(BP_DB_TABLE_FAVICONS, BP_DB_TABLE_HISTORY), 0, 0, 0);
+                       ret = sqlite3_exec(handle,
+                               BP_SCHEMA_IMAGE(BP_DB_TABLE_FAVICONS, BP_DB_TABLE_HISTORY), 0, 0, 0);
                }
                if (ret == SQLITE_OK && __check_table(handle, BP_DB_TABLE_THUMBNAILS) < 0) {
-                       ret = sqlite3_exec(handle, BP_SCHEMA_IMAGE(BP_DB_TABLE_THUMBNAILS, BP_DB_TABLE_HISTORY), 0, 0, 0);
+                       ret = sqlite3_exec(handle,
+                               BP_SCHEMA_IMAGE(BP_DB_TABLE_THUMBNAILS, BP_DB_TABLE_HISTORY), 0, 0, 0);
                }
                if (ret == SQLITE_OK && __check_table(handle, BP_DB_TABLE_WEBICONS) < 0) {
-                       ret = sqlite3_exec(handle, BP_SCHEMA_IMAGE(BP_DB_TABLE_WEBICONS, BP_DB_TABLE_HISTORY), 0, 0, 0);
+                       ret = sqlite3_exec(handle,
+                               BP_SCHEMA_IMAGE(BP_DB_TABLE_WEBICONS, BP_DB_TABLE_HISTORY), 0, 0, 0);
                }
        } else if (adaptor_type == BP_CLIENT_TABS) {
-               if (__check_table(handle, BP_DB_TABLE_TABS) < 0) {
+               if (__check_table(handle, BP_DB_TABLE_TABS) < 0)
                        ret = sqlite3_exec(handle, BP_SCHEMA_TABS, 0, 0, 0);
-               }
+
                if (ret == SQLITE_OK && __check_table(handle, BP_DB_TABLE_FAVICONS) < 0) {
-                       ret = sqlite3_exec(handle, BP_SCHEMA_IMAGE(BP_DB_TABLE_FAVICONS, BP_DB_TABLE_TABS), 0, 0, 0);
+                       ret = sqlite3_exec(handle,
+                               BP_SCHEMA_IMAGE(BP_DB_TABLE_FAVICONS, BP_DB_TABLE_TABS), 0, 0, 0);
                }
                if (ret == SQLITE_OK && __check_table(handle, BP_DB_TABLE_THUMBNAILS) < 0) {
-                       ret = sqlite3_exec(handle, BP_SCHEMA_IMAGE(BP_DB_TABLE_THUMBNAILS, BP_DB_TABLE_TABS), 0, 0, 0);
+                       ret = sqlite3_exec(handle,
+                               BP_SCHEMA_IMAGE(BP_DB_TABLE_THUMBNAILS, BP_DB_TABLE_TABS), 0, 0, 0);
                }
        }
 
@@ -218,8 +222,7 @@ int bp_db_open(sqlite3 **handle, char *database)
 
                if (sqlite3_open_v2(database, handle, SQLITE_OPEN_READWRITE,
                                NULL) != SQLITE_OK) {
-                       TRACE_ERROR
-                               ("[ERROR][%s][%s]", database, sqlite3_errmsg(*handle));
+                       TRACE_ERROR("[ERROR][%s][%s]", database, sqlite3_errmsg(*handle));
                        int errorcode = sqlite3_errcode(*handle);
                        *handle = 0;
                        if (errorcode == SQLITE_CORRUPT) { // remove & re-create
@@ -229,7 +232,7 @@ int bp_db_open(sqlite3 **handle, char *database)
                        }
                        if (errorcode == SQLITE_CANTOPEN) {
                                // create empty database
-                               if (sqlite3_open(database, handle) != SQLITE_OK ) {
+                               if (sqlite3_open(database, handle) != SQLITE_OK) {
                                        TRACE_SECURE_INFO("failed to connect:%s", database);
                                        unlink(database);
                                        return -1;
@@ -271,8 +274,7 @@ void bp_db_reset(sqlite3_stmt *stmt)
                sqlite3_clear_bindings(stmt);
                if (sqlite3_reset(stmt) != SQLITE_OK) {
                        sqlite3 *handle = sqlite3_db_handle(stmt);
-                       TRACE_ERROR("[ERROR] reset:%s",
-                               sqlite3_errmsg(handle));
+                       TRACE_ERROR("[ERROR] reset:%s", sqlite3_errmsg(handle));
                }
        }
 }
@@ -398,7 +400,7 @@ sqlite3_stmt *bp_db_prepare_basic_get_info_stmt(sqlite3 *handle,
 }
 
 static int __bp_sql_bind_value(sqlite3_stmt *stmt,
-       bp_column_data_defs condtype,  void *value, int index)
+       bp_column_data_defs condtype, void *value, int index)
 {
        int errorcode = SQLITE_ERROR;
        int *cast_value = 0;
@@ -421,8 +423,7 @@ static int __bp_sql_bind_value(sqlite3_stmt *stmt,
 #endif
                break;
        case BP_DB_COL_TYPE_TEXT:
-               errorcode = sqlite3_bind_text(stmt, index, (char *)value, -1,
-                       SQLITE_STATIC);
+               errorcode = sqlite3_bind_text(stmt, index, (char *)value, -1, SQLITE_STATIC);
                break;
        case BP_DB_COL_TYPE_DATETIME:
                cast_value = value;
@@ -436,7 +437,7 @@ static int __bp_sql_bind_value(sqlite3_stmt *stmt,
 }
 
 int bp_db_bind_value(sqlite3_stmt *stmt,
-       bp_column_data_defs condtype,  void *value, int index)
+       bp_column_data_defs condtype, void *value, int index)
 {
        return __bp_sql_bind_value(stmt, condtype, value, index);
 }
@@ -479,12 +480,12 @@ int bp_db_set_datetime(sqlite3 *handle, int id, char *table,
 
        if (timestamp <= 0) {
                query = sqlite3_mprintf(
-                       "UPDATE %s SET %s = DATETIME('NOW') WHERE id = ?",
-                       table, column);
+                               "UPDATE %s SET %s = DATETIME('NOW') WHERE id = ?",
+                               table, column);
        } else {
                query = sqlite3_mprintf(
-                       "UPDATE %s SET %s = DATETIME(%d, 'unixepoch') WHERE id = ?",
-                       table, column, timestamp);
+                               "UPDATE %s SET %s = DATETIME(%d, 'unixepoch') WHERE id = ?",
+                               table, column, timestamp);
        }
        if (query == NULL) {
                TRACE_ERROR("[CHECK COMBINE]");
@@ -568,10 +569,10 @@ int bp_db_limit_rows(sqlite3 *handle, char *table, int limit_size,
        if (ordering == NULL)
                ordering = "ASC";
 
-       char *query = sqlite3_mprintf
-                       ("DELETE FROM %s WHERE %s NOT IN (SELECT %s FROM %s ORDER BY %s %s LIMIT %d)",
-                       table, BP_DB_COMMON_COL_ID, BP_DB_COMMON_COL_ID,
-                       table, ordercolumn, ordering, limit_size);
+       char *query = sqlite3_mprintf(
+               "DELETE FROM %s WHERE %s NOT IN (SELECT %s FROM %s ORDER BY %s %s LIMIT %d)",
+               table, BP_DB_COMMON_COL_ID, BP_DB_COMMON_COL_ID,
+               table, ordercolumn, ordering, limit_size);
 
        BP_DB_BASIC_PREPARE;
 
@@ -644,7 +645,7 @@ static char *__make_conds_ids_query(char *table, char *getcolumn,
                getcolumn = BP_DB_COMMON_COL_ID;
        if (condition == NULL) {
                query = sqlite3_mprintf("SELECT %s FROM %s", getcolumn, table);
-       } else  {
+       } else {
                query = sqlite3_mprintf("SELECT %s FROM %s WHERE %s", getcolumn,
                                table, condition);
        }
@@ -721,7 +722,7 @@ int bp_db_get_custom_bind_conds_rows_count(sqlite3 *handle, char *table,
        } else {
                BP_DB_BASIC_PREPARE;
                int i = 0;
-               for (;i < bind_count; i++) {
+               for (; i < bind_count; i++) {
                        if (sqlite3_bind_text(stmt, (i+1), keyword, -1,
                                        SQLITE_STATIC) != SQLITE_OK) {
                                TRACE_ERROR("[BIND] %s", sqlite3_errmsg(handle));
@@ -752,7 +753,7 @@ int bp_db_get_custom_bind_conds_ids(sqlite3 *handle, char *table,
        } else {
                BP_DB_BASIC_PREPARE;
                int i = 0;
-               for (;i < bind_count; i++) {
+               for (; i < bind_count; i++) {
                        if (sqlite3_bind_text(stmt, (i+1), keyword, -1,
                                        SQLITE_STATIC) != SQLITE_OK) {
                                TRACE_ERROR("[BIND] %s", sqlite3_errmsg(handle));
@@ -829,7 +830,7 @@ int bp_db_get_custom_conds_ids(sqlite3 *handle, char *table, int *ids,
                getcolumn = BP_DB_COMMON_COL_ID;
        if (condition == NULL) {
                query = sqlite3_mprintf("SELECT %s FROM %s", getcolumn, table);
-       } else  {
+       } else {
                query = sqlite3_mprintf("SELECT %s FROM %s WHERE %s", getcolumn,
                                table, condition);
        }
@@ -907,8 +908,7 @@ int bp_db_insert_column(sqlite3 *handle, int id, char *table,
                return -1;
        }
 
-       query = sqlite3_mprintf
-                       ("INSERT INTO %s (id, %s) VALUES (?, DATETIME('NOW'))",
+       query = sqlite3_mprintf("INSERT INTO %s (id, %s) VALUES (?, DATETIME('NOW'))",
                        table, date_column);
        if (query == NULL) {
                TRACE_ERROR("[CHECK COMBINE]");
@@ -949,8 +949,7 @@ int bp_db_insert3_column(sqlite3 *handle, char *table, char *column,
        }
 
        if (column2 == NULL) {
-               query = sqlite3_mprintf
-                               ("INSERT INTO %s (%s) VALUES (?)", table, column);
+               query = sqlite3_mprintf("INSERT INTO %s (%s) VALUES (?)", table, column);
        } else {
                if (column3 == NULL) {
                        query = sqlite3_mprintf
@@ -1235,8 +1234,7 @@ char *bp_db_get_text_column(sqlite3 *handle, int id, char *table,
                *error = __get_sql_errorcode(errorcode);
                if (*error == BP_ERROR_NONE)
                        *error = BP_ERROR_INVALID_PARAMETER;
-               TRACE_ERROR("[PREPARE] %d:%s", errorcode,
-                       sqlite3_errmsg(handle));
+               TRACE_ERROR("[PREPARE] %d:%s", errorcode, sqlite3_errmsg(handle));
                __bp_finalize(stmt);
                return NULL;
        }
@@ -1245,8 +1243,7 @@ char *bp_db_get_text_column(sqlite3 *handle, int id, char *table,
                *error = __get_sql_errorcode(errorcode);
                if (*error == BP_ERROR_NONE)
                        *error = BP_ERROR_INVALID_PARAMETER;
-               TRACE_ERROR("[BIND] %d:%s", errorcode,
-                       sqlite3_errmsg(handle));
+               TRACE_ERROR("[BIND] %d:%s", errorcode, sqlite3_errmsg(handle));
                __bp_finalize(stmt);
                return NULL;
        }
@@ -1258,8 +1255,7 @@ char *bp_db_get_text_column(sqlite3 *handle, int id, char *table,
                if (getbytes > 0) {
                        getstr = (char *)calloc(getbytes + 1, sizeof(char));
                        if (getstr != NULL) {
-                               memcpy(getstr, sqlite3_column_text(stmt, 0),
-                                       getbytes * sizeof(char));
+                               memcpy(getstr, sqlite3_column_text(stmt, 0), getbytes * sizeof(char));
                                getstr[getbytes] = '\0';
                        } else {
                                TRACE_ERROR("[MEM] allocating");
@@ -1309,8 +1305,7 @@ char *bp_db_get_cond2_text_column(sqlite3 *handle, char *table,
                query = sqlite3_mprintf("SELECT %s FROM %s WHERE %s is ?",
                                column, table, condcolumn);
        } else {
-               query = sqlite3_mprintf
-                               ("SELECT %s FROM %s WHERE %s is ? AND %s is ?",
+               query = sqlite3_mprintf("SELECT %s FROM %s WHERE %s is ? AND %s is ?",
                                column, table, condcolumn, condcolumn2);
        }
        if (query == NULL) {
@@ -1323,8 +1318,7 @@ char *bp_db_get_cond2_text_column(sqlite3 *handle, char *table,
                *error = __get_sql_errorcode(errorcode);
                if (*error == BP_ERROR_NONE)
                        *error = BP_ERROR_INVALID_PARAMETER;
-               TRACE_ERROR("[PREPARE] %d:%s", errorcode,
-                       sqlite3_errmsg(handle));
+               TRACE_ERROR("[PREPARE] %d:%s", errorcode, sqlite3_errmsg(handle));
                __bp_finalize(stmt);
                return NULL;
        }
@@ -1343,8 +1337,7 @@ char *bp_db_get_cond2_text_column(sqlite3 *handle, char *table,
                        *error = __get_sql_errorcode(errorcode);
                        if (*error == BP_ERROR_NONE)
                                *error = BP_ERROR_INVALID_PARAMETER;
-                       TRACE_ERROR("[BIND] %d:%s", errorcode,
-                               sqlite3_errmsg(handle));
+                       TRACE_ERROR("[BIND] %d:%s", errorcode, sqlite3_errmsg(handle));
                        __bp_finalize(stmt);
                        return NULL;
                }
@@ -1357,8 +1350,7 @@ char *bp_db_get_cond2_text_column(sqlite3 *handle, char *table,
                if (getbytes > 0) {
                        getstr = (char *)calloc(getbytes + 1, sizeof(char));
                        if (getstr != NULL) {
-                               memcpy(getstr, sqlite3_column_text(stmt, 0),
-                                       getbytes * sizeof(char));
+                               memcpy(getstr, sqlite3_column_text(stmt, 0), getbytes * sizeof(char));
                                getstr[getbytes] = '\0';
                        } else {
                                TRACE_ERROR("[MEM] allocating");
@@ -1397,8 +1389,7 @@ int bp_db_set_blob_column(sqlite3 *handle, int id, char *table,
                query = sqlite3_mprintf("UPDATE %s SET %s = ?", table, column);
        } else {
                query =
-                       sqlite3_mprintf
-                               ("UPDATE %s SET %s = ? WHERE id = ?", table, column);
+                       sqlite3_mprintf("UPDATE %s SET %s = ? WHERE id = ?", table, column);
        }
        if (query == NULL) {
                TRACE_ERROR("[CHECK COMBINE]");
@@ -1464,8 +1455,7 @@ sqlite3_stmt *bp_db_get_blob_stmt(sqlite3 *handle, int id, char *table,
                *error = __get_sql_errorcode(errorcode);
                if (*error == BP_ERROR_NONE)
                        *error = BP_ERROR_INVALID_PARAMETER;
-               TRACE_ERROR("[PREPARE] %d:%s", errorcode,
-                       sqlite3_errmsg(handle));
+               TRACE_ERROR("[PREPARE] %d:%s", errorcode, sqlite3_errmsg(handle));
                __bp_finalize(stmt);
                return NULL;
        }
@@ -1518,11 +1508,10 @@ int bp_db_get_blob_column(sqlite3 *handle, int id, char *table,
        if (errorcode == SQLITE_ROW) {
                blob_length = sqlite3_column_bytes(stmt, 0);
                if (blob_length > 0) {
-                       *data = (unsigned char *)calloc
-                                       (blob_length, sizeof(unsigned char));
+                       *data = calloc(blob_length, sizeof(unsigned char));
                        if (*data != NULL) {
                                memcpy(*data, sqlite3_column_blob(stmt, 0),
-                               sizeof(unsigned char) * blob_length);
+                                               sizeof(unsigned char) * blob_length);
                        } else {
                                TRACE_ERROR("[MEM] allocating");
                                *error = BP_ERROR_OUT_OF_MEMORY;
@@ -1614,8 +1603,7 @@ int bp_db_get_cond2_int_column(sqlite3 *handle, char *table,
                query = sqlite3_mprintf("SELECT %s FROM %s WHERE %s is ?",
                                column, table, condcolumn);
        } else {
-               query = sqlite3_mprintf
-                               ("SELECT %s FROM %s WHERE %s is ? AND %s is ?",
+               query = sqlite3_mprintf("SELECT %s FROM %s WHERE %s is ? AND %s is ?",
                                column, table, condcolumn, condcolumn2);
        }
        if (query == NULL) {
@@ -1712,7 +1700,7 @@ int bp_db_get_columns(sqlite3 *handle, int id, char *table,
                                        *getint_p = sqlite3_column_int(stmt, i);
                                        columns[i].value = getint_p;
                                }
-                       } else if (sqlite3_column_type(stmt, i) == SQLITE_TEXT){
+                       } else if (sqlite3_column_type(stmt, i) == SQLITE_TEXT) {
                                int getbytes = sqlite3_column_bytes(stmt, i);
                                columns[i].length = 0;
                                if (getbytes > 0) {
@@ -1726,12 +1714,11 @@ int bp_db_get_columns(sqlite3 *handle, int id, char *table,
                                                columns[i].length = getbytes;
                                        }
                                }
-                       } else if (sqlite3_column_type(stmt, i) == SQLITE_BLOB){
+                       } else if (sqlite3_column_type(stmt, i) == SQLITE_BLOB) {
                                int getbytes = sqlite3_column_bytes(stmt, i);
                                columns[i].length = 0;
                                if (getbytes > 0) {
-                                       columns[i].value = (unsigned char *)calloc
-                                                       (getbytes, sizeof(unsigned char));
+                                       columns[i].value = calloc(getbytes, sizeof(unsigned char));
                                        if (columns[i].value != NULL) {
                                                memcpy(columns[i].value,
                                                        sqlite3_column_blob(stmt, i),
@@ -1837,11 +1824,9 @@ int bp_db_remove_cond2(sqlite3 *handle, char *table, char *condcolumn,
                query = sqlite3_mprintf("DELETE FROM %s", table);
        } else {
                if (condcolumn2 == NULL) {
-                       query = sqlite3_mprintf
-                                       ("DELETE FROM %s WHERE %s is ?", table, condcolumn);
+                       query = sqlite3_mprintf("DELETE FROM %s WHERE %s is ?", table, condcolumn);
                } else {
-                       query = sqlite3_mprintf
-                                       ("DELETE FROM %s WHERE %s is ? AND %s is ?",
+                       query = sqlite3_mprintf("DELETE FROM %s WHERE %s is ? AND %s is ?",
                                        table, condcolumn, condcolumn2);
                }
        }
@@ -1890,33 +1875,32 @@ int bp_db_backup(sqlite3 *handle, char *path)
        }
 
        errorcode = sqlite3_open(path, &backup_handle);
-       if(backup_handle) {
-           if (errorcode == SQLITE_OK) {
-                   pbackup =
-                               sqlite3_backup_init(backup_handle, "main", handle, "main");
-                   if (pbackup == NULL) {
-                           sqlite3_close(backup_handle);
-                           TRACE_ERROR("[INIT]");
-                           return -1;
-                   }
-                   do {
-                       errorcode = sqlite3_backup_step(pbackup, -1);
-                       TRACE_SECURE_INFO("progress (%d)",
-                               (100 * (sqlite3_backup_pagecount(pbackup) -
-                               sqlite3_backup_remaining(pbackup)) /
-                               sqlite3_backup_pagecount(pbackup)));
-                   } while (errorcode == SQLITE_OK); // more pages to be copied
-                   sqlite3_backup_finish(pbackup);
-                   if (errorcode == SQLITE_DONE) { // finished
-                       sqlite3_close(backup_handle);
-                       return 0;
+       if (backup_handle) {
+               if (errorcode == SQLITE_OK) {
+                       pbackup =
+                               sqlite3_backup_init(backup_handle, "main", handle, "main");
+                       if (pbackup == NULL) {
+                               sqlite3_close(backup_handle);
+                               TRACE_ERROR("[INIT]");
+                               return -1;
+                       }
+                       do {
+                               errorcode = sqlite3_backup_step(pbackup, -1);
+                               TRACE_SECURE_INFO("progress (%d)",
+                                       (100 * (sqlite3_backup_pagecount(pbackup) -
+                                               sqlite3_backup_remaining(pbackup)) /
+                                               sqlite3_backup_pagecount(pbackup)));
+                       } while (errorcode == SQLITE_OK); // more pages to be copied
+                       sqlite3_backup_finish(pbackup);
+                       if (errorcode == SQLITE_DONE) { // finished
+                               sqlite3_close(backup_handle);
+                               return 0;
+                       }
                }
-        }
-        TRACE_ERROR("[ERROR] [%s]", sqlite3_errmsg(backup_handle));
-        (void)sqlite3_close(backup_handle);
-       }
-       else {
-               TRACE_ERROR("bp_db_backup()  backup_handle is NULL");
+               TRACE_ERROR("[ERROR] [%s]", sqlite3_errmsg(backup_handle));
+               (void)sqlite3_close(backup_handle);
+       } else {
+               TRACE_ERROR("bp_db_backup() backup_handle is NULL");
        }
        return -1;
 }
@@ -1937,35 +1921,34 @@ int bp_db_restore(sqlite3 *handle, char *path)
        }
 
        errorcode = sqlite3_open(path, &backup_handle);
-       if(backup_handle) {
-           if (errorcode == SQLITE_OK) {
-               pbackup =
-                       sqlite3_backup_init(handle, "main", backup_handle, "main");
-               if (pbackup == NULL) {
-                       sqlite3_close(backup_handle);
-                       TRACE_ERROR("[INIT]");
-                       return -1;
-               }
-               do {
-                       errorcode = sqlite3_backup_step(pbackup, -1);
-                       TRACE_SECURE_INFO("progress (%d)",
-                               (100 * (sqlite3_backup_pagecount(pbackup) -
-                               sqlite3_backup_remaining(pbackup)) /
-                               sqlite3_backup_pagecount(pbackup)));
-               } while (errorcode == SQLITE_OK); // more pages to be copied
-               sqlite3_backup_finish(pbackup);
-               if (errorcode == SQLITE_DONE) { // finished
-                       sqlite3_close(backup_handle);
-                       return 0;
+       if (backup_handle) {
+               if (errorcode == SQLITE_OK) {
+                       pbackup =
+                               sqlite3_backup_init(handle, "main", backup_handle, "main");
+                       if (pbackup == NULL) {
+                               sqlite3_close(backup_handle);
+                               TRACE_ERROR("[INIT]");
+                               return -1;
+                       }
+                       do {
+                               errorcode = sqlite3_backup_step(pbackup, -1);
+                               TRACE_SECURE_INFO("progress (%d)",
+                                       (100 * (sqlite3_backup_pagecount(pbackup) -
+                                               sqlite3_backup_remaining(pbackup)) /
+                                               sqlite3_backup_pagecount(pbackup)));
+                       } while (errorcode == SQLITE_OK); // more pages to be copied
+                       sqlite3_backup_finish(pbackup);
+                       if (errorcode == SQLITE_DONE) { // finished
+                               sqlite3_close(backup_handle);
+                               return 0;
+                       }
                }
-          }
-          TRACE_ERROR("[ERROR] [%s]", sqlite3_errmsg(backup_handle));
-          (void)sqlite3_close(backup_handle);
-      }
-      else {
-       TRACE_ERROR("bp_db_restore()  backup_handle is NULL");
-      }
-       return -1;
+               TRACE_ERROR("[ERROR] [%s]", sqlite3_errmsg(backup_handle));
+               (void)sqlite3_close(backup_handle);
+       } else {
+               TRACE_ERROR("bp_db_restore() backup_handle is NULL");
+       }
+       return -1;
 }
 
 char *bp_db_get_text_stmt(sqlite3_stmt* stmt, int index)
@@ -1980,7 +1963,7 @@ char *bp_db_get_text_stmt(sqlite3_stmt* stmt, int index)
                if (getstr != NULL) {
                        char *gettext = NULL;
                        gettext = sqlite3_column_text(stmt, index);
-                       if (gettext != NULL){
+                       if (gettext != NULL) {
                                memcpy(getstr, gettext,
                                                getbytes * sizeof(char));
                                getstr[getbytes] = '\0';
index 2731e81e9db3e425f50696d38929341a1b5670ed..d8199f4f973b0ee8a7c5db9dfbac2e70d9860dee 100755 (executable)
@@ -143,7 +143,7 @@ static char *__get_column_by_offset(bp_history_offset offset)
 
 static char *__get_operator(bp_history_timestamp_op_defs op)
 {
-       switch(op) {
+       switch (op) {
        case BP_HISTORY_OP_NOT_EQUAL: // !=
                return "IS NOT";
        case BP_HISTORY_OP_GREATER: // >
@@ -242,23 +242,23 @@ static bp_error_defs __bp_history_get_cond_ids(int sock, const int raw_search)
 
                        if (raw_search == 0 && check_offset & BP_HISTORY_O_URL) {
                                errorcode = bp_common_get_duplicated_url_ids(g_db_handle,
-                               &g_db_mutex, BP_DB_TABLE_HISTORY, &ids, &ids_count,
-                               conds.limit, conds.offset,
-                               order_column, conds.ordering, is_like, keyword, conditions);
+                                               &g_db_mutex, BP_DB_TABLE_HISTORY, &ids, &ids_count,
+                                               conds.limit, conds.offset,
+                                               order_column, conds.ordering, is_like, keyword, conditions);
                        } else if (check_offset & BP_HISTORY_O_TITLE) {
                                char *checkcolumn = NULL;
-                               if (check_offset & BP_HISTORY_O_TITLE) {
+                               if (check_offset & BP_HISTORY_O_TITLE)
                                        checkcolumn = BP_DB_COMMON_COL_TITLE;
-                               } else if (check_offset & BP_HISTORY_O_URL) {
+                               else if (check_offset & BP_HISTORY_O_URL)
                                        checkcolumn = BP_DB_COMMON_COL_URL;
-                               } else {
+                               else
                                        errorcode = BP_ERROR_INVALID_PARAMETER;
-                               }
+
                                if (checkcolumn != NULL) {
                                        errorcode = bp_common_get_duplicated_ids(g_db_handle,
-                                       &g_db_mutex, BP_DB_TABLE_HISTORY, &ids, &ids_count,
-                                       conds.limit, conds.offset, BP_DB_COMMON_COL_TITLE,
-                                       order_column, conds.ordering, is_like, keyword, conditions);
+                                                       &g_db_mutex, BP_DB_TABLE_HISTORY, &ids, &ids_count,
+                                                       conds.limit, conds.offset, BP_DB_COMMON_COL_TITLE,
+                                                       order_column, conds.ordering, is_like, keyword, conditions);
                                }
                        }
                }
@@ -276,7 +276,7 @@ static bp_error_defs __bp_history_get_cond_ids(int sock, const int raw_search)
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-           free(ids);
+               free(ids);
        free(keyword);
        if (conditions != NULL)
                sqlite3_free(conditions);
@@ -316,23 +316,23 @@ static bp_error_defs __bp_history_get_cond_timestamp_ids(int sock)
                int i = 0;
                for (; i < timestamp_count; i++) {
                        if (bp_ipc_read_custom_type(sock, &t_timestamps[i],
-                               sizeof(bp_history_timestamp_fmt)) < 0) {
+                                               sizeof(bp_history_timestamp_fmt)) < 0) {
                                TRACE_ERROR("[ERROR] TIMESTAMPs [BP_ERROR_IO_ERROR]");
                                bp_ipc_send_errorcode(sock, BP_ERROR_IO_ERROR);
                                return BP_ERROR_IO_ERROR;
                        }
                        if (i == 0) {
                                conditions = sqlite3_mprintf("%s %s datetime(%ld, 'unixepoch')",
-                               __get_column_by_offset(t_timestamps[i].offset),
-                               __get_operator(t_timestamps[i].cmp_operator),
-                               t_timestamps[i].timestamp);
-                       } else {
-                               char *tmp_cond = sqlite3_mprintf
-                                               (" %s (%s %s datetime(%ld, 'unixepoch'))",
-                                               (t_timestamps[i].conds_operator == 0 ? "AND":"OR"),
                                                __get_column_by_offset(t_timestamps[i].offset),
                                                __get_operator(t_timestamps[i].cmp_operator),
                                                t_timestamps[i].timestamp);
+                       } else {
+                               char *tmp_cond = sqlite3_mprintf
+                                       (" %s (%s %s datetime(%ld, 'unixepoch'))",
+                                        (t_timestamps[i].conds_operator == 0 ? "AND" : "OR"),
+                                        __get_column_by_offset(t_timestamps[i].offset),
+                                        __get_operator(t_timestamps[i].cmp_operator),
+                                        t_timestamps[i].timestamp);
                                if (tmp_cond != NULL) {
                                        conditions = bp_merge_strings(conditions, tmp_cond);
                                        sqlite3_free(tmp_cond);
@@ -412,7 +412,7 @@ static bp_error_defs __bp_history_get_cond_timestamp_ids(int sock)
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-           free(ids);
+               free(ids);
        free(keyword);
        if (conditions != NULL)
                sqlite3_free(conditions);
@@ -433,8 +433,7 @@ static bp_error_defs __bp_history_get_duplicated_ids(int sock)
 
        bp_ipc_send_errorcode(sock, BP_ERROR_NONE);
        memset(&conds, 0x00, sizeof(bp_db_base_conds_fmt));
-       if (bp_ipc_read_custom_type
-               (sock, &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
+       if (bp_ipc_read_custom_type(sock, &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
                TRACE_ERROR("[ERROR] CONDs [BP_ERROR_IO_ERROR]");
                bp_ipc_send_errorcode(sock, BP_ERROR_IO_ERROR);
                return BP_ERROR_IO_ERROR;
@@ -483,14 +482,14 @@ static bp_error_defs __bp_history_get_duplicated_ids(int sock)
 
                if (offset & BP_HISTORY_O_URL) {
                        errorcode = bp_common_get_duplicated_url_ids(g_db_handle,
-                       &g_db_mutex, BP_DB_TABLE_HISTORY, &ids, &ids_count,
-                       conds.limit, conds.offset,
-                       ordercolumn, conds.ordering, is_like, keyword, NULL);
+                                       &g_db_mutex, BP_DB_TABLE_HISTORY, &ids, &ids_count,
+                                       conds.limit, conds.offset,
+                                       ordercolumn, conds.ordering, is_like, keyword, NULL);
                } else if (offset & BP_HISTORY_O_TITLE) {
                        errorcode = bp_common_get_duplicated_ids(g_db_handle,
-                       &g_db_mutex, BP_DB_TABLE_HISTORY, &ids, &ids_count,
-                       conds.limit, conds.offset, BP_DB_COMMON_COL_TITLE,
-                       ordercolumn, conds.ordering, is_like, keyword, NULL);
+                                       &g_db_mutex, BP_DB_TABLE_HISTORY, &ids, &ids_count,
+                                       conds.limit, conds.offset, BP_DB_COMMON_COL_TITLE,
+                                       ordercolumn, conds.ordering, is_like, keyword, NULL);
                } else {
                        errorcode = BP_ERROR_INVALID_PARAMETER;
                }
@@ -538,8 +537,7 @@ static bp_error_defs __bp_history_set_limit_size(int sock)
 
        bp_ipc_send_errorcode(sock, BP_ERROR_NONE);
        memset(&conds, 0x00, sizeof(bp_db_base_conds_fmt));
-       if (bp_ipc_read_custom_type
-               (sock, &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
+       if (bp_ipc_read_custom_type(sock, &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
                TRACE_ERROR("[ERROR] CONDs [BP_ERROR_IO_ERROR]");
                bp_ipc_send_errorcode(sock, BP_ERROR_IO_ERROR);
                return BP_ERROR_IO_ERROR;
@@ -621,37 +619,31 @@ static bp_error_defs __bp_history_get_info_offset(int sock, int id, bp_shm_defs
 
        // bob
        if (offset & BP_HISTORY_O_ICON) {
-               int recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_FAVICONS,
+               int recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, &errorcode);
                if (recvint > 0)
                        info.favicon_width = recvint;
-               recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_FAVICONS,
+               recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, &errorcode);
                if (recvint > 0)
                        info.favicon_height = recvint;
        }
        if (offset & BP_HISTORY_O_SNAPSHOT) {
-               int recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
+               int recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, &errorcode);
                if (recvint > 0)
                        info.thumbnail_width = recvint;
-               recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
+               recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, &errorcode);
                if (recvint > 0)
                        info.thumbnail_height = recvint;
        }
        if (offset & BP_HISTORY_O_WEBICON) {
-               int recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_WEBICONS,
+               int recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_WEBICONS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, &errorcode);
                if (recvint > 0)
                        info.webicon_width = recvint;
-               recvint = bp_db_get_int_column
-                               (g_db_handle, id, BP_DB_TABLE_WEBICONS,
+               recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_WEBICONS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, &errorcode);
                if (recvint > 0)
                        info.webicon_height = recvint;
@@ -698,7 +690,7 @@ static bp_error_defs __bp_history_get_info_offset(int sock, int id, bp_shm_defs
        pthread_mutex_unlock(&g_db_mutex);
        return BP_ERROR_NONE;
 }
-/*
+#if 0
 static bp_error_defs __bp_history_delete_all_childs(int sock, int remove)
 {
        int is_deleted = 1;
@@ -722,7 +714,7 @@ static bp_error_defs __bp_history_delete_all_childs(int sock, int remove)
        bp_ipc_send_errorcode(sock, errorcode);
        return errorcode;
 }
-*/
+#endif
 
 static bp_error_defs __bp_history_reset(int sock)
 {
@@ -739,7 +731,7 @@ static bp_error_defs __bp_history_reset(int sock)
        return errorcode;
 }
 
-/*
+#if 0
 static bp_error_defs __bp_history_set_is_deleted(int sock, int id)
 {
        BP_PRE_CHECK;
@@ -755,7 +747,7 @@ static bp_error_defs __bp_history_set_is_deleted(int sock, int id)
        bp_ipc_send_errorcode(sock, errorcode);
        return errorcode;
 }
-*/
+#endif
 
 static bp_error_defs __bp_history_delete(int sock, int id)
 {
@@ -893,43 +885,35 @@ bp_error_defs bp_history_handle_requests(bp_client_slots_defs *slots,
                errorcode = __bp_history_get_duplicated_ids(sock);
                break;
        case BP_CMD_COMMON_GET_URL:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_URL, sock, id);
                break;
        case BP_CMD_COMMON_GET_TITLE:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_TITLE, sock, id);
                break;
        case BP_CMD_COMMON_GET_FAVICON:
-               errorcode = bp_common_get_blob
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
+               errorcode = bp_common_get_blob(g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB, sock, id);
                break;
        case BP_CMD_COMMON_GET_FAVICON_WIDTH:
-               errorcode = bp_common_get_blob_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
+               errorcode = bp_common_get_blob_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, sock, id);
                break;
        case BP_CMD_COMMON_GET_FAVICON_HEIGHT:
-               errorcode = bp_common_get_blob_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
+               errorcode = bp_common_get_blob_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, sock, id);
                break;
        case BP_CMD_COMMON_GET_THUMBNAIL:
-               errorcode = bp_common_get_blob
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_get_blob(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB, sock, id);
                break;
        case BP_CMD_COMMON_GET_THUMBNAIL_WIDTH:
-               errorcode = bp_common_get_blob_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_get_blob_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, sock, id);
                break;
        case BP_CMD_COMMON_GET_THUMBNAIL_HEIGHT:
-               errorcode = bp_common_get_blob_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_get_blob_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, sock, id);
                break;
        case BP_CMD_COMMON_GET_ICON:
@@ -945,46 +929,38 @@ bp_error_defs bp_history_handle_requests(bp_client_slots_defs *slots,
                                &g_db_mutex, BP_DB_TABLE_WEBICONS, sock, id, &client->shm);
                break;
        case BP_CMD_HISTORY_GET_FREQUENCY:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_HISTORY_COL_FREQUENCY, sock, id);
                break;
        case BP_CMD_COMMON_GET_DATE_CREATED:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_DATETIME_CREATED, sock, id);
                break;
        case BP_CMD_COMMON_GET_DATE_MODIFIED:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_DATETIME_MODIFIED, sock, id);
                break;
        case BP_CMD_COMMON_GET_DATE_VISITED:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_DATETIME_VISITED, sock, id);
                break;
        case BP_CMD_COMMON_GET_INFO_OFFSET:
                errorcode = __bp_history_get_info_offset(sock, id, &client->shm);
                break;
        case BP_CMD_HISTORY_SET_FREQUENCY:
-               errorcode = bp_common_set_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_set_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_HISTORY_COL_FREQUENCY, sock, id);
                break;
        case BP_CMD_COMMON_SET_URL:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_URL, sock, id);
                break;
        case BP_CMD_COMMON_SET_TITLE:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_TITLE, sock, id);
                break;
        case BP_CMD_COMMON_SET_FAVICON:
-               errorcode = bp_common_set_blob
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
+               errorcode = bp_common_set_blob(g_db_handle, &g_db_mutex, BP_DB_TABLE_FAVICONS,
                                BP_DB_COMMON_COL_BLOB, sock, id);
                break;
        case BP_CMD_COMMON_SET_FAVICON_WIDTH:
@@ -998,18 +974,15 @@ bp_error_defs bp_history_handle_requests(bp_client_slots_defs *slots,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, sock, id);
                break;
        case BP_CMD_COMMON_SET_THUMBNAIL:
-               errorcode = bp_common_set_blob
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_set_blob(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB, sock, id);
                break;
        case BP_CMD_COMMON_SET_THUMBNAIL_WIDTH:
-               errorcode = bp_common_replace_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_replace_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_WIDTH, sock, id);
                break;
        case BP_CMD_COMMON_SET_THUMBNAIL_HEIGHT:
-               errorcode = bp_common_replace_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
+               errorcode = bp_common_replace_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_THUMBNAILS,
                                BP_DB_COMMON_COL_BLOB_HEIGHT, sock, id);
                break;
        case BP_CMD_COMMON_SET_ICON:
@@ -1025,18 +998,15 @@ bp_error_defs bp_history_handle_requests(bp_client_slots_defs *slots,
                                &g_db_mutex, BP_DB_TABLE_WEBICONS, sock, id, &client->shm);
                break;
        case BP_CMD_COMMON_SET_DATE_CREATED:
-               errorcode = bp_common_set_date
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_set_date(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_DATE_CREATED, sock, id);
                break;
        case BP_CMD_COMMON_SET_DATE_MODIFIED:
-               errorcode = bp_common_set_date
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_set_date(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_DATE_MODIFIED, sock, id);
                break;
        case BP_CMD_COMMON_SET_DATE_VISITED:
-               errorcode = bp_common_set_date
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
+               errorcode = bp_common_set_date(g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY,
                                BP_DB_COMMON_COL_DATE_VISITED, sock, id);
                break;
        case BP_CMD_HISTORY_SET_VISIT:
@@ -1046,8 +1016,8 @@ bp_error_defs bp_history_handle_requests(bp_client_slots_defs *slots,
                errorcode = __bp_history_set_limit_size(sock);
                break;
        case BP_CMD_COMMON_CREATE:
-               errorcode = bp_common_create
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_HISTORY, sock, id);
+               errorcode = bp_common_create(g_db_handle,
+                               &g_db_mutex, BP_DB_TABLE_HISTORY, sock, id);
                break;
        case BP_CMD_COMMON_DELETE:
 
index 5d5ad4baf0c81065e9984e703226805d929520de..78f60b5c180b8cf004b7243b2230368fcadc46eb 100755 (executable)
@@ -79,14 +79,14 @@ static void on_changed_receive(void *data, DBusMessage *msg)
 
        __unregister_dbus_booting_done_service();
 
-       if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) {
+       if (signal(SIGCHLD, SIG_IGN) == SIG_ERR)
                TRACE_ERROR("failed to register signal callback");
-       }
+
        pid_t child_pid = 0;
-       if((child_pid = fork()) < 0 ) {
+       if ((child_pid = fork()) < 0) {
                TRACE_ERROR("[ERROR] fock");
        } else {
-               if(child_pid == 0) {
+               if (child_pid == 0) {
                        execl(tzplatform_mkpath(TZ_SYS_RO_APPS, "org.tizen.browser/bin/browser"),
                                tzplatform_mkpath(TZ_SYS_RO_APPS, "org.tizen.browser/bin/browser"),
                                "precaching", NULL);
@@ -114,8 +114,8 @@ static gboolean __bp_idle_booting_done_service(void *data)
 
        g_e_dbus_handler =
                e_dbus_signal_handler_add(g_e_dbus_conn, NULL, DEVICED_PATH_CORE,
-                                               DEVICED_INTERFACE_CORE, SIGNAL_BOOTING_DONE,
-                                               on_changed_receive, NULL);
+                               DEVICED_INTERFACE_CORE, SIGNAL_BOOTING_DONE,
+                               on_changed_receive, NULL);
        if (g_e_dbus_handler == NULL) {
                TRACE_ERROR("e_dbus_signal_handler_add error");
                return -1;
index 93c36bf8ccf8cda71d39d7ffe35a73df794471d2..026037a1ad5dc214d1a4507ab46042cf277c4963 100755 (executable)
@@ -31,7 +31,7 @@ static char *__bp_notify_get_path(int pid)
                TRACE_ERROR("failed to alocalte fifo path pid:%d", (int)pid);
                return NULL;
        }
-       if (snprintf(notify_fifo, path_size,"%s/%d", NOTIFY_DIR, pid) < 0) {
+       if (snprintf(notify_fifo, path_size, "%s/%d", NOTIFY_DIR, pid) < 0) {
                TRACE_ERROR("failed to make fifo path pid:%d", (int)pid);
                free(notify_fifo);
                return NULL;
@@ -48,11 +48,12 @@ int bp_notify_init(int pid)
        struct stat fifo_state;
        if (stat(notify_fifo, &fifo_state) == 0) // found
                unlink(notify_fifo);
-       if (mkfifo(notify_fifo, 0644/*-rwrr*/) < 0) {
+
+       if (mkfifo(notify_fifo, 0644/*-rwrr*/) < 0)
                TRACE_ERROR("failed to make fifo %s", notify_fifo);
-       } else {
+       else
                notify_fd = open(notify_fifo, O_RDWR | O_NONBLOCK, 0600);
-       }
+
        free(notify_fifo);
        return notify_fd;
 }
index beb8d1d9b1a9b26b34c549cf075ae6e75b8abc99..fecad58143301954cf00e2e675bbed60647622bf 100755 (executable)
@@ -274,24 +274,24 @@ static char *__print_client_type(bp_client_type_defs type)
 static void __update_client_permission(bp_client_defs *client)
 {
        pthread_mutex_lock(&mutex_for_cynara_check);
-       if (client->cynara_clientSmack != NULL && client->cynara_session != NULL &&
-               client->cynara_uid != NULL && client->privilege_label != NULL) {
-           if(cynara_check(p_cynara, client->cynara_clientSmack, client->cynara_session,
-                   client->cynara_uid, client->privilege_label) == CYNARA_API_ACCESS_ALLOWED) {
-               client->permission.read = 1;
-               client->permission.write = 1;
-               TRACE_ERROR("client has %s privilege.", client->privilege_label);
-           } else {
-               client->permission.read = 0;
-               client->permission.write = 0;
-               TRACE_ERROR("client does not have %s privilege.", client->privilege_label);
-           }
+       if (client->cynara_clientSmack != NULL && client->cynara_session != NULL
+                       && client->cynara_uid != NULL && client->privilege_label != NULL) {
+               if (cynara_check(p_cynara, client->cynara_clientSmack, client->cynara_session,
+                               client->cynara_uid, client->privilege_label) == CYNARA_API_ACCESS_ALLOWED) {
+                       client->permission.read = 1;
+                       client->permission.write = 1;
+                       TRACE_ERROR("client has %s privilege.", client->privilege_label);
+               } else {
+                       client->permission.read = 0;
+                       client->permission.write = 0;
+                       TRACE_ERROR("client does not have %s privilege.", client->privilege_label);
+               }
        } else {
-           client->permission.read = 0;
-           client->permission.write = 0;
-           TRACE_ERROR("client value is NULL.");
+               client->permission.read = 0;
+               client->permission.write = 0;
+               TRACE_ERROR("client value is NULL.");
        }
-    pthread_mutex_unlock(&mutex_for_cynara_check);
+       pthread_mutex_unlock(&mutex_for_cynara_check);
 }
 
 static int __check_smack_privilege(bp_privilege_defs *permission,
@@ -350,30 +350,25 @@ static bp_error_defs __handle_client_request(bp_client_defs *client)
                if (__check_smack_privilege(&client->permission,
                                client_cmd.cmd) < 0) {
 #ifdef SUPPORT_SERVER_PRIVILEGE
-                       TRACE_SECURE_ERROR
-                               ("[PERMISSION] [%d] Deny by Server Privilege",
-                               client_cmd.cmd);
+                       TRACE_SECURE_ERROR("[PERMISSION] [%d] Deny by Server Privilege", client_cmd.cmd);
                        errorcode = BP_ERROR_PERMISSION_DENY;
                        bp_ipc_send_errorcode(client->cmd_socket, errorcode);
                        return errorcode;
 #endif
                }
 
-               switch(client->type) {
+               switch (client->type) {
                case BP_CLIENT_TABS:
                case BP_CLIENT_TABS_SYNC:
-                       errorcode = bp_tabs_handle_requests
-                                       (g_bp_slots, client, &client_cmd);
+                       errorcode = bp_tabs_handle_requests(g_bp_slots, client, &client_cmd);
                        break;
                case BP_CLIENT_BOOKMARK:
                case BP_CLIENT_BOOKMARK_SYNC:
                case BP_CLIENT_BOOKMARK_CSC:
-                       errorcode = bp_bookmark_handle_requests
-                                       (g_bp_slots, client, &client_cmd);
+                       errorcode = bp_bookmark_handle_requests(g_bp_slots, client, &client_cmd);
                        break;
                case BP_CLIENT_HISTORY:
-                       errorcode = bp_history_handle_requests
-                                       (g_bp_slots, client, &client_cmd);
+                       errorcode = bp_history_handle_requests(g_bp_slots, client, &client_cmd);
                        break;
                case BP_CLIENT_HISTORY_SYNC:
                        TRACE_ERROR("No Support Yet");
@@ -402,7 +397,7 @@ void *client_thread_idle(void *arg)
        bp_client_defs *client = slot->client;
        bp_error_defs errorcode = BP_ERROR_NONE;
        if (client != NULL) {
-               switch(client->type) {
+               switch (client->type) {
                case BP_CLIENT_TABS:
                case BP_CLIENT_TABS_SYNC:
                        errorcode = bp_tabs_ready_resource();
@@ -430,11 +425,11 @@ void *client_thread_idle(void *arg)
 
        while (client != NULL && client->cmd_socket >= 0) {
 
-               FD_ZERO(&imask );
-               FD_ZERO(&emask );
+               FD_ZERO(&imask);
+               FD_ZERO(&emask);
                FD_SET(client->cmd_socket, &imask);
                FD_SET(client->cmd_socket, &emask);
-               if (select(client->cmd_socket + 1, &imask, 0, &emask, 0) < 0 ) {
+               if (select(client->cmd_socket + 1, &imask, 0, &emask, 0) < 0) {
                        TRACE_ERROR("select");
                        break;
                }
@@ -445,14 +440,14 @@ void *client_thread_idle(void *arg)
                        if (slot->client == NULL) {
                                pthread_mutex_unlock(&slot->mutex);
                                TRACE_ERROR("[CHECK] closed by other thread");
-                               pthread_setcancelstate (PTHREAD_CANCEL_ENABLE,  NULL);
+                               pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
                                return 0;
                        }
                        pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
                        client->access_time = (int)time(NULL);
                        errorcode = BP_ERROR_NONE;
                        errorcode = __handle_client_request(client);
-                       pthread_setcancelstate (PTHREAD_CANCEL_ENABLE,  NULL);
+                       pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
                        pthread_mutex_unlock(&slot->mutex);
 
                        if (errorcode == BP_ERROR_IO_ERROR ||
@@ -524,7 +519,7 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
        }
        privates->slots = bp_client_slots_new(BP_MAX_CLIENT);
        if (privates->slots == NULL) {
-               TRACE_ERROR("[CRITICAL]  failed to alloc for slots");
+               TRACE_ERROR("[CRITICAL] failed to alloc for slots");
                return ;
        }
 
@@ -578,7 +573,7 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                        // Anyway accept client.
                        clientlen = sizeof(clientaddr);
                        int clientfd = accept(listenfd, (struct sockaddr *)&clientaddr,
-                                                       &clientlen);
+                                       &clientlen);
                        if (clientfd < 0) {
                                TRACE_ERROR("[CRITICAL] accept provider was crashed ?");
                                // provider need the time of refresh.
@@ -591,7 +586,7 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                        tv_timeo.tv_sec = 2;
                        tv_timeo.tv_usec = 500000;
                        if (setsockopt(clientfd, SOL_SOCKET, SO_RCVTIMEO, &tv_timeo,
-                               sizeof( tv_timeo ) ) < 0) {
+                                       sizeof(tv_timeo)) < 0) {
                                TRACE_ERROR("[CRITICAL] setsockopt SO_SNDTIMEO");
                                close(clientfd);
                                continue;
@@ -642,7 +637,7 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                                                        privates->slots[iter].client;
                                                if (client != NULL) {
                                                        if (client->access_time > 0 &&
-                                                               client->access_time < oldest_time) {
+                                                                       client->access_time < oldest_time) {
                                                                oldest_time = client->access_time;
                                                                oldest_index = iter;
                                                        }
@@ -650,16 +645,15 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                                        }
 
                                        if (oldest_index >= 0) {
-                                               bp_client_defs *client =
+                                               bp_client_defs *client =
                                                        privates->slots[oldest_index].client;
                                                if (client != NULL) {
-                                                       TRACE_WARN
-                                                           ("clear client[%s:%d] slot:%d sock:%d",
-                                                           __print_client_type(client->type),
-                                                           client->cid, oldest_index,
-                                                           client->cmd_socket);
-                                                       if (client->cmd_socket >= 0)
-                                                           FD_CLR(client->cmd_socket, &listen_fdset);
+                                                       TRACE_WARN("clear client[%s:%d] slot:%d sock:%d",
+                                                                __print_client_type(client->type),
+                                                                client->cid, oldest_index,
+                                                                client->cmd_socket);
+                                                       if (client->cmd_socket >= 0)
+                                                               FD_CLR(client->cmd_socket, &listen_fdset);
                                                }
                                                bp_remove_client_from_slot(&privates->slots[oldest_index]);
                                                i = oldest_index;
@@ -673,13 +667,10 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                                }
                                // allocation
                                int cid = __get_client_id(privates->slots);
-                               privates->slots[i].client =
-                                       (bp_client_defs *)calloc(1,
-                                       sizeof(bp_client_defs));
+                               privates->slots[i].client = calloc(1, sizeof(bp_client_defs));
                                if (privates->slots[i].client == NULL) {
                                        TRACE_ERROR("calloc, ignore this client");
-                                       bp_ipc_send_errorcode(clientfd,
-                                               BP_ERROR_OUT_OF_MEMORY);
+                                       bp_ipc_send_errorcode(clientfd, BP_ERROR_OUT_OF_MEMORY);
                                        close(clientfd);
                                        continue;
                                }
@@ -699,7 +690,7 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                                privates->slots[i].client->privilege_label = NULL;
 
                                // user-space-smack
-                               switch(client_type) {
+                               switch (client_type) {
                                case BP_CLIENT_TABS:
                                case BP_CLIENT_TABS_SYNC:
                                        privates->slots[i].client->privilege_label = SECURITY_PRIVILEGE_TAB;
@@ -718,8 +709,7 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                                }
                                if (privates->slots[i].client->privilege_label == NULL) {
                                        TRACE_ERROR("client type");
-                                       bp_ipc_send_errorcode(clientfd,
-                                               BP_ERROR_PERMISSION_DENY);
+                                       bp_ipc_send_errorcode(clientfd, BP_ERROR_PERMISSION_DENY);
                                        bp_remove_client_from_slot(&privates->slots[i]);
                                        continue;
                                } else if (!strcmp(privates->slots[i].client->privilege_label, "inhouse")) {
@@ -728,52 +718,47 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                                        privates->slots[i].client->permission.read = 1;
                                        privates->slots[i].client->permission.write = 1;
                                } else {
-                                       if(cynara_creds_socket_get_client(clientfd, CLIENT_METHOD_SMACK,
-                                               &(privates->slots[i].client->cynara_clientSmack)) != CYNARA_API_SUCCESS) {
+                                       if (cynara_creds_socket_get_client(clientfd, CLIENT_METHOD_SMACK,
+                                                       &(privates->slots[i].client->cynara_clientSmack)) != CYNARA_API_SUCCESS) {
                                                TRACE_ERROR("failed to create cynara client identification string");
-                                               bp_ipc_send_errorcode(clientfd,
-                                                       BP_ERROR_PERMISSION_DENY);
+                                               bp_ipc_send_errorcode(clientfd, BP_ERROR_PERMISSION_DENY);
                                                bp_remove_client_from_slot(&privates->slots[i]);
                                                continue;
                                        }
-                                       if(cynara_creds_socket_get_user(clientfd, USER_METHOD_UID, 
-                                               &(privates->slots[i].client->cynara_uid)) != CYNARA_API_SUCCESS) {
+                                       if (cynara_creds_socket_get_user(clientfd, USER_METHOD_UID,
+                                                       &(privates->slots[i].client->cynara_uid)) != CYNARA_API_SUCCESS) {
                                                TRACE_ERROR("failed to create cynara user identification string");
-                                               bp_ipc_send_errorcode(clientfd,
-                                                       BP_ERROR_PERMISSION_DENY);
+                                               bp_ipc_send_errorcode(clientfd, BP_ERROR_PERMISSION_DENY);
                                                bp_remove_client_from_slot(&privates->slots[i]);
                                                continue;
                                        }
                                        pid_t cynara_pid;
-                                       if(cynara_creds_socket_get_pid(clientfd, &cynara_pid) != CYNARA_API_SUCCESS) {
+                                       if (cynara_creds_socket_get_pid(clientfd, &cynara_pid) != CYNARA_API_SUCCESS) {
                                                TRACE_ERROR("failed to create PID string for client session");
-                                               bp_ipc_send_errorcode(clientfd,
-                                                       BP_ERROR_PERMISSION_DENY);
+                                               bp_ipc_send_errorcode(clientfd, BP_ERROR_PERMISSION_DENY);
                                                bp_remove_client_from_slot(&privates->slots[i]);
                                                continue;
                                        }
-                                       if((privates->slots[i].client->cynara_session = cynara_session_from_pid(cynara_pid)) == NULL) {
+                                       if ((privates->slots[i].client->cynara_session = cynara_session_from_pid(cynara_pid)) == NULL) {
                                                TRACE_ERROR("failed to create client session");
-                                               bp_ipc_send_errorcode(clientfd,
-                                                       BP_ERROR_PERMISSION_DENY);
+                                               bp_ipc_send_errorcode(clientfd, BP_ERROR_PERMISSION_DENY);
                                                bp_remove_client_from_slot(&privates->slots[i]);
                                                continue;
                                        }
 
                                        __update_client_permission(privates->slots[i].client);
                                }
-/*
+#if 0
                                TRACE_INFO("[Permission] sock:%d read:%d write:%d",
                                        clientfd,
                                        privates->slots[i].client->permission.read,
                                        privates->slots[i].client->permission.write);
-*/
+#endif
 #ifdef SUPPORT_SERVER_PRIVILEGE
                                if (privates->slots[i].client->permission.read == 0 &&
-                                       privates->slots[i].client->permission.write == 0) {
+                                               privates->slots[i].client->permission.write == 0) {
                                        TRACE_ERROR("client have no privilege permission");
-                                       bp_ipc_send_errorcode(clientfd,
-                                               BP_ERROR_PERMISSION_DENY);
+                                       bp_ipc_send_errorcode(clientfd, BP_ERROR_PERMISSION_DENY);
                                        bp_remove_client_from_slot(&privates->slots[i]);
                                        continue;
                                }
@@ -796,8 +781,7 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                                }
 
 #ifndef SUPPORT_CLIENT_THREAD
-                               FD_SET(privates->slots[i].client->cmd_socket,
-                                       &listen_fdset);
+                               FD_SET(privates->slots[i].client->cmd_socket, &listen_fdset);
                                if (privates->slots[i].client->cmd_socket > maxfd)
                                        maxfd = privates->slots[i].client->cmd_socket;
 #endif
@@ -808,8 +792,7 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                                                (void *)&privates->slots[i]) != 0) {
                                        // check zombie client. disconnect it
                                        TRACE_ERROR("[ERROR][main_thread] create\n");
-                                       bp_ipc_send_errorcode(clientfd,
-                                               BP_ERROR_OUT_OF_MEMORY);
+                                       bp_ipc_send_errorcode(clientfd, BP_ERROR_OUT_OF_MEMORY);
                                        bp_remove_client_from_slot(&privates->slots[i]);
                                        continue;
                                }
@@ -818,8 +801,7 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
 
                                // ok. ready to accept API of this client
                                bp_ipc_send_errorcode(clientfd, BP_ERROR_NONE);
-                               bp_ipc_send_custom_type(clientfd,
-                                       &privates->slots[i].client->cid, sizeof(int));
+                               bp_ipc_send_custom_type(clientfd, &privates->slots[i].client->cid, sizeof(int));
 
                        } else {
                                //Unknown case
@@ -832,19 +814,17 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                for (i = 0; i < BP_MAX_CLIENT; i++) {
                        if (privates->slots[i].client == NULL)
                                continue;
-                       if (privates->slots[i].client->cmd_socket < 0){
+                       if (privates->slots[i].client->cmd_socket < 0) {
                                TRACE_ERROR("[CRITICAL] [i] Found Bad socket", i);
                                bp_remove_client_from_slot(&privates->slots[i]);
                                continue;
                        }
 
-                       if (FD_ISSET(privates->slots[i].client->cmd_socket, &rset)
-                               > 0) {
+                       if (FD_ISSET(privates->slots[i].client->cmd_socket, &rset) > 0) {
                                is_timeout = 0;
 
                                privates->slots[i].client->access_time = (int)time(NULL);
-                               if (__handle_client_request
-                                       (privates->slots[i].client) == BP_ERROR_IO_ERROR) {
+                               if (__handle_client_request(privates->slots[i].client) == BP_ERROR_IO_ERROR) {
                                        TRACE_ERROR("disconnect client slot:%d sock:%d", i,
                                                        privates->slots[i].client->cmd_socket);
                                        FD_CLR(privates->slots[i].client->cmd_socket, &listen_fdset);
@@ -861,18 +841,16 @@ void bp_thread_requests_manager(bp_privates_defs *privates)
                        if (prev_timeout == 0) {
                                prev_timeout = now_timeout;
                        } else if (now_timeout < prev_timeout ||
-                               (now_timeout - prev_timeout) >
-                               (flexible_timeout + BP_CARE_CLIENT_MIN_INTERVAL)) {
+                                       (now_timeout - prev_timeout) >
+                                       (flexible_timeout + BP_CARE_CLIENT_MIN_INTERVAL)) {
                                TRACE_WARN("[WARN] check system date prev[%ld]now[%ld]",
                                        prev_timeout, now_timeout);
                        } else {
-                               if ((now_timeout - prev_timeout) <
-                                               BP_CARE_CLIENT_MIN_INTERVAL) {
+                               if ((now_timeout - prev_timeout) < BP_CARE_CLIENT_MIN_INTERVAL) {
                                        // this is error.
                                        // terminate Process
-                                       TRACE_ERROR
-                                       ("[CRITICAL] Sock exception prev[%ld]now[%ld][%ld]",
-                                       prev_timeout, now_timeout, flexible_timeout);
+                                       TRACE_ERROR("[CRITICAL] Sock exception prev[%ld]now[%ld][%ld]",
+                                                prev_timeout, now_timeout, flexible_timeout);
                                        break;
                                }
                        }
index e12108c95d162e48b1138a5fea4e8fae1ee31254..ebf69bccf7000162d9b99a5a87df91599e209218 100755 (executable)
@@ -79,10 +79,10 @@ void bp_common_send_noti_all(bp_client_slots_defs *slots,
        bp_command_defs cmd = BP_CMD_COMMON_NOTI;
        for (i = 0; i < BP_MAX_CLIENT; i++) {
                if (slots[i].client != NULL &&
-                       __is_same_noti_client(slots[i].client->type, ctype) == 0 &&
-                       slots[i].client->notify > 0 &&
-                       slots[i].client->noti_enable == 1 &&
-                       slots[i].client->cid != except_cid) {
+                               __is_same_noti_client(slots[i].client->type, ctype) == 0 &&
+                               slots[i].client->notify > 0 &&
+                               slots[i].client->noti_enable == 1 &&
+                               slots[i].client->cid != except_cid) {
                        // send noti
                        bp_ipc_send_custom_type(slots[i].client->notify,
                                &cmd, sizeof(bp_command_defs));
@@ -116,7 +116,7 @@ int bp_common_is_connected_my_sync_adaptor(bp_client_slots_defs *slots,
 
        if (type == BP_CLIENT_TABS)
                search_type = BP_CLIENT_TABS_SYNC;
-       else if (type == BP_CLIENT_BOOKMARK )
+       else if (type == BP_CLIENT_BOOKMARK)
                search_type = BP_CLIENT_BOOKMARK_SYNC;
        else if (type == BP_CLIENT_SCRAP)
                search_type = BP_CLIENT_SCRAP_SYNC;
@@ -183,7 +183,7 @@ int bp_common_make_unique_id(sqlite3 *handle, pthread_mutex_t *mutex,
                        TRACE_DEBUG("SQL LOCK, try again %d", check_count);
                        continue;
                }
-       } while(id == check_id); // means duplicated id
+       } while (id == check_id); // means duplicated id
        return id;
 }
 
@@ -273,8 +273,7 @@ bp_error_defs bp_common_get_full_ids(sqlite3 *handle,
 
        BP_PRE_CHECK;
 
-       char *conditions =
-                       sqlite3_mprintf("(%s IS 0)", BP_DB_COMMON_COL_IS_DELETED);
+       char *conditions = sqlite3_mprintf("(%s IS 0)", BP_DB_COMMON_COL_IS_DELETED);
 
        bp_error_defs errorcode =
                bp_common_get_ids(handle, mutex, table, &ids, &ids_count, -1, 0,
@@ -286,14 +285,14 @@ bp_error_defs bp_common_get_full_ids(sqlite3 *handle,
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-               free(ids);
+               free(ids);
        if (conditions != NULL)
                sqlite3_free(conditions);
        return errorcode;
 }
 
-bp_error_defs bp_common_get_full_with_deleted_ids
-       (sqlite3 *handle, pthread_mutex_t *mutex, char *table, int sock)
+bp_error_defs bp_common_get_full_with_deleted_ids(sqlite3 *handle,
+       pthread_mutex_t *mutex, char *table, int sock)
 {
        BP_PRE_CHECK;
 
@@ -312,7 +311,7 @@ bp_error_defs bp_common_get_full_with_deleted_ids
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-               free(ids);
+               free(ids);
        return errorcode;
 }
 
@@ -338,14 +337,14 @@ bp_error_defs bp_common_get_dirty_ids(sqlite3 *handle,
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-               free(ids);
+               free(ids);
        if (conditions != NULL)
                sqlite3_free(conditions);
        return errorcode;
 }
 
-bp_error_defs bp_common_get_deleted_ids
-       (sqlite3 *handle, pthread_mutex_t *mutex, char *table, int sock)
+bp_error_defs bp_common_get_deleted_ids(sqlite3 *handle,
+       pthread_mutex_t *mutex, char *table, int sock)
 {
        BP_PRE_CHECK;
 
@@ -367,7 +366,7 @@ bp_error_defs bp_common_get_deleted_ids
                bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count));
        }
        if (ids != NULL)
-               free(ids);
+               free(ids);
        if (conditions != NULL)
                sqlite3_free(conditions);
        return errorcode;
@@ -513,8 +512,7 @@ bp_error_defs bp_common_get_tag(sqlite3 *handle, pthread_mutex_t *mutex,
        bp_error_defs errorcode = BP_ERROR_NONE;
        char *recv_str = NULL;
        pthread_mutex_lock(mutex);
-       recv_str = bp_db_get_cond2_text_column
-                       (handle, table, BP_DB_COMMON_TAGS_COL_TAG,
+       recv_str = bp_db_get_cond2_text_column(handle, table, BP_DB_COMMON_TAGS_COL_TAG,
                        BP_DB_COMMON_COL_ID, BP_DB_COL_TYPE_INT, &id,
                        BP_DB_COMMON_TAGS_COL_TAG_ID, BP_DB_COL_TYPE_INT,
                        &recv_int, &errorcode);
@@ -794,8 +792,7 @@ void bp_common_get_info_send_blob(sqlite3 *handle,
        bp_shm_defs *shm)
 {
        bp_error_defs errorcode = BP_ERROR_NONE;
-       int blob_length = bp_common_shm_get_bytes(handle, table, sock, id,
-               shm, &errorcode);
+       int blob_length = bp_common_shm_get_bytes(handle, table, sock, id, shm, &errorcode);
        if (blob_length <= 0) {
                bp_ipc_send_errorcode(sock, BP_ERROR_NO_DATA);
        } else {
@@ -808,8 +805,7 @@ void bp_common_get_info_send_blob(sqlite3 *handle,
                // send .. the way of IPC
                bp_ipc_send_custom_type(sock, &trans_way, sizeof(int));
                if (trans_way == 0) {
-                       bp_ipc_send_custom_type(sock, shm->local,
-                               sizeof(unsigned char) * blob_length);
+                       bp_ipc_send_custom_type(sock, shm->local, sizeof(unsigned char) * blob_length);
                        free(shm->local);
                        shm->local = NULL;
                }
@@ -851,8 +847,7 @@ bp_error_defs bp_common_get_blob_shm(sqlite3 *handle,
                        bp_ipc_send_custom_type(sock, &trans_way, sizeof(int));
 
                        if (trans_way == 0) {
-                               bp_ipc_send_custom_type(sock, shm->local,
-                                       sizeof(unsigned char) * blob_length);
+                               bp_ipc_send_custom_type(sock, shm->local, sizeof(unsigned char) * blob_length);
                                free(shm->local);
                                shm->local = NULL;
                        }
@@ -879,7 +874,7 @@ bp_error_defs bp_common_set_blob_shm(sqlite3 *handle,
                bp_ipc_send_errorcode(sock, BP_ERROR_IO_ERROR);
                return BP_ERROR_IO_ERROR;
        }
-       if ( blob_length < BP_MAX_INT_COUNT && blob_length > 0) {
+       if (blob_length < BP_MAX_INT_COUNT && blob_length > 0) {
                unsigned char *blob_buffer = NULL;
                unsigned char *blob_data = NULL;
                // read here what IPC should be used below from provider.
@@ -996,8 +991,7 @@ bp_error_defs bp_common_get_blob_with_size(sqlite3 *handle,
                bp_ipc_send_custom_type(sock, &blob_length, sizeof(int));
                bp_ipc_send_custom_type(sock, &width, sizeof(int));
                bp_ipc_send_custom_type(sock, &height, sizeof(int));
-               bp_ipc_send_custom_type(sock, blob_data,
-                       sizeof(unsigned char) * blob_length);
+               bp_ipc_send_custom_type(sock, blob_data, sizeof(unsigned char) * blob_length);
        }
        free(blob_data);
        return errorcode;
@@ -1051,8 +1045,7 @@ bp_error_defs bp_common_set_int(sqlite3 *handle, pthread_mutex_t *mutex,
                return BP_ERROR_IO_ERROR;
        }
        pthread_mutex_lock(mutex);
-       if (bp_db_get_int_column(handle, id, table, BP_DB_COMMON_COL_ID,
-                       &errorcode) >= 0) {
+       if (bp_db_get_int_column(handle, id, table, BP_DB_COMMON_COL_ID, &errorcode) >= 0) {
                if (bp_db_set_column(handle, id, table, column,
                                BP_DB_COL_TYPE_INT, &recv_int, &errorcode) < 0) {
                        TRACE_ERROR("[ERROR][SQL][%d] %s", id, column);
@@ -1096,8 +1089,7 @@ bp_error_defs bp_common_set_string(sqlite3 *handle,
        }
 
        pthread_mutex_lock(mutex);
-       if (bp_db_get_int_column(handle, id, table, BP_DB_COMMON_COL_ID,
-                       &errorcode) >= 0) {
+       if (bp_db_get_int_column(handle, id, table, BP_DB_COMMON_COL_ID, &errorcode) >= 0) {
                if (bp_db_set_column(handle, id, table, column,
                                BP_DB_COL_TYPE_TEXT, recv_str, &errorcode) < 0) {
                        TRACE_ERROR("[ERROR][SQL][%d] SET_STRING", id);
@@ -1123,10 +1115,9 @@ bp_error_defs bp_common_set_date(sqlite3 *handle,
                return BP_ERROR_IO_ERROR;
        }
        pthread_mutex_lock(mutex);
-       if (bp_db_set_datetime(handle, id, table, column, recv_int,
-                       &errorcode) < 0) {
+       if (bp_db_set_datetime(handle, id, table, column, recv_int, &errorcode) < 0)
                TRACE_ERROR("[ERROR][SQL][%d] SET_DATE", id);
-       }
+
        pthread_mutex_unlock(mutex);
        bp_ipc_send_errorcode(sock, errorcode);
        return errorcode;
@@ -1173,7 +1164,7 @@ void bp_common_convert_to_lowercase(char *src)
        int i = 0;
        if (src == NULL)
                return ;
-       for (;i < strlen(src); i++) {
+       for (; i < strlen(src); i++) {
                char c = *(src + i);
                if (c >= 'A' && c <= 'Z')
                        *(src + i) = c - 'A' + 'a';
@@ -1192,7 +1183,7 @@ static int __is_url_www_prefix(char *keyword)
                target = keyword;
        int is_w_keyword = 0;
        int keyword_length = strlen(target);
-       if (keyword_length <= 5) {  // www. + % in tail
+       if (keyword_length <= 5) { // www. + % in tail
                int i = 0;
                int w_count = 0;
                is_w_keyword = 1;
@@ -1238,8 +1229,7 @@ bp_error_defs bp_common_get_inquired_ids(sqlite3 *handle,
 
        // make condition.
        if (cond2 == NULL) {
-               basic_cond = sqlite3_mprintf("%s IS 0",
-                       BP_DB_COMMON_COL_IS_DELETED);
+               basic_cond = sqlite3_mprintf("%s IS 0", BP_DB_COMMON_COL_IS_DELETED);
        } else {
                basic_cond = sqlite3_mprintf("%s IS 0 AND %s",
                        BP_DB_COMMON_COL_IS_DELETED, cond2);
@@ -1273,7 +1263,7 @@ bp_error_defs bp_common_get_inquired_ids(sqlite3 *handle,
                                        "%s AND (%s LIKE ? OR %s LIKE ?)",
                                        basic_cond, BP_DB_COMMON_COL_LOWER_TITLE,
                                        BP_DB_COMMON_COL_LOWER_URL);
-                                       bind_count = 2;
+                       bind_count = 2;
                }
        } else {
                char *is_like_str = NULL;
@@ -1352,13 +1342,11 @@ bp_error_defs bp_common_get_duplicated_url_ids(sqlite3 *handle,
                return BP_ERROR_INVALID_PARAMETER;
        }
 
-       if (cond2 == NULL) {
-               basic_cond = sqlite3_mprintf("%s IS 0",
-                       BP_DB_COMMON_COL_IS_DELETED);
-       } else {
-               basic_cond = sqlite3_mprintf("%s IS 0 AND %s",
-                       BP_DB_COMMON_COL_IS_DELETED, cond2);
-       }
+       if (cond2 == NULL)
+               basic_cond = sqlite3_mprintf("%s IS 0", BP_DB_COMMON_COL_IS_DELETED);
+       else
+               basic_cond = sqlite3_mprintf("%s IS 0 AND %s", BP_DB_COMMON_COL_IS_DELETED, cond2);
+
        if (basic_cond == NULL) {
                TRACE_ERROR("[ERROR] make query");
                return BP_ERROR_OUT_OF_MEMORY;
@@ -1453,21 +1441,18 @@ bp_error_defs bp_common_get_duplicated_ids(sqlite3 *handle,
                return BP_ERROR_INVALID_PARAMETER;
        }
 
-       if (cond2 == NULL) {
-               basic_cond = sqlite3_mprintf("%s IS 0",
-                       BP_DB_COMMON_COL_IS_DELETED);
-       } else {
-               basic_cond = sqlite3_mprintf("%s IS 0 AND %s",
-                       BP_DB_COMMON_COL_IS_DELETED, cond2);
-       }
+       if (cond2 == NULL)
+               basic_cond = sqlite3_mprintf("%s IS 0", BP_DB_COMMON_COL_IS_DELETED);
+       else
+               basic_cond = sqlite3_mprintf("%s IS 0 AND %s", BP_DB_COMMON_COL_IS_DELETED, cond2);
+
        if (basic_cond == NULL) {
                TRACE_ERROR("[ERROR] make query");
                return BP_ERROR_OUT_OF_MEMORY;
        }
        if (is_like > 0) {
                bp_common_convert_to_lowercase(keyword);
-               conditions = sqlite3_mprintf("%s AND LOWER(%s) LIKE ?",
-                       basic_cond, checkcolumn);
+               conditions = sqlite3_mprintf("%s AND LOWER(%s) LIKE ?", basic_cond, checkcolumn);
        } else {
                conditions = sqlite3_mprintf("%s AND %s %s ?",
                        basic_cond, checkcolumn, (is_like == 0 ? "IS" : "IS NOT"));
@@ -1554,7 +1539,7 @@ bp_error_defs bp_common_get_ids(sqlite3 *handle,
 
        pthread_mutex_lock(mutex);
        int inquired_ids_count = bp_db_get_custom_conds_ids(handle, table,
-               inquired_ids, BP_DB_COMMON_COL_ID, limit, offset, ordercolumn,
+                       inquired_ids, BP_DB_COMMON_COL_ID, limit, offset, ordercolumn,
                        (ordering <= 0 ? "ASC" : "DESC"), conditions, &errorcode);
        pthread_mutex_unlock(mutex);
 
@@ -1633,20 +1618,19 @@ static int __bp_is_valid_dir(const char *dirpath)
                return -1;
        }
        stat_ret = stat(dirpath, &dir_state);
-       if (stat_ret == 0 && S_ISDIR(dir_state.st_mode)) {
+       if (stat_ret == 0 && S_ISDIR(dir_state.st_mode))
                return 0;
-       }
+
        return -1;
 }
 
 void bp_rebuild_dir(const char *dirpath)
 {
        if (__bp_is_valid_dir(dirpath) < 0) {
-               if (mkdir(dirpath, S_IRWXU | S_IRWXG | S_IRWXO) == 0) {
+               if (mkdir(dirpath, 0755) == 0) {
                        TRACE_INFO("check directory:%s", dirpath);
-                       if (smack_setlabel(dirpath, "_", SMACK_LABEL_ACCESS) != 0) {
+                       if (smack_setlabel(dirpath, "_", SMACK_LABEL_ACCESS) != 0)
                                TRACE_SECURE_ERROR("failed to set smack label:%s", dirpath);
-                       }
                } else {
                        TRACE_ERROR("failed to create directory:%s", dirpath);
                }
index d1c9b9aee8df3e7be3687117ba5f5cf3808fedac..35295863cf5fe8d2b575d431f41284022416e90c 100755 (executable)
@@ -57,7 +57,7 @@ ssize_t bp_ipc_recv(int sock, void *value, size_t type_size,
                        errorcode = BP_ERROR_IO_ERROR;
                }
        } while (sock >= 0 && (errorcode == BP_ERROR_IO_EAGAIN ||
-               errorcode == BP_ERROR_IO_EINTR) && (--tryagain > 0));
+                               errorcode == BP_ERROR_IO_EINTR) && (--tryagain > 0));
        return recv_bytes;
 }
 
@@ -81,8 +81,7 @@ int bp_ipc_send_errorcode(int fd, bp_error_defs errorcode)
 bp_error_defs bp_ipc_read_errorcode(int fd)
 {
        bp_error_defs errorcode = BP_ERROR_NONE;
-       if (bp_ipc_recv(fd, &errorcode, sizeof(bp_error_defs),
-                       __FUNCTION__) <= 0)
+       if (bp_ipc_recv(fd, &errorcode, sizeof(bp_error_defs), __FUNCTION__) <= 0)
                errorcode = BP_ERROR_IO_ERROR;
        return errorcode;
 }
index 746a4ca2dd2aec761064cf099d2cb73b6b642683..0233691bcb8b4dd409206885d5f0b2e45681a694 100755 (executable)
@@ -50,8 +50,7 @@ static bp_error_defs __bp_tab_get_duplicated_ids(int sock)
 
        bp_ipc_send_errorcode(sock, BP_ERROR_NONE);
        memset(&conds, 0x00, sizeof(bp_db_base_conds_fmt));
-       if (bp_ipc_read_custom_type
-               (sock, &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
+       if (bp_ipc_read_custom_type(sock, &conds, sizeof(bp_db_base_conds_fmt)) < 0) {
                TRACE_ERROR("[ERROR] CONDs [BP_ERROR_IO_ERROR]");
                bp_ipc_send_errorcode(sock, BP_ERROR_IO_ERROR);
                return BP_ERROR_IO_ERROR;
@@ -100,24 +99,24 @@ static bp_error_defs __bp_tab_get_duplicated_ids(int sock)
 
                if (offset & BP_TAB_O_URL) {
                        errorcode = bp_common_get_duplicated_url_ids(g_db_handle,
-                       &g_db_mutex, BP_DB_TABLE_TABS, &ids, &ids_count,
-                       conds.limit, conds.offset,
-                       ordercolumn, conds.ordering, is_like, keyword, NULL);
+                               &g_db_mutex, BP_DB_TABLE_TABS, &ids, &ids_count,
+                               conds.limit, conds.offset,
+                               ordercolumn, conds.ordering, is_like, keyword, NULL);
                } else {
-                       if (offset & BP_TAB_O_TITLE) {
+                       if (offset & BP_TAB_O_TITLE)
                                checkcolumn = BP_DB_COMMON_COL_TITLE;
-                       } else if (offset & BP_TAB_O_DEVICE_NAME) {
+                       else if (offset & BP_TAB_O_DEVICE_NAME)
                                checkcolumn = BP_DB_COMMON_COL_DEVICE_NAME;
-                       } else if (offset & BP_TAB_O_DEVICE_ID) {
+                       else if (offset & BP_TAB_O_DEVICE_ID)
                                checkcolumn = BP_DB_COMMON_COL_DEVICE_ID;
-                       } else {
+                       else
                                errorcode = BP_ERROR_INVALID_PARAMETER;
-                       }
+
                        if (checkcolumn != NULL) {
                                errorcode = bp_common_get_duplicated_ids(g_db_handle,
-                               &g_db_mutex, BP_DB_TABLE_TABS, &ids, &ids_count,
-                               conds.limit, conds.offset, checkcolumn,
-                               ordercolumn, conds.ordering, is_like, keyword, NULL);
+                                       &g_db_mutex, BP_DB_TABLE_TABS, &ids, &ids_count,
+                                       conds.limit, conds.offset, checkcolumn,
+                                       ordercolumn, conds.ordering, is_like, keyword, NULL);
                        }
                }
 
@@ -291,25 +290,21 @@ static bp_error_defs __bp_tab_get_info_offset(int sock, int id, bp_shm_defs *shm
                }
 
                if (offset & BP_TAB_O_ICON) {
-                       int recvint = bp_db_get_int_column
-                                       (g_db_handle, id, BP_DB_TABLE_FAVICONS,
+                       int recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_FAVICONS,
                                        BP_DB_COMMON_COL_BLOB_WIDTH, &errorcode);
                        if (recvint > 0)
                                info.favicon_width = recvint;
-                       recvint = bp_db_get_int_column
-                                       (g_db_handle, id, BP_DB_TABLE_FAVICONS,
+                       recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_FAVICONS,
                                        BP_DB_COMMON_COL_BLOB_HEIGHT, &errorcode);
                        if (recvint > 0)
                                info.favicon_height = recvint;
                }
                if (offset & BP_TAB_O_SNAPSHOT) {
-                       int recvint = bp_db_get_int_column
-                                       (g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
+                       int recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
                                        BP_DB_COMMON_COL_BLOB_WIDTH, &errorcode);
                        if (recvint > 0)
                                info.thumbnail_width = recvint;
-                       recvint = bp_db_get_int_column
-                                       (g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
+                       recvint = bp_db_get_int_column(g_db_handle, id, BP_DB_TABLE_THUMBNAILS,
                                        BP_DB_COMMON_COL_BLOB_HEIGHT, &errorcode);
                        if (recvint > 0)
                                info.thumbnail_height = recvint;
@@ -568,9 +563,9 @@ static bp_error_defs __bp_tab_set_easy_all(int sock, int id, int ctype)
                        errorcode = BP_ERROR_IO_ERROR;
                }
        }
-       if (errorcode != BP_ERROR_NONE) {
+       if (errorcode != BP_ERROR_NONE)
                goto TAB_SET_ALL_ERROR;
-       }
+
 
        // check the number of extra columns to update
        if (tabinfo.is_activated >= 0)
@@ -597,9 +592,8 @@ static bp_error_defs __bp_tab_set_easy_all(int sock, int id, int ctype)
                check_id = bp_db_get_int_column(g_db_handle, id,
                        BP_DB_TABLE_TABS, BP_DB_COMMON_COL_ID, &errorcode);
                pthread_mutex_unlock(&g_db_mutex);
-               if (check_id < 0 && errorcode != BP_ERROR_ID_NOT_FOUND) {
+               if (check_id < 0 && errorcode != BP_ERROR_ID_NOT_FOUND)
                        goto TAB_SET_ALL_ERROR;
-               }
        }
 
        errorcode = BP_ERROR_NONE;
@@ -630,10 +624,11 @@ static bp_error_defs __bp_tab_set_easy_all(int sock, int id, int ctype)
                        bp_db_bind_value(g_db_basic_insert_stmt, BP_DB_COL_TYPE_TEXT, device_name, 7);
                if (offset & BP_TAB_O_DEVICE_ID)
                        bp_db_bind_value(g_db_basic_insert_stmt, BP_DB_COL_TYPE_TEXT, device_id, 8);
+
                int ret = bp_db_exec_stmt(g_db_basic_insert_stmt);
-               if (ret != SQLITE_OK && ret != SQLITE_DONE) {
+               if (ret != SQLITE_OK && ret != SQLITE_DONE)
                        errorcode = bp_common_sql_errorcode(ret);
-               }
+
                bp_db_reset(g_db_basic_insert_stmt);
                pthread_mutex_unlock(&g_db_mutex);
        } else { // update
@@ -644,7 +639,7 @@ static bp_error_defs __bp_tab_set_easy_all(int sock, int id, int ctype)
                        columns_count++;
                if (tabinfo.date_modified >= 0)
                        columns_count++;
-               if (tabinfo.index >= 0)  // if negative, ignore
+               if (tabinfo.index >= 0) // if negative, ignore
                        columns_count++;
                if (tabinfo.is_incognito >= 0)
                        columns_count++;
@@ -884,8 +879,7 @@ bp_error_defs bp_tabs_handle_requests(bp_client_slots_defs *slots,
        }
        if (client_cmd == NULL) {
                TRACE_ERROR("[ERROR] NULL Command");
-               if (bp_ipc_send_errorcode(client->cmd_socket,
-                               BP_ERROR_INVALID_PARAMETER) < 0)
+               if (bp_ipc_send_errorcode(client->cmd_socket, BP_ERROR_INVALID_PARAMETER) < 0)
                        return BP_ERROR_IO_ERROR;
                return BP_ERROR_INVALID_PARAMETER;
        }
@@ -902,8 +896,7 @@ bp_error_defs bp_tabs_handle_requests(bp_client_slots_defs *slots,
 
        switch (cmd) {
        case BP_CMD_COMMON_CREATE:
-               errorcode = bp_common_create
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock, id);
+               errorcode = bp_common_create(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock, id);
                break;
        case BP_CMD_COMMON_DELETE:
 
@@ -916,8 +909,7 @@ bp_error_defs bp_tabs_handle_requests(bp_client_slots_defs *slots,
                        break;
                }
 #endif
-               errorcode = bp_common_delete
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock, id);
+               errorcode = bp_common_delete(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock, id);
                break;
        case BP_CMD_DEINITIALIZE:
                if (client->type == BP_CLIENT_TABS_SYNC) {
@@ -950,50 +942,41 @@ bp_error_defs bp_tabs_handle_requests(bp_client_slots_defs *slots,
                bp_ipc_send_errorcode(sock, errorcode);
                break;
        case BP_CMD_COMMON_SET_IS_DELETED:
-               errorcode = bp_common_set_is_deleted
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock, id);
+               errorcode = bp_common_set_is_deleted(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock, id);
                break;
        case BP_CMD_COMMON_GET_CONDS_ORDER_IDS: // duplicated
                errorcode = __bp_tab_get_duplicated_ids(sock);
                break;
        case BP_CMD_COMMON_GET_FULL_IDS: // without deleted
-               errorcode = bp_common_get_full_ids
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
+               errorcode = bp_common_get_full_ids(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
                break;
        case BP_CMD_COMMON_GET_FULL_WITH_DELETED_IDS:
-               errorcode = bp_common_get_full_with_deleted_ids
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
+               errorcode = bp_common_get_full_with_deleted_ids(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
                break;
        case BP_CMD_COMMON_GET_DIRTY_IDS: // only dirty
                errorcode = bp_common_get_dirty_ids
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
+                       (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
                break;
        case BP_CMD_COMMON_GET_DELETED_IDS:
-               errorcode = bp_common_get_deleted_ids
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
+               errorcode = bp_common_get_deleted_ids(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
                break;
        case BP_CMD_COMMON_CLEAR_DIRTY_IDS:
-               errorcode = bp_common_clear_dirty_ids
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
+               errorcode = bp_common_clear_dirty_ids(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
                break;
        case BP_CMD_COMMON_CLEAR_DELETED_IDS:
-               errorcode = bp_common_clear_deleted_ids
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
+               errorcode = bp_common_clear_deleted_ids(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, sock);
                break;
        case BP_CMD_TABS_GET_INDEX:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
-                               BP_DB_TABS_COL_INDEX, sock, id);
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+                        BP_DB_TABS_COL_INDEX, sock, id);
                break;
        case BP_CMD_COMMON_GET_URL:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
-                               BP_DB_COMMON_COL_URL, sock, id);
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+                        BP_DB_COMMON_COL_URL, sock, id);
                break;
        case BP_CMD_COMMON_GET_TITLE:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
-                               BP_DB_COMMON_COL_TITLE, sock, id);
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+                        BP_DB_COMMON_COL_TITLE, sock, id);
                break;
        case BP_CMD_COMMON_GET_ICON:
                errorcode = bp_common_get_blob_shm(g_db_handle,
@@ -1004,73 +987,59 @@ bp_error_defs bp_tabs_handle_requests(bp_client_slots_defs *slots,
                                &g_db_mutex, BP_DB_TABLE_THUMBNAILS, sock, id, &client->shm);
                break;
        case BP_CMD_TABS_GET_ACTIVATED:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_TABS_COL_ACTIVATED, sock, id);
                break;
        case BP_CMD_TABS_GET_INCOGNITO:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_TABS_COL_IS_INCOGNITO, sock, id);
                break;
        case BP_CMD_TABS_GET_BROWSER_INSTANCE:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_TABS_COL_BROWSER_INSTANCE, sock, id);
                break;
        case BP_CMD_COMMON_GET_DATE_CREATED:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_DATETIME_CREATED, sock, id);
                break;
        case BP_CMD_COMMON_GET_DATE_MODIFIED:
-               errorcode = bp_common_get_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_DATETIME_MODIFIED, sock, id);
                break;
        case BP_CMD_COMMON_GET_ACCOUNT_NAME:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_ACCOUNT_NAME, sock, id);
                break;
        case BP_CMD_COMMON_GET_ACCOUNT_TYPE:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_ACCOUNT_TYPE, sock, id);
                break;
        case BP_CMD_COMMON_GET_DEVICE_NAME:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_DEVICE_NAME, sock, id);
                break;
        case BP_CMD_COMMON_GET_DEVICE_ID:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_DEVICE_ID, sock, id);
                break;
        case BP_CMD_TABS_GET_USAGE:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_TABS_COL_USAGE, sock, id);
                break;
        case BP_CMD_COMMON_GET_SYNC:
-               errorcode = bp_common_get_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_get_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_SYNC, sock, id);
                break;
        case BP_CMD_TABS_SET_INDEX:
-               errorcode = bp_common_set_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_TABS_COL_INDEX, sock, id);
                break;
        case BP_CMD_COMMON_SET_URL:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_URL, sock, id);
                break;
        case BP_CMD_COMMON_SET_TITLE:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_TITLE, sock, id);
                break;
        case BP_CMD_COMMON_SET_ICON:
@@ -1082,58 +1051,47 @@ bp_error_defs bp_tabs_handle_requests(bp_client_slots_defs *slots,
                                &g_db_mutex, BP_DB_TABLE_THUMBNAILS, sock, id, &client->shm);
                break;
        case BP_CMD_TABS_SET_ACTIVATED:
-               errorcode = bp_common_set_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_TABS_COL_ACTIVATED, sock, id);
                break;
        case BP_CMD_TABS_SET_INCOGNITO:
-               errorcode = bp_common_set_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_TABS_COL_IS_INCOGNITO, sock, id);
                break;
        case BP_CMD_TABS_SET_BROWSER_INSTANCE:
-               errorcode = bp_common_set_int
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_int(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_TABS_COL_BROWSER_INSTANCE, sock, id);
                break;
        case BP_CMD_COMMON_SET_DATE_CREATED:
-               errorcode = bp_common_set_date
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_date(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_DATE_CREATED, sock, id);
                break;
        case BP_CMD_COMMON_SET_DATE_MODIFIED:
-               errorcode = bp_common_set_date
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_date(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_DATE_MODIFIED, sock, id);
                break;
        case BP_CMD_COMMON_SET_ACCOUNT_NAME:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_ACCOUNT_NAME, sock, id);
                break;
        case BP_CMD_COMMON_SET_ACCOUNT_TYPE:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_ACCOUNT_TYPE, sock, id);
                break;
        case BP_CMD_COMMON_SET_DEVICE_NAME:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_DEVICE_NAME, sock, id);
                break;
        case BP_CMD_COMMON_SET_DEVICE_ID:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_DEVICE_ID, sock, id);
                break;
        case BP_CMD_TABS_SET_USAGE:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_TABS_COL_USAGE, sock, id);
                break;
        case BP_CMD_COMMON_SET_SYNC:
-               errorcode = bp_common_set_string
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
+               errorcode = bp_common_set_string(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS,
                                BP_DB_COMMON_COL_SYNC, sock, id);
                break;
        case BP_CMD_COMMON_NOTI:
@@ -1148,8 +1106,7 @@ bp_error_defs bp_tabs_handle_requests(bp_client_slots_defs *slots,
                errorcode = __bp_tab_get_info_offset(sock, id, &client->shm);
                break;
        case BP_CMD_COMMON_SET_DIRTY:
-               errorcode = bp_common_set_dirty
-                               (g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, id);
+               errorcode = bp_common_set_dirty(g_db_handle, &g_db_mutex, BP_DB_TABLE_TABS, id);
                break;
        case BP_CMD_TABS_ACTIVATE:
                errorcode = __bp_tab_activate(sock, id);
index 80cd7b115f14496891f191223e154da591a9d06b..df182986f09f4721d8f8df856723c24da3915b65 100755 (executable)
 static inline void bp_ftrace(char *fmt, ...)
 {
        static FILE *logd = NULL;
-       if(logd == NULL )
+       if (logd == NULL)
                logd = fopen("/var/log/browser-provider.log", "a+");
 
        va_list args;
        va_start(args, fmt);
-       if(logd != NULL) {
+       if (logd != NULL) {
                vfprintf(logd, fmt, args);
                fflush(logd);
        }
@@ -57,7 +57,7 @@ static inline void bp_ftrace(char *fmt, ...)
 #if defined(LOGD) && defined(TIZEN_DEBUG_ENABLE)
 #define TRACE_DEBUG(format, ARG...) LOGD(format, ##ARG)
 #else
-#define TRACE_DEBUG(...) do { } while(0)
+#define TRACE_DEBUG(...) do { } while (0)
 #endif
 #define TRACE_ERROR(format, ARG...) LOGE(format, ##ARG)
 #define TRACE_INFO(format, ARG...) LOGI(format, ##ARG)
@@ -66,30 +66,30 @@ static inline void bp_ftrace(char *fmt, ...)
 #if defined(SECURE_LOGD) && defined(TIZEN_DEBUG_ENABLE)
 #define TRACE_SECURE_DEBUG(format, ARG...) SECURE_LOGD(format, ##ARG)
 #else
-#define TRACE_SECURE_DEBUG(...) do { } while(0)
+#define TRACE_SECURE_DEBUG(...) do { } while (0)
 #endif
 #if defined(SECURE_LOGI) && defined(TIZEN_DEBUG_ENABLE)
 #define TRACE_SECURE_INFO(format, ARG...) SECURE_LOGI(format, ##ARG)
 #else
-#define TRACE_SECURE_INFO(...) do { } while(0)
+#define TRACE_SECURE_INFO(...) do { } while (0)
 #endif
 #if defined(SECURE_LOGE) && defined(TIZEN_DEBUG_ENABLE)
 #define TRACE_SECURE_ERROR(format, ARG...) SECURE_LOGE(format, ##ARG)
 #else
-#define TRACE_SECURE_ERROR(...) do { } while(0)
+#define TRACE_SECURE_ERROR(...) do { } while (0)
 #endif
 
 #endif
 
 #else // No Logging
 
-#define TRACE_DEBUG(...) do { } while(0)
-#define TRACE_ERROR(...) do { } while(0)
-#define TRACE_INFO(...) do { } while(0)
-#define TRACE_WARN(...) do { } while(0)
-#define TRACE_SECURE_DEBUG(...) do { } while(0)
-#define TRACE_SECURE_INFO(...) do { } while(0)
-#define TRACE_SECURE_ERROR(...) do { } while(0)
+#define TRACE_DEBUG(...) do { } while (0)
+#define TRACE_ERROR(...) do { } while (0)
+#define TRACE_INFO(...) do { } while (0)
+#define TRACE_WARN(...) do { } while (0)
+#define TRACE_SECURE_DEBUG(...) do { } while (0)
+#define TRACE_SECURE_INFO(...) do { } while (0)
+#define TRACE_SECURE_ERROR(...) do { } while (0)
 
 #endif
 
index f9205e3f16152305c811a2f674a6442629478692..6515915fbd173dfc938ef1fd15d7b808bc82050d 100755 (executable)
@@ -27,8 +27,8 @@
        if (sock < 0) {\
                TRACE_ERROR("[ERROR] sock establish");\
                return BP_ERROR_IO_ERROR;\
-       }\
-} while(0)
+       } \
+} while (0)
 
 ssize_t bp_ipc_recv(int sock, void *value, size_t type_size,
        const char *func);
index f325396b80f6d1a43ab1e8ebd7193c03b4184e4f..cc1648ca31f528200706774d6018e7d68327a473 100755 (executable)
@@ -38,7 +38,7 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED
        ${CMAKE_SOURCE_DIR}/common-adaptor/common-adaptor-png.c
        ${CMAKE_SOURCE_DIR}/provider/browser-provider-socket.c
        ${CMAKE_SOURCE_DIR}/provider/browser-provider-shm.c
-       ${CMAKE_CURRENT_SOURCE_DIR}/tab-adaptor.c )
+       ${CMAKE_CURRENT_SOURCE_DIR}/tab-adaptor.c)
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${tab_adaptor_pkgs_LDFLAGS} ${TAB_LINK_LIBRARIES})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${PKG_VERSION})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0)
index 49826932e1413efe1bf552134baeb7cafe5e425d..4e26f838c6da7e9abaf79f89e69b6ca2d55b8577 100755 (executable)
@@ -132,8 +132,8 @@ typedef enum {
 /**
  * @brief The structure containing the variables for all properties
  * @remarks The caller has access only to variables which are related to the bp_history_offset. \n
- *                     The caller has to initialize the structure before using it.\n
- *                     The caller has to free the memory of the structure allocated by bp_tab_adaptor_get_info().
+ *                     The caller has to initialize the structure before using it.\n
+ *                     The caller has to free the memory of the structure allocated by bp_tab_adaptor_get_info().
  */
 typedef struct {
        int index;                                      /**< The index of the tab, otherwise ignore this variable by setting to negative */
@@ -293,7 +293,7 @@ EXPORT_API int bp_tab_adaptor_clear_dirty_ids(void);
 /**
  * @brief Ddeletes all tabs having set 'is_deleted' property from the storage
  * @details If cloud is on, "is_dirty" property is off by calling delete function,\n
- *                     if cloud is off, a scrap is deleted really from storage whenever delete function is called.
+ *                     if cloud is off, a scrap is deleted really from storage whenever delete function is called.
  * @return 0 on success, otherwise -1 is returned and error code is set to indicate the error.
  */
 EXPORT_API int bp_tab_adaptor_clear_deleted_ids(void);
@@ -641,7 +641,7 @@ EXPORT_API int bp_tab_adaptor_set_snapshot(const int id, const int width, const
  * @brief Creates a new item
  * @details The creation time is set to the present time automatically
  * @param [out] id The id of created item. The caller can handle the way to generate id value with initializing this param before calling.
- *                             If caller pass negative value such as -1, provider will generate id value automatically, otherwise it will try to use passed value as an id of new item.
+ *                             If caller pass negative value such as -1, provider will generate id value automatically, otherwise it will try to use passed value as an id of new item.
  * @return 0 on success, otherwise -1 is returned and error code is set to indicate the error.
  * @see bp_tab_adaptor_delete()
  */
@@ -667,7 +667,7 @@ EXPORT_API int bp_tab_adaptor_get_errorcode(void);
 /**
  * @brief Creates a new item or update it using the structure
  * @param [out] id The id of created item. The caller can handle the way to generate id value with initializing this param before calling.
- *                             If caller pass negative value such as -1, provider will generate id value automatically, otherwise it will try to use passed value as an id of new item.
+ *                             If caller pass negative value such as -1, provider will generate id value automatically, otherwise it will try to use passed value as an id of new item.
  * @param[in] info The structure contains all properties that caller want to set
  * @return 0 on success, otherwise -1 is returned and error code is set to indicate the error.
  * @pre The structure has to be initialized to 0, then use the variables call to change them,\n
@@ -728,7 +728,7 @@ EXPORT_API int bp_tab_adaptor_activate(const int id);
 /**
  * @brief Gets the array of ids and the number of rows of items searched by keyword and some structure from the storage
  * @remarks Allocated memory (ids) has to released by the caller.\n
- *                     If the caller wants to do LIKE searching, keyword has to have some wild card like _aa, a_a, %aa, aa% or %aa%.
+ *                     If the caller wants to do LIKE searching, keyword has to have some wild card like _aa, a_a, %aa, aa% or %aa%.
  * @param[out] ids The array of ids
  * @param[out] count The array size
  * @param[in] limit The maximum number of rows to get, negative value means no limit
@@ -741,8 +741,8 @@ EXPORT_API int bp_tab_adaptor_activate(const int id);
  * @return 0 on success, otherwise -1 is returned and error code is set to indicate the error.
  * @see bp_tab_offset
  */
-EXPORT_API int bp_tab_adaptor_get_duplicated_ids_p
-       (int **ids, int *count, const int limit, const int offset,
+EXPORT_API int bp_tab_adaptor_get_duplicated_ids_p(
+       int **ids, int *count, const int limit, const int offset,
        const bp_tab_offset order_column_offset, const int ordering,
        const bp_tab_offset check_column_offset,
        const char *keyword, const int is_like);
index 386b18fb2370991eedf373d2827d91f267861c44..1376d23fc636d6fcde80a3aaeb2fea8537690f04 100755 (executable)
@@ -43,7 +43,7 @@ static bp_error_defs errorcode = BP_ERROR_NONE;
 static void *__tab_adaptor_event_manager(void *arg)
 {
        int status = bp_common_adaptor_event_manager(arg,
-               &g_adaptor_noti_cb, &g_adaptor_noti_user_data);
+                       &g_adaptor_noti_cb, &g_adaptor_noti_user_data);
 
        pthread_mutex_lock(&g_adaptor_mutex);
        g_adaptor_event_thread_pid = 0; // set 0 to not call pthread_cancel
@@ -72,7 +72,7 @@ static int __browser_adaptor_disconnect(void)
 {
        TRACE_DEBUG("pthread:%0x", (int)g_adaptor_event_thread_pid);
        return bp_common_adaptor_disconnect(&g_adaptorinfo,
-               &g_adaptor_event_thread_pid);
+                       &g_adaptor_event_thread_pid);
 }
 
 static int __browser_adaptor_connect(int callback)
@@ -85,19 +85,18 @@ static int __browser_adaptor_connect(int callback)
                        client_type = BP_CLIENT_TABS_SYNC;
 #endif
 
-               if (bp_common_adaptor_connect_to_provider(&g_adaptorinfo,
-                               client_type) < 0) {
+               if (bp_common_adaptor_connect_to_provider(&g_adaptorinfo, client_type) < 0) {
                        TRACE_ERROR("[CHECK connection]");
                        return -1;
                }
        }
        g_bp_command.cmd = BP_CMD_NONE;
        g_bp_command.id = -1;
-       if(g_adaptorinfo != NULL) {
-           g_bp_command.cid = g_adaptorinfo->cid;
-       } else {
-           g_bp_command.cid = 0;
-       }
+       if (g_adaptorinfo != NULL)
+               g_bp_command.cid = g_adaptorinfo->cid;
+       else
+               g_bp_command.cid = 0;
+
        if (callback == 1 && g_adaptor_event_thread_pid <= 0) {
                // create thread here ( getting event_socket )
                if (pthread_create(&g_adaptor_event_thread_pid, NULL,
@@ -111,8 +110,7 @@ static int __browser_adaptor_connect(int callback)
        return 0;
 }
 
-static int __bp_tab_adaptor_get_ids_p
-       (int **ids, int *count, bp_command_defs cmd)
+static int __bp_tab_adaptor_get_ids_p(int **ids, int *count, bp_command_defs cmd)
 {
        if (ids == NULL || count == NULL)
                return -1;
@@ -132,8 +130,7 @@ static int __bp_tab_adaptor_get_ids_p
        return 0;
 }
 
-static int __bp_tab_adaptor_get_string
-       (const int id, bp_command_defs cmd, char **value)
+static int __bp_tab_adaptor_get_string(const int id, bp_command_defs cmd, char **value)
 {
        if (id < 0 || value == NULL)
                return -1;
@@ -150,8 +147,7 @@ static int __bp_tab_adaptor_get_string
        return ret;
 }
 
-static int __bp_tab_adaptor_get_int
-       (const int id, bp_command_defs cmd, int *value)
+static int __bp_tab_adaptor_get_int(const int id, bp_command_defs cmd, int *value)
 {
        if (id < 0 || value == NULL)
                return -1;
@@ -168,8 +164,7 @@ static int __bp_tab_adaptor_get_int
        return ret;
 }
 
-static int __bp_tab_adaptor_set_string
-       (const int id, bp_command_defs cmd, const char *value)
+static int __bp_tab_adaptor_set_string(const int id, bp_command_defs cmd, const char *value)
 {
        if (id < 0 || value == NULL || bp_common_precheck_string(value) < 0)
                return -1;
@@ -186,8 +181,7 @@ static int __bp_tab_adaptor_set_string
        return ret;
 }
 
-static int __bp_tab_adaptor_set_int
-       (const int id, bp_command_defs cmd, const int value)
+static int __bp_tab_adaptor_set_int(const int id, bp_command_defs cmd, const int value)
 {
        if (id < 0) {
                TRACE_ERROR("[CHECK id][%d]", id);
@@ -683,7 +677,7 @@ int bp_tab_adaptor_delete(const int id)
 
 int bp_tab_adaptor_get_errorcode(void)
 {
-       switch(errorcode) {
+       switch (errorcode) {
        case BP_ERROR_INVALID_PARAMETER:
                return BP_TAB_ERROR_INVALID_PARAMETER;
        case BP_ERROR_OUT_OF_MEMORY:
@@ -765,9 +759,9 @@ int bp_tab_adaptor_easy_create(int *id, bp_tab_info_fmt *info)
                return -1;
        }
        if (bp_ipc_send_custom_type(sock, &new_base_tab,
-                       sizeof(bp_tab_base_fmt)) < 0 ||
+                               sizeof(bp_tab_base_fmt)) < 0 ||
                        bp_ipc_send_custom_type(sock, &offset,
-                       sizeof(bp_tab_offset)) < 0) {
+                               sizeof(bp_tab_offset)) < 0) {
                errorcode = BP_ERROR_IO_ERROR;
                BP_PRINT_ERROR(*id, errorcode);
                __browser_adaptor_disconnect();
@@ -944,24 +938,24 @@ int bp_tab_adaptor_get_info(const int id, const bp_tab_offset offset,
        memset(info, 0x00, sizeof(bp_tab_info_fmt));
 
        // fill info
-       if (offset & BP_TAB_O_INDEX) {
+       if (offset & BP_TAB_O_INDEX)
                info->index = tabinfo.index;
-       }
-       if (offset & BP_TAB_O_IS_ACTIVATED) {
+
+       if (offset & BP_TAB_O_IS_ACTIVATED)
                info->is_activated = tabinfo.is_activated;
-       }
-       if (offset & BP_TAB_O_IS_INCOGNITO) {
+
+       if (offset & BP_TAB_O_IS_INCOGNITO)
                info->is_incognito = tabinfo.is_incognito;
-       }
-       if (offset & BP_TAB_O_BROWSER_INSTANCE) {
+
+       if (offset & BP_TAB_O_BROWSER_INSTANCE)
                info->browser_instance = tabinfo.browser_instance;
-       }
-       if (offset & BP_TAB_O_DATE_CREATED) {
+
+       if (offset & BP_TAB_O_DATE_CREATED)
                info->date_created = tabinfo.date_created;
-       }
-       if (offset & BP_TAB_O_DATE_MODIFIED) {
+
+       if (offset & BP_TAB_O_DATE_MODIFIED)
                info->date_modified = tabinfo.date_modified;
-       }
+
        // get strings . keep the order with provider
        if (offset & BP_TAB_O_URL) {
                if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
@@ -1052,8 +1046,8 @@ EXPORT_API int bp_tab_adaptor_activate(const int id)
        return __bp_tab_adaptor_send_cmd(id, BP_CMD_TABS_ACTIVATE);
 }
 
-int bp_tab_adaptor_get_duplicated_ids_p
-       (int **ids, int *count, const int limit, const int offset,
+int bp_tab_adaptor_get_duplicated_ids_p(
+       int **ids, int *count, const int limit, const int offset,
        const bp_tab_offset order_column_offset, const int ordering,
        const bp_tab_offset check_column_offset,
        const char *keyword, const int is_like)
@@ -1088,9 +1082,9 @@ int bp_tab_adaptor_get_duplicated_ids_p
        }
        bp_tab_offset oflags = check_column_offset;
        if (bp_ipc_send_custom_type(sock, &conds,
-                       sizeof(bp_db_base_conds_fmt)) < 0 ||
+                               sizeof(bp_db_base_conds_fmt)) < 0 ||
                        bp_ipc_send_custom_type(sock, &oflags,
-                       sizeof(bp_tab_offset)) < 0 ||
+                               sizeof(bp_tab_offset)) < 0 ||
                        bp_adaptor_ipc_send_int(sock, is_like) < 0 ||
                        bp_ipc_send_string(sock, keyword) < 0) {
                errorcode = BP_ERROR_IO_ERROR;
@@ -1115,7 +1109,7 @@ int bp_tab_adaptor_get_duplicated_ids_p
        // int count.
        int ids_count = bp_adaptor_ipc_read_int(sock);
        TRACE_DEBUG("response ids count:%d", ids_count);
-       if (ids_count < BP_MAX_IDS_COUNT&& ids_count > 0) {
+       if (ids_count < BP_MAX_IDS_COUNT && ids_count > 0) {
                int *idlist = (int *)calloc(ids_count, sizeof(int));
                if (idlist == NULL) {
                        errorcode = BP_ERROR_OUT_OF_MEMORY;
@@ -1128,8 +1122,7 @@ int bp_tab_adaptor_get_duplicated_ids_p
                        return -1;
                }
                // getting ids array from provider
-               if (bp_ipc_read_blob(sock, idlist,
-                               (sizeof(int) * ids_count)) < 0) {
+               if (bp_ipc_read_blob(sock, idlist, (sizeof(int) * ids_count)) < 0) {
                        free(idlist);
                        errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
                        BP_PRINT_ERROR(-1, errorcode);