Added three new helper functions to the API.

xbps_find_pkg_in_array_by_name
xbps_find_pkg_in_array_by_pattern
xbps_remove_pkgname_from_array
This commit is contained in:
Juan RP
2011-01-29 12:28:23 +01:00
parent 298305c1d5
commit 241751f1b7
2 changed files with 101 additions and 23 deletions

View File

@ -476,6 +476,28 @@ bool xbps_find_virtual_pkg_in_dict(prop_dictionary_t pkgd,
const char *str,
bool bypattern);
/**
* Finds a package dictionary in a proplib array by matching a package name.
*
* @param[in] array The proplib array where to look for.
* @param[in] name The package name to match.
*
* @return true on success, false otherwise and errno is set appropiately.
*/
prop_dictionary_t xbps_find_pkg_in_array_by_name(prop_array_t array,
const char *name);
/**
* Finds a package dictionary in a proplib array by matching a package pattern.
*
* @param[in] array The proplib array where to look for.
* @param[in] pattern The package pattern to match.
*
* @return true on success, false otherwise and errno is set appropiately.
*/
prop_dictionary_t xbps_find_pkg_in_array_by_pattern(prop_array_t array,
const char *pattern);
/**
* Finds a package name matching an string object in a proplib array.
*
@ -579,6 +601,16 @@ bool xbps_remove_pkg_from_dict_by_name(prop_dictionary_t dict,
*/
bool xbps_remove_string_from_array(prop_array_t array, const char *str);
/**
* Removes a string from a proplib's array matched by a package name.
*
* @param[in] array Proplib array where to look for.
* @param[in] name Package name to match.
*
* @return true on success, false otherwise and errno is set appropiately.
*/
bool xbps_remove_pkgname_from_array(prop_array_t array, const char *name);
/*@}*/
/** @addtogroup purge */