Added xbps_callback_array_iter() and use it in xbps-bin to list missing pkgdeps.

This commit is contained in:
Juan RP
2011-01-25 02:55:34 +01:00
parent 61fbf17bb9
commit 082efc3535
3 changed files with 55 additions and 14 deletions

View File

@ -53,7 +53,7 @@
* @def XBPS_RELVER
* Current library release date.
*/
#define XBPS_RELVER "20110124"
#define XBPS_RELVER "20110125"
/**
* @def XBPS_META_PATH
@ -343,6 +343,22 @@ bool xbps_add_obj_to_dict(prop_dictionary_t dict,
*/
bool xbps_add_obj_to_array(prop_array_t array, prop_object_t obj);
/**
* Executes a function callback specified in \a fn with \a arg paassed
* as its argument into they array \a array.
*
* @param[in] array Proplib array to iterate.
* @param[in] fn Function callback to run on every object in the array.
* While running the function callback, the hird parameter (a pointer to
* a boolean) can be set to true to stop immediately the loop.
* @param[in] arg Argument to be passed to the function callback.
*
* @return 0 on success, otherwise an errno value is set appropiately.
*/
int xbps_callback_array_iter(prop_array_t array,
int (*fn)(prop_object_t, void *, bool *),
void *arg);
/**
* Executes a function callback into the array associated with key \a key,
* contained in a proplib dictionary.