Fix coding style 36/82436/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 3 Aug 2016 10:02:14 +0000 (19:02 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 3 Aug 2016 10:02:14 +0000 (19:02 +0900)
Change-Id: Ie2187e207e27b15a168faea9e2c713a32a37a7e3
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
include/pkgmgr-info.h
include/pkgmgrinfo_debug.h
include/pkgmgrinfo_type.h
parser/pkgmgr_parser.c
parser/pkgmgr_parser_db.c
src/pkgmgrinfo_appinfo.c
src/pkgmgrinfo_client.c
src/pkgmgrinfo_db.c
src/pkgmgrinfo_pkginfo.c
src/pkgmgrinfo_private.c

index 15bddb4..652828c 100644 (file)
@@ -463,14 +463,14 @@ int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_v
  * @par        This API is for package-manager client application
  * @par Sync (or) Async : Synchronous API
  *
- * @param[in] handle           pointer to the pkginfo handle.
- * @param[out] tep_name        pointer to hold tep name
+ * @param[in] handle   pointer to the pkginfo handle.
+ * @param[out] tep_name        pointer to hold tep name
  * @return     0 if success, error code(<0) if fail
  * @retval     PMINFO_R_OK success
  * @retval     PMINFO_R_EINVAL invalid argument
  * @retval     PMINFO_R_ERROR  internal error
- * @pre        pkgmgrinfo_pkginfo_get_pkginfo()
- * @post               pkgmgrinfo_pkginfo_destroy_pkginfo()
+ * @pre                pkgmgrinfo_pkginfo_get_pkginfo()
+ * @post       pkgmgrinfo_pkginfo_destroy_pkginfo()
  * @see        pkgmgrinfo_pkginfo_get_pkgid()
  * @code
 static int get_tep_name(const char *pkgid)
@@ -502,14 +502,14 @@ int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name
  * @par        This API is for package-manager client application
  * @par Sync (or) Async : Synchronous API
  *
- * @param[in] handle           pointer to the pkginfo handle.
- * @param[out] zip_mount_file  pointer to hold zip mount file
+ * @param[in] handle   pointer to the pkginfo handle.
+ * @param[out] zip_mount_file  pointer to hold zip mount file
  * @return     0 if success, error code(<0) if fail
  * @retval     PMINFO_R_OK success
  * @retval     PMINFO_R_EINVAL invalid argument
  * @retval     PMINFO_R_ERROR  internal error
  * @pre        pkgmgrinfo_pkginfo_get_pkginfo()
- * @post       pkgmgrinfo_pkginfo_destroy_pkginfo()
+ * @post       pkgmgrinfo_pkginfo_destroy_pkginfo()
  * @see        pkgmgrinfo_pkginfo_get_pkgid()
  * @code
 static int get_zip_mount_file(const char *pkgid)
@@ -3426,14 +3426,14 @@ int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **e
  * @par        This API is for package-manager client application
  * @par Sync (or) Async : Synchronous API
  *
- * @param[in] handle           pointer to the appinfo handle.
- * @param[out] tep_name        pointer to hold tep name
+ * @param[in] handle           pointer to the appinfo handle.
+ * @param[out] tep_name                pointer to hold tep name
  * @return     0 if success, error code(<0) if fail
  * @retval     PMINFO_R_OK success
  * @retval     PMINFO_R_EINVAL invalid argument
  * @retval     PMINFO_R_ERROR  internal error
  * @pre        pkgmgrinfo_appinfo_get_appinfo()
- * @post               pkgmgrinfo_appinfo_destroy_appinfo()
+ * @post       pkgmgrinfo_appinfo_destroy_appinfo()
  * @see        pkgmgrinfo_appinfo_get_appid()
  * @code
 static int get_tep_name(const char *appid)
@@ -3465,14 +3465,14 @@ int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name
  * @par        This API is for package-manager client application
  * @par Sync (or) Async : Synchronous API
  *
- * @param[in] handle           pointer to the appinfo handle.
- * @param[out] zip_mount_file  pointer to hold zip mount file name
+ * @param[in] handle           pointer to the appinfo handle.
+ * @param[out] zip_mount_file          pointer to hold zip mount file name
  * @return     0 if success, error code(<0) if fail
  * @retval     PMINFO_R_OK success
  * @retval     PMINFO_R_EINVAL invalid argument
  * @retval     PMINFO_R_ERROR  internal error
  * @pre        pkgmgrinfo_appinfo_get_appinfo()
- * @post               pkgmgrinfo_appinfo_destroy_appinfo()
+ * @post       pkgmgrinfo_appinfo_destroy_appinfo()
  * @see        pkgmgrinfo_appinfo_get_appid()
  * @code
 static int get_zip_mount_file(const char *appid)
@@ -4226,14 +4226,14 @@ int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *proces
  * @par        This API is for package-manager client application
  * @par Sync (or) Async : Synchronous API
  *
- * @param[in] handle           pointer to the application info handle.
- * @param[out] app_type        pointer to hold installed storage location
+ * @param[in] handle           pointer to the application info handle.
+ * @param[out] app_type                pointer to hold installed storage location
  * @return     0 if success, error code(<0) if fail
  * @retval     PMINFO_R_OK success
  * @retval     PMINFO_R_EINVAL invalid argument
  * @retval     PMINFO_R_ERROR  internal error
  * @pre        pkgmgrinfo_appinfo_get_appinfo()
- * @post               pkgmgrinfo_appinfo_destroy_appinfo()
+ * @post       pkgmgrinfo_appinfo_destroy_appinfo()
  * @see        pkgmgrinfo_appinfo_get_appid()
  * @code
 static int get_app_installed_location(const char *appid)
@@ -5218,8 +5218,8 @@ static int delete_cert_info(const char *pkgid)
 }
  * @endcode
  */
- int pkgmgrinfo_delete_certinfo(const char *pkgid);
- int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
+int pkgmgrinfo_delete_certinfo(const char *pkgid);
+int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
 
 /**
  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
@@ -5441,7 +5441,7 @@ static int get_app_guestmode_visibility(const char *appid)
 }
  * @endcode
  */
- int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
+int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
 
 /**
  * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
@@ -5478,17 +5478,17 @@ static int set_app_guestmode_visibility(const char *appid, bool value)
 }
  * @endcode
  */
- int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
- int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
+int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
+int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
 
 /**
 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
 * @brief        This API sets the package 'installed_storage' value in db
 *
-* @par          This API is for package-manager client application
+* @par This API is for package-manager client application
 * @par Sync (or) Async : Synchronous API
 *
-* @param[in] pkgid      pointer to the package ID.
+* @param[in] pkgid             pointer to the package ID.
 * @param[in] location  package install location
 * @return  0 if success, error code(<0) if fail
 * @retval  PMINFO_R_OK success
@@ -5507,8 +5507,8 @@ static int set_app_installed_storage(const char *appid, INSTALL_LOCATION locatio
 }
 * @endcode
 */
- int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
- int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
+int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
+int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
 
 /**
  * @pkgmgrinfo client API
index 0350124..3f24c3a 100644 (file)
 
 #define PKGMGR_INFO_ENABLE_DLOG
 
-#define COLOR_RED              "\033[0;31m"
-#define COLOR_BLUE             "\033[0;34m"
+#define COLOR_RED              "\033[0;31m"
+#define COLOR_BLUE             "\033[0;34m"
 #define COLOR_END              "\033[0;m"
 
 #ifdef PKGMGR_INFO_ENABLE_DLOG
-#define PKGMGR_INFO_DEBUG(fmt, ...)\
-       do\
-       {\
-               LOGD(fmt, ##__VA_ARGS__);\
+#define PKGMGR_INFO_DEBUG(fmt, ...) \
+       do { \
+               LOGD(fmt, ##__VA_ARGS__); \
        } while (0)
 
-#define PKGMGR_INFO_DEBUG_ERR(fmt, ...)\
-       do\
-       {\
-               LOGE(COLOR_RED fmt COLOR_END, ##__VA_ARGS__);\
-       }while (0)
+#define PKGMGR_INFO_DEBUG_ERR(fmt, ...) \
+       do { \
+               LOGE(COLOR_RED fmt COLOR_END, ##__VA_ARGS__); \
+       } while (0)
 
 #define PKGMGR_INFO_BEGIN() \
-       do\
-    {\
-               LOGD(COLOR_BLUE"BEGIN >>>>"COLOR_END);\
-    } while( 0 )
+       do { \
+               LOGD(COLOR_BLUE"BEGIN >>>>"COLOR_END); \
+       } while (0)
 
 #define PKGMGR_INFO_END() \
-       do\
-    {\
-               LOGD(COLOR_BLUE"END <<<<"COLOR_END);\
-    } \
-    while( 0 )
+       do { \
+               LOGD(COLOR_BLUE"END <<<<"COLOR_END); \
+       } while (0)
 
 #else
 #define PKGMGR_INFO_DEBUG(fmt, ...) \
-       do\
-       {\
-               printf("\n [%s: %s(): %d] " fmt"\n",  rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
+       do { \
+               printf("\n [%s: %s(): %d] " fmt"\n",  rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
        } while (0)
 
 #define PKGMGR_INFO_BEGIN() \
-       do\
-    {\
-        printf("\n [%s: %d] : BEGIN >>>> %s() \n", rindex(__FILE__, '/')+1,  __LINE__ , __FUNCTION__);\
-    } while( 0 )
+       do { \
+               printf("\n [%s: %d] : BEGIN >>>> %s() \n", rindex(__FILE__, '/')+1,  __LINE__ , __FUNCTION__); \
+       } while (0)
 
 #define PKGMGR_INFO_END() \
-       do\
-    {\
-        printf("\n [%s: %d]: END   <<<< %s()\n", rindex(__FILE__, '/')+1,  __LINE__ , __FUNCTION__); \
-    } \
-    while( 0 )
+       do { \
+               printf("\n [%s: %d]: END   <<<< %s()\n", rindex(__FILE__, '/')+1,  __LINE__ , __FUNCTION__); \
+       } while (0)
 #endif
 
 
index 8cab293..30524e6 100644 (file)
@@ -71,7 +71,7 @@ typedef enum {
        PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6,          /**< End Entity Root Certificate*/
        PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,          /**< End Entity Intermediate Certificate*/
        PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8,                /**< End Entity Signer Certificate*/
-}pkgmgrinfo_instcert_type;
+} pkgmgrinfo_instcert_type;
 
 typedef enum {
        PMINFO_CERT_COMPARE_MATCH,
@@ -131,19 +131,19 @@ typedef enum {
        PMINFO_HWACCELERATION_OFF = 0,          /**< Don't use hardware acceleration*/
        PMINFO_HWACCELERATION_ON = 1,           /**< Use hardware acceleration*/
        PMINFO_HWACCELERATION_DEFAULT = 2               /**< Follow system setting for hardware acceleration */
-}pkgmgrinfo_app_hwacceleration;
+} pkgmgrinfo_app_hwacceleration;
 
 typedef enum {
        PMINFO_SCREENREADER_OFF = 0,            /**< Don't use screen reader*/
        PMINFO_SCREENREADER_ON = 1,             /**< Use screen reader*/
        PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2              /**< Follow system setting for screen reader */
-}pkgmgrinfo_app_screenreader;
+} pkgmgrinfo_app_screenreader;
 
 typedef enum {
        PMINFO_RECENTIMAGE_USE_ICON = 0,                /**<Use icon for recent image*/
        PMINFO_RECENTIMAGE_USE_CAPTURE = 1,             /**< Use capture for recent image*/
        PMINFO_RECENTIMAGE_USE_NOTHING = 2              /**< Don't use recent image */
-}pkgmgrinfo_app_recentimage;
+} pkgmgrinfo_app_recentimage;
 
 /**
  * @brief A handle to get package information
@@ -186,7 +186,7 @@ typedef void* pkgmgrinfo_appcontrol_h;
 typedef void pkgmgrinfo_client;
 
 /**
- * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
+ * @fn int (*pkgmgrinfo_pkg_list_cb) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
  *
  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
  *
@@ -198,11 +198,11 @@ typedef void pkgmgrinfo_client;
  * @see  pkgmgrinfo_pkginfo_get_list()
  * @see  pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
  */
-typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
+typedef int (*pkgmgrinfo_pkg_list_cb) (const pkgmgrinfo_pkginfo_h handle,
                                                        void *user_data);
 
 /**
- * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
+ * @fn int (*pkgmgrinfo_app_list_cb) (const pkgmgrinfo_appinfo_h handle, void *user_data)
  *
  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
  *
@@ -215,11 +215,11 @@ typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
  * @see  pkgmgrinfo_appinfo_filter_foreach_appinfo()
  * @see  pkgmgrinfo_appinfo_metadata_filter_foreach()
  */
-typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
+typedef int (*pkgmgrinfo_app_list_cb) (const pkgmgrinfo_appinfo_h handle,
                                                        void *user_data);
 
 /**
- * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
+ * @fn int (*pkgmgrinfo_app_category_list_cb) (const char *category_name, void *user_data)
  *
  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
  *
@@ -230,11 +230,11 @@ typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
  *
  * @see  pkgmgrinfo_appinfo_foreach_category()
  */
-typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
+typedef int (*pkgmgrinfo_app_category_list_cb) (const char *category_name,
                                                        void *user_data);
 
 /**
- * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
+ * @fn int (*pkgmgrinfo_app_permission_list_cb) (const char *permission_type, void *user_data)
  *
  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
  *
@@ -245,11 +245,11 @@ typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
  *
  * @see  pkgmgrinfo_appinfo_foreach_category()
  */
-typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
+typedef int (*pkgmgrinfo_app_permission_list_cb) (const char *permission_type,
                                                        void *user_data);
 
 /**
- * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
+ * @fn int (*pkgmgrinfo_pkg_privilege_list_cb) (const char *privilege_name, void *user_data)
  *
  * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
  *
@@ -260,11 +260,11 @@ typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
  *
  * @see  pkgmgrinfo_pkginfo_foreach_privilege()
  */
-typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
+typedef int (*pkgmgrinfo_pkg_privilege_list_cb) (const char *privilege_name,
                                                        void *user_data);
 
 /**
- * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
+ * @fn int (*pkgmgrinfo_app_metadata_list_cb) (const char *metadata_key, const char *metadata_value, void *user_data)
  *
  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
  *
@@ -276,11 +276,11 @@ typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
  *
  * @see  pkgmgrinfo_appinfo_foreach_metadata()
  */
-typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
+typedef int (*pkgmgrinfo_app_metadata_list_cb) (const char *metadata_key,
                                                        const char *metadata_value, void *user_data);
 
 /**
- * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
+ * @fn int (*pkgmgrinfo_app_control_list_cb) (pkgmgrinfo_appcontrol_h handle, void *user_data)
  *
  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
  *
@@ -291,11 +291,11 @@ typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
  *
  * @see  pkgmgrinfo_appinfo_foreach_appcontrol()
  */
-typedef int (*pkgmgrinfo_app_control_list_cb ) (const char *operation, const char *uri, const char *mime,
+typedef int (*pkgmgrinfo_app_control_list_cb) (const char *operation, const char *uri, const char *mime,
                                                        void *user_data);
 
 /**
- * @fn int (*pkgmgrinfo_app_background_category_list_cb ) (const char *category_name, void *user_data)
+ * @fn int (*pkgmgrinfo_app_background_category_list_cb) (const char *category_name, void *user_data)
  *
  * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_background_category()
  *
@@ -306,7 +306,7 @@ typedef int (*pkgmgrinfo_app_control_list_cb ) (const char *operation, const cha
  *
  * @see  pkgmgrinfo_appinfo_foreach_background_category()
  */
-typedef int (*pkgmgrinfo_app_background_category_list_cb ) (const char *category_name, void *user_data);
+typedef int (*pkgmgrinfo_app_background_category_list_cb) (const char *category_name, void *user_data);
 
 /**
  * @fn int (*pkgmgrinfo_app_splash_screen_list_cb)(const char *src,
@@ -392,9 +392,9 @@ typedef enum {
   * @brief permission Types
   */
 typedef enum {
-       PMINFO_PERMISSION_NORMAL = 0,            /**< permission normal*/
-       PMINFO_PERMISSION_SIGNATURE,     /**< permission type is signature*/
-       PMINFO_PERMISSION_PRIVILEGE,     /**< permission type is privilege*/
+       PMINFO_PERMISSION_NORMAL = 0,           /**< permission normal*/
+       PMINFO_PERMISSION_SIGNATURE,            /**< permission type is signature*/
+       PMINFO_PERMISSION_PRIVILEGE,            /**< permission type is privilege*/
 } pkgmgrinfo_permission_type;
 
 typedef enum {
index b9220fc..c3ea5b3 100644 (file)
@@ -51,7 +51,6 @@
 #define ASCII(s) (char *)s
 #define XMLCHAR(s) (const xmlChar *)s
 
-//#define METADATA_PARSER_LIST SYSCONFDIR "/package-manager/parserlib/metadata/metadata_parser_list.txt"
 #define METADATA_PARSER_LIST SYSCONFDIR "/package-manager/parserlib/metadata/mdparser_list.txt"
 #define METADATA_PARSER_NAME   "metadataparser:"
 
@@ -109,9 +108,8 @@ static void __save_xml_attribute(xmlTextReaderPtr reader, char *attribute, char
                *xml_attribute = strdup((const char *)attrib_val);
                xmlFree(attrib_val);
        } else {
-               if (default_value != NULL) {
+               if (default_value != NULL)
                        *xml_attribute = strdup(default_value);
-               }
        }
 }
 
@@ -168,7 +166,7 @@ static void __save_xml_default_value(manifest_x * mfx)
        mfx->readonly = strdup("False");
        mfx->update = strdup("False");
        mfx->system = strdup("False");
-       mfx->installed_storage= strdup("installed_internal");
+       mfx->installed_storage = strdup("installed_internal");
        package = mfx->package;
 }
 
@@ -213,7 +211,7 @@ static void __str_trim(char *input)
 API int __is_admin()
 {
        uid_t uid = getuid();
-       if ((uid_t) 0 == uid )
+       if ((uid_t)0 == uid)
                return 1;
        else
                return 0;
@@ -273,7 +271,7 @@ static char *__get_metadata_parser_plugin(const char *type)
                fclose(fp);
 
        if (path == NULL) {
-               _LOGE("no matching [%s] [%s]\n", METADATA_PARSER_NAME,type);
+               _LOGE("no matching [%s] [%s]\n", METADATA_PARSER_NAME, type);
                return NULL;
        }
 
@@ -319,7 +317,7 @@ static char *__get_category_parser_plugin(const char *type)
                fclose(fp);
 
        if (path == NULL) {
-               _LOGE("no matching [%s] [%s]\n", CATEGORY_PARSER_NAME,type);
+               _LOGE("no matching [%s] [%s]\n", CATEGORY_PARSER_NAME, type);
                return NULL;
        }
 
@@ -443,7 +441,7 @@ static int __ps_run_metadata_parser(GList *md_list, const char *tag,
 
        if ((metadata_parser_plugin =
                dlsym(lib_handle, ac)) == NULL || dlerror() != NULL) {
-               _LOGE("can not find symbol[%s] \n",ac);
+               _LOGE("can not find symbol[%s] \n", ac);
                goto END;
        }
 
@@ -497,7 +495,7 @@ static int __ps_run_category_parser(GList *category_list, const char *tag,
 
        if ((category_parser_plugin =
                dlsym(lib_handle, ac)) == NULL || dlerror() != NULL) {
-               _LOGE("can not find symbol[%s] \n",ac);
+               _LOGE("can not find symbol[%s] \n", ac);
                goto END;
        }
 
@@ -582,11 +580,10 @@ static int __run_tag_parser_prestep(void *lib_handle, xmlTextReaderPtr reader, A
 
        value = xmlTextReaderConstValue(reader);
        if (value != NULL) {
-               if (xmlStrlen(value) > 40) {
+               if (xmlStrlen(value) > 40)
                        _LOGD(" %.40s...", value);
-               } else {
+               else
                        _LOGD(" %s", value);
-               }
        }
 
        name = xmlTextReaderConstName(reader);
@@ -609,12 +606,11 @@ static int __run_tag_parser_prestep(void *lib_handle, xmlTextReaderPtr reader, A
        if (temp == NULL)
                return -1;
        xmlNode *next_node = NULL;
-       while(cur_node != NULL) {
-               if ( (strcmp(ASCII(temp->name), ASCII(cur_node->name)) == 0) &&
-                       (temp->line == cur_node->line) ) {
+       while (cur_node != NULL) {
+               if ((strcmp(ASCII(temp->name), ASCII(cur_node->name)) == 0) &&
+                       (temp->line == cur_node->line)) {
                        break;
-               }
-               else {
+               } else {
                        next_node = xmlNextElementSibling(cur_node);
                        xmlUnlinkNode(cur_node);
                        xmlFreeNode(cur_node);
@@ -639,7 +635,7 @@ static int __run_tag_parser_prestep(void *lib_handle, xmlTextReaderPtr reader, A
        return ret;
 }
 
-static int __run_metadata_parser_prestep (manifest_x *mfx, char *md_key, ACTION_TYPE action)
+static int __run_metadata_parser_prestep(manifest_x *mfx, char *md_key, ACTION_TYPE action)
 {
        int ret = -1;
        int tag_exist = 0;
@@ -667,7 +663,7 @@ static int __run_metadata_parser_prestep (manifest_x *mfx, char *md_key, ACTION_
                        md = (metadata_x *)md_tmp->data;
                        if (md == NULL)
                                continue;
-                       //get glist of metadata key and value combination
+                       /* get glist of metadata key and value combination */
                        memset(buffer, 0x00, 1024);
                        snprintf(buffer, 1024, "%s/", md_key);
                        if ((md->key && md->value) && (strncmp(md->key, md_key, strlen(md_key)) == 0) && (strncmp(buffer, md->key, strlen(buffer)) == 0)) {
@@ -697,15 +693,13 @@ static int __run_metadata_parser_prestep (manifest_x *mfx, char *md_key, ACTION_
                        }
                }
 
-               //send glist to parser when tags for metadata plugin parser exist.
+               /* send glist to parser when tags for metadata plugin parser exist. */
                if (tag_exist) {
                        ret = __ps_run_metadata_parser(md_list, md_tag, action, mfx->package, app->appid);
-                       if (ret < 0){
+                       if (ret < 0)
                                _LOGD("metadata_parser failed[%d] for tag[%s]\n", ret, md_tag);
-                       }
-                       else{
+                       else
                                _LOGD("metadata_parser success for tag[%s]\n", md_tag);
-                       }
                }
                __metadata_parser_clear_dir_list(md_list);
                md_list = NULL;
@@ -722,7 +716,7 @@ END:
        return ret;
 }
 
-static int __run_category_parser_prestep (manifest_x *mfx, char *category_key, ACTION_TYPE action)
+static int __run_category_parser_prestep(manifest_x *mfx, char *category_key, ACTION_TYPE action)
 {
        int ret = -1;
        int tag_exist = 0;
@@ -748,7 +742,7 @@ static int __run_category_parser_prestep (manifest_x *mfx, char *category_key, A
                        continue;
                for (category_tmp = app->category; category_tmp; category_tmp = category_tmp->next) {
                        category = (const char *)category_tmp->data;
-                       //get glist of category key and value combination
+                       /* get glist of category key and value combination */
                        memset(buffer, 0x00, 1024);
                        snprintf(buffer, 1024, "%s/", category_key);
                        if ((category) && (strncmp(category, category_key, strlen(category_key)) == 0)) {
@@ -770,7 +764,7 @@ static int __run_category_parser_prestep (manifest_x *mfx, char *category_key, A
                        }
                }
 
-               //send glist to parser when tags for metadata plugin parser exist.
+               /* send glist to parser when tags for metadata plugin parser exist. */
                if (tag_exist) {
                        ret = __ps_run_category_parser(category_list, category_tag, action, mfx->package, app->appid);
                        if (ret < 0)
@@ -802,12 +796,11 @@ static void __process_tag(void *lib_handle, xmlTextReaderPtr reader, ACTION_TYPE
                }
        case XML_READER_TYPE_ELEMENT:
                {
-                       // Elements without closing tag don't receive
+                       /* Elements without closing tag don't receive */
                        const xmlChar *elementName =
                            xmlTextReaderLocalName(reader);
-                       if (elementName == NULL) {
+                       if (elementName == NULL)
                                break;
-                       }
 
                        if (strcmp(tag, ASCII(elementName)) == 0) {
                                _LOGD("find : tag[%s] ACTION_TYPE[%d] pkg[%s]\n", tag, action, pkgid);
@@ -930,9 +923,8 @@ int __ps_process_tag_parser(manifest_x *mfx, const char *filename, ACTION_TYPE a
                        }
                        xmlFreeTextReader(reader);
 
-                       if (ret != 0) {
+                       if (ret != 0)
                                _LOGD("%s : failed to parse", filename);
-                       }
                } else {
                        _LOGD("Unable to open %s", filename);
                }
@@ -953,7 +945,7 @@ int __ps_process_tag_parser(manifest_x *mfx, const char *filename, ACTION_TYPE a
 
 int __ps_process_metadata_parser(manifest_x *mfx, ACTION_TYPE action)
 {
-       fprintf(stdout,"__ps_process_metadata_parser\n");
+       fprintf(stdout, "__ps_process_metadata_parser\n");
        int ret = 0;
        FILE *fp = NULL;
        char md_key[PKG_STRING_LEN_MAX] = { 0 };
@@ -1454,7 +1446,7 @@ static void __ps_process_tag(manifest_x * mfx, char *const tagv[])
                /*check tag :  removable*/
                } else if (strcmp(ret_result, "removable") == 0) {
                        ret_result = strtok_r(NULL, delims, &ptr);
-                       if (strcmp(ret_result, "true") == 0){
+                       if (strcmp(ret_result, "true") == 0) {
                                free((void *)mfx->removable);
                                mfx->removable = strdup("true");
                        } else if (strcmp(ret_result, "false") == 0) {
@@ -1627,7 +1619,7 @@ static int __ps_process_application(xmlTextReaderPtr reader, application_x *appl
        __save_xml_attribute(reader, "on-boot", &application->onboot, "false");
        __save_xml_attribute(reader, "splash-screen-display", &application->splash_screen_display, "true");
 
-       application->package= strdup(package);
+       application->package = strdup(package);
        /* overwrite some attributes if the app is widgetapp */
        if (type == PMINFO_WIDGET_APP || type == PMINFO_WATCH_APP) {
                free((void *)application->nodisplay);
@@ -1940,7 +1932,7 @@ static int __ps_remove_appsvc_db(manifest_x *mfx, uid_t uid)
                if (application == NULL)
                        continue;
                ret = appsvc_operation(application->appid, uid);
-               if (ret <0)
+               if (ret < 0)
                        _LOGE("can not operation  symbol \n");
        }
 
@@ -2106,7 +2098,8 @@ DEPRECATED API int pkgmgr_parser_parse_usr_manifest_for_installation(const char
        return PMINFO_R_OK;
 }
 
-API int pkgmgr_parser_process_manifest_x_for_installation(manifest_x* mfx, const char *manifest) {
+API int pkgmgr_parser_process_manifest_x_for_installation(manifest_x* mfx, const char *manifest)
+{
        retvm_if(mfx == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        retvm_if(manifest == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        _LOGD("processing manifest_x for installation: %s\n", manifest);
@@ -2119,7 +2112,8 @@ API int pkgmgr_parser_process_manifest_x_for_installation(manifest_x* mfx, const
        return PMINFO_R_OK;
 }
 
-API int pkgmgr_parser_process_usr_manifest_x_for_installation(manifest_x* mfx, const char *manifest, uid_t uid) {
+API int pkgmgr_parser_process_usr_manifest_x_for_installation(manifest_x* mfx, const char *manifest, uid_t uid)
+{
        retvm_if(mfx == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        retvm_if(manifest == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        _LOGD("processing manifest_x for installation: %s\n", manifest);
@@ -2194,9 +2188,8 @@ DEPRECATED API int pkgmgr_parser_parse_manifest_for_upgrade(const char *manifest
 
        __ps_process_tag_parser(mfx, manifest, ACTION_UPGRADE);
        ret = __ps_process_metadata_parser(mfx, ACTION_UPGRADE);
-       if (ret == -1){
+       if (ret == -1)
                _LOGD("Upgrade metadata parser failed\n");
-       }
        ret = __ps_process_category_parser(mfx, ACTION_UPGRADE);
        if (ret == -1)
                _LOGD("Creating category parser failed\n");
@@ -2282,7 +2275,8 @@ DEPRECATED API int pkgmgr_parser_parse_usr_manifest_for_upgrade(const char *mani
        return PMINFO_R_OK;
 }
 
-API int pkgmgr_parser_process_manifest_x_for_upgrade(manifest_x* mfx, const char *manifest) {
+API int pkgmgr_parser_process_manifest_x_for_upgrade(manifest_x* mfx, const char *manifest)
+{
        retvm_if(mfx == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        retvm_if(manifest == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        _LOGD("pkgmgr_parser_process_manifest_x_for_upgrade  parsing manifest for upgradation: %s\n", manifest);
@@ -2295,7 +2289,8 @@ API int pkgmgr_parser_process_manifest_x_for_upgrade(manifest_x* mfx, const char
        return PMINFO_R_OK;
 }
 
-API int pkgmgr_parser_process_usr_manifest_x_for_upgrade(manifest_x* mfx, const char *manifest, uid_t uid) {
+API int pkgmgr_parser_process_usr_manifest_x_for_upgrade(manifest_x* mfx, const char *manifest, uid_t uid)
+{
        retvm_if(mfx == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        retvm_if(manifest == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        _LOGD(" pkgmgr_parser_process_usr_manifest_x_for_upgrade parsing manifest for upgradation: %s\n", manifest);
@@ -2401,7 +2396,8 @@ API int pkgmgr_parser_parse_usr_manifest_for_uninstallation(const char *manifest
        return PMINFO_R_OK;
 }
 
-API int pkgmgr_parser_process_manifest_x_for_uninstallation(manifest_x* mfx, const char *manifest) {
+API int pkgmgr_parser_process_manifest_x_for_uninstallation(manifest_x* mfx, const char *manifest)
+{
        retvm_if(mfx == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        retvm_if(manifest == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        _LOGD("processing manifest_x for uninstallation: %s\n", manifest);
@@ -2416,7 +2412,8 @@ API int pkgmgr_parser_process_manifest_x_for_uninstallation(manifest_x* mfx, con
        return PMINFO_R_OK;
 }
 
-API int pkgmgr_parser_process_usr_manifest_x_for_uninstallation(manifest_x* mfx, const char *manifest, uid_t uid) {
+API int pkgmgr_parser_process_usr_manifest_x_for_uninstallation(manifest_x* mfx, const char *manifest, uid_t uid)
+{
        retvm_if(mfx == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        retvm_if(manifest == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
        _LOGD("processing manifest_x for uninstallation: %s\n", manifest);
index b752f5c..a95bcbe 100644 (file)
@@ -458,8 +458,7 @@ static int __guestmode_visibility_cb(void *data, int ncols, char **coltxt, char
        if (mfx->application == NULL)
                return -1;
        app = (application_x *)mfx->application->data;
-       for(i = 0; i < ncols; i++)
-       {
+       for (i = 0; i < ncols; i++) {
                if (strcmp(colname[i], "app_id") == 0) {
                        if (coltxt[i])
                                appid = strdup(coltxt[i]);
@@ -469,7 +468,7 @@ static int __guestmode_visibility_cb(void *data, int ncols, char **coltxt, char
                }
        }
        if (appid == NULL) {
-               if(status != NULL)
+               if (status != NULL)
                        free(status);
                _LOGD("app id is NULL\n");
                return -1;
@@ -639,9 +638,9 @@ static void __trimfunc(GList* trim_list)
                                        continue;
                                } else
                                        prev = trim_data;
-                       }
-                       else
+                       } else {
                                prev = trim_data;
+                       }
                }
                list = g_list_next(list);
        }
@@ -738,7 +737,7 @@ static gint __check_icon_folder(const char *orig_icon_path, char **new_icon_path
        for (i = 0; i < 2; i++) {
                snprintf(modified_iconpath, BUFSIZE - 1, "%s/%s%s", icon_path, dpi_path[i], icon_filename);
                if (access(modified_iconpath, F_OK) != -1) {
-                       // if exists, return modified icon path
+                       /* if exists, return modified icon path */
                        *new_icon_path = strdup(modified_iconpath);
                        return 0;
                }
@@ -795,7 +794,7 @@ static gint __compare_icon_with_lang(gconstpointer a, gconstpointer b)
 
        if (strcasecmp(icon->lang, lang) == 0) {
                if (strcasecmp(icon->lang, DEFAULT_LOCALE) == 0) {
-                       //icon for no locale. check existance of folder-hierachied default icons
+                       /* icon for no locale. check existance of folder-hierachied default icons */
                        if (__check_icon_folder(icon->text, &icon_folder_path) == 0) {
                                free(icon->text);
                                icon->text = icon_folder_path;
@@ -830,21 +829,21 @@ static char *__find_icon(GList *icons, const char *lang)
        int dpi = 0;
        int ret;
 
-       // first, find icon whose locale and dpi with given lang and system's dpi has matched
+       /* first, find icon whose locale and dpi with given lang and system's dpi has matched */
        tmp = g_list_find_custom(icons, lang, (GCompareFunc)__compare_icon_with_lang_dpi);
        if (tmp != NULL) {
                icon = (icon_x *)tmp->data;
                return (char *)icon->text;
        }
 
-       // if first has failed, find icon whose locale has matched
+       /* if first has failed, find icon whose locale has matched */
        tmp = g_list_find_custom(icons, lang, (GCompareFunc)__compare_icon_with_lang);
        if (tmp != NULL) {
                icon = (icon_x *)tmp->data;
                return (char *)icon->text;
        }
 
-       // if second has failed, find icon whose dpi has matched with system's dpi
+       /* if second has failed, find icon whose dpi has matched with system's dpi */
        ret = system_info_get_platform_int("http://tizen.org/feature/screen.dpi", &dpi);
        if (ret == SYSTEM_INFO_ERROR_NONE) {
                tmp = g_list_find_custom(icons, GINT_TO_POINTER(dpi), (GCompareFunc)__compare_icon_with_dpi);
@@ -854,7 +853,7 @@ static char *__find_icon(GList *icons, const char *lang)
                }
        }
 
-       // last, find default icon marked as "No Locale"
+       /* last, find default icon marked as "No Locale" */
        tmp = g_list_find_custom(icons, NULL, (GCompareFunc)__compare_icon);
        if (tmp != NULL) {
                icon = (icon_x *)tmp->data;
@@ -1024,7 +1023,7 @@ static void __insert_application_locale_info(gpointer data, gpointer userdata)
        sqlite3_free(query);
 
        /*insert ui app locale info to pkg locale to get mainapp data */
-       if (strcasecmp(app->mainapp, "true")==0) {
+       if (strcasecmp(app->mainapp, "true") == 0) {
                query = sqlite3_mprintf("INSERT OR REPLACE INTO package_localized_info(package, package_locale, "
                        "package_label, package_icon, package_description, package_license, package_author) VALUES"
                        "(%Q, %Q, "
@@ -1115,7 +1114,7 @@ static int __insert_mainapp_info(manifest_x *mfx)
                        _LOGD("Package App Info DB Insert Failed\n");
                        return -1;
                }
-               if (strcasecmp(app->mainapp, "True")==0)
+               if (strcasecmp(app->mainapp, "True") == 0)
                        mfx->mainapp_id = strdup(app->appid);
        }
 
@@ -1141,7 +1140,7 @@ static int __insert_mainapp_info(manifest_x *mfx)
                }
 
                free((void *)app->mainapp);
-               app->mainapp= strdup("true");
+               app->mainapp = strdup("true");
                mfx->mainapp_id = strdup(app->appid);
        }
 
@@ -1168,23 +1167,22 @@ static int __convert_background_category(GList *category_list)
 
        while (tmp_list != NULL) {
                category_data = (char *)tmp_list->data;
-               if (strcmp(category_data, APP_BG_CATEGORY_MEDIA_STR) == 0) {
+               if (strcmp(category_data, APP_BG_CATEGORY_MEDIA_STR) == 0)
                        ret = ret | APP_BG_CATEGORY_MEDIA_VAL;
-               } else if (strcmp(category_data, APP_BG_CATEGORY_DOWNLOAD_STR) == 0) {
+               else if (strcmp(category_data, APP_BG_CATEGORY_DOWNLOAD_STR) == 0)
                        ret = ret | APP_BG_CATEGORY_DOWNLOAD_VAL;
-               } else if (strcmp(category_data, APP_BG_CATEGORY_BGNETWORK_STR) == 0) {
+               else if (strcmp(category_data, APP_BG_CATEGORY_BGNETWORK_STR) == 0)
                        ret = ret | APP_BG_CATEGORY_BGNETWORK_VAL;
-               } else if (strcmp(category_data, APP_BG_CATEGORY_LOCATION_STR) == 0) {
+               else if (strcmp(category_data, APP_BG_CATEGORY_LOCATION_STR) == 0)
                        ret = ret | APP_BG_CATEGORY_LOCATION_VAL;
-               } else if (strcmp(category_data, APP_BG_CATEGORY_SENSOR_STR) == 0) {
+               else if (strcmp(category_data, APP_BG_CATEGORY_SENSOR_STR) == 0)
                        ret = ret | APP_BG_CATEGORY_SENSOR_VAL;
-               } else if (strcmp(category_data, APP_BG_CATEGORY_IOTCOMM_STR) == 0) {
+               else if (strcmp(category_data, APP_BG_CATEGORY_IOTCOMM_STR) == 0)
                        ret = ret | APP_BG_CATEGORY_IOTCOMM_VAL;
-               } else if (strcmp(category_data, APP_BG_CATEGORY_SYSTEM) == 0) {
+               else if (strcmp(category_data, APP_BG_CATEGORY_SYSTEM) == 0)
                        ret = ret | APP_BG_CATEGORY_SYSTEM_VAL;
-               } else {
+               else
                        _LOGE("Unidentified category [%s]", category_data);
-               }
                tmp_list = g_list_next(tmp_list);
        }
 
@@ -2539,12 +2537,11 @@ API int pkgmgr_parser_initialize_db(uid_t uid)
                return ret;
        }
 
-       if( 0 != __parserdb_change_perm(getUserPkgCertDBPathUID(GLOBAL_USER), GLOBAL_USER)) {
+       if (0 != __parserdb_change_perm(getUserPkgCertDBPathUID(GLOBAL_USER), GLOBAL_USER))
                _LOGD("Failed to change cert db permission\n");
-       }
-       if( 0 != __parserdb_change_perm(getUserPkgParserDBPathUID(uid), uid)) {
+
+       if (0 != __parserdb_change_perm(getUserPkgParserDBPathUID(uid), uid))
                _LOGD("Failed to change parser db permission\n");
-       }
 
        return 0;
 }
@@ -2567,7 +2564,7 @@ static int __parserdb_change_perm(const char *db_file, uid_t uid)
        if (db_file == NULL)
                return -1;
 
-       if (getuid() != OWNER_ROOT) //At this time we should be root to apply this
+       if (getuid() != OWNER_ROOT) /* At this time we should be root to apply this */
                return 0;
        snprintf(journal_file, sizeof(journal_file), "%s%s", db_file, "-journal");
        if (uid == OWNER_ROOT)
@@ -2869,7 +2866,7 @@ API int pkgmgr_parser_update_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid)
        if (ret == -1)
                goto err;
        /*Preserve guest mode visibility*/
-       __preserve_guestmode_visibility_value( mfx);
+       __preserve_guestmode_visibility_value(mfx);
        /*Begin transaction*/
        ret = sqlite3_exec(pkgmgr_parser_db, "BEGIN EXCLUSIVE", NULL, NULL, NULL);
        if (ret != SQLITE_OK) {
index 7790255..3607bf4 100644 (file)
@@ -967,7 +967,7 @@ static gpointer __copy_icon(gconstpointer src, gpointer data)
        icon_x *icon;
 
        icon = calloc(1, sizeof(icon_x));
-       if (icon== NULL) {
+       if (icon == NULL) {
                LOGE("memory alloc failed");
                *(int *)data = -1;
                return NULL;
@@ -1035,7 +1035,7 @@ static gpointer __copy_appcontrol(gconstpointer src, gpointer data)
        appcontrol_x *appcontrol;
 
        appcontrol = calloc(1, sizeof(appcontrol_x));
-       if (appcontrol ==NULL) {
+       if (appcontrol == NULL) {
                LOGE("memory alloc failed");
                *(int *)data = -1;
                return NULL;
@@ -1392,9 +1392,8 @@ API int pkgmgrinfo_appinfo_get_usr_installed_list_full(
                return PMINFO_R_EINVAL;
        }
 
-       if (pkgmgrinfo_appinfo_filter_create(&filter)) {
+       if (pkgmgrinfo_appinfo_filter_create(&filter))
                return PMINFO_R_ERROR;
-       }
 
        if (pkgmgrinfo_appinfo_filter_add_bool(filter,
                                PMINFO_APPINFO_PROP_APP_DISABLE, false)) {
@@ -1531,10 +1530,10 @@ API int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
 
 API int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
 {
-        const char *locale;
-        icon_x *ptr;
-        GList *tmp;
-        pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+       const char *locale;
+       icon_x *ptr;
+       GList *tmp;
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
 
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
        retvm_if(icon == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
@@ -1867,7 +1866,7 @@ API int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, ch
                        continue;
 
                val = (char *)ptr->section;
-               if (val && strcmp(val, "notification") == 0){
+               if (val && strcmp(val, "notification") == 0) {
                        *icon = (char *)ptr->text;
                        return PMINFO_R_OK;
                }
@@ -2019,7 +2018,7 @@ API int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **p
                return PMINFO_R_ERROR;
        if (info->app_info->portraitimg == NULL)
                info->app_info->portraitimg = strdup("");
-       if (info->app_info->landscapeimg== NULL)
+       if (info->app_info->landscapeimg == NULL)
                info->app_info->landscapeimg = strdup("");
 
        *portrait_img = (char *)info->app_info->portraitimg;
@@ -2067,15 +2066,16 @@ API int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h h
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL\n");
        pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
 
-       if (info->app_info && info->app_info->installed_storage){
-                if (strcmp(info->app_info->installed_storage,"installed_internal") == 0)
+       if (info->app_info && info->app_info->installed_storage) {
+                if (strcmp(info->app_info->installed_storage, "installed_internal") == 0)
                        *storage = PMINFO_INTERNAL_STORAGE;
-                else if (strcmp(info->app_info->installed_storage,"installed_external") == 0)
+                else if (strcmp(info->app_info->installed_storage, "installed_external") == 0)
                         *storage = PMINFO_EXTERNAL_STORAGE;
                 else
                         return PMINFO_R_ERROR;
-       }else
+       } else {
                return PMINFO_R_ERROR;
+       }
 
        return PMINFO_R_OK;
 }
index 8dbc4f5..c65b70d 100644 (file)
@@ -49,28 +49,28 @@ API int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type
        tryvm_if(ret < 0, ret = PMINFO_R_ERROR, "pkgmgr_client_new failed.");
 
 catch:
-        /*
-         * Do not close libpkgmgr-client.so.0 to avoid munmap registered callback
-         *
-         * The lib dependency chain like below
-         * amd --> pkgmgr-info -- dlopen --> libpkgmgr-client --> libpkgmgr-installer-client
-         *
-         * And there is a function in libpkgmgr-installer-client named _on_signal_handle_filter()
-         * which will registered to dbus callback in amd though in fact amd doesn't direct depends
-         * on libpkgmgr-installer-client.
-         *
-         * So when the dlcose happen, then libpkgmgr-installer-client been closed too since no one
-         * link to it then.
-         *
-         * However, when the libdbus call into the callback function, it suddenly fond that the
-         * function address is gone (unmapped), then we receive a SIGSEGV.
-         *
-         * I'm not sure why we're using dlopen/dlclose in this case, I think it's much simple and
-         * robust if we just link to the well-known lib.
-         *
-         * See https://bugs.tizen.org/jira/browse/PTREL-591
+       /*
+        * Do not close libpkgmgr-client.so.0 to avoid munmap registered callback
+        *
+        * The lib dependency chain like below
+        * amd --> pkgmgr-info -- dlopen --> libpkgmgr-client --> libpkgmgr-installer-client
+        *
+        * And there is a function in libpkgmgr-installer-client named _on_signal_handle_filter()
+        * which will registered to dbus callback in amd though in fact amd doesn't direct depends
+        * on libpkgmgr-installer-client.
+        *
+        * So when the dlcose happen, then libpkgmgr-installer-client been closed too since no one
+        * link to it then.
+        *
+        * However, when the libdbus call into the callback function, it suddenly fond that the
+        * function address is gone (unmapped), then we receive a SIGSEGV.
+        *
+        * I'm not sure why we're using dlopen/dlclose in this case, I think it's much simple and
+        * robust if we just link to the well-known lib.
+        *
+        * See https://bugs.tizen.org/jira/browse/PTREL-591
        dlclose(handle);
-         */
+        */
        return ret;
 }
 
@@ -92,7 +92,7 @@ API int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handle
        tryvm_if(ret < 0, ret = PMINFO_R_ERROR, "pkgmgr_client_new failed.");
 
 catch:
-        /* same as pkgmgrinfo_client_new */
+       /* same as pkgmgrinfo_client_new */
        return ret;
 }
 
@@ -114,6 +114,6 @@ API int pkgmgrinfo_client_free(pkgmgrinfo_client *pc)
        tryvm_if(ret < 0, ret = PMINFO_R_ERROR, "pkgmgr_client_new failed.");
 
 catch:
-        /* same as pkgmgrinfo_client_new */
+       /* same as pkgmgrinfo_client_new */
        return ret;
 }
index ff23b29..1fb4032 100644 (file)
@@ -162,7 +162,8 @@ static int _mkdir_for_user(const char* dir, uid_t uid, gid_t gid)
        return 0;
 }
 
-static const char *_get_db_path(uid_t uid) {
+static const char *_get_db_path(uid_t uid)
+{
        const char *db_path = NULL;
        if (uid != GLOBAL_USER && uid != ROOT_UID) {
                tzplatform_set_user(uid);
@@ -277,7 +278,7 @@ API const char *getIconPath(uid_t uid, bool readonly)
                        path = tzplatform_mkpath(TZ_SYS_RW_ICONS, "/");
        }
 
-       // just allow certain users to create the icon directory if needed.
+       /* just allow certain users to create the icon directory if needed. */
        if (uid_caller == ROOT_UID || uid_caller == uid)
                _mkdir_for_user(path, uid, gid);
 
@@ -304,7 +305,7 @@ API const char *getUserPkgParserDBPathUID(uid_t uid)
                pkgmgr_parser_db = tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_parser.db");
        }
 
-       // just allow certain users to create the dbspace directory if needed.
+       /* just allow certain users to create the dbspace directory if needed. */
        if (uid_caller == ROOT_UID || uid_caller == uid) {
                const char *db_path = _get_db_path(uid);
                _mkdir_for_user(db_path, uid, gid);
@@ -333,7 +334,7 @@ API const char *getUserPkgCertDBPathUID(uid_t uid)
                pkgmgr_cert_db = tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_cert.db");
        }
 
-       // just allow certain users to create the dbspace directory if needed.
+       /* just allow certain users to create the dbspace directory if needed. */
        if (uid_caller == ROOT_UID || uid_caller == uid) {
                const char *db_path = _get_db_path(uid);
                _mkdir_for_user(db_path, uid, gid);
@@ -360,7 +361,7 @@ API const char *getUserManifestPath(uid_t uid, bool readonly)
                        path = tzplatform_mkpath(TZ_SYS_RW_PACKAGES, "/");
        }
 
-       // just allow certain users to create the icon directory if needed.
+       /* just allow certain users to create the icon directory if needed. */
        if (uid_caller == ROOT_UID || uid_caller == uid)
                _mkdir_for_user(path, uid, gid);
 
@@ -402,7 +403,7 @@ int __open_manifest_db(uid_t uid, bool readonly)
        int flags;
 
        if (manifest_db.ref) {
-               manifest_db.ref ++;
+               manifest_db.ref++;
                return 0;
        }
 
@@ -451,7 +452,7 @@ int __open_cert_db(uid_t uid, bool readonly)
        int flags;
 
        if (cert_db.ref) {
-               cert_db.ref ++;
+               cert_db.ref++;
                return 0;
        }
 
@@ -522,7 +523,8 @@ API int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled
 
        memset(query, '\0', MAX_QUERY_LEN);
        snprintf(query, MAX_QUERY_LEN,
-               "update package_app_info set app_enabled='%s' where app_id='%s'", enabled?"true":"false", appid);
+               "update package_app_info set app_enabled='%s' where app_id='%s'",
+               enabled ? "true" : "false", appid);
 
        if (SQLITE_OK !=
            sqlite3_exec(GET_DB(manifest_db), query, NULL, NULL, &error_message)) {
@@ -658,20 +660,24 @@ API int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_
        retvm_if(ret != SQLITE_OK, PMINFO_R_ERROR, "connect db failed!");
 
        /*Begin transaction*/
-       // Setting Manifest DB
+       /* Setting Manifest DB */
        ret = sqlite3_exec(pkgmgr_parser_db, "BEGIN EXCLUSIVE", NULL, NULL, NULL);
        tryvm_if(ret != SQLITE_OK, ret = PMINFO_R_ERROR, "Failed to begin transaction\n");
        _LOGD("Transaction Begin\n");
 
-       // pkgcakge_info table
-       query = sqlite3_mprintf("update package_info set installed_storage=%Q where package=%Q", location?"installed_external":"installed_internal", pkgid);
+       /* pkgcakge_info table */
+       query = sqlite3_mprintf(
+                       "update package_info set installed_storage=%Q where package=%Q",
+                       location ? "installed_external" : "installed_internal", pkgid);
 
        ret = sqlite3_exec(pkgmgr_parser_db, query, NULL, NULL, NULL);
        tryvm_if(ret != SQLITE_OK, ret = PMINFO_R_ERROR, "Don't execute query = %s\n", query);
        sqlite3_free(query);
 
-       // package_app_info table
-       query = sqlite3_mprintf("update package_app_info set app_installed_storage=%Q where package=%Q", location?"installed_external":"installed_internal", pkgid);
+       /* package_app_info table */
+       query = sqlite3_mprintf(
+                       "update package_app_info set app_installed_storage=%Q where package=%Q",
+                       location ? "installed_external" : "installed_internal", pkgid);
 
        ret = sqlite3_exec(pkgmgr_parser_db, query, NULL, NULL, NULL);
        tryvm_if(ret != SQLITE_OK, ret = PMINFO_R_ERROR, "Don't execute query = %s\n", query);
index 8423b8a..c47d1cc 100644 (file)
@@ -82,7 +82,7 @@ static void __destroy_each_node(gpointer data, gpointer user_data)
 static void __cleanup_pkginfo(pkgmgr_pkginfo_x *data)
 {
        ret_if(data == NULL);
-       if (data->locale){
+       if (data->locale) {
                free((void *)data->locale);
                data->locale = NULL;
        }
@@ -138,9 +138,8 @@ long long _pkgmgr_calculate_dir_size(char *dirname)
                                size occupied (in terms of 4096 blocks)*/
                        q = (fileinfo.st_size / BLOCK_SIZE);
                        r = (fileinfo.st_size % BLOCK_SIZE);
-                       if (r) {
+                       if (r)
                                q = q + 1;
-                       }
                        total += q * BLOCK_SIZE;
                        }
                }
@@ -1172,9 +1171,9 @@ API int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pk
        if (info->pkg_info == NULL || info->pkg_info->installed_storage == NULL)
                return PMINFO_R_ERROR;
 
-       if (strcmp(info->pkg_info->installed_storage,"installed_internal") == 0)
+       if (strcmp(info->pkg_info->installed_storage, "installed_internal") == 0)
                *storage = PMINFO_INTERNAL_STORAGE;
-       else if (strcmp(info->pkg_info->installed_storage,"installed_external") == 0)
+       else if (strcmp(info->pkg_info->installed_storage, "installed_external") == 0)
                *storage = PMINFO_EXTERNAL_STORAGE;
        else
                return PMINFO_R_ERROR;
@@ -1284,10 +1283,10 @@ API int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *acce
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(accessible == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
 
-#if 0 //smack issue occured, check later
+#if 0 /* smack issue occured, check later */
        char *pkgid = NULL;
        pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
-       if (pkgid == NULL){
+       if (pkgid == NULL) {
                 _LOGD("invalid func parameters\n");
                 return PMINFO_R_ERROR;
        }
@@ -1297,13 +1296,13 @@ API int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *acce
        char app_mmc_path[FILENAME_MAX] = { 0, };
        char app_dir_path[FILENAME_MAX] = { 0, };
        char app_mmc_internal_path[FILENAME_MAX] = { 0, };
-       snprintf(app_dir_path, FILENAME_MAX,"%s%s", PKG_INSTALLATION_PATH, pkgid);
-       snprintf(app_mmc_path, FILENAME_MAX,"%s%s", PKG_SD_PATH, pkgid);
-       snprintf(app_mmc_internal_path, FILENAME_MAX,"%s%s/.mmc", PKG_INSTALLATION_PATH, pkgid);
+       snprintf(app_dir_path, FILENAME_MAX, "%s%s", PKG_INSTALLATION_PATH, pkgid);
+       snprintf(app_mmc_path, FILENAME_MAX, "%s%s", PKG_SD_PATH, pkgid);
+       snprintf(app_mmc_internal_path, FILENAME_MAX, "%s%s/.mmc", PKG_INSTALLATION_PATH, pkgid);
 
        /*check whether application is in external memory or not */
        fp = fopen(app_mmc_path, "r");
-       if (fp == NULL){
+       if (fp == NULL) {
                _LOGD(" app path in external memory not accesible\n");
        } else {
                fclose(fp);
@@ -1323,12 +1322,11 @@ API int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *acce
                /*check whether the application is installed in SD card
                but SD card is not present*/
                fp = fopen(app_mmc_internal_path, "r");
-               if (fp == NULL){
+               if (fp == NULL) {
                        *accessible = 1;
                        _LOGD("pkgmgr_get_pkg_external_validation() : INTERNAL_MEM \n");
                        return PMINFO_R_OK;
-               }
-               else{
+               } else {
                        *accessible = 0;
                        _LOGD("pkgmgr_get_pkg_external_validation() : ERROR_MMC_STATUS \n");
                }
index bc7d97c..348578e 100644 (file)
@@ -40,14 +40,14 @@ struct _pkginfo_str_map_t {
 };
 
 static struct _pkginfo_str_map_t pkginfo_str_prop_map[] = {
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_ID,              PMINFO_PKGINFO_PROP_PACKAGE_ID},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE,            PMINFO_PKGINFO_PROP_PACKAGE_TYPE},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION,         PMINFO_PKGINFO_PROP_PACKAGE_VERSION},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION,PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE,PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME,     PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL,    PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF,     PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF},
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_ID,      PMINFO_PKGINFO_PROP_PACKAGE_ID},
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE,    PMINFO_PKGINFO_PROP_PACKAGE_TYPE},
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION, PMINFO_PKGINFO_PROP_PACKAGE_VERSION},
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION,        PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION},
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE,       PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE},
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME,     PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME},
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL,    PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL},
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF,     PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF},
        {E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE,       PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE}
 };
 
@@ -84,13 +84,13 @@ struct _appinfo_str_map_t {
 static struct _appinfo_str_map_t appinfo_str_prop_map[] = {
        {E_PMINFO_APPINFO_PROP_APP_ID,          PMINFO_APPINFO_PROP_APP_ID},
        {E_PMINFO_APPINFO_PROP_APP_COMPONENT,   PMINFO_APPINFO_PROP_APP_COMPONENT},
-       {E_PMINFO_APPINFO_PROP_APP_EXEC,        PMINFO_APPINFO_PROP_APP_EXEC},
-       {E_PMINFO_APPINFO_PROP_APP_ICON,        PMINFO_APPINFO_PROP_APP_ICON},
-       {E_PMINFO_APPINFO_PROP_APP_TYPE,        PMINFO_APPINFO_PROP_APP_TYPE},
-       {E_PMINFO_APPINFO_PROP_APP_OPERATION,   PMINFO_APPINFO_PROP_APP_OPERATION},
-       {E_PMINFO_APPINFO_PROP_APP_URI,         PMINFO_APPINFO_PROP_APP_URI},
-       {E_PMINFO_APPINFO_PROP_APP_MIME,        PMINFO_APPINFO_PROP_APP_MIME},
-       {E_PMINFO_APPINFO_PROP_APP_CATEGORY,    PMINFO_APPINFO_PROP_APP_CATEGORY},
+       {E_PMINFO_APPINFO_PROP_APP_EXEC,        PMINFO_APPINFO_PROP_APP_EXEC},
+       {E_PMINFO_APPINFO_PROP_APP_ICON,        PMINFO_APPINFO_PROP_APP_ICON},
+       {E_PMINFO_APPINFO_PROP_APP_TYPE,        PMINFO_APPINFO_PROP_APP_TYPE},
+       {E_PMINFO_APPINFO_PROP_APP_OPERATION,   PMINFO_APPINFO_PROP_APP_OPERATION},
+       {E_PMINFO_APPINFO_PROP_APP_URI, PMINFO_APPINFO_PROP_APP_URI},
+       {E_PMINFO_APPINFO_PROP_APP_MIME,        PMINFO_APPINFO_PROP_APP_MIME},
+       {E_PMINFO_APPINFO_PROP_APP_CATEGORY,    PMINFO_APPINFO_PROP_APP_CATEGORY},
        {E_PMINFO_APPINFO_PROP_APP_HWACCELERATION,      PMINFO_APPINFO_PROP_APP_HWACCELERATION},
        {E_PMINFO_APPINFO_PROP_APP_SCREENREADER,        PMINFO_APPINFO_PROP_APP_SCREENREADER},
        {E_PMINFO_APPINFO_PROP_APP_METADATA_KEY,        PMINFO_APPINFO_PROP_APP_METADATA_KEY},