Add xbps_remove_{pkgname,string}_from_array() to the API.

This commit is contained in:
Juan RP 2014-09-13 18:13:25 +02:00
parent b42c3d8498
commit dea31f0a15
3 changed files with 25 additions and 5 deletions

View File

@ -48,7 +48,7 @@
*
* This header documents the full API for the XBPS Library.
*/
#define XBPS_API_VERSION "20140912"
#define XBPS_API_VERSION "20140913"
#ifndef XBPS_VERSION
#define XBPS_VERSION "UNSET"
@ -1592,6 +1592,28 @@ int xbps_set_pkg_state_dictionary(xbps_dictionary_t dict, pkg_state_t state);
/** @addtogroup util */
/*@{*/
/**
* Removes a string object matching \a pkgname in
* the \a array array of strings.
*
* @param[in] array Proplib array of strings.
* @param[in] pkgname pkgname string object to remove.
*
* @return true on success, false otherwise.
*/
bool xbps_remove_pkgname_from_array(xbps_array_t array, const char *pkgname);
/**
* Removes a string object matching \a str in the
* \a array array of strings.
*
* @param[in] array Proplib array of strings.
* @param[in] str string object to remove.
*
* @return true on success, false otherwise.
*/
bool xbps_remove_string_from_array(xbps_array_t array, const char *str);
/**
* Creates a directory (and required components if necessary).
*

View File

@ -126,8 +126,6 @@ int HIDDEN xbps_array_replace_dict_by_pattern(xbps_array_t,
bool HIDDEN xbps_remove_pkg_from_array_by_name(xbps_array_t, const char *);
bool HIDDEN xbps_remove_pkg_from_array_by_pattern(xbps_array_t, const char *);
bool HIDDEN xbps_remove_pkg_from_array_by_pkgver(xbps_array_t, const char *);
bool HIDDEN xbps_remove_pkgname_from_array(xbps_array_t, const char *);
bool HIDDEN xbps_remove_string_from_array(xbps_array_t, const char *);
/**
* @private

View File

@ -104,13 +104,13 @@ remove_obj_from_array(xbps_array_t array, const char *str, int mode)
return true;
}
bool HIDDEN
bool
xbps_remove_string_from_array(xbps_array_t array, const char *str)
{
return remove_obj_from_array(array, str, 0);
}
bool HIDDEN
bool
xbps_remove_pkgname_from_array(xbps_array_t array, const char *str)
{
return remove_obj_from_array(array, str, 1);