Fix dependency info callback signature and API name
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgr-info.h
index 0a4c9b3..0634127 100644 (file)
@@ -6353,10 +6353,10 @@ int pkgmgrinfo_compare_package_version(const char *current_version,
  * @pre                pkgmgrinfo_pkginfo_get_pkginfo()
  * @post               pkgmgrinfo_pkginfo_destroy_pkginfo()
  * @code
-int dependency_cb(const char *pkgid, const char *type,
+int dependency_cb(const char *from const char *to, const char *type,
                const char *required_version,void *user_data)
 {
-       printf("this package %s %s", type, pkgid);
+       printf("this package %s %s", type, to);
        if (required_version)
                printf("required version : %s", required_version);
        return 0;
@@ -6384,10 +6384,11 @@ int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
                void *user_data);
 
 /**
- * @fn int pkgmgrinfo_pkginfo_foreach_required_by(pkgmgrinfo_pkginfo_h handle,
+ * @fn int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
                        pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
                        void *user_data);
- * @brief      This API gets the list of packages which has dependency of a particular package
+ * @brief      This API gets the list of packages which has dependency directly
+ *             and indirectly of a particular package
  *
  * @par                This API is for package-manager client application
  * @par Sync (or) Async : Synchronous API
@@ -6401,23 +6402,23 @@ int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
  * @pre                pkgmgrinfo_pkginfo_get_pkginfo()
  * @post               pkgmgrinfo_pkginfo_destroy_pkginfo()
  * @code
-int dependency_cb(const char *pkgid, const char *type,
+int dependency_cb(const char *from, const char *to, const char *type,
                const char *required_version,void *user_data)
 {
-       printf("%s %s this package", pkgid, type);
+       printf("%s %s %s package", from, to, type);
        if (required_version)
                printf("required version : %s", required_version);
        return 0;
 }
 
-static int list_required_by(const char *package)
+static int list_depends_on(const char *package)
 {
        int ret = 0;
        pkgmgrinfo_pkginfo_h handle;
        ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
        if (ret != PMINFO_R_OK)
                return -1;
-       ret = pkgmgrinfo_pkginfo_foreach_required_by(handle, dependency_cb, NULL);
+       ret = pkgmgrinfo_pkginfo_foreach_depends_on(handle, dependency_cb, NULL);
        if (ret != PMINFO_R_OK) {
                pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
                return -1;
@@ -6427,7 +6428,7 @@ static int list_required_by(const char *package)
 }
  * @endcode
  */
-int pkgmgrinfo_pkginfo_foreach_required_by(pkgmgrinfo_pkginfo_h handle,
+int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
                pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
                void *user_data);