* @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;
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
* @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;
}
* @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);