![]() |
XBPS Library API
0.19
The X Binary Package System
|
Functions | |
int | xbps_cmpver (const char *pkg1, const char *pkg2) |
char * | xbps_file_hash (const char *file) |
int | xbps_file_hash_check (const char *file, const char *sha256) |
int | xbps_humanize_number (char *buf, int64_t bytes) |
int | xbps_mkpath (const char *path, mode_t mode) |
bool | xbps_pkg_arch_match (struct xbps_handle *xhp, const char *orig, const char *target) |
bool | xbps_pkg_has_rundeps (prop_dictionary_t dict) |
char * | xbps_pkg_index_files_plist (struct xbps_handle *xhp, const char *uri) |
char * | xbps_pkg_index_plist (struct xbps_handle *xhp, const char *uri) |
int | xbps_pkg_is_installed (struct xbps_handle *xhp, const char *pkg) |
char * | xbps_pkg_name (const char *pkg) |
const char * | xbps_pkg_revision (const char *pkg) |
const char * | xbps_pkg_version (const char *pkg) |
int | xbps_pkgpattern_match (const char *pkgver, const char *pattern) |
char * | xbps_pkgpattern_name (const char *pattern) |
const char * | xbps_pkgpattern_version (const char *pattern) |
bool | xbps_repository_is_remote (const char *uri) |
char * | xbps_xasprintf (const char *fmt,...) |
int xbps_cmpver | ( | const char * | pkg1, |
const char * | pkg2 | ||
) |
char* xbps_file_hash | ( | const char * | file | ) |
Returns a string with the sha256 hash for the file specified by file.
[in] | file | Path to a file. |
Definition at line 65 of file util_hash.c.
Referenced by xbps_file_hash_check(), and xbps_register_pkg().
int xbps_file_hash_check | ( | const char * | file, |
const char * | sha256 | ||
) |
Compares the sha256 hash of the file file with the sha256 string specified by sha256.
[in] | file | Path to a file. |
[in] | sha256 | SHA256 hash to compare. |
Definition at line 124 of file util_hash.c.
References xbps_file_hash().
Referenced by xbps_remove_pkg_files().
int xbps_humanize_number | ( | char * | buf, |
int64_t | bytes | ||
) |
Converts the 64 bits signed number specified in bytes to a human parsable string buffer pointed to buf.
[out] | buf | Buffer to store the resulting string. At least it should have space for 6 chars. |
[in] | bytes | 64 bits signed number to convert. |
int xbps_mkpath | ( | const char * | path, |
mode_t | mode | ||
) |
bool xbps_pkg_arch_match | ( | struct xbps_handle * | xhp, |
const char * | orig, | ||
const char * | target | ||
) |
Returns true if provided string is valid for target architecture.
[in] | xhp | The pointer to an xbps_handle struct. |
[in] | orig | Architecture to match. |
[in] | target | If not NULL, orig will be matched against it rather than returned value of uname(2). |
bool xbps_pkg_has_rundeps | ( | prop_dictionary_t | dict | ) |
char* xbps_pkg_index_files_plist | ( | struct xbps_handle * | xhp, |
const char * | uri | ||
) |
Returns the full path to a repository package index files plist file, as specified by uri.
[in] | xhp | The pointer to an xbps_handle struct. |
[in] | uri | Repository URI. |
Definition at line 201 of file util.c.
References xbps_repository_is_remote(), and xbps_xasprintf().
char* xbps_pkg_index_plist | ( | struct xbps_handle * | xhp, |
const char * | uri | ||
) |
Gets the full path to a repository package index plist file, as specified by uri.
[in] | xhp | The pointer to an xbps_handle struct. |
[in] | uri | Repository URI. |
Definition at line 189 of file util.c.
References xbps_repository_is_remote(), and xbps_xasprintf().
int xbps_pkg_is_installed | ( | struct xbps_handle * | xhp, |
const char * | pkg | ||
) |
Checks if a package is currently installed by matching pkg.
[in] | xhp | The pointer to an xbps_handle struct. |
[in] | pkg | Package name, version pattern or exact pkg to match. |
Definition at line 63 of file util.c.
References xbps_pkg_state_dictionary(), xbps_pkgdb_get_pkg(), and xbps_pkgdb_get_virtualpkg().
char* xbps_pkg_name | ( | const char * | pkg | ) |
Gets the name of a package string. Package strings are composed by a <pkgname>/<version> pair and separated by the minus sign, i.e foo-2.0.
[in] | pkg | Package string. |
Definition at line 115 of file util.c.
Referenced by xbps_remove_pkg(), and xbps_remove_pkg_files().
const char* xbps_pkg_revision | ( | const char * | pkg | ) |
const char* xbps_pkg_version | ( | const char * | pkg | ) |
Gets the package version in a package string, i.e foo-2.0.
[in] | pkg | Package string. |
Definition at line 87 of file util.c.
Referenced by xbps_pkgdb_remove_pkg(), xbps_remove_pkg(), xbps_remove_pkg_files(), xbps_rindex_get_pkg(), xbps_rindex_get_virtualpkg(), and xbps_rpool_get_pkg().
int xbps_pkgpattern_match | ( | const char * | pkgver, |
const char * | pattern | ||
) |
Package pattern matching.
[in] | pkgver | Package name/version, i.e `foo-1.0'. |
[in] | pattern | Package pattern to match against pkgver. There are 3 strategies for version matching:
|
Definition at line 298 of file util.c.
Referenced by xbps_match_any_virtualpkg_in_rundeps().
char* xbps_pkgpattern_name | ( | const char * | pattern | ) |
Gets a the package name of a package pattern string specified by the pattern argument.
[in] | pattern | A package pattern. Package patterns are composed by looking at '><=' to split components, i.e foo>=2.0, blah<1.0, blob==2.0, etc. |
const char* xbps_pkgpattern_version | ( | const char * | pattern | ) |
Gets the package version of a package pattern string specified by the pattern argument.
[in] | pattern | A package pattern. The same rules in xbps_get_pkgpattern_name() apply here. |
Definition at line 162 of file util.c.
Referenced by xbps_pkgdb_remove_pkg(), xbps_pkgdb_replace_pkg(), xbps_rindex_get_pkg(), xbps_rindex_get_virtualpkg(), and xbps_rpool_get_pkg().
bool xbps_repository_is_remote | ( | const char * | uri | ) |
Checks if the URI specified by uri is remote or local.
[in] | uri | URI string. |
Definition at line 50 of file util.c.
Referenced by xbps_pkg_index_files_plist(), and xbps_pkg_index_plist().
char* xbps_xasprintf | ( | const char * | fmt, |
... | |||
) |
Returns a string by concatenating its variable argument list as specified by the format string fmt.
[in] | fmt | Format string, see printf(3). |
Definition at line 278 of file util.c.
Referenced by xbps_configure_pkg(), xbps_fetch_file(), xbps_init(), xbps_match_any_virtualpkg_in_rundeps(), xbps_pkg_exec_buffer(), xbps_pkg_index_files_plist(), xbps_pkg_index_plist(), xbps_pkgdb_update(), xbps_register_pkg(), xbps_remove_pkg(), and xbps_remove_pkg_files().