![]() |
XBPS Library API 20240111
The X Binary Package System
|
Functions | |
int | xbps_array_foreach_cb (struct xbps_handle *xhp, xbps_array_t array, xbps_dictionary_t dict, int(*fn)(struct xbps_handle *, xbps_object_t obj, const char *, void *arg, bool *done), void *arg) |
int | xbps_array_foreach_cb_multi (struct xbps_handle *xhp, xbps_array_t array, xbps_dictionary_t dict, int(*fn)(struct xbps_handle *, xbps_object_t obj, const char *, void *arg, bool *done), void *arg) |
bool | xbps_match_virtual_pkg_in_array (xbps_array_t array, const char *str) |
bool | xbps_match_virtual_pkg_in_dict (xbps_dictionary_t pkgd, const char *str) |
bool | xbps_match_any_virtualpkg_in_rundeps (xbps_array_t rundeps, xbps_array_t provides) |
bool | xbps_match_pkgname_in_array (xbps_array_t array, const char *pkgname) |
bool | xbps_match_pkgver_in_array (xbps_array_t array, const char *pkgver) |
bool | xbps_match_pkgpattern_in_array (xbps_array_t array, const char *pattern) |
bool | xbps_match_pkgdep_in_array (xbps_array_t array, const char *pkgver) |
bool | xbps_match_string_in_array (xbps_array_t array, const char *val) |
xbps_object_iterator_t | xbps_array_iter_from_dict (xbps_dictionary_t dict, const char *key) |
These functions manipulate plist files and objects shared by almost all library functions.
int xbps_array_foreach_cb | ( | struct xbps_handle * | xhp, |
xbps_array_t | array, | ||
xbps_dictionary_t | dict, | ||
int(*)(struct xbps_handle *, xbps_object_t obj, const char *, void *arg, bool *done) | fn, | ||
void * | arg | ||
) |
Executes a function callback (fn) per object in the proplib array array.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | array | The proplib array to traverse. |
[in] | dict | The dictionary associated with the array. |
[in] | fn | Function callback to run for any pkg dictionary. |
[in] | arg | Argument to be passed to the function callback. |
Referenced by xbps_pkgdb_foreach_cb().
int xbps_array_foreach_cb_multi | ( | struct xbps_handle * | xhp, |
xbps_array_t | array, | ||
xbps_dictionary_t | dict, | ||
int(*)(struct xbps_handle *, xbps_object_t obj, const char *, void *arg, bool *done) | fn, | ||
void * | arg | ||
) |
Executes a function callback (fn) per object in the proplib array array. This is a multithreaded implementation spawning a thread per core. Each thread processes a fraction of total objects in the array.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | array | The proplib array to traverse. |
[in] | dict | The dictionary associated with the array. |
[in] | fn | Function callback to run for any pkg dictionary. |
[in] | arg | Argument to be passed to the function callback. |
Referenced by xbps_pkgdb_foreach_cb_multi().
bool xbps_match_virtual_pkg_in_array | ( | xbps_array_t | array, |
const char * | str | ||
) |
Match a virtual package name or pattern by looking at proplib array of strings.
[in] | array | Proplib array of strings. |
[in] | str | Virtual package name or package pattern to match. |
Definition at line 43 of file plist_match.c.
References xbps_match_pkgdep_in_array(), xbps_match_pkgname_in_array(), xbps_match_pkgpattern_in_array(), xbps_match_string_in_array(), xbps_pkg_version(), and xbps_pkgpattern_version().
Referenced by xbps_match_virtual_pkg_in_dict().
bool xbps_match_virtual_pkg_in_dict | ( | xbps_dictionary_t | pkgd, |
const char * | str | ||
) |
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. |
Definition at line 58 of file plist_match.c.
References xbps_match_virtual_pkg_in_array().
bool xbps_match_any_virtualpkg_in_rundeps | ( | xbps_array_t | rundeps, |
xbps_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 71 of file plist_match.c.
References xbps_pkgpattern_match().
bool xbps_match_pkgname_in_array | ( | xbps_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 168 of file plist_match.c.
Referenced by xbps_match_virtual_pkg_in_array().
bool xbps_match_pkgver_in_array | ( | xbps_array_t | array, |
const char * | pkgver | ||
) |
Match a package name/version in the specified array of strings with pkgnames.
[in] | array | The proplib array to search on. |
[in] | pkgver | The package name/version to match. |
Definition at line 174 of file plist_match.c.
Referenced by xbps_configure_packages().
bool xbps_match_pkgpattern_in_array | ( | xbps_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 180 of file plist_match.c.
Referenced by xbps_match_virtual_pkg_in_array().
bool xbps_match_pkgdep_in_array | ( | xbps_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_1’. |
Definition at line 186 of file plist_match.c.
Referenced by xbps_match_virtual_pkg_in_array().
bool xbps_match_string_in_array | ( | xbps_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 162 of file plist_match.c.
Referenced by xbps_alternatives_register(), xbps_configure_packages(), xbps_match_virtual_pkg_in_array(), xbps_pkg_is_ignored(), and xbps_repo_store().
xbps_object_iterator_t xbps_array_iter_from_dict | ( | xbps_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 202 of file plist.c.
Referenced by xbps_transaction_commit().