libxbps: new func xbps_array_replace_dict_by_name(array, dict, pkgname)

This function replaces a dictionary in an array matched by pkgname,
with the dictionary passed in as 2nd argument.
This commit is contained in:
Juan RP
2011-10-19 00:37:36 +02:00
parent 8fa21753b1
commit 0a041cdd2e
2 changed files with 50 additions and 7 deletions

View File

@ -55,7 +55,7 @@
*/
#define XBPS_PKGINDEX_VERSION "1.2"
#define XBPS_API_VERSION "20111017-2"
#define XBPS_API_VERSION "20111019"
#define XBPS_VERSION "0.10.0"
/**
@ -1014,6 +1014,21 @@ bool xbps_remove_string_from_array(prop_array_t array, const char *str);
*/
bool xbps_remove_pkgname_from_array(prop_array_t array, const char *name);
/**
* Replaces a dictionary with another dictionary in \a dict, in the
* array \array by matching its "pkgname" object with \a pkgname.
*
* @param[in] array Proplib array where to look for.
* @param[in] dict Proplib dictionary to be added in \a array.
* @param[in] pkgname Package name to be matched.
*
* @return 0 on success, EINVAL if dictionary couldn't be set in
* array or ENOENT if no match.
*/
int xbps_array_replace_dict_by_name(prop_array_t array,
prop_dictionary_t dict,
const char *pkgname);
/*@}*/
/** @addtogroup purge */