![]() |
XBPS Library API
0.19
The X Binary Package System
|
Functions | |
prop_object_iterator_t | xbps_array_iter_from_dict (prop_dictionary_t dict, const char *key) |
int | xbps_callback_array_iter (struct xbps_handle *xhp, prop_array_t array, int(*fn)(struct xbps_handle *, prop_object_t, void *, bool *), void *arg) |
int | xbps_callback_array_iter_in_dict (struct xbps_handle *xhp, prop_dictionary_t dict, const char *key, int(*fn)(struct xbps_handle *, prop_object_t, void *, bool *), void *arg) |
int | xbps_callback_array_iter_reverse (struct xbps_handle *xhp, prop_array_t array, int(*fn)(struct xbps_handle *, prop_object_t, void *, bool *), void *arg) |
int | xbps_callback_array_iter_reverse_in_dict (struct xbps_handle *xhp, prop_dictionary_t dict, const char *key, int(*fn)(struct xbps_handle *, prop_object_t, void *, bool *), void *arg) |
bool | xbps_match_any_virtualpkg_in_rundeps (prop_array_t rundeps, prop_array_t provides) |
bool | xbps_match_pkgdep_in_array (prop_array_t array, const char *pkgver) |
bool | xbps_match_pkgname_in_array (prop_array_t array, const char *pkgname) |
bool | xbps_match_pkgpattern_in_array (prop_array_t array, const char *pattern) |
bool | xbps_match_string_in_array (prop_array_t array, const char *val) |
bool | xbps_match_virtual_pkg_in_dict (prop_dictionary_t pkgd, const char *str, bool bypattern) |
These functions manipulate plist files and objects shared by almost all library functions.
prop_object_iterator_t xbps_array_iter_from_dict | ( | prop_dictionary_t | dict, |
const char * | key | ||
) |
Returns a proplib object iterator associated with an array, contained in a proplib dictionary matching the specified key.
[in] | dict | Proplib dictionary where to look for the array. |
[in] | key | Key associated with the array. |
Definition at line 192 of file plist.c.
Referenced by xbps_remove_pkg_files(), and xbps_transaction_commit().
int xbps_callback_array_iter | ( | struct xbps_handle * | xhp, |
prop_array_t | array, | ||
int(*)(struct xbps_handle *, prop_object_t, void *, bool *) | fn, | ||
void * | arg | ||
) |
Executes a function callback specified in fn with arg passed as its argument into they array array.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | array | Proplib array to iterate. |
[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. |
[in] | arg | Argument to be passed to the function callback. |
int xbps_callback_array_iter_in_dict | ( | struct xbps_handle * | xhp, |
prop_dictionary_t | dict, | ||
const char * | key, | ||
int(*)(struct xbps_handle *, prop_object_t, void *, bool *) | fn, | ||
void * | arg | ||
) |
Executes a function callback into the array associated with key key, contained in a proplib dictionary.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | dict | Proplib dictionary where the array resides. |
[in] | key | Key associated with array. |
[in] | fn | Function callback to run on every object in the array. While running the function callback, the third parameter (a pointer to a boolean) can be set to true to stop immediately the loop. |
[in] | arg | Argument to be passed to the function callback. |
int xbps_callback_array_iter_reverse | ( | struct xbps_handle * | xhp, |
prop_array_t | array, | ||
int(*)(struct xbps_handle *, prop_object_t, void *, bool *) | fn, | ||
void * | arg | ||
) |
Executes a function callback specified in fn with arg passed as its argument into they array array in reverse order (upwards).
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | array | Proplib array to iterate. |
[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. |
[in] | arg | Argument to be passed to the function callback. |
Definition at line 139 of file plist.c.
Referenced by xbps_callback_array_iter_reverse_in_dict().
int xbps_callback_array_iter_reverse_in_dict | ( | struct xbps_handle * | xhp, |
prop_dictionary_t | dict, | ||
const char * | key, | ||
int(*)(struct xbps_handle *, prop_object_t, void *, bool *) | fn, | ||
void * | arg | ||
) |
Executes a function callback (in reverse order) into the array associated with key key, contained in a proplib dictionary.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | dict | Proplib dictionary where the array resides. |
[in] | key | Key associated with array. |
[in] | fn | Function callback to run on every object in the array. While running the function callback, the third parameter (a pointer to a boolean) can be set to true to stop immediately the loop. |
[in] | arg | Argument to be passed to the function callback. |
Definition at line 169 of file plist.c.
References xbps_callback_array_iter_reverse().
bool xbps_match_any_virtualpkg_in_rundeps | ( | prop_array_t | rundeps, |
prop_array_t | provides | ||
) |
Match any virtual package from array provides in they array rundeps with dependencies.
[in] | rundeps | Proplib array with dependencies as strings, i.e foo>=2.0. |
[in] | provides | Proplib array of strings with virtual pkgdeps, i.e foo-1.0 blah-2.0. |
Definition at line 62 of file plist_match.c.
References xbps_pkgpattern_match(), and xbps_xasprintf().
bool xbps_match_pkgdep_in_array | ( | prop_array_t | array, |
const char * | pkgver | ||
) |
Match a package dependency against any package pattern in the specified array of strings.
[in] | array | The proplib array to search on. |
[in] | pkgver | The package name-version to match, i.e `foo-1.0'. |
Definition at line 200 of file plist_match.c.
bool xbps_match_pkgname_in_array | ( | prop_array_t | array, |
const char * | pkgname | ||
) |
Match a package name in the specified array of strings.
[in] | array | The proplib array to search on. |
[in] | pkgname | The package name to match. |
Definition at line 188 of file plist_match.c.
Referenced by xbps_match_virtual_pkg_in_dict().
bool xbps_match_pkgpattern_in_array | ( | prop_array_t | array, |
const char * | pattern | ||
) |
Match a package pattern in the specified array of strings.
[in] | array | The proplib array to search on. |
[in] | pattern | The package pattern to match, i.e `foo>=0' or `foo<1'. |
Definition at line 194 of file plist_match.c.
Referenced by xbps_match_virtual_pkg_in_dict().
bool xbps_match_string_in_array | ( | prop_array_t | array, |
const char * | val | ||
) |
Match a string (exact match) in the specified array of strings.
[in] | array | The proplib array to search on. |
[in] | val | The string to be matched. |
Definition at line 182 of file plist_match.c.
bool xbps_match_virtual_pkg_in_dict | ( | prop_dictionary_t | pkgd, |
const char * | str, | ||
bool | bypattern | ||
) |
Match a virtual package name or pattern by looking at package's dictionary "provides" array object.
[in] | pkgd | Package dictionary. |
[in] | str | Virtual package name or package pattern to match. |
[in] | bypattern | If true, str should be a package name, otherwise it should be a package pattern, i.e `foo>=0' or `foo<1'. |
Definition at line 43 of file plist_match.c.
References xbps_match_pkgname_in_array(), and xbps_match_pkgpattern_in_array().
Referenced by xbps_rindex_get_virtualpkg().