XBPS Library API 20240111
The X Binary Package System
Functions
Alternatives generic functions

Functions

int xbps_alternatives_set (struct xbps_handle *xhp, const char *pkg, const char *group)
 
int xbps_alternatives_register (struct xbps_handle *xhp, xbps_dictionary_t pkgd)
 
int xbps_alternatives_unregister (struct xbps_handle *xhp, xbps_dictionary_t pkgd)
 

Detailed Description

These functions implement the alternatives framework.

Function Documentation

◆ xbps_alternatives_set()

int xbps_alternatives_set ( struct xbps_handle xhp,
const char *  pkg,
const char *  group 
)

Sets all alternatives provided by this pkg, or only those set by a group.

Parameters
[in]xhpThe pointer to the xbps_handle struct.
[in]pkgPackage name to match.
[in]groupAlternatives group to match.
Returns
0 on success, or an errno value otherwise.

Definition at line 241 of file package_alternatives.c.

References xbps_handle::pkgdb, xbps_pkgdb_get_pkg(), and xbps_remove_string_from_array().

Here is the call graph for this function:

◆ xbps_alternatives_register()

int xbps_alternatives_register ( struct xbps_handle xhp,
xbps_dictionary_t  pkgd 
)

Registers all alternative groups provided by a package.

Parameters
[in]xhpThe pointer to the xbps_handle struct.
[in]pkgdPackage dictionary as stored in the transaction dictionary.
Returns
0 on success, or an errno value otherwise.

Definition at line 533 of file package_alternatives.c.

References xbps_handle::pkgdb, and xbps_match_string_in_array().

Here is the call graph for this function:

◆ xbps_alternatives_unregister()

int xbps_alternatives_unregister ( struct xbps_handle xhp,
xbps_dictionary_t  pkgd 
)

Unregisters all alternative groups provided by a package.

Parameters
[in]xhpThe pointer to the xbps_handle struct.
[in]pkgdPackage dictionary as stored in the transaction dictionary.
Returns
0 on success, or an errno value otherwise.

Definition at line 334 of file package_alternatives.c.

References xbps_handle::pkgdb, and xbps_remove_string_from_array().

Here is the call graph for this function: